/* Adelie IT Portal — styles follow adelieit.com (Adelie Blue #0b4aa2, Inter) */
:root {
  --adelie: #0b4aa2; --adelie-light: #1b67d0; --adelie-dark: #083a82;
  --navy: #0a1628; --ink: #0f172a; --muted: #64748b; --light: #f1f5f9; --soft: #f8faff;
  --border: rgba(11,74,162,.12); --line: #e2e8f0;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --radius: 16px; --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06); --shadow-md: 0 8px 30px rgba(0,0,0,.08);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--soft); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--adelie); text-decoration: none; } a:hover { color: var(--adelie-light); }
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

/* ---------- Header ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { width: min(1180px, 94vw); margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--ink); font-size: 1.1rem; }
.brand img { width: 34px; height: 34px; }
.brand small { font-weight: 600; color: var(--muted); font-size: .8rem; margin-left: .2rem; }
.nav { display: flex; gap: .25rem; flex: 1; }
.nav a { padding: .45rem .8rem; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a:hover { background: var(--light); color: var(--ink); }
.nav a.active { background: rgba(11,74,162,.08); color: var(--adelie); }
.who { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: var(--muted); }
.menu-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); }
@media (max-width: 820px) {
  .menu-toggle { display: block; margin-left: auto; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: .75rem; border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
  .who .who-name { display: none; }
}

/* ---------- Layout ---------- */
.page { width: min(1180px, 94vw); margin: 2rem auto 4rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.card + .card { margin-top: 1.25rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: 2fr 1fr; } @media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--adelie); line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .88rem; font-weight: 600; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 10px; padding: .65rem 1.15rem; font: 600 .95rem var(--font); cursor: pointer; transition: background .2s, box-shadow .2s; }
.btn-primary { background: var(--adelie); color: #fff; box-shadow: 0 4px 14px rgba(11,74,162,.25); }
.btn-primary:hover { background: var(--adelie-light); color: #fff; }
.btn-outline { background: #fff; color: var(--adelie); border: 1.5px solid var(--adelie); }
.btn-ghost { background: transparent; color: var(--muted); padding: .4rem .6rem; }
.btn-ghost:hover { color: var(--ink); background: var(--light); }
.btn-danger { background: #fff; color: var(--bad); border: 1.5px solid #fecaca; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
input, select, textarea { width: 100%; font: 400 .95rem var(--font); color: var(--ink); padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--adelie); box-shadow: 0 0 0 3px rgba(11,74,162,.12); }
textarea { min-height: 140px; resize: vertical; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 700; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Banners ---------- */
.banner { border-radius: 10px; padding: .75rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.banner-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.banner-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.banner-info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 600px at 10% -10%, rgba(27,103,208,.18), transparent), linear-gradient(160deg, var(--navy), #101d33 60%, #0b2a5c); }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 2.25rem; }
.auth-card .brand { justify-content: center; margin-bottom: 1.25rem; font-size: 1.3rem; }
.auth-card h1 { font-size: 1.35rem; text-align: center; margin-bottom: .35rem; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: .92rem; margin-bottom: 1.5rem; }
.auth-foot { text-align: center; margin-top: 1.25rem; font-size: .88rem; }
.auth-legal { text-align: center; margin-top: 1.25rem; color: rgba(255,255,255,.55); font-size: .8rem; }
.qr { display: flex; justify-content: center; margin: .5rem 0 1rem; }
.qr img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; background: var(--light); padding: .5rem .7rem; border-radius: 8px; word-break: break-all; text-align: center; }
.steps { font-size: .9rem; color: var(--muted); margin: 0 0 1rem 1.1rem; } .steps li { margin-bottom: .25rem; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
td { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--soft); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; }
.tabs button { background: none; border: 0; padding: .45rem .9rem; border-radius: 8px; font: 600 .9rem var(--font); color: var(--muted); cursor: pointer; }
.tabs button.active { background: rgba(11,74,162,.08); color: var(--adelie); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.b-open { background: #dbeafe; color: #1e40af; } .b-progress { background: #fef3c7; color: #92400e; }
.b-waiting { background: #fae8ff; color: #86198f; } .b-resolved { background: #dcfce7; color: #166534; }
.b-closed { background: #e2e8f0; color: #475569; }
.b-low { background: #f1f5f9; color: #475569; } .b-normal { background: #e0e7ff; color: #3730a3; }
.b-high { background: #ffedd5; color: #9a3412; } .b-critical { background: #fee2e2; color: #991b1b; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.15); } .dot-off { background: #94a3b8; }

/* ---------- Ticket thread ---------- */
.thread { display: flex; flex-direction: column; gap: 1rem; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: #fff; }
.msg.staff { border-color: rgba(11,74,162,.25); background: #f5f9ff; }
.msg-head { display: flex; gap: .5rem; align-items: baseline; font-size: .85rem; margin-bottom: .4rem; }
.msg-head strong { color: var(--ink); } .msg-body { white-space: pre-wrap; word-wrap: break-word; }
.people { display: flex; flex-direction: column; gap: .5rem; }
.person { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(11,74,162,.1); color: var(--adelie); display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .9rem; } .kv dt { color: var(--muted); }
.checklist label { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-bottom: .4rem; }
.checklist input { width: auto; }
.loading { text-align: center; color: var(--muted); padding: 3rem; }
.mt { margin-top: 1rem; }
.grid > .card + .card { margin-top: 0; }
.avatar img { width: 18px; height: 18px; }
.show-sm { display: none; }
.brand { white-space: nowrap; }
@media (max-width: 640px) {
  .hide-sm { display: none; } .show-sm { display: block; }
  .brand small { display: none; }
  .page { margin-top: 1.25rem; }
  .card { padding: 1.1rem; }
  h1 { font-size: 1.35rem; }
}
