@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Core blue/white palette, kept, but layered for depth ---- */
  --navy:        #060e26;   /* near-black navy base, for real depth (not flat #0f1f3d) */
  --navy-light:  #0c1a3d;
  --navy-mid:    #142c63;
  --blue-deep:   #1a3a8f;
  --blue:        #2563eb;
  --blue-light:  #3b82f6;
  --blue-vivid:  #4f7dff;
  --blue-pale:   #dbeafe;
  --cyan:        #22d3ee;   /* holographic / glow accent */
  --cyan-pale:   #cffafe;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --purple:      #8b5cf6;
  --white:       #ffffff;
  --ice:         #f4f8ff;   /* app background, cooler than plain gray */
  --gray-50:     #f6f8fc;
  --gray-100:    #eef2f9;
  --gray-200:    #dfe6f2;
  --gray-300:    #c3cee2;
  --gray-400:    #93a2c2;
  --gray-500:    #64749a;
  --gray-600:    #46567a;
  --gray-700:    #2e3b5c;
  --gray-800:    #1b2440;
  --gray-900:    #0d1428;
  --sidebar-w:   264px;
  --topbar-h:    66px;
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   22px;
  --shadow-sm:   0 1px 3px rgba(10,25,70,.06), 0 1px 2px rgba(10,25,70,.05);
  --shadow:      0 8px 28px rgba(10,25,70,.10);
  --shadow-lg:   0 20px 55px rgba(10,25,70,.20);
  --glow-blue:   0 0 0 1px rgba(37,99,235,.16), 0 0 24px rgba(37,99,235,.18);
  --glow-cyan:   0 0 0 1px rgba(34,211,238,.25), 0 0 22px rgba(34,211,238,.25);
  --transition:  .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--gray-700);
  background: var(--ice);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.25;
  letter-spacing: -.015em;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-light); }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.app-shell {
  display: flex; min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(37,99,235,.05), transparent 40%),
    radial-gradient(circle at 100% 30%, rgba(34,211,238,.05), transparent 35%),
    var(--ice);
}

/* SIDEBAR — floating glass panel, not a flush flat block */
.sidebar {
  width: var(--sidebar-w);
  margin: 12px 0 12px 12px;
  height: calc(100vh - 24px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 0%, rgba(34,211,238,.16), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(37,99,235,.20), transparent 50%),
    linear-gradient(175deg, var(--navy) 0%, var(--navy-mid) 100%);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .3s ease, width .25s ease;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-lg);
}

/* faint animated sheen across the top of the sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: -60%; left: -20%;
  width: 140%; height: 50%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.05), transparent);
  animation: sheenDrift 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheenDrift {
  0%, 100% { transform: translateX(-10%) translateY(0); }
  50%      { transform: translateX(10%) translateY(6%); }
}

.sidebar-brand {
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative; z-index: 1;
}

.brand-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--blue-vivid), var(--blue));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--glow-blue);
  border: 1px solid rgba(255,255,255,.2);
}

.brand-text { flex: 1; overflow: hidden; }
.brand-text .app-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 15px;
  color: #fff;
  display: block;
  letter-spacing: -.2px;
}
.brand-text .app-sub {
  font-size: 9.5px; color: var(--cyan);
  display: block; margin-top: 2px;
  text-transform: uppercase; letter-spacing: 1.4px;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative; z-index: 1;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(34,211,238,.35);
}

.user-info .user-name {
  font-size: 13px; font-weight: 600;
  color: #fff;
  display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.user-info .user-role {
  font-size: 10px; color: var(--cyan);
  display: block; text-transform: uppercase; letter-spacing: .8px;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; position: relative; z-index: 1; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.nav-section-label {
  font-size: 9.5px; font-weight: 600;
  color: rgba(255,255,255,.32);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 14px 20px 6px;
  font-family: 'JetBrains Mono', monospace;
}

.nav-item { padding: 0 12px; margin-bottom: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.62);
  font-size: 13.5px; font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.nav-link.active {
  background: linear-gradient(135deg, var(--blue-vivid), var(--blue));
  color: #fff;
  box-shadow: var(--glow-blue);
}
.nav-link.active::before {
  content: '';
  position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.nav-link .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px; text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  position: relative; z-index: 1;
}
.sidebar-footer .nav-link { color: rgba(255,255,255,.4); }
.sidebar-footer .nav-link:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* MAIN CONTENT */
.main-content {
  margin-left: calc(var(--sidebar-w) + 12px);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR — frosted glass, not flat white */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(223,230,242,.8);
  display: flex; align-items: center;
  padding: 0 26px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.topbar-toggle {
  display: flex;
  background: none; border: none;
  cursor: pointer; padding: 6px;
  color: var(--gray-600);
  border-radius: var(--radius-sm);
}
.topbar-toggle:hover { background: var(--gray-100); }

.topbar-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 19px; color: var(--gray-900); }
.topbar-subtitle { font-size: 12px; color: var(--gray-400); font-family: 'JetBrains Mono', monospace; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.notif-btn {
  position: relative;
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-500);
  transition: all var(--transition);
  font-size: 18px;
}
.notif-btn:hover { background: var(--blue-pale); color: var(--blue); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 6px rgba(239,68,68,.6);
}

/* PAGE CONTENT */
.page-content { flex: 1; padding: 26px; }

.page-header { margin-bottom: 26px; }
.page-header h1 { font-size: 24px; color: var(--gray-900); }
.page-header p { color: var(--gray-500); margin-top: 5px; font-size: 13.5px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-400); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; }
.breadcrumb span { color: var(--blue); }

/* ============================================================
   CARDS — glass surface with gradient top border, not flat white box
   ============================================================ */
.card {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(223,230,242,.9);
  overflow: hidden;
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  opacity: .7;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 12px;
}
.card-header h3 { font-size: 15.5px; font-weight: 600; color: var(--gray-900); }
.card-header .card-actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 22px; }
.card-footer { padding: 16px 22px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }

.stat-card {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(223,230,242,.9);
  display: flex; align-items: center; gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.3); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue    { background: linear-gradient(135deg, var(--blue-pale), #c7ddff); color: var(--blue); }
.stat-icon.yellow  { background: #fef3c7; color: var(--warning); }
.stat-icon.green   { background: #d1fae5; color: var(--success); }
.stat-icon.red     { background: #fee2e2; color: var(--danger); }
.stat-icon.purple  { background: #ede9fe; color: var(--purple); }
.stat-icon.cyan    { background: linear-gradient(135deg, var(--cyan-pale), #a5f3fc); color: #0891b2; }

.stat-info .stat-label { font-size: 11.5px; color: var(--gray-500); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-info .stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-info .stat-sub { font-size: 11px; color: var(--gray-400); margin-top: 5px; font-family: 'JetBrains Mono', monospace; }

/* ============================================================
   BUTTONS — glossy with a shine sweep, not flat single-color
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-vivid), var(--blue));
  color: #fff;
  box-shadow: var(--glow-blue);
}
.btn-primary::after {
  content: '';
  position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(37,99,235,.25), 0 0 34px rgba(37,99,235,.32); color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); }

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--blue);
  color: var(--blue);
}
.btn-outline-primary:hover { background: var(--blue-pale); }

.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-mid); color: #fff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.form-label span.required { color: var(--danger); margin-left: 3px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--blue);
  box-shadow: var(--glow-blue);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 11.5px; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Upload Area */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.upload-area .upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-area p { font-size: 13px; color: var(--gray-500); }
.upload-area strong { color: var(--blue); }
.upload-area input[type="file"] { display: none; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge-blue   { background: var(--blue-pale); color: var(--blue); }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-cyan   { background: var(--cyan-pale); color: #0e7490; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: 12px 16px;
  background: var(--gray-50);
  font-size: 11px; font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .7px;
  border-bottom: 2px solid var(--gray-200);
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13.5px;
  color: var(--gray-700);
  vertical-align: middle;
}
.table tr:hover td { background: var(--blue-pale); }
.table tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 13.5px;
  border-left: 4px solid;
  animation: slideDown .3s ease;
  position: relative;
  overflow: hidden;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

.alert-success { background: #d1fae5; color: #065f46; border-color: var(--success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-color: var(--warning); }
.alert-info    { background: var(--blue-pale); color: #1e40af; border-color: var(--blue); }

.alert .alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert .alert-close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; opacity: .6; font-size: 16px;
  padding: 0 4px; color: inherit;
}
.alert .alert-close:hover { opacity: 1; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { padding: 8px 0; }
.timeline-item {
  display: flex; gap: 16px;
  padding-bottom: 24px;
  position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px; top: 30px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gray-200), transparent);
}

.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px; font-weight: 700;
  z-index: 1;
}
.timeline-dot.active  { background: linear-gradient(135deg, var(--blue-vivid), var(--blue)); color: #fff; box-shadow: var(--glow-blue); }
.timeline-dot.success { background: var(--success); color: #fff; box-shadow: 0 0 0 4px #d1fae5; }
.timeline-dot.warning { background: var(--warning); color: #fff; box-shadow: 0 0 0 4px #fef3c7; }
.timeline-dot.danger  { background: var(--danger); color: #fff; box-shadow: 0 0 0 4px #fee2e2; }
.timeline-dot.gray    { background: var(--gray-200); color: var(--gray-500); }
.timeline-dot.purple  { background: var(--purple); color: #fff; box-shadow: 0 0 0 4px #ede9fe; }

.timeline-content { flex: 1; padding-top: 4px; }
.timeline-content .tl-title { font-weight: 700; font-size: 14px; color: var(--gray-900); margin-bottom: 3px; }
.timeline-content .tl-date  { font-size: 11.5px; color: var(--gray-400); margin-bottom: 4px; font-family: 'JetBrains Mono', monospace; }
.timeline-content .tl-note  { font-size: 12.5px; color: var(--gray-600); background: var(--gray-50); padding: 8px 12px; border-radius: var(--radius-sm); border-left: 3px solid var(--gray-200); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6,14,38,.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  max-width: 520px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
  overflow: hidden;
  border: 1px solid rgba(223,230,242,.9);
}
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-lg { max-width: 720px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
.modal-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}
.modal-header h4 { font-size: 18px; flex: 1; }
.modal-close {
  background: none; border: none; cursor: pointer;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); font-size: 20px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }
.modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   AUTH PAGES — animated mesh gradient + floating glass card
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--ice);
}
.auth-left {
  flex: 1;
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 55%, var(--blue-deep) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
/* floating blurred orbs, slow drifting motion */
.auth-left::before,
.auth-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .35;
  animation: orbFloat 14s ease-in-out infinite;
}
.auth-left::before {
  width: 340px; height: 340px;
  background: var(--blue-light);
  top: -80px; left: -60px;
}
.auth-left::after {
  width: 280px; height: 280px;
  background: var(--cyan);
  bottom: -60px; right: -40px;
  animation-delay: -7s;
  animation-direction: reverse;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(30px,-20px) scale(1.08); }
}

.auth-left-content {
  position: relative; z-index: 1; text-align: center; color: #fff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
}
.auth-left-content .big-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--blue-vivid), var(--blue));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 24px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: var(--glow-cyan);
}
.auth-left-content h2 {
  color: #fff; font-size: 28px; margin-bottom: 12px;
}
.auth-left-content p { color: rgba(255,255,255,.65); font-size: 14px; line-height: 1.7; max-width: 340px; margin: 0 auto; }
.auth-features { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.07);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12);
  text-align: left;
}
.auth-feature .feat-icon { font-size: 20px; flex-shrink: 0; color: var(--cyan); }
.auth-feature .feat-text { font-size: 13px; color: rgba(255,255,255,.82); font-weight: 500; }

/* .auth-right {
  width: 480px;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 48px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.55' transform='translate(-1,-1)'%3E%3Cellipse cx='32' cy='17' rx='9' ry='15'/%3E%3Cellipse cx='32' cy='47' rx='9' ry='15'/%3E%3Cellipse cx='47' cy='32' rx='15' ry='9'/%3E%3Cellipse cx='17' cy='32' rx='15' ry='9'/%3E%3Ccircle cx='32' cy='32' r='4'/%3E%3C/g%3E%3Cg fill='%231a3a8f' fill-opacity='0.10' transform='translate(1,1)'%3E%3Cellipse cx='32' cy='17' rx='9' ry='15'/%3E%3Cellipse cx='32' cy='47' rx='9' ry='15'/%3E%3Cellipse cx='47' cy='32' rx='15' ry='9'/%3E%3Cellipse cx='17' cy='32' rx='15' ry='9'/%3E%3Ccircle cx='32' cy='32' r='4'/%3E%3C/g%3E%3Cg fill='%232563eb' fill-opacity='0.07'%3E%3Cellipse cx='32' cy='17' rx='9' ry='15'/%3E%3Cellipse cx='32' cy='47' rx='9' ry='15'/%3E%3Cellipse cx='47' cy='32' rx='15' ry='9'/%3E%3Cellipse cx='17' cy='32' rx='15' ry='9'/%3E%3Ccircle cx='32' cy='32' r='4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px 64px;
  background-repeat: repeat;
} */

.auth-right {
  width: 480px;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 48px;
  position: relative;
  overflow: hidden;
  background-color: #fff;
}

/* gambar batik sebagai elemen <img>, full-cover di belakang konten */
.auth-right-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* card pembungkus form login, biar kontennya nggak nempel langsung ke background batik */
.auth-form-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(10px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  overflow: hidden;
}
.auth-form-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.auth-form-box { width: 100%; }
.auth-form-box .auth-title {
  font-size: 27px;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.auth-form-box .auth-sub {
  font-size: 13.5px; color: var(--gray-400);
  margin-bottom: 28px;
}
.auth-link { color: var(--blue); font-weight: 600; font-size: 13.5px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--gray-400); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--gray-200);
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-muted { color: var(--gray-400); }
.text-gray { color: var(--gray-500); }
.text-navy { color: var(--navy); }
.text-blue { color: var(--blue); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: .5; }
.empty-state h4 { font-size: 16px; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gray-100); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: var(--gray-600); font-weight: 500;
}

.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row {
  display: flex; align-items: flex-start;
  gap: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row .info-label { font-weight: 600; color: var(--gray-500); min-width: 160px; flex-shrink: 0; }
.info-row .info-value { color: var(--gray-800); }

/* Notification dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(var(--topbar-h) - 2px);
  right: 24px;
  width: 340px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(223,230,242,.9);
  z-index: 200;
  display: none;
}
.notif-dropdown.open { display: block; animation: slideDown .2s ease; }
.notif-dropdown-header { padding: 14px 18px; border-bottom: 1px solid var(--gray-100); font-weight: 700; font-size: 14px; }
.notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--blue-pale); }
.notif-item .notif-title { font-weight: 600; font-size: 13px; color: var(--gray-900); margin-bottom: 3px; }
.notif-item .notif-msg { font-size: 12px; color: var(--gray-500); line-height: 1.5; }
.notif-item .notif-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }
.notif-empty { padding: 28px; text-align: center; color: var(--gray-400); font-size: 13px; }

/* Progress steps */
.progress-steps { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step-item {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.step-item.completed:not(:last-child)::after { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  position: relative; z-index: 1;
  transition: all .3s;
}
.step-item.completed .step-circle { background: linear-gradient(135deg, var(--blue-vivid), var(--blue)); color: #fff; }
.step-item.active .step-circle { background: linear-gradient(135deg, var(--blue-vivid), var(--blue)); color: #fff; box-shadow: var(--glow-blue); }
.step-label { font-size: 11px; font-weight: 600; color: var(--gray-400); margin-top: 8px; text-align: center; }
.step-item.completed .step-label, .step-item.active .step-label { color: var(--blue); }

/* Persyaratan list */
.req-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.req-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  font-size: 13px;
}
.req-item::before { content: '✓'; color: var(--success); font-weight: 700; }

/* Jenis surat cards */
.surat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.surat-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.surat-card:hover { border-color: var(--blue); background: var(--blue-pale); transform: translateY(-2px); box-shadow: var(--shadow); }
.surat-card.selected { border-color: var(--blue); background: var(--blue-pale); box-shadow: var(--glow-blue); }
/* signature motif: holographic verification seal, like the foil sticker on real official documents */
.surat-card.selected::after {
  content: '';
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #bfe1ff, #fff, #a5f3fc, #dbeafe, #fff, #bfe1ff);
  box-shadow: 0 0 10px rgba(34,211,238,.5), inset 0 0 4px rgba(255,255,255,.8);
  animation: holoSpin 5s linear infinite;
}
@keyframes holoSpin { to { filter: hue-rotate(20deg); transform: rotate(360deg); } }
.surat-card .surat-icon { font-size: 32px; margin-bottom: 10px; }
.surat-card .surat-name { font-weight: 700; font-size: 13px; color: var(--gray-800); margin-bottom: 4px; }
.surat-card .surat-est { font-size: 11.5px; color: var(--gray-400); }

/* File item */
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  margin-bottom: 8px;
}
.file-item .file-icon { font-size: 20px; flex-shrink: 0; }
.file-item .file-info { flex: 1; min-width: 0; }
.file-item .file-name { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .file-meta { font-size: 11.5px; color: var(--gray-400); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .form-row { grid-template-columns: 1fr; }
  .grid-3, .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-120%);
    margin: 0; height: 100vh; border-radius: 0;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 32px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-3, .form-row-3 { grid-template-columns: 1fr; }
  .surat-grid { grid-template-columns: 1fr 1fr; }
  .topbar-title { font-size: 15px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .surat-grid { grid-template-columns: 1fr; }
  .modal { width: 95%; }
}

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: var(--gray-900); color: #fff;
  font-size: 11.5px; padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Print */
@media print {
  .sidebar, .topbar { display: none; }
  .main-content { margin-left: 0; }
}

/* Brand logo in sidebar */
.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--glow-blue);
}

.brand-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* SIDEBAR COLLAPSE */

:root { --sidebar-collapsed-w: 68px; }

.topbar-toggle { display: flex; }

.sidebar      { transition: width .25s ease, transform .3s ease; }
.main-content { transition: margin-left .25s ease; }

.toggle-icon { display: block; transition: transform .25s ease; }
.app-shell.sidebar-collapsed .toggle-icon { transform: rotate(180deg); }

.app-shell.sidebar-collapsed .sidebar      { width: var(--sidebar-collapsed-w); }
.app-shell.sidebar-collapsed .main-content { margin-left: calc(var(--sidebar-collapsed-w) + 12px); }

.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .user-info,
.app-shell.sidebar-collapsed .nav-section-label,
.app-shell.sidebar-collapsed .nav-badge {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 20px 0;
}
.app-shell.sidebar-collapsed .brand-logo-img {
  width: 36px;
  height: 36px;
}
.app-shell.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 14px 0;
}
.app-shell.sidebar-collapsed .user-avatar { margin: 0; }
.app-shell.sidebar-collapsed .nav-item    { padding: 0 8px; }
.app-shell.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}
.app-shell.sidebar-collapsed .nav-link.active::before { display: none; }
.app-shell.sidebar-collapsed .nav-icon {
  width: 28px;
  height: 28px;
  font-size: 17px;
  margin: 0;
}

.app-shell.sidebar-collapsed .nav-link[data-tooltip]::after {
  content: attr(data-tooltip);
  bottom: auto;
  top: 50%;
  left: calc(100% + 14px);
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-900);
  color: #fff;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 200;
}
.app-shell.sidebar-collapsed .nav-link[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: auto;
  top: 50%;
  left: calc(100% + 7px);
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--gray-900);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 200;
}
.app-shell.sidebar-collapsed .nav-link[data-tooltip]:hover::after,
.app-shell.sidebar-collapsed .nav-link[data-tooltip]:hover::before {
  opacity: 1;
}

@media (max-width: 768px) {
  .app-shell.sidebar-collapsed .sidebar      { width: var(--sidebar-w); }
  .app-shell.sidebar-collapsed .main-content { margin-left: 0; }

  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .brand-text,
  .app-shell.sidebar-collapsed .user-info,
  .app-shell.sidebar-collapsed .nav-section-label,
  .app-shell.sidebar-collapsed .nav-badge { display: revert; }

  .app-shell.sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding: 22px 20px 20px; }
  .app-shell.sidebar-collapsed .brand-logo-img { width: 48px; height: 48px; }
  .app-shell.sidebar-collapsed .sidebar-user  { justify-content: flex-start; padding: 16px 20px; }
  .app-shell.sidebar-collapsed .nav-item      { padding: 0 12px; }
  .app-shell.sidebar-collapsed .nav-link      { justify-content: flex-start; padding: 10px 14px; }
  .app-shell.sidebar-collapsed .nav-icon      { width: 20px; height: 20px; font-size: 16px; }
  .app-shell.sidebar-collapsed .toggle-icon   { transform: none; }

  .app-shell.sidebar-collapsed .nav-link[data-tooltip]::after,
  .app-shell.sidebar-collapsed .nav-link[data-tooltip]::before { display: none; }
}