/* ============================================================
   Ticket System — design system
   ============================================================ */

:root {
  /* Neutrals */
  --gray-25:  #fcfcfd;
  --gray-50:  #f9fafb;
  --gray-100: #f2f4f7;
  --gray-200: #e4e7ec;
  --gray-300: #d0d5dd;
  --gray-400: #98a2b3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1d2939;
  --gray-900: #101828;
  --gray-950: #0c111d;

  /* Brand */
  --brand-50:  #eef4ff;
  --brand-100: #e0eaff;
  --brand-200: #c7d7fe;
  --brand-400: #8098f9;
  --brand-500: #6172f3;
  --brand-600: #444ce7;
  --brand-700: #3538cd;

  /* Semantic */
  --blue-50: #eff8ff;  --blue-200: #b2ddff;  --blue-700: #175cd3;
  --green-50:#ecfdf3;  --green-200:#abefc6;  --green-700:#027a48;
  --amber-50:#fffaeb;  --amber-200:#fedf89;  --amber-700:#b54708;
  --red-50:  #fef3f2;  --red-200:  #fecdca;  --red-700:  #b42318;
  --cyan-50: #f0f9ff;  --cyan-200: #b9e6fe;  --cyan-700: #0e7090;
  --violet-50:#f4f3ff; --violet-200:#d9d6fe; --violet-700:#6941c6;

  /* Surfaces */
  --bg: var(--gray-50);
  --surface: #ffffff;
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --text: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-faint: var(--gray-400);

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .1), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);

  --sidebar-w: 248px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", ui-monospace, Consolas, "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.icon { width: 16px; height: 16px; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ============================================================
   App shell
   ============================================================ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--gray-950);
  border-right: 1px solid var(--gray-800);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(68, 76, 231, .45);
}
.brand-mark .icon { width: 19px; height: 19px; }
.brand-name { color: #fff; font-weight: 650; font-size: 14.5px; line-height: 1.25; }
.brand-sub { color: var(--gray-500); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label {
  color: var(--gray-600);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 14px 10px 6px;
  margin: 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--gray-400);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--gray-100); text-decoration: none; }
.nav-item.is-active { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600; }
.nav-item.is-active .icon { color: var(--brand-400); }
.nav-item .icon { width: 17px; height: 17px; }

.sidebar-foot { border-top: 1px solid var(--gray-800); padding-top: 14px; margin-top: 10px; }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-meta { min-width: 0; flex: 1; }
.user-name {
  color: var(--gray-100); font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-mail {
  color: var(--gray-500); font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--r-sm);
  color: var(--gray-500); flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

/* Shown instead of the sign-out button while AUTH_ENABLED=false */
.dev-chip {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  background: rgba(180, 71, 8, .22);
  color: #fdb022;
  border: 1px solid rgba(253, 176, 34, .28);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: help;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar-title { font-size: 20px; }
.topbar-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; }

.content { padding: 26px 32px 64px; max-width: 1280px; width: 100%; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--gray-700);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--gray-50); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-muted); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-700); }

.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--gray-800);
}
.card-title .icon { width: 16px; height: 16px; color: var(--text-faint); }
.card-note { font-size: 12.5px; color: var(--text-muted); }
.card-body { padding: 20px; }
.card-body--flush { padding: 0; }

/* ============================================================
   KPI tiles
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--brand-50); color: var(--brand-600);
}
.kpi-icon .icon { width: 19px; height: 19px; }
.kpi-icon--blue   { background: var(--blue-50);   color: var(--blue-700); }
.kpi-icon--amber  { background: var(--amber-50);  color: var(--amber-700); }
.kpi-icon--red    { background: var(--red-50);    color: var(--red-700); }
.kpi-icon--green  { background: var(--green-50);  color: var(--green-700); }
.kpi-icon--violet { background: var(--violet-50); color: var(--violet-700); }
.kpi-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.kpi-value { font-size: 26px; font-weight: 680; line-height: 1.15; margin-top: 4px; letter-spacing: -0.02em; }
.kpi-hint { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.kpi-hint--alert { color: var(--red-700); font-weight: 600; }

/* ============================================================
   Tables
   ============================================================ */

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 10px 20px;
  background: var(--gray-25);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13.5px;
  vertical-align: middle;
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-25); }

.t-id { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.t-title {
  font-weight: 600; color: var(--gray-800);
  white-space: normal; min-width: 260px; max-width: 420px;
}
.t-title a { color: inherit; }
.t-title a:hover { color: var(--brand-600); text-decoration: none; }
.t-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* ============================================================
   Pills, chips, avatars
   ============================================================ */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill .icon { width: 12.5px; height: 12.5px; }
.pill--open        { background: var(--blue-50);   color: var(--blue-700);   border-color: var(--blue-200); }
.pill--in-progress { background: var(--brand-50);  color: var(--brand-700);  border-color: var(--brand-200); }
.pill--on-hold     { background: var(--amber-50);  color: var(--amber-700);  border-color: var(--amber-200); }
.pill--resolved    { background: var(--green-50);  color: var(--green-700);  border-color: var(--green-200); }
.pill--closed      { background: var(--gray-100);  color: var(--gray-600);   border-color: var(--gray-200); }

.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.prio .icon { width: 13px; height: 13px; }
.prio--low      { color: var(--gray-500); }
.prio--medium   { color: var(--blue-700); }
.prio--high     { color: var(--amber-700); }
.prio--critical { color: var(--red-700); }

.tchip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.tchip .icon { width: 12.5px; height: 12.5px; }
.tchip--support     { background: var(--cyan-50);   color: var(--cyan-700);   border-color: var(--cyan-200); }
.tchip--development { background: var(--violet-50); color: var(--violet-700); border-color: var(--violet-200); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0; user-select: none;
}
.avatar--lg { width: 38px; height: 38px; font-size: 13.5px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--v1 { background: #e0eaff; color: #3538cd; }
.avatar--v2 { background: #d3f8df; color: #027a48; }
.avatar--v3 { background: #fee4e2; color: #b42318; }
.avatar--v4 { background: #fdead7; color: #b54708; }
.avatar--v5 { background: #e0f2fe; color: #0e7090; }
.avatar--v6 { background: #ebe9fe; color: #6941c6; }

.person { display: inline-flex; align-items: center; gap: 8px; }
.person-name { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.person--empty { color: var(--text-faint); font-size: 13px; font-style: italic; }

.overdue-tag {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--red-700); font-size: 11.5px; font-weight: 700;
}
.overdue-tag .icon { width: 12px; height: 12px; }

/* ============================================================
   Distribution bars
   ============================================================ */

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 108px 1fr 34px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.bar-track { display: block; height: 8px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand-500); transition: width .3s ease; }
.bar-fill--open        { background: var(--blue-700); }
.bar-fill--in-progress { background: var(--brand-500); }
.bar-fill--on-hold     { background: var(--amber-700); }
.bar-fill--resolved    { background: var(--green-700); }
.bar-fill--closed      { background: var(--gray-400); }
.bar-fill--support     { background: var(--cyan-700); }
.bar-fill--development { background: var(--violet-700); }
.bar-fill--low         { background: var(--gray-400); }
.bar-fill--medium      { background: var(--blue-700); }
.bar-fill--high        { background: var(--amber-700); }
.bar-fill--critical    { background: var(--red-700); }
.bar-value { font-size: 12.5px; font-weight: 650; color: var(--gray-700); text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   Forms
   ============================================================ */

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.field-label .icon { width: 14px; height: 14px; color: var(--text-faint); }
.field-hint { font-size: 12px; color: var(--text-muted); }

.input, .select, .textarea {
  font: inherit;
  font-size: 13.5px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select { cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--gray-25);
  padding: 14px;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover { border-color: var(--brand-400); background: var(--brand-50); }
.dropzone input[type="file"] { font: inherit; font-size: 12.5px; width: 100%; color: var(--text-secondary); }

.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 18px;
}

/* Filter bar */
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.search { position: relative; flex: 1; min-width: 220px; }
.search .icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-faint); pointer-events: none;
}
.search .input { padding-left: 34px; }
.filterbar .select { width: auto; min-width: 136px; }

/* ============================================================
   Timeline
   ============================================================ */

.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 2px; background: var(--gray-200);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -32px; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.tl-dot .icon { width: 12px; height: 12px; }
.tl-dot--comment { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-600); }
.tl-dot--created { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.tl-dot--attachment { background: var(--cyan-50); border-color: var(--cyan-200); color: var(--cyan-700); }

.tl-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-height: 24px; }
.tl-actor { font-size: 13px; font-weight: 650; color: var(--gray-800); }
.tl-text { font-size: 13px; color: var(--text-secondary); }
.tl-time { font-size: 12px; color: var(--text-faint); }
.tl-bubble {
  margin-top: 7px;
  background: var(--gray-25);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--gray-700);
  line-height: 1.55;
  white-space: pre-wrap;
}
.tl-chip {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: var(--r-sm);
  background: var(--gray-100); color: var(--gray-700);
  font-size: 12px; font-weight: 600;
}

/* ============================================================
   Attachments
   ============================================================ */

.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.file-row {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 13px;
  background: var(--surface);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.file-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.file-badge {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--gray-100); color: var(--gray-600);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  display: block; font-size: 13px; font-weight: 600; color: var(--gray-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta { font-size: 11.5px; color: var(--text-muted); }

/* ============================================================
   Ticket detail
   ============================================================ */

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 14px;
}
.back-link:hover { color: var(--gray-700); text-decoration: none; }
.back-link .icon { width: 15px; height: 15px; }

.hero { margin-bottom: 22px; }
.hero-id { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.hero-title { font-size: 23px; line-height: 1.3; margin: 5px 0 12px; letter-spacing: -0.02em; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 22px; align-items: start; }

.meta-list { display: flex; flex-direction: column; }
.meta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--gray-100);
}
.meta-row:last-child { border-bottom: none; }
.meta-key {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-muted); font-weight: 500;
}
.meta-key .icon { width: 14px; height: 14px; color: var(--text-faint); }
.meta-val { font-size: 13px; font-weight: 600; color: var(--gray-800); text-align: right; }
.meta-val--muted { color: var(--text-faint); font-weight: 500; }

.prose { font-size: 14px; line-height: 1.65; color: var(--gray-700); white-space: pre-wrap; margin: 0; }
.prose--empty { color: var(--text-faint); font-style: italic; }

/* ============================================================
   Empty states & alerts
   ============================================================ */

.empty { text-align: center; padding: 44px 24px; }
.empty-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--gray-100); color: var(--text-faint);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.empty-icon .icon { width: 23px; height: 23px; }
.empty-title { font-size: 15px; font-weight: 650; color: var(--gray-800); }
.empty-text { font-size: 13px; color: var(--text-muted); margin: 5px 0 16px; }
.empty--sm { padding: 26px 16px; }
.empty--sm .empty-icon { width: 38px; height: 38px; margin-bottom: 10px; }
.empty--sm .empty-icon .icon { width: 18px; height: 18px; }

.alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500;
}
.alert .icon { width: 17px; height: 17px; flex-shrink: 0; }
.alert--success { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.alert--error   { background: var(--red-50);   border-color: var(--red-200);   color: var(--red-700); }

/* ============================================================
   Auth screen
   ============================================================ */

.auth {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 480px at 50% -10%, var(--brand-50), transparent 70%),
    var(--gray-50);
}
.auth-card {
  width: 100%; max-width: 408px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
  text-align: center;
}
.auth-mark {
  width: 52px; height: 52px; border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 6px 16px rgba(68, 76, 231, .35);
}
.auth-mark .icon { width: 26px; height: 26px; }
.auth-title { font-size: 20px; letter-spacing: -0.02em; }
.auth-text { color: var(--text-muted); font-size: 13.5px; margin: 8px 0 26px; }
.ms-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--gray-800);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: background .12s ease, box-shadow .12s ease;
}
.ms-btn:hover { background: var(--gray-50); text-decoration: none; box-shadow: var(--shadow-sm); }
.ms-btn .icon { width: 17px; height: 17px; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--text-faint); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 12px;
    padding: 12px 16px; overflow-x: auto;
  }
  .sidebar-brand { padding: 0; }
  .brand-text { display: none; }
  .nav { flex-direction: row; flex: 1; }
  .nav-label { display: none; }
  .sidebar-foot { border-top: none; margin: 0; padding: 0; }
  .user-meta { display: none; }
  .topbar { padding: 16px 18px; flex-wrap: wrap; }
  .content { padding: 18px 18px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
}
