/* Capital Claim — Hire Pack Generator | Design system
   Token-based, light/dark, mobile-responsive. Brand: blue + sun accent. */

:root {
  /* Brand */
  --brand:        #0b6fb8;   /* Capital Claim blue */
  --brand-dark:   #075089;
  --brand-light:  #e8f3fb;
  --accent:       #f7941d;   /* sun / orange */
  --accent-light: #fff2e0;

  /* Greys */
  --gray-50:#f8fafc; --gray-100:#f1f5f9; --gray-200:#e2e8f0; --gray-300:#cbd5e1;
  --gray-400:#94a3b8; --gray-500:#64748b; --gray-600:#475569; --gray-700:#334155;
  --gray-800:#1e293b; --gray-900:#0f172a;

  --green:#16a34a; --green-bg:#dcfce7;
  --red:#dc2626;   --red-bg:#fee2e2;
  --yellow:#ca8a04;--yellow-bg:#fef9c3;
  --blue:#2563eb;  --blue-bg:#dbeafe;

  /* Semantic (light) */
  --bg:            var(--gray-100);
  --surface:       #ffffff;
  --surface-2:     var(--gray-50);
  --border:        var(--gray-200);
  --text:          var(--gray-900);
  --text-muted:    var(--gray-500);
  --sidebar-bg:    #0c2233;
  --sidebar-text:  #cbd8e4;
  --sidebar-active:var(--brand);

  --radius:10px; --radius-sm:7px; --radius-lg:16px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.06);
  --shadow:0 4px 16px rgba(15,23,42,.08);
  --shadow-lg:0 12px 32px rgba(15,23,42,.14);
  --sidebar-w:248px;
  --font:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

[data-theme="dark"] {
  --bg:#0b1220; --surface:#131c2b; --surface-2:#0f1726;
  --border:#26344a; --text:#e6edf5; --text-muted:#94a3b8;
  --sidebar-bg:#0a1521; --sidebar-text:#a9b8c9;
  --brand-light:#10293c; --accent-light:#2c2113;
  --green-bg:#0f2e1c; --red-bg:#3a1414; --yellow-bg:#332a08; --blue-bg:#12233f;
  --shadow:0 4px 16px rgba(0,0,0,.4); --shadow-lg:0 12px 32px rgba(0,0,0,.5);
}

* { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }
body {
  font-family:var(--font); background:var(--bg); color:var(--text);
  font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app-layout { display:flex; min-height:100vh; }
.main-content { flex:1; min-width:0; display:flex; flex-direction:column; }
.page-content { padding:24px; max-width:1200px; width:100%; margin:0 auto; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width:var(--sidebar-w); background:var(--sidebar-bg); color:var(--sidebar-text);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh; flex-shrink:0;
}
.sidebar-logo { padding:20px 18px; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar-logo a { display:flex; align-items:center; gap:11px; color:#fff; text-decoration:none; }
.logo-icon {
  width:38px; height:38px; border-radius:9px; display:grid; place-items:center;
  font-weight:800; font-size:15px; color:#fff;
  background:linear-gradient(135deg,var(--brand) 0%,var(--brand-dark) 60%);
  box-shadow:0 0 0 1px rgba(255,255,255,.08), inset 0 -2px 6px rgba(0,0,0,.25);
}
.logo-text { display:flex; flex-direction:column; font-weight:700; font-size:15px; line-height:1.1; }
.logo-text span { font-weight:500; font-size:11px; color:var(--sidebar-text); opacity:.8; margin-top:2px; }

.sidebar-nav { flex:1; overflow-y:auto; padding:14px 12px; }
.nav-section { font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--sidebar-text);
  opacity:.55; padding:16px 10px 6px; font-weight:700; }
.nav-item a {
  display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:8px;
  color:var(--sidebar-text); text-decoration:none; font-weight:500; font-size:13.5px; margin-bottom:2px;
  transition:background .12s,color .12s;
}
.nav-item a:hover { background:rgba(255,255,255,.06); color:#fff; }
.nav-item a.active { background:var(--sidebar-active); color:#fff; }
.nav-item svg { width:18px; height:18px; flex-shrink:0; }

.sidebar-footer { padding:12px; border-top:1px solid rgba(255,255,255,.08); }
.user-menu { display:flex; align-items:center; gap:10px; padding:6px; }
.user-avatar {
  width:36px; height:36px; border-radius:50%; background:var(--accent); color:#fff;
  display:grid; place-items:center; font-weight:700; font-size:13px; flex-shrink:0;
}
.user-info { display:flex; flex-direction:column; min-width:0; }
.user-info strong { font-size:13px; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-info span { font-size:11px; opacity:.7; }

.sidebar-backdrop { display:none; }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  height:60px; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:14px; padding:0 24px; position:sticky; top:0; z-index:20;
}
.topbar-title { font-weight:700; font-size:16px; }
.topbar-actions { margin-left:auto; display:flex; align-items:center; gap:6px; }
.menu-toggle { display:none; }
.icon-btn {
  width:38px; height:38px; border-radius:9px; border:1px solid transparent; background:transparent;
  display:grid; place-items:center; color:var(--text-muted); cursor:pointer;
}
.icon-btn:hover { background:var(--surface-2); color:var(--text); }
.icon-btn svg { width:19px; height:19px; }

/* ─── Cards / panels ─────────────────────────────────────────────────────── */
.card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
}
.card-pad { padding:20px; }
.card-head { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:12px; }
.card-head h2,.card-head h3 { font-size:15px; }
.card-head .spacer { margin-left:auto; }

.page-header { display:flex; align-items:flex-start; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.page-header h1 { font-size:22px; font-weight:800; }
.page-header .sub { color:var(--text-muted); margin-top:2px; }
.page-header .spacer { margin-left:auto; }

.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:repeat(2,1fr); }
.grid-3 { grid-template-columns:repeat(3,1fr); }
.grid-4 { grid-template-columns:repeat(4,1fr); }

.stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px; box-shadow:var(--shadow-sm); }
.stat .label { color:var(--text-muted); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.stat .value { font-size:28px; font-weight:800; margin-top:6px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:9px 16px; border-radius:8px; border:1px solid transparent; font-weight:600;
  font-size:13.5px; cursor:pointer; font-family:inherit; line-height:1; transition:.12s; white-space:nowrap;
}
.btn:hover { text-decoration:none; }
.btn svg { width:16px; height:16px; }
.btn-primary { background:var(--brand); color:#fff; }
.btn-primary:hover { background:var(--brand-dark); color:#fff; }
.btn-accent { background:var(--accent); color:#fff; }
.btn-accent:hover { filter:brightness(.94); color:#fff; }
.btn-secondary { background:var(--surface); color:var(--text); border-color:var(--border); }
.btn-secondary:hover { background:var(--surface-2); }
.btn-danger { background:var(--red); color:#fff; }
.btn-danger:hover { filter:brightness(.94); color:#fff; }
.btn-ghost { background:transparent; color:var(--text-muted); }
.btn-ghost:hover { background:var(--surface-2); color:var(--text); }
.btn-sm { padding:6px 11px; font-size:12.5px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group.full { grid-column:1 / -1; }
.form-label { font-weight:600; font-size:12.5px; color:var(--text); }
.form-label .req { color:var(--red); }
.form-control, .form-select, textarea.form-control {
  width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:8px;
  background:var(--surface); color:var(--text); font-family:inherit; font-size:13.5px;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-light);
}
.form-hint { font-size:11.5px; color:var(--text-muted); }
textarea.form-control { resize:vertical; min-height:80px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x:auto; border-radius:var(--radius); border:1px solid var(--border); }
table.data { width:100%; border-collapse:collapse; background:var(--surface); font-size:13.5px; }
table.data th, table.data td { padding:11px 14px; text-align:left; border-bottom:1px solid var(--border); }
table.data th { background:var(--surface-2); font-weight:700; font-size:11.5px; text-transform:uppercase;
  letter-spacing:.04em; color:var(--text-muted); }
table.data tr:last-child td { border-bottom:none; }
table.data tbody tr:hover { background:var(--surface-2); }
.text-right { text-align:right; }
.text-muted { color:var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge { display:inline-block; padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:700; }
.badge-green{background:var(--green-bg);color:var(--green);}
.badge-red{background:var(--red-bg);color:var(--red);}
.badge-yellow{background:var(--yellow-bg);color:var(--yellow);}
.badge-blue{background:var(--blue-bg);color:var(--blue);}
.badge-gray{background:var(--gray-200);color:var(--gray-600);}
[data-theme="dark"] .badge-gray{background:#26344a;color:var(--gray-300);}

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert { margin:0 24px; margin-top:16px; padding:12px 16px; border-radius:9px; font-size:13.5px; font-weight:500;
  border:1px solid transparent; }
.alert-success { background:var(--green-bg); color:var(--green); border-color:var(--green); }
.alert-error { background:var(--red-bg); color:var(--red); border-color:var(--red); }

/* ─── Auth screens ───────────────────────────────────────────────────────── */
.auth-wrap { min-height:100vh; display:grid; place-items:center; padding:24px;
  background:linear-gradient(135deg,var(--brand-dark),var(--brand)); }
.auth-card { width:100%; max-width:400px; background:var(--surface); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg); padding:32px; }
.auth-logo { display:flex; align-items:center; gap:11px; justify-content:center; margin-bottom:6px; }
.auth-logo .logo-icon { width:44px; height:44px; font-size:17px; }
.auth-card h1 { font-size:20px; text-align:center; margin-bottom:4px; }
.auth-card .sub { text-align:center; color:var(--text-muted); margin-bottom:22px; font-size:13px; }
.auth-card .form-group { margin-bottom:14px; }
.auth-card .btn { width:100%; }
.auth-foot { text-align:center; margin-top:16px; font-size:12.5px; color:var(--text-muted); }

.empty { text-align:center; padding:48px 24px; color:var(--text-muted); }
.empty svg { width:42px; height:42px; opacity:.4; margin-bottom:10px; }

.checkbox-row { display:flex; align-items:center; gap:8px; }
.checkbox-row input { width:16px; height:16px; }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width:880px) {
  .sidebar { position:fixed; left:0; top:0; z-index:60; transform:translateX(-100%); transition:transform .2s; }
  .sidebar.open { transform:translateX(0); box-shadow:var(--shadow-lg); }
  .sidebar-backdrop.show { display:block; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:55; }
  .menu-toggle { display:grid; }
  .form-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns:1fr; }
  .page-content { padding:16px; }
}
