/* ==========================================================================
   Epidemic Marketing — Client Support Platform
   Design system
   ========================================================================== */

:root {
  --navy-900: #071B33;
  --navy-800: #0A2A4E;
  --navy-700: #123A66;
  --navy-600: #1B4E85;

  --cyan-500: #2FC6DE;
  --cyan-600: #1FA8BF;
  --cyan-50: #E8F9FC;

  --orange-500: #F5921B;
  --orange-600: #DB7C0B;
  --orange-50: #FEF3E4;

  --gray-25: #FCFCFD;
  --gray-50: #F7F8FA;
  --gray-100: #EFF1F5;
  --gray-200: #E2E6ED;
  --gray-300: #CBD2DD;
  --gray-400: #9AA4B5;
  --gray-500: #6B7688;
  --gray-600: #4D5768;
  --gray-700: #363E4C;
  --gray-800: #232A35;
  --gray-900: #141920;

  --green-500: #129D6E;
  --green-50: #E6F7F1;
  --red-500: #DC3A43;
  --red-50: #FDECEC;
  --amber-500: #E0A008;
  --amber-50: #FDF5E2;
  --violet-500: #6A5AE0;
  --violet-50: #EFEDFD;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.10), 0 4px 8px rgba(16, 24, 40, 0.04);

  --sidebar-w: 248px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--cyan-600); }

h1, h2, h3, h4 { margin: 0 0 6px; color: var(--navy-900); font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 10px; color: var(--gray-600); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--gray-500); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; }

/* ==========================================================================
   App shell — sidebar layout
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan-500), var(--navy-600));
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #fff;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-text { line-height: 1.2; min-width: 0; }
.brand-name {
  font-size: 12.5px; font-weight: 800; color: #fff;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub {
  font-size: 10.5px; color: var(--cyan-500);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}

.sidebar-nav { flex: 1 1 auto; min-height: 0; padding: 14px 10px; overflow-y: auto; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.38); font-weight: 700;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8.5px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.72);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.13s, color 0.13s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: var(--navy-600); color: #fff; font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }
.nav-count {
  margin-left: auto;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
}
.nav-item.active .nav-count { background: var(--cyan-500); color: var(--navy-900); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;            /* never compress: keeps Sign Out fully visible */
  background: var(--navy-900);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-500), var(--navy-600));
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.sidebar-user-meta { min-width: 0; line-height: 1.25; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: rgba(255,255,255,0.5); text-transform: capitalize;
}

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--navy-900); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 24px; flex: 1; max-width: 1400px; width: 100%; }

.mobile-toggle { display: none; }

/* ==========================================================================
   Code / embed snippet blocks
   ========================================================================== */
.code-block {
  position: relative;
  background: var(--navy-900);
  border-radius: var(--radius);
  padding: 16px 44px 16px 16px;
  overflow-x: auto;
}
.code-block pre {
  margin: 0;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px; line-height: 1.6;
  color: #D9E6F2; white-space: pre; tab-size: 2;
}
.code-block .code-copy {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  color: #D9E6F2; border-radius: 6px; padding: 6px 8px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
}
.code-block .code-copy:hover { background: rgba(255,255,255,0.16); }
.code-block .code-copy svg { width: 13px; height: 13px; }
.code-block .code-copy.copied { background: var(--green-500); border-color: var(--green-500); color: #fff; }

.embed-preview-frame {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f4f6f9;
}

/* ==========================================================================
   Embed mode — used when the app is loaded inside an iframe via the
   embed widget/snippet. Strips the sidebar and topbar chrome entirely so
   the ticketing UI blends into the host page.
   ========================================================================== */
body.is-embed .sidebar,
body.is-embed .topbar,
body.is-embed .nav-scrim { display: none !important; }
body.is-embed .main { margin-left: 0; }
body.is-embed .content { padding: 16px; max-width: none; }
body.is-embed { background: #fff; }
body.is-embed .auth-wrap { min-height: auto; grid-template-columns: 1fr; }
body.is-embed .auth-brand { display: none; }
body.is-embed .auth-panel { padding: 24px 16px; }
body.is-embed .auth-card { max-width: 420px; margin: 0 auto; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 13.5px; font-weight: 600;
  line-height: 1.2;
  padding: 9px 16px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, box-shadow 0.13s, color 0.13s;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}
.btn:focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 2px; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }

.btn-accent { background: var(--orange-500); color: #fff; }
.btn-accent:hover { background: var(--orange-600); color: #fff; }

.btn-cyan { background: var(--cyan-500); color: var(--navy-900); }
.btn-cyan:hover { background: var(--cyan-600); color: #fff; }

.btn-secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-800); }

.btn-danger { background: #fff; color: var(--red-500); border-color: #F3C6C8; }
.btn-danger:hover { background: var(--red-50); border-color: var(--red-500); color: var(--red-500); }

.btn-danger-solid { background: var(--red-500); color: #fff; }
.btn-danger-solid:hover { background: #C22F38; color: #fff; }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-sm { font-size: 12.5px; padding: 6px 11px; min-height: 31px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { font-size: 15px; padding: 12px 22px; min-height: 46px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: inline-flex; gap: 7px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   Cards & layout primitives
   ========================================================================== */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  margin-bottom: 18px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-25);
}
.card-header h3 { margin: 0; }
.card-body { padding: 18px; }
.card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-25);
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-header p { margin: 2px 0 0; font-size: 13.5px; }

.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); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--gray-200); margin: 16px 0; }

/* ==========================================================================
   Stat cards
   ========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gray-300);
}
.stat.is-open::before { background: var(--cyan-500); }
.stat.is-progress::before { background: var(--violet-500); }
.stat.is-waiting::before { background: var(--amber-500); }
.stat.is-urgent::before { background: var(--red-500); }
.stat.is-done::before { background: var(--green-500); }

.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gray-500); font-weight: 700; margin-bottom: 4px;
}
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy-900); line-height: 1.1; letter-spacing: -0.02em; }
.stat-meta { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ==========================================================================
   Badges & pills
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.5;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-open { background: var(--cyan-50); color: #0E7C8F; border-color: #BCE9F1; }
.badge-in-progress { background: var(--violet-50); color: #4B3DC4; border-color: #D5D0F9; }
.badge-waiting { background: var(--amber-50); color: #9A6E04; border-color: #F6E3B0; }
.badge-resolved { background: var(--green-50); color: #0B7A55; border-color: #B9E7D7; }
.badge-closed { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }
.badge-neutral { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }

.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.prio::before { content: ''; width: 7px; height: 7px; border-radius: 2px; }
.prio-low { color: var(--gray-500); }
.prio-low::before { background: var(--gray-400); }
.prio-normal { color: var(--navy-600); }
.prio-normal::before { background: var(--cyan-500); }
.prio-high { color: var(--orange-600); }
.prio-high::before { background: var(--orange-500); }
.prio-urgent { color: var(--red-500); }
.prio-urgent::before { background: var(--red-500); }

.tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
  background: var(--gray-100); color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.ref {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px; font-weight: 600; color: var(--gray-500);
}
.sla-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
}
.sla-ok { background: var(--green-50); color: #0B7A55; }
.sla-soon { background: var(--amber-50); color: #9A6E04; }
.sla-breach { background: var(--red-50); color: var(--red-500); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data thead th {
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-500); font-weight: 700;
  padding: 10px 14px;
  background: var(--gray-25);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.1s; }
table.data tbody tr:hover { background: var(--gray-25); }
table.data a.row-link { color: var(--navy-800); font-weight: 600; }
table.data a.row-link:hover { color: var(--cyan-600); }

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--gray-500);
}
.empty svg { width: 40px; height: 40px; color: var(--gray-300); margin-bottom: 10px; }
.empty h4 { color: var(--gray-700); margin-bottom: 4px; }
.empty p { font-size: 13px; margin-bottom: 14px; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
}
label .req { color: var(--red-500); }
.hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], input[type="url"],
select, textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-800);
  padding: 9px 11px;
  min-height: 38px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.13s, box-shadow 0.13s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 3px rgba(47, 198, 222, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--gray-400); }
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7688' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 32px;
}
input[type="file"] {
  width: 100%;
  font-size: 13px;
  padding: 9px;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--gray-25);
}
input[type="file"]::file-selector-button {
  font-family: var(--font); font-size: 12.5px; font-weight: 600;
  padding: 6px 11px; margin-right: 10px;
  border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  background: #fff; color: var(--gray-700); cursor: pointer;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--navy-800); cursor: pointer; }
.checkbox-row label { margin: 0; font-weight: 500; cursor: pointer; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(auto-fit, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.filter-bar .form-group { margin-bottom: 0; }

/* ==========================================================================
   Flash messages
   ========================================================================== */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.flash svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.flash-success { background: var(--green-50); color: #0B6B4B; border-color: #B9E7D7; }
.flash-error { background: var(--red-50); color: #B02A32; border-color: #F3C6C8; }
.flash-info { background: var(--cyan-50); color: #0E7C8F; border-color: #BCE9F1; }

/* ==========================================================================
   Ticket thread
   ========================================================================== */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 11px; }
.msg-body {
  flex: 1;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 13px 15px;
  min-width: 0;
}
.msg-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 7px;
}
.msg-author { font-weight: 700; font-size: 13.5px; color: var(--navy-900); }
.msg-time { font-size: 12px; color: var(--gray-400); }
.msg-text { font-size: 13.5px; color: var(--gray-700); white-space: pre-wrap; line-height: 1.65; }
.msg.is-staff .msg-body { background: var(--gray-25); }
.msg.is-internal .msg-body {
  background: var(--amber-50);
  border-color: #F3DCA4;
  border-left: 3px solid var(--amber-500);
}

.attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.attach {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
}
.attach:hover { border-color: var(--cyan-500); background: var(--cyan-50); }
.attach svg { width: 15px; height: 15px; color: var(--gray-400); flex-shrink: 0; }
.attach .name { font-weight: 600; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach .size { color: var(--gray-400); margin-left: auto; flex-shrink: 0; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: flex; gap: 10px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--gray-600);
  position: relative;
}
.tl-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gray-300);
  margin-top: 6px; flex-shrink: 0;
}
.tl-time { margin-left: auto; color: var(--gray-400); font-size: 11.5px; white-space: nowrap; }

.meta-list { display: flex; flex-direction: column; gap: 11px; }
.meta-item { display: flex; flex-direction: column; gap: 3px; }
.meta-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gray-500); font-weight: 700;
}
.meta-value { font-size: 13.5px; color: var(--gray-800); font-weight: 500; }

/* ==========================================================================
   Login
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-brand {
  background: linear-gradient(150deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  color: #fff;
  padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute; right: -120px; bottom: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,198,222,0.22), transparent 68%);
}
.auth-brand-top { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-brand-body { position: relative; z-index: 1; }
.auth-brand-body h2 {
  color: #fff; font-size: 30px; line-height: 1.22;
  margin-bottom: 14px; letter-spacing: -0.02em; max-width: 420px;
}
.auth-brand-body p { color: rgba(255,255,255,0.65); font-size: 14.5px; max-width: 400px; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; }
.auth-points li {
  display: flex; align-items: center; gap: 9px;
  color: rgba(255,255,255,0.82); font-size: 13.5px;
  padding: 5px 0;
}
.auth-points svg { width: 16px; height: 16px; color: var(--cyan-500); flex-shrink: 0; }
.auth-brand-foot { position: relative; z-index: 1; color: rgba(255,255,255,0.4); font-size: 12.5px; }

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: #fff;
}
.auth-card { width: 100%; max-width: 372px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card > p { margin-bottom: 22px; font-size: 13.5px; }

/* ==========================================================================
   Misc
   ========================================================================== */
.progress {
  height: 6px; border-radius: 3px;
  background: var(--gray-200); overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--cyan-500); border-radius: 3px; }
.progress.over > span { background: var(--red-500); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bar-row .bar-label { width: 140px; flex-shrink: 0; color: var(--gray-600); font-weight: 500; }
.bar-row .bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.bar-row .bar-fill { display: block; height: 100%; min-width: 2px; background: var(--navy-600); border-radius: 4px; transition: width .3s ease; }
.bar-row .bar-num { width: 34px; text-align: right; font-weight: 700; color: var(--navy-900); font-size: 13px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; }
.tab {
  padding: 9px 15px;
  font-size: 13.5px; font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--gray-800); }
.tab.active { color: var(--navy-800); border-bottom-color: var(--cyan-500); }

details.disclosure summary {
  cursor: pointer; font-weight: 600; font-size: 13px;
  color: var(--navy-700); padding: 7px 0; list-style: none;
}
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary::before { content: '+ '; font-weight: 700; }
details.disclosure[open] summary::before { content: '− '; }

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .sidebar, .topbar, .btn, form { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    background: #fff; cursor: pointer; color: var(--gray-700);
  }
  .mobile-toggle svg { width: 18px; height: 18px; }
  .nav-scrim {
    display: none;
    position: fixed; inset: 0; background: rgba(7,27,51,0.45); z-index: 35;
  }
  body.nav-open .nav-scrim { display: block; }
  .content { padding: 16px; }
  .grid-2, .grid-4, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 14px; }
}
