/* Hegel UI Standard V1 — Operations pilot. Presentation only. */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/inter-700.woff2') format('woff2'); }

:root {
  --navy:#0F2747; --blue:#2563EB; --bg:#F5F7FA; --surface:#FFFFFF;
  --text:#111827; --muted:#6B7280; --border:#E5E7EB;
  --blue-hover:#1D4ED8; --bg-hover:#F3F4F6; --danger:#B3261E; --focus:#2563EB;
  --sidebar-w:240px;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; background:var(--bg); color:var(--text);
  font-family:'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size:14.5px; line-height:1.5; font-weight:400;
}
a { color:var(--blue); text-decoration:none; }
a:hover { text-decoration:underline; }
h1 { font-size:22px; font-weight:600; margin:0; letter-spacing:-.01em; }
h2 { font-size:17px; font-weight:600; margin:0 0 10px; }

/* ---------- App shell ---------- */
.app { display:flex; min-height:100vh; }
.sidebar {
  flex:0 0 var(--sidebar-w); width:var(--sidebar-w);
  background:var(--navy); color:#fff; display:flex; flex-direction:column;
  padding:18px 14px; position:sticky; top:0; height:100vh;
  overflow-y:auto; overscroll-behavior:contain;   /* scroll on short screens so foot/logout stays reachable */
}
.sidebar-brand { font-weight:700; font-size:15px; letter-spacing:.06em; line-height:1.15; padding:6px 8px 18px; }
.sidebar-brand span { display:block; font-weight:400; opacity:.7; }
.sidenav { display:flex; flex-direction:column; gap:3px; }
.sidenav a { display:block; padding:9px 12px; border-radius:8px; color:#c9d4e5; font-weight:500; font-size:14px; }
.sidenav a:hover { background:rgba(255,255,255,.08); color:#fff; text-decoration:none; }
.sidenav a.active { background:var(--blue); color:#fff; font-weight:600; }
.sidebar-foot { margin-top:auto; padding-top:14px; border-top:1px solid rgba(255,255,255,.12); display:flex; flex-direction:column; gap:10px; }
.who { display:flex; flex-direction:column; padding:0 4px; }
.who-name { font-weight:600; font-size:13.5px; }
.who-role { color:#9fb0c9; font-size:12px; }

.main-col { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
.topbar {
  display:flex; align-items:center; gap:12px; height:56px;
  background:var(--surface); border-bottom:1px solid var(--border); padding:0 clamp(14px,3vw,24px);
  position:sticky; top:0; z-index:20;
}
.topbar-brand { font-weight:600; display:none; }         /* shown on mobile only */
.page-title { display:none; font-weight:600; font-size:15px; color:var(--text); }  /* shown on desktop only */
.topbar-user { margin-left:auto; color:var(--muted); font-size:13.5px; font-weight:500; }
.hamburger { display:none; flex-direction:column; gap:4px; width:38px; height:38px; border:1px solid var(--border); border-radius:8px; background:#fff; cursor:pointer; align-items:center; justify-content:center; }
.hamburger span { display:block; width:18px; height:2px; background:var(--text); border-radius:2px; }
.backdrop { display:none; }

.container { width:100%; max-width:1120px; margin:0 auto; padding:24px clamp(14px,3vw,30px); }
/* Block layout so the login/error card keeps its 460px width and centres via margin. */
.auth-wrap { display:block; }

/* ---------- Page head ---------- */
.page-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:18px; }

/* ---------- Cards ---------- */
.card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:22px; box-shadow:0 1px 2px rgba(16,24,40,.04); }
.login-card, .form-card { max-width:460px; margin:6vh auto 2rem; }
.form-card { max-width:720px; }   /* modestly wider forms on desktop; still capped, centered, responsive */

/* ---------- Buttons ---------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:38px; padding:0 15px; border-radius:8px; border:1px solid transparent;
  font-family:inherit; font-size:14px; font-weight:600; line-height:1; cursor:pointer; text-decoration:none;
}
/* Neutral default first; the colour variants below (equal specificity) must win. */
.btn, .btn-secondary { background:var(--surface); border-color:var(--border); color:var(--text); }
.btn:hover, .btn-secondary:hover { background:var(--bg-hover); text-decoration:none; }
.btn-primary { background:var(--blue); border-color:var(--blue); color:#fff; }
.btn-primary:hover { background:var(--blue-hover); border-color:var(--blue-hover); }
.btn-danger { background:var(--danger); border-color:var(--danger); color:#fff; }
.btn-danger:hover { filter:brightness(.96); }
.btn-block { width:100%; }
.btn-small { height:32px; padding:0 11px; font-size:13px; }
.btn-link { background:none; border:none; color:var(--blue); padding:0 6px; height:38px; font-weight:600; }
.btn-link:hover { text-decoration:underline; background:none; }
.btn:disabled, .btn[disabled] { opacity:.55; cursor:not-allowed; }
.form-actions { display:flex; gap:10px; align-items:center; margin-top:18px; }

/* ---------- Forms ---------- */
label { display:block; margin:14px 0 0; font-weight:500; font-size:13.5px; color:var(--text); }
.input {
  display:block; width:100%; margin-top:6px; padding:9px 11px; font-size:14.5px; font-family:inherit;
  border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text);
}
textarea.input { resize:vertical; min-height:96px; }
.input:focus, .btn:focus-visible, .sidenav a:focus-visible { outline:2px solid var(--focus); outline-offset:1px; border-color:var(--focus); }
.input:disabled { background:var(--bg); color:var(--muted); }
label.check { display:flex; align-items:center; gap:8px; font-weight:500; margin-top:14px; }
label.check input { width:auto; margin:0; }
.hint { display:block; font-weight:400; color:var(--muted); font-size:12.5px; margin-top:5px; }
.err { display:block; color:var(--danger); font-size:12.5px; margin-top:5px; }
.hidden { display:none; }

.search { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.search .input { margin-top:0; max-width:360px; }

/* ---------- Tables ---------- */
table.jobs { width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
table.jobs th, table.jobs td { text-align:left; padding:11px 14px; border-bottom:1px solid var(--border); font-size:14px; }
table.jobs th { background:var(--bg); color:var(--muted); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
table.jobs tbody tr:last-child td { border-bottom:none; }
table.jobs tbody tr:hover { background:#fafbfd; }
.actions { text-align:right; white-space:nowrap; }
.empty { color:var(--muted); padding:26px; text-align:center; background:var(--surface); border:1px solid var(--border); border-radius:10px; }

/* ---------- Status badges (restrained, semantic) ---------- */
.status { display:inline-block; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.status-new { background:#E7EEF7; color:#0F2747; }
.status-scheduled { background:#E8F1FB; color:#1D4ED8; }
.status-in-progress { background:#FEF4E6; color:#8A5A00; }
.status-waiting { background:#EEEAFC; color:#5B3FB0; }
.status-completed { background:#E4F6EA; color:#1A7F4B; }

/* ---------- Flash ---------- */
.flash { padding:10px 13px; border-radius:8px; margin-bottom:14px; font-size:14px; border:1px solid transparent; }
.flash-error { background:#FDECEC; color:var(--danger); border-color:#F3C9C6; }
.flash-success { background:#E4F6EA; color:#1A7F4B; border-color:#BFE4CD; }

/* ---------- Responsive: drawer under 900px ---------- */
@media (max-width:900px) {
  .sidebar {
    position:fixed; top:0; left:0; height:100vh; z-index:40;
    transform:translateX(-100%); transition:transform .22s ease; box-shadow:0 0 0 100vmax transparent;
  }
  body.drawer-open .sidebar { transform:translateX(0); box-shadow:2px 0 16px rgba(0,0,0,.18); }
  body.drawer-open .backdrop { display:block; position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:30; }
  .hamburger { display:flex; }
  .topbar-brand { display:inline; }
}

/* Desktop: put the page title in the header and drop the duplicate content heading. */
@media (min-width:901px) {
  .topbar .page-title { display:inline; }
  .main-col .container > .page-head h1,
  .main-col .container > .card > h1 { display:none; }
  .page-head { justify-content:flex-end; }   /* action button stays right when heading is hidden */
}

/* ---------- Responsive: table → cards under 640px (preserved behaviour) ---------- */
@media (max-width:640px) {
  table.jobs, table.jobs thead, table.jobs tbody, table.jobs th, table.jobs td, table.jobs tr { display:block; }
  table.jobs { border:none; background:none; }
  table.jobs thead { position:absolute; left:-9999px; }
  table.jobs tr { background:var(--surface); border:1px solid var(--border); border-radius:10px; margin-bottom:10px; padding:5px 12px; }
  table.jobs td { border:none; padding:3px 0; display:flex; justify-content:space-between; gap:16px; align-items:center; }
  table.jobs td::before { content:attr(data-label); font-weight:600; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
  .actions { justify-content:flex-end; }
  .page-head { flex-direction:column; align-items:stretch; }
}

/* Switch System (SSO pilot) — sits above the user/logout foot in the sidebar. */
.switch-system { border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; margin-bottom: 12px; }
.switch-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #9fb0c9; padding: 2px 12px 6px; }
