/* ============================================================
   MAN 1 Cilacap — Design System
   Apple HIG · Minimalist & Professional · Trust-first
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Lora:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Primary palette */
  --color-primary:        #1A4F8A;
  --color-primary-light:  #2563A8;
  --color-primary-hover:  #153F6E;
  --color-primary-10:     #EBF1F9;
  --color-primary-20:     #C8D9EE;

  /* Accent */
  --color-accent:         #2E7D5E;
  --color-accent-light:   #38966F;
  --color-accent-10:      #EAF4EF;

  /* Neutrals */
  --color-gray-900:       #1C1C1E;
  --color-gray-700:       #3A3A3C;
  --color-gray-500:       #636366;
  --color-gray-400:       #8E8E93;
  --color-gray-200:       #C7C7CC;
  --color-gray-100:       #E5E5EA;
  --color-gray-50:        #F2F2F7;
  --color-white:          #FFFFFF;

  /* Semantic */
  --color-success:        #34C759;
  --color-success-bg:     #F0FBF3;
  --color-warning:        #FF9500;
  --color-warning-bg:     #FFF8EE;
  --color-error:          #FF3B30;
  --color-error-bg:       #FFF2F1;
  --color-info:           #007AFF;
  --color-info-bg:        #EBF5FF;

  /* Status badge colors */
  --status-baru-bg:       #EBF5FF;
  --status-baru-text:     #0055CC;
  --status-diproses-bg:   #FFF8EE;
  --status-diproses-text: #B85C00;
  --status-selesai-bg:    #F0FBF3;
  --status-selesai-text:  #1A6B3A;

  /* Typography */
  --font-sans:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:   'Lora', Georgia, serif;

  /* Type scale */
  --text-display:    clamp(42px, 6vw, 64px);
  --text-headline:   clamp(32px, 4vw, 48px);
  --text-title1:     clamp(26px, 3vw, 34px);
  --text-title2:     clamp(22px, 2.5vw, 28px);
  --text-title3:     22px;
  --text-body:       17px;
  --text-callout:    16px;
  --text-subhead:    15px;
  --text-footnote:   13px;
  --text-caption:    12px;

  /* Line heights */
  --lh-display:  1.1;
  --lh-headline: 1.15;
  --lh-title:    1.2;
  --lh-body:     1.65;
  --lh-small:    1.4;

  /* Letter spacing */
  --ls-display:  -0.03em;
  --ls-headline: -0.02em;
  --ls-title:    -0.01em;
  --ls-body:      0;
  --ls-caption:   0.02em;
  --ls-upper:     0.08em;

  /* Spacing (8px base) */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;
  --sp-24:  96px;
  --sp-32:  128px;

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.08);

  /* Motion */
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    150ms;
  --dur-base:    250ms;
  --dur-slow:    400ms;
  --dur-page:    500ms;

  /* Layout */
  --max-width:   1280px;
  --nav-height:  64px;
  --bottom-nav:  72px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-gray-900);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Focus indicators (WCAG AA) ───────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Reduce motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-gray-200); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-400); }

/* ── Typography utilities ─────────────────────────────────── */
.text-display  { font-size: var(--text-display);  line-height: var(--lh-display);  letter-spacing: var(--ls-display);  font-weight: 800; }
.text-headline { font-size: var(--text-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: 700; }
.text-title1   { font-size: var(--text-title1);   line-height: var(--lh-title);    letter-spacing: var(--ls-title);    font-weight: 700; }
.text-title2   { font-size: var(--text-title2);   line-height: var(--lh-title);    letter-spacing: var(--ls-title);    font-weight: 600; }
.text-title3   { font-size: var(--text-title3);   line-height: var(--lh-title);    font-weight: 600; }
.text-body     { font-size: var(--text-body);     line-height: var(--lh-body);     font-weight: 400; }
.text-callout  { font-size: var(--text-callout);  line-height: var(--lh-body);     font-weight: 400; }
.text-subhead  { font-size: var(--text-subhead);  line-height: var(--lh-small);    font-weight: 500; }
.text-footnote { font-size: var(--text-footnote); line-height: var(--lh-small);    font-weight: 400; }
.text-caption  { font-size: var(--text-caption);  line-height: var(--lh-small);    letter-spacing: var(--ls-caption); font-weight: 400; }

.text-muted    { color: var(--color-gray-500); }
.text-subtle   { color: var(--color-gray-400); }
.text-primary  { color: var(--color-primary); }
.text-serif    { font-family: var(--font-serif); }
.text-upper    { text-transform: uppercase; letter-spacing: var(--ls-upper); font-size: var(--text-caption); font-weight: 600; }
.text-center   { text-align: center; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-10);
}

.section { padding: var(--sp-24) 0; }
.section-sm { padding: var(--sp-12) 0; }
.section-lg { padding: calc(var(--sp-24) * 1.5) 0; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-gray-100);
  z-index: 100;
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.navbar__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.navbar__logo-placeholder {
  width: 36px;
  height: 36px;
  background: var(--color-primary-10);
  border: 1.5px dashed var(--color-primary-20);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-primary);
  font-weight: 600;
}
.navbar__name {
  font-size: var(--text-subhead);
  font-weight: 700;
  color: var(--color-gray-900);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.navbar__name span {
  display: block;
  font-size: var(--text-caption);
  font-weight: 400;
  color: var(--color-gray-500);
  letter-spacing: 0;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.navbar__link {
  font-size: var(--text-subhead);
  font-weight: 500;
  color: var(--color-gray-700);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.navbar__link:hover { color: var(--color-primary); background: var(--color-primary-10); }
.navbar__link.active { color: var(--color-primary); font-weight: 600; }

/* ── Bottom Nav (Mobile) ──────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav);
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--color-gray-100);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--color-gray-400);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-bottom: 4px;
  transition: color var(--dur-fast);
  border: none;
  background: none;
  cursor: pointer;
}
.bottom-nav__item.active { color: var(--color-primary); }
.bottom-nav__item svg { width: 22px; height: 22px; }
.bottom-nav__badge {
  position: absolute;
  top: 10px;
  background: var(--color-error);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
  transform: translateX(10px);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-size: var(--text-callout);
  font-weight: 600;
  line-height: 1;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); box-shadow: 0 4px 12px rgba(26,79,138,0.25); }

.btn-secondary {
  background: var(--color-gray-50);
  color: var(--color-gray-700);
  border-color: var(--color-gray-100);
}
.btn-secondary:hover { background: var(--color-gray-100); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary-20);
}
.btn-outline:hover { background: var(--color-primary-10); border-color: var(--color-primary); }

.btn-danger {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: rgba(255,59,48,0.2);
}
.btn-danger:hover { background: var(--color-error); color: white; }

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--text-footnote); }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--text-body); border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Form elements ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-label {
  font-size: var(--text-subhead);
  font-weight: 600;
  color: var(--color-gray-700);
}
.form-label .optional {
  font-weight: 400;
  color: var(--color-gray-400);
  font-size: var(--text-caption);
  margin-left: var(--sp-1);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--color-gray-100);
  border-radius: var(--radius-md);
  font-size: var(--text-callout);
  color: var(--color-gray-900);
  background: var(--color-white);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  -webkit-appearance: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-gray-400); }
.form-input:hover,
.form-select:hover,
.form-textarea:hover { border-color: var(--color-gray-200); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,79,138,0.10);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238E8E93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  padding-right: var(--sp-10);
  cursor: pointer;
}
.form-textarea { resize: vertical; min-height: 120px; line-height: var(--lh-body); }
.form-hint { font-size: var(--text-caption); color: var(--color-gray-400); }
.form-error { font-size: var(--text-caption); color: var(--color-error); display: none; }
.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea { border-color: var(--color-error); }
.form-group.has-error .form-error { display: block; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: var(--sp-6); }
.card-elevated { box-shadow: var(--shadow-md); }
.card-hover { transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ── Badges / Status ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-baru     { background: var(--status-baru-bg);     color: var(--status-baru-text); }
.badge-diproses { background: var(--status-diproses-bg); color: var(--status-diproses-text); }
.badge-selesai  { background: var(--status-selesai-bg);  color: var(--status-selesai-text); }
.badge-gray     { background: var(--color-gray-100);     color: var(--color-gray-500); }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--color-gray-100);
  margin: var(--sp-6) 0;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ── Toast notification ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--sp-4));
  right: var(--sp-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  background: var(--color-gray-900);
  color: white;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-size: var(--text-subhead);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--dur-slow) var(--ease-spring);
  max-width: 320px;
}
.toast.success { background: var(--color-accent); }
.toast.error   { background: var(--color-error); }
.toast.warning { background: var(--color-warning); color: var(--color-gray-900); }
.toast.exit    { animation: toastOut var(--dur-base) var(--ease-out) forwards; }

@keyframes toastIn  { from { opacity:0; transform: translateX(20px) scale(0.95); } to { opacity:1; transform: none; } }
@keyframes toastOut { to   { opacity:0; transform: translateX(20px) scale(0.95); } }

/* ── Loading overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
}
.loading-overlay.visible { opacity: 1; pointer-events: all; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--color-gray-100);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
  padding: var(--sp-4);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--dur-slow) var(--ease-spring);
}
.modal-overlay.visible .modal { transform: none; }
.modal__header {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--color-gray-100);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
}
.modal__body    { padding: var(--sp-6); }
.modal__footer  { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--color-gray-100); display: flex; gap: var(--sp-3); justify-content: flex-end; }
.modal__close   { width: 32px; height: 32px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; color: var(--color-gray-400); flex-shrink: 0; transition: background var(--dur-fast), color var(--dur-fast); }
.modal__close:hover { background: var(--color-gray-50); color: var(--color-gray-700); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-24) var(--sp-8);
  text-align: center;
  gap: var(--sp-4);
}
.empty-state__icon {
  width: 64px; height: 64px;
  background: var(--color-gray-50);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-gray-400);
}

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: var(--ls-upper);
  border-bottom: 1px solid var(--color-gray-100);
  white-space: nowrap;
  background: var(--color-gray-50);
}
td {
  padding: var(--sp-4);
  font-size: var(--text-subhead);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-50);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-gray-50); }
.table-truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Stats card ───────────────────────────────────────────── */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-sm);
}
.stat-card__label { font-size: var(--text-caption); font-weight: 600; color: var(--color-gray-500); text-transform: uppercase; letter-spacing: var(--ls-upper); }
.stat-card__value { font-size: 36px; font-weight: 800; color: var(--color-gray-900); line-height: 1; letter-spacing: -0.03em; }
.stat-card__sub   { font-size: var(--text-caption); color: var(--color-gray-400); }
.stat-card.accent-blue  { border-top: 3px solid var(--color-primary); }
.stat-card.accent-amber { border-top: 3px solid var(--color-warning); }
.stat-card.accent-green { border-top: 3px solid var(--color-success); }
.stat-card.accent-gray  { border-top: 3px solid var(--color-gray-200); }

/* ── Admin layout ─────────────────────────────────────────── */
.admin-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--color-gray-900);
  padding: var(--sp-8) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-6);
}
.admin-sidebar__logo {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.admin-sidebar__logo-placeholder {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  border: 1.5px dashed rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: rgba(255,255,255,0.5); font-weight: 600;
}
.admin-sidebar__title { font-size: var(--text-footnote); font-weight: 700; color: white; line-height: 1.2; }
.admin-sidebar__title span { display: block; font-weight: 400; color: rgba(255,255,255,0.45); font-size: 11px; margin-top: 1px; }

.admin-nav__label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-4);
}
.admin-nav__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-subhead);
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: background var(--dur-fast), color var(--dur-fast);
  cursor: pointer;
}
.admin-nav__item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav__item:hover { background: rgba(255,255,255,0.07); color: white; }
.admin-nav__item.active { background: var(--color-primary); color: white; }
.admin-nav__badge { margin-left: auto; background: var(--color-error); color: white; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); }

.admin-sidebar__logout {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-subhead);
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  transition: background var(--dur-fast), color var(--dur-fast);
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.admin-sidebar__logout:hover { background: rgba(255,59,48,0.15); color: var(--color-error); }
.admin-sidebar__logout svg { width: 18px; height: 18px; }

.admin-main { overflow: auto; background: var(--color-gray-50); }
.admin-topbar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-100);
  padding: var(--sp-4) var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-content { padding: var(--sp-8); }

/* ── Hero section ─────────────────────────────────────────── */
.hero {
  padding-top: calc(var(--nav-height) + var(--sp-24));
  padding-bottom: var(--sp-24);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(180deg, var(--color-primary-10) 0%, transparent 100%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  top: var(--nav-height);
  right: -120px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,79,138,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: center;
}
.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-primary-10);
  color: var(--color-primary);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}
.hero__kicker-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero__title { margin-bottom: var(--sp-5); }
.hero__title em { font-style: italic; font-family: var(--font-serif); color: var(--color-primary); }
.hero__desc { font-size: var(--text-body); color: var(--color-gray-500); margin-bottom: var(--sp-8); max-width: 460px; line-height: 1.75; }
.hero__cta  { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__card-stack { position: relative; width: 100%; max-width: 380px; }
.hero__card-bg {
  position: absolute;
  inset: 0;
  background: var(--color-primary-10);
  border-radius: var(--radius-xl);
  transform: rotate(3deg) scale(0.96);
}
.hero__card-main {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-gray-100);
}

/* ── Service cards ────────────────────────────────────────── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}
.service-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--color-primary-20); }
.service-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.service-card__title { font-size: var(--text-title3); font-weight: 600; color: var(--color-gray-900); }
.service-card__desc  { font-size: var(--text-subhead); color: var(--color-gray-500); line-height: 1.6; }
.service-card__tag   { display: inline-block; font-size: var(--text-caption); font-weight: 600; color: var(--color-primary); background: var(--color-primary-10); padding: 2px var(--sp-2); border-radius: var(--radius-full); margin-top: auto; }

/* ── Steps ────────────────────────────────────────────────── */
.steps { display: flex; gap: var(--sp-8); align-items: flex-start; }
.step { flex: 1; display: flex; gap: var(--sp-5); }
.step__number {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-subhead);
  font-weight: 700;
}
.step__content { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-2); }
.step__connector { flex-shrink: 0; height: 1px; width: var(--sp-8); background: var(--color-gray-200); margin-top: 20px; }

/* ── Stat counters ────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
  background: var(--color-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.stats-item {
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.stats-item:last-child { border-right: none; }
.stats-item__value { font-size: 40px; font-weight: 800; color: white; line-height: 1; letter-spacing: -0.03em; }
.stats-item__label { font-size: var(--text-subhead); color: rgba(255,255,255,0.7); margin-top: var(--sp-2); }

/* ── Ticket result ────────────────────────────────────────── */
.ticket-box {
  background: var(--color-primary-10);
  border: 2px dashed var(--color-primary-20);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  text-align: center;
}
.ticket-id {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

/* ── Section header ───────────────────────────────────────── */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-8); }
.section-header__label { display: block; font-size: var(--text-caption); font-weight: 600; color: var(--color-primary); text-transform: uppercase; letter-spacing: var(--ls-upper); margin-bottom: var(--sp-2); }
.section-header__title { font-size: var(--text-title1); font-weight: 700; color: var(--color-gray-900); line-height: 1.2; }

/* ── Filter row ───────────────────────────────────────────── */
.filter-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.filter-chip {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--text-footnote);
  font-weight: 600;
  border: 1.5px solid var(--color-gray-100);
  background: var(--color-white);
  color: var(--color-gray-500);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.filter-chip:hover { border-color: var(--color-primary-20); color: var(--color-primary); }
.filter-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: white; }

/* ── Search bar ───────────────────────────────────────────── */
.search-bar {
  position: relative;
  flex: 1; min-width: 200px; max-width: 320px;
}
.search-bar svg { position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--color-gray-400); width: 16px; height: 16px; }
.search-bar input { padding-left: calc(var(--sp-3) + 16px + var(--sp-2)); }

/* ── Print styles (PDF export) ────────────────────────────── */
@media print {
  .navbar, .bottom-nav, .admin-sidebar, .admin-topbar,
  .btn, .filter-row, .modal-overlay, .toast-container { display: none !important; }
  body { background: white !important; color: black !important; font-size: 12px; }
  .admin-wrap { display: block !important; }
  .admin-main { overflow: visible !important; }
  .card { box-shadow: none !important; border: 1px solid var(--color-gray-200) !important; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-12); }
  .hero__visual { display: none; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stats-item:nth-child(2) { border-right: none; }
  .steps { flex-direction: column; gap: var(--sp-6); }
  .step__connector { display: none; }
  .admin-wrap { grid-template-columns: 200px 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-height: 56px; }
  .container { padding: 0 var(--sp-5); }
  .navbar { display: none; }
  .bottom-nav { display: block; }
  .page { padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); }
  .hero { padding-top: calc(var(--sp-8)); }
  .service-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .section { padding: var(--sp-12) 0; }
  .section-lg { padding: var(--sp-12) 0; }
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { padding: var(--sp-4); }
  .admin-topbar { padding: var(--sp-4); }
  th, td { padding: var(--sp-3); }
}

@media (max-width: 480px) {
  .service-grid { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}
