/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #16469D;
  --navy2: #0f3578;
  --gold: #FFC40C;
  --gold2: #e6b000;
  --orange: #F16022;
  --light-blue: #3DB1E5;
  --green: #24AA5D;
  --white: #ffffff;
  --off-white: #f2f4f9;
  --lavender: #E0E6F4;
  --surface: #ffffff;
  --surface2: #E0E6F4;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(22,70,157,0.12);
  --text: #1a1a2e;
  --text2: #4a5568;
  --text3: #718096;
  --blue-bg: #e6f1fb; --blue-text: #0c447c; --blue-border: #85b7eb;
  --green-bg: #e6f7ed; --green-text: #155c2e; --green-border: #24AA5D;
  --red-bg: #fcebeb; --red-text: #791f1f; --red-border: #f09595;
  --amber-bg: #fef5e0; --amber-text: #633806; --amber-border: #F16022;
  --gray-bg: #E0E6F4; --gray-text: #3d4a5c; --gray-border: #a8b4cc;
}
html, body { margin: 0; padding: 0; }
body { font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--off-white); color: var(--text); min-height: 100vh; font-size: 15px; line-height: 1.6; }

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== Header ===== */
header { background: var(--navy); border-bottom: 3px solid var(--gold); padding: 0 2.5rem; display: flex; align-items: center; height: 64px; position: sticky; top: 0; z-index: 100; }
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-text { font-weight: 700; font-size: 16px; color: var(--white); letter-spacing: 0.06em; text-transform: uppercase; }
.logo-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.2); }
.logo-sub { font-size: 12px; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; margin-left: 4px; }
.logo-back { font-size: 12px; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.15s; }
.logo-back:hover { color: var(--gold); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ===== Hamburger Nav ===== */
.hamburger-wrap { position: relative; }
.hamburger-btn { background: none; border: none; color: var(--white); font-size: 22px; cursor: pointer; padding: 6px 8px; line-height: 1; border-radius: 6px; transition: background 0.15s, color 0.15s; }
.hamburger-btn:hover { background: rgba(255,255,255,0.12); color: var(--gold); }
.nav-menu { display: none; position: absolute; top: calc(100% + 10px); right: 0; background: var(--surface); border: 0.5px solid var(--border2); border-radius: 10px; box-shadow: 0 8px 24px rgba(22,70,157,0.15); min-width: 220px; z-index: 150; overflow: hidden; }
.nav-menu.open { display: block; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; transition: background 0.12s; cursor: pointer; border-bottom: 0.5px solid var(--border); }
.nav-item:last-child { border-bottom: none; }
.nav-item:hover { background: var(--lavender); }
.nav-item.active { color: var(--navy); font-weight: 700; border-left: 3px solid var(--gold); }
.nav-item-icon { font-size: 16px; width: 22px; text-align: center; }
.nav-item-lock { font-size: 10px; color: var(--text3); margin-left: auto; }

/* ===== Buttons ===== */
button { font-size: 13px; padding: 8px 18px; border-radius: 8px; border: 1.5px solid var(--border2); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; font-weight: 600; transition: all 0.15s; white-space: nowrap; }
button:hover { background: var(--surface2); border-color: var(--navy); }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy2); border-color: var(--navy2); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--border2); }

/* ===== Spinner ===== */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
.spinner-dark { border-color: rgba(22,70,157,0.2); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Badge ===== */
.badge { font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600; border: 1px solid; white-space: nowrap; width: fit-content; }

/* ===== Common card ===== */
.card { background: var(--surface); border: 0.5px solid var(--border2); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 1px 6px rgba(22,70,157,0.06); }

/* ===== Stat grid ===== */
.stat-grid { display: grid; gap: 12px; margin-bottom: 1.25rem; }
.stat { background: var(--navy); border-radius: 10px; padding: 1rem 1.25rem; }
.stat-label { font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-val { font-size: 28px; font-weight: 700; color: var(--white); }

/* ===== Common ticket styles ===== */
.ticket-key { font-size: 12px; color: var(--navy); font-family: monospace; font-weight: 600; }
.ticket-key a { color: var(--navy); text-decoration: none; }
.ticket-key a:hover { text-decoration: underline; }
.ticket-summary { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-date { font-size: 11px; color: var(--text3); }

/* ===== Error ===== */
.error { background: var(--red-bg); color: var(--red-text); border: 0.5px solid var(--red-border); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 1rem; }

/* ===== Footer timestamp ===== */
.footer-ts { font-size: 11px; color: var(--text3); margin-top: 1.5rem; text-align: right; }

/* ===== Password modal ===== */
.pw-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; padding: 1.5rem; }
.pw-overlay.open { display: flex; }
.pw-modal { background: var(--surface); border-radius: 14px; border: 0.5px solid var(--border2); padding: 2rem; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.pw-modal h2 { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.pw-modal p { font-size: 13px; color: var(--text2); margin-bottom: 1.25rem; }
.pw-modal input { width: 100%; font-size: 14px; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--border2); background: var(--surface); color: var(--text); font-family: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.pw-modal input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,70,157,0.12); }
.pw-modal input.err { border-color: #f09595; }
.pw-err { font-size: 12px; color: #791f1f; margin-top: 6px; min-height: 18px; }
.pw-actions { display: flex; gap: 8px; margin-top: 1.25rem; }
.pw-actions button { flex: 1; font-size: 13px; padding: 9px 18px; border-radius: 8px; border: 1.5px solid var(--border2); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; font-weight: 600; transition: all 0.15s; }
.pw-actions button:hover { background: var(--surface2); border-color: var(--navy); }
.pw-actions .pw-submit { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pw-actions .pw-submit:hover { background: var(--navy2); border-color: var(--navy2); }
