/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f0f2f6;
  color: #1e1e2e;
  font-size: 14px;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, #3b5bdb 0%, #1c3faa 100%);
  box-shadow: 0 2px 16px rgba(59,91,219,.35);
  padding: .6rem 0;
}

.navbar-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #fff !important;
  letter-spacing: .2px;
}

/* ACS logo in navbar — chip it onto a white pill so the brand reads on the
   blue gradient, and lock the height so width scales proportionally. */
.brand-logo {
  height: 32px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ACS logo on the connect screen — bigger, no pill background needed. */
.connect-logo {
  display: block;
  max-width: 280px;
  width: 100%;
  height: auto;
}

.nav-label {
  color: rgba(255,255,255,.75);
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
  margin: 0;
}

.nav-select {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .8rem;
  border-radius: 6px;
  padding: .28rem .75rem;
  min-width: 110px;
}
.nav-select option { color: #1e1e2e; background: #fff; }
.nav-select:focus  { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.4); }

.btn-nav {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .8rem;
  border-radius: 6px;
  padding: .32rem .85rem;
  transition: background .15s;
}
.btn-nav:hover { background: rgba(255,255,255,.28); color: #fff; }

.btn-nav-success {
  background: #12b76a;
  border: none;
  color: #fff;
  font-size: .8rem;
  border-radius: 6px;
  padding: .32rem .85rem;
  transition: background .15s;
}
.btn-nav-success:hover { background: #0ea05e; color: #fff; }

.btn-nav-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: rgba(255,255,255,.8);
  font-size: .8rem;
  border-radius: 6px;
  padding: .32rem .85rem;
  transition: all .15s;
}
.btn-nav-outline:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  border-radius: 14px !important;
  transition: box-shadow .2s;
}

.card-header {
  border-radius: 14px 14px 0 0 !important;
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
  border-radius: 14px !important;
  transition: transform .18s, box-shadow .18s, border-color .15s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.1) !important;
}
.clickable-stat { cursor: pointer; }
.stat-card.stat-active {
  border: 2px solid #06b6d4 !important;
  box-shadow: 0 8px 24px rgba(6,182,212,.25) !important;
}

.stat-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #6b7280;
  margin-bottom: 0;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-sub { font-size: .72rem; }

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Soft icon backgrounds */
.bg-primary-soft   { background: rgba(59,91,219,.12); }
.bg-warning-soft   { background: rgba(245,158,11,.14); }
.bg-success-soft   { background: rgba(16,185,129,.12); }
.bg-danger-soft    { background: rgba(239,68,68,.12);  }
.bg-info-soft      { background: rgba(6,182,212,.12);  }
.bg-secondary-soft { background: rgba(107,114,128,.12);}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table thead th {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb !important;
  padding: .65rem 1rem;
  background: #f9fafb;
}

.table tbody td {
  padding: .7rem 1rem;
  font-size: .85rem;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbff; }

/* ── Priority badges ─────────────────────────────────────────────────────── */
.pbadge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.pb-urgent  { background: #fee2e2; color: #b91c1c; }
.pb-high    { background: #ffedd5; color: #c2410c; }
.pb-medium  { background: #fef9c3; color: #a16207; }
.pb-low     { background: #dcfce7; color: #166534; }
.pb-none    { background: #f3f4f6; color: #4b5563; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.sbadge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 50px;
  letter-spacing: .3px;
  white-space: nowrap;
}
.sb-open        { background: #dbeafe; color: #1d4ed8; }
.sb-closed      { background: #dcfce7; color: #166534; }
.sb-resolved    { background: #dcfce7; color: #166534; }
.sb-on-hold     { background: #ffedd5; color: #c2410c; }
.sb-in-progress { background: #f3e8ff; color: #7e22ce; }
.sb-default     { background: #f3f4f6; color: #4b5563; }

/* ── Workload bar ────────────────────────────────────────────────────────── */
.load-track {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
  min-width: 80px;
}
.load-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b5bdb, #7c9ef5);
  transition: width .5s ease;
}

/* ── Connect screen ──────────────────────────────────────────────────────── */
.connect-card {
  border-radius: 20px !important;
  box-shadow: 0 8px 40px rgba(0,0,0,.08) !important;
}
.connect-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(59,91,219,.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Loading screen ──────────────────────────────────────────────────────── */
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

/* ── Chart card header ───────────────────────────────────────────────────── */
.card-header h6 {
  font-size: .85rem;
  color: #374151;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid #e5e7eb;
  margin-top: .5rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .stat-value { font-size: 1.6rem; }
  .navbar-brand span { display: none; }
}
