/* =====================================================
   ALL-IN-1 DESK PORTAL  (portal.allin1desk.com)
   Theme tokens lifted from allin1desk.com main site so
   the portal feels like a natural extension of the brand.
   ===================================================== */

:root {
  /* Brand */
  --navy-950: #030712;
  --navy-900: #0B1426;
  --navy-800: #0F1E3C;
  --navy-700: #152951;
  --navy-600: #1E3A66;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --cyan-500: #06B6D4;
  --cyan-400: #22D3EE;
  --cyan-300: #67E8F9;

  /* Neutrals */
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  /* Semantic */
  --color-primary:        var(--blue-600);
  --color-primary-hover:  var(--blue-500);
  --color-accent:         var(--cyan-500);
  --color-accent-light:   var(--cyan-400);
  --color-bg:             var(--white);
  --color-bg-subtle:      var(--gray-50);
  --color-bg-dark:        var(--navy-900);
  --color-text:           var(--gray-900);
  --color-text-muted:     var(--gray-500);
  --color-text-light:     var(--gray-400);
  --color-border:         var(--gray-200);
  --color-border-strong:  var(--gray-300);

  /* Status */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error:   #EF4444;
  --color-info:    var(--blue-500);

  /* Typography */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,30,60,0.06);
  --shadow-md: 0 4px 12px rgba(15,30,60,0.08);
  --shadow-lg: 0 12px 32px rgba(15,30,60,0.12);

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg-subtle);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--color-text); margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
h1 { font-size: var(--text-3xl); font-weight: 800; }
h2 { font-size: var(--text-2xl); font-weight: 700; }
h3 { font-size: var(--text-xl); font-weight: 700; }
p  { line-height: 1.6; color: var(--color-text); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }
code, pre { font-family: var(--font-mono); font-size: var(--text-sm); }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-900);
  color: var(--white);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 30;
}
.sidebar-brand {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--navy-700);
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}
.sidebar-brand-tag {
  font-size: var(--text-xs);
  color: var(--gray-200);  /* was gray-400 -- too dim on navy */
  margin-top: 2px;
  font-weight: 500;
}
.sidebar-nav { flex: 1; padding: var(--space-4) var(--space-2); overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--gray-100);  /* was gray-300 -- bump for readability */
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
}
.sidebar-nav a:hover { background: var(--navy-800); color: var(--white); text-decoration: none; }
.sidebar-nav a.active { background: var(--blue-600); color: var(--white); }
.sidebar-nav .group-label {
  padding: var(--space-3) var(--space-4) var(--space-1);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  /* Use a cool muted blue with high alpha so labels stay clearly
     subordinate to nav items but actually read against the navy bg. */
  color: rgba(191, 215, 242, 0.75);
  font-weight: 600;
}
.sidebar-foot {
  padding: var(--space-4);
  border-top: 1px solid var(--navy-700);
  font-size: var(--text-xs);
  color: var(--gray-300);  /* was gray-400 -- bump for readability */
}

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.topbar-right { display: flex; align-items: center; gap: var(--space-4); }
.topbar-user {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.topbar-user .pill {
  padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--gray-100); color: var(--gray-700);
  font-size: var(--text-xs); font-weight: 600;
}

.content { padding: var(--space-6); flex: 1; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--space-4); }
.card h3.card-title { margin-top: 0; font-size: var(--text-lg); }
.card-grid { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .card-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .card-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 1200px) { .card-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; } }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: var(--text-3xl); color: var(--color-text); }
.kpi-trend { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Tables ---------- */
table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
table.tbl th, table.tbl td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
table.tbl thead th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--gray-50); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary    { background: var(--blue-600);   color: var(--white); }
.btn-primary:hover { background: var(--blue-500); color: var(--white); text-decoration: none; }
.btn-accent     { background: var(--cyan-500);   color: var(--navy-900); }
.btn-accent:hover { background: var(--cyan-400); }
.btn-secondary  { background: var(--white); color: var(--gray-800); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-danger     { background: var(--color-error); color: var(--white); }
.btn-danger:hover { background: #DC2626; color: var(--white); text-decoration: none; }
.btn-ghost      { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: var(--text-xs); }
.btn[disabled], .btn.disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-row { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.form-row label { font-size: var(--text-sm); font-weight: 600; color: var(--gray-700); }
.form-row .hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.input, select.input, textarea.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  background: var(--white);
  color: var(--color-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
textarea.input { min-height: 96px; resize: vertical; }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600;
  border: 1px solid transparent;
}
.pill-trial      { background: rgba(59,130,246,0.10); color: var(--blue-700);   border-color: rgba(59,130,246,0.25); }
.pill-active     { background: rgba(16,185,129,0.10); color: #047857;            border-color: rgba(16,185,129,0.25); }
.pill-pastdue    { background: rgba(245,158,11,0.10); color: #B45309;            border-color: rgba(245,158,11,0.30); }
.pill-suspended  { background: rgba(239,68,68,0.10);  color: #B91C1C;            border-color: rgba(239,68,68,0.30); }
.pill-cancelled  { background: var(--gray-100);        color: var(--gray-600);    border-color: var(--gray-200); }
.pill-on         { background: rgba(16,185,129,0.10); color: #047857; }
.pill-off        { background: var(--gray-100);        color: var(--gray-500); }

/* ---------- Login screen ---------- */
.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at top, rgba(37,99,235,0.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(6,182,212,0.10), transparent 65%),
    var(--navy-900);
  padding: var(--space-6);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
}
.login-brand {
  text-align: center;
  margin-bottom: var(--space-6);
}
.login-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-brand-tag { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: 4px; }
.login-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #B91C1C;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.login-foot {
  margin-top: var(--space-5);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---------- Utilities ---------- */
.muted     { color: var(--color-text-muted); }
.tiny      { font-size: var(--text-xs); }
.small     { font-size: var(--text-sm); }
.bold      { font-weight: 700; }
.right     { text-align: right; }
.center    { text-align: center; }
.flex      { display: flex; }
.flex-row  { display: flex; flex-direction: row; }
.flex-col  { display: flex; flex-direction: column; }
.gap-2     { gap: var(--space-2); }
.gap-3     { gap: var(--space-3); }
.gap-4     { gap: var(--space-4); }
.mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
.between { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Tag for industry / category ---------- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 200ms ease; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 var(--space-4); }
}
