/* =====================================================================
   SIKARTAR — Design System & Application Stylesheet
   Single-file CSS. No frameworks. Vanilla CSS3 with custom properties.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------------------- */
:root {
  /* Brand */
  --color-primary: #2563EB;
  --color-primary-dark: #1D4ED8;
  --color-primary-light: #DBEAFE;
  --color-secondary: #0F172A;
  --color-success: #22C55E;
  --color-success-light: #DCFCE7;
  --color-danger: #EF4444;
  --color-danger-light: #FEE2E2;
  --color-warning: #F59E0B;
  --color-warning-light: #FEF3C7;
  --color-info: #0EA5E9;
  --color-info-light: #E0F2FE;

  /* Surfaces (light mode) */
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F1F5F9;
  --bg-sidebar: #0F172A;
  --bg-sidebar-hover: rgba(255,255,255,0.06);
  --bg-sidebar-active: rgba(37,99,235,0.18);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #F8FAFC;

  --border-color: #E2E8F0;
  --border-color-strong: #CBD5E1;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-glow: 0 0 0 4px rgba(37,99,235,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --sidebar-width: 264px;
  --sidebar-collapsed-width: 84px;
  --navbar-height: 68px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-body: #0B1120;
  --bg-surface: #131B2E;
  --bg-surface-alt: #1B2338;
  --bg-sidebar: #090E1A;
  --bg-sidebar-hover: rgba(255,255,255,0.06);
  --bg-sidebar-active: rgba(37,99,235,0.25);

  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0F172A;

  --border-color: #232D45;
  --border-color-strong: #2E3A57;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.45);
}

/* ---------------------------------------------------------------------
   2. RESET
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-base), color var(--transition-base);
  font-size: 14.5px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
::selection { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------------
   3. LAYOUT SHELL
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base), transform var(--transition-base);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap; overflow: hidden;
}
.sidebar-brand .brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #60A5FA);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37,99,235,0.4);
}
.sidebar-brand .brand-text { overflow: hidden; }
.sidebar-brand .brand-title { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-brand .brand-sub { font-size: 11px; color: #64748B; }
.sidebar.collapsed .brand-text { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #4B5A7A; padding: 16px 12px 6px; font-weight: 700;
}
.sidebar.collapsed .nav-section-label { display: none; }
.nav-item { margin-bottom: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #B8C2D9; font-size: 13.7px; font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative; white-space: nowrap; overflow: hidden;
}
.nav-link .nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-link:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-link.active { background: var(--bg-sidebar-active); color: #93C5FD; font-weight: 600; }
.nav-link.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; background: var(--color-primary); border-radius: 0 4px 4px 0;
}
.nav-link .badge-count {
  margin-left: auto; background: var(--color-danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-full);
}
.sidebar.collapsed .nav-link span:not(.nav-icon) { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; }

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-toggle-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.04); border: none; color: #94A3B8;
  padding: 9px; border-radius: var(--radius-sm); transition: background var(--transition-fast);
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.09); color: #fff; }

/* Main content area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition-base);
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed-width); }

/* Navbar */
.navbar {
  height: var(--navbar-height);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.navbar-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.navbar-menu-btn {
  display: none; background: none; border: none; color: var(--text-primary);
  width: 38px; height: 38px; border-radius: var(--radius-sm); align-items: center; justify-content: center;
}
.navbar-menu-btn:hover { background: var(--bg-surface-alt); }

.navbar-search {
  position: relative; max-width: 380px; width: 100%;
}
.navbar-search input {
  width: 100%; border: 1px solid var(--border-color); background: var(--bg-surface-alt);
  border-radius: var(--radius-md); padding: 9px 14px 9px 38px; font-size: 13.5px;
  color: var(--text-primary); transition: all var(--transition-fast);
}
.navbar-search input:focus { border-color: var(--color-primary); background: var(--bg-surface); box-shadow: var(--shadow-glow); outline: none; }
.navbar-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
.navbar-search .search-shortcut {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border-color);
  padding: 1px 6px; border-radius: 5px;
}

.navbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover { background: var(--bg-surface-alt); color: var(--text-primary); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-danger); border: 2px solid var(--bg-surface);
}
.theme-toggle .icon-sun, .theme-toggle .icon-moon { transition: opacity var(--transition-fast), transform var(--transition-base); }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon, :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }

.navbar-user { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: var(--radius-md); transition: background var(--transition-fast); }
.navbar-user:hover { background: var(--bg-surface-alt); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--color-primary), #818CF8);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.navbar-user-info { display: flex; flex-direction: column; line-height: 1.25; }
.navbar-user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.navbar-user-info .user-role { font-size: 11px; color: var(--text-muted); }

/* Page container */
.page-content { padding: 26px; flex: 1; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a:hover { color: var(--color-primary); }

/* ---------------------------------------------------------------------
   4. GRID / STAT CARDS
   --------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 20px; }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-header .card-header-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }

.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--stat-color, var(--color-primary)) 0%, transparent 70%); opacity: 0.10;
}
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--stat-bg, var(--color-primary-light)); color: var(--stat-color, var(--color-primary));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-trend { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: var(--radius-full); }
.stat-trend.up { color: var(--color-success); background: var(--color-success-light); }
.stat-trend.down { color: var(--color-danger); background: var(--color-danger-light); }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 14px; letter-spacing: -0.02em; }
.stat-label { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }

/* ---------------------------------------------------------------------
   5. BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; transition: all var(--transition-fast); position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.28); }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: 0 4px 14px rgba(37,99,235,0.38); }
.btn-secondary { background: var(--bg-surface-alt); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { filter: brightness(0.93); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }
.btn-warning { background: var(--color-warning); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border-color-strong); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-surface-alt); border-color: var(--color-primary); color: var(--color-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-surface-alt); color: var(--text-primary); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Ripple */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.5); transform: scale(0); animation: ripple-anim 550ms ease-out; pointer-events: none; }
[class*="btn-outline"] .ripple, .btn-secondary .ripple, .btn-ghost .ripple { background: rgba(37,99,235,0.18); }
@keyframes ripple-anim { to { transform: scale(3); opacity: 0; } }

/* ---------------------------------------------------------------------
   6. FORMS
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px; }
.form-label .required { color: var(--color-danger); }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary); font-size: 13.7px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.form-control.error { border-color: var(--color-danger); }
textarea.form-control { resize: vertical; min-height: 96px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--color-danger); margin-top: 5px; display: none; }
.form-error.show { display: block; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.input-group { position: relative; }
.input-group .form-control { padding-left: 38px; }
.input-group .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }

.select-wrap { position: relative; }
.select-wrap select.form-control { appearance: none; padding-right: 34px; cursor: pointer; }
.select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

.checkbox-wrap, .radio-wrap { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.checkbox-wrap input, .radio-wrap input { width: 17px; height: 17px; accent-color: var(--color-primary); cursor: pointer; }

.file-drop {
  border: 2px dashed var(--border-color-strong); border-radius: var(--radius-md); padding: 26px;
  text-align: center; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast);
  background: var(--bg-surface-alt);
}
.file-drop:hover, .file-drop.dragover { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); }

.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: var(--border-color-strong); border-radius: var(--radius-full); transition: background var(--transition-fast); cursor: pointer; }
.switch-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform var(--transition-fast); box-shadow: var(--shadow-sm); }
.switch input:checked + .switch-slider { background: var(--color-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ---------------------------------------------------------------------
   7. TABLES
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-color); background: var(--bg-surface); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.3px; }
.data-table thead th {
  text-align: left; padding: 13px 16px; background: var(--bg-surface-alt); color: var(--text-secondary);
  font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color); white-space: nowrap; position: sticky; top: 0;
}
.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-surface-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border-color); }
.table-actions { display: flex; align-items: center; gap: 6px; }
.table-cell-user { display: flex; align-items: center; gap: 10px; }
.table-cell-user .avatar { width: 32px; height: 32px; font-size: 11px; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
.pagination-info { font-size: 12.5px; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 5px; }
.page-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
}
.page-btn:hover { background: var(--bg-surface-alt); }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   8. BADGES / TAGS
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--color-success-light); color: #16A34A; }
.badge-danger { background: var(--color-danger-light); color: #DC2626; }
.badge-warning { background: var(--color-warning-light); color: #D97706; }
.badge-info { background: var(--color-info-light); color: #0284C7; }
.badge-neutral { background: var(--bg-surface-alt); color: var(--text-secondary); }
.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* ---------------------------------------------------------------------
   9. MODAL
   --------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity var(--transition-base); padding: 20px;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  transform: translateY(16px) scale(0.98); opacity: 0; transition: all var(--transition-base);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal.modal-lg { max-width: 780px; }
.modal.modal-sm { max-width: 400px; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-surface-alt); border: none; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--border-color); color: var(--text-primary); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border-color); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------------
   10. TOAST
   --------------------------------------------------------------------- */
.toast-container { position: fixed; top: 22px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
  background: var(--bg-surface); border: 1px solid var(--border-color); border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 11px; animation: toast-in 320ms cubic-bezier(0.34,1.56,0.64,1);
}
.toast.hide { animation: toast-out 260ms ease forwards; }
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.info .toast-icon { color: var(--color-info); }
.toast-content { flex: 1; }
.toast-title { font-size: 13.3px; font-weight: 700; }
.toast-msg { font-size: 12.3px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-muted); flex-shrink: 0; }
@keyframes toast-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(110%); opacity: 0; } }

/* ---------------------------------------------------------------------
   11. DROPDOWN
   --------------------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.97);
  transition: all var(--transition-fast); z-index: 200;
}
.dropdown-menu.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-primary); width: 100%; text-align: left; background: none; border: none;
}
.dropdown-item:hover { background: var(--bg-surface-alt); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 6px 4px; }
.dropdown-header { padding: 10px 12px 4px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }

/* Notification panel specific */
.notif-panel { width: 340px; max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 12px; border-radius: var(--radius-sm); }
.notif-item:hover { background: var(--bg-surface-alt); }
.notif-item .notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); margin-top: 6px; flex-shrink: 0; }
.notif-item.read .notif-dot { background: transparent; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ---------------------------------------------------------------------
   12. SKELETON LOADING
   --------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-alt) 25%, var(--border-color) 37%, var(--bg-surface-alt) 63%);
  background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-title { height: 18px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 110px; border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------------
   13. SPINNER / LOADER
   --------------------------------------------------------------------- */
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.dark { border: 2.5px solid var(--border-color); border-top-color: var(--color-primary); }
.spinner.lg { width: 34px; height: 34px; border-width: 3.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader { position: fixed; inset: 0; background: var(--bg-body); display: flex; align-items: center; justify-content: center; z-index: 3000; }

/* ---------------------------------------------------------------------
   14. EMPTY STATE
   --------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-secondary); }
.empty-state .empty-icon {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%; background: var(--bg-surface-alt);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.empty-state h4 { font-size: 15px; margin-bottom: 6px; color: var(--text-primary); }
.empty-state p { font-size: 13px; max-width: 320px; margin: 0 auto 18px; }

/* ---------------------------------------------------------------------
   15. TIMELINE / ACTIVITY FEED
   --------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -28px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-surface); border: 3px solid var(--color-primary); z-index: 1;
}
.timeline-item.success .timeline-dot { border-color: var(--color-success); }
.timeline-item.danger .timeline-dot { border-color: var(--color-danger); }
.timeline-item.warning .timeline-dot { border-color: var(--color-warning); }
.timeline-title { font-size: 13.3px; font-weight: 600; color: var(--text-primary); }
.timeline-desc { font-size: 12.3px; color: var(--text-secondary); margin-top: 2px; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.activity-feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.activity-feed-item:last-child { border-bottom: none; }
.activity-feed-icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------------------------------------------------------------------
   16. PROGRESS BAR
   --------------------------------------------------------------------- */
.progress { width: 100%; height: 8px; background: var(--bg-surface-alt); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width 600ms cubic-bezier(0.4,0,0.2,1); }
.progress-bar.success { background: var(--color-success); }
.progress-bar.warning { background: var(--color-warning); }
.progress-bar.danger { background: var(--color-danger); }
.progress-labeled { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 6px; color: var(--text-secondary); }

/* ---------------------------------------------------------------------
   17. TABS
   --------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 11px 16px; font-size: 13.3px; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-panel { display: none; animation: fade-in 240ms ease; }
.tab-panel.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------
   18. LOGIN / AUTH PAGE
   --------------------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: flex; }
.auth-visual {
  flex: 1.1; background: linear-gradient(155deg, var(--color-secondary) 0%, #1E3A8A 55%, var(--color-primary) 100%);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 60px;
}
.auth-visual::before, .auth-visual::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.06);
}
.auth-visual::before { width: 420px; height: 420px; top: -140px; right: -140px; }
.auth-visual::after { width: 300px; height: 300px; bottom: -100px; left: -80px; background: rgba(37,99,235,0.25); }
.auth-visual-content { position: relative; z-index: 1; color: #fff; max-width: 440px; }
.auth-visual-content h2 { font-size: 30px; line-height: 1.3; margin-bottom: 14px; }
.auth-visual-content p { color: #C7D2FE; font-size: 14.5px; line-height: 1.7; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg-body); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .auth-sub { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 30px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.auth-footer-link { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-secondary); }
.auth-footer-link a { color: var(--color-primary); font-weight: 600; }

/* ---------------------------------------------------------------------
   19. PUBLIC SITE (Lomba, Berita publik dsb)
   --------------------------------------------------------------------- */
.public-navbar {
  position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg-surface) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between; padding: 14px 32px;
}
.public-nav-links { display: flex; gap: 28px; align-items: center; }
.public-nav-links a { font-size: 13.7px; font-weight: 600; color: var(--text-secondary); }
.public-nav-links a:hover, .public-nav-links a.active { color: var(--color-primary); }
.public-hero { padding: 64px 32px; text-align: center; background: var(--bg-surface-alt); }
.public-hero h1 { font-size: 34px; margin-bottom: 12px; }
.public-hero p { color: var(--text-secondary); max-width: 560px; margin: 0 auto; font-size: 15px; }
.public-container { max-width: 1180px; margin: 0 auto; padding: 40px 32px; }

.lomba-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.lomba-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: all var(--transition-base); display: flex; flex-direction: column; }
.lomba-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.lomba-card-poster { aspect-ratio: 16/10; background: var(--bg-surface-alt); overflow: hidden; position: relative; }
.lomba-card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.lomba-card:hover .lomba-card-poster img { transform: scale(1.06); }
.lomba-card-status { position: absolute; top: 12px; right: 12px; }
.lomba-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lomba-card-title { font-size: 16px; font-weight: 700; line-height: 1.35; }
.lomba-card-desc { font-size: 12.8px; color: var(--text-secondary); line-height: 1.55; flex: 1; }
.lomba-meta-row { display: flex; align-items: center; gap: 7px; font-size: 12.3px; color: var(--text-secondary); }
.lomba-meta-row svg { flex-shrink: 0; color: var(--text-muted); }
.lomba-card-actions { display: flex; gap: 8px; margin-top: 6px; }

.lomba-detail-hero { display: grid; grid-template-columns: 380px 1fr; gap: 34px; margin-bottom: 34px; }
.lomba-detail-poster { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.lomba-info-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.lomba-info-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.lomba-info-row .info-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--color-primary-light); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.dyn-form-field { margin-bottom: 18px; }

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

/* ---------------------------------------------------------------------
   20. CALENDAR (mini)
   --------------------------------------------------------------------- */
.mini-calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mini-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.mini-calendar-grid .cal-dow { color: var(--text-muted); font-weight: 700; padding-bottom: 6px; font-size: 10.5px; }
.mini-calendar-grid .cal-day { padding: 7px 0; border-radius: var(--radius-sm); color: var(--text-primary); position: relative; cursor: pointer; }
.mini-calendar-grid .cal-day:hover { background: var(--bg-surface-alt); }
.mini-calendar-grid .cal-day.muted { color: var(--text-muted); opacity: 0.4; }
.mini-calendar-grid .cal-day.today { background: var(--color-primary); color: #fff; font-weight: 700; }
.mini-calendar-grid .cal-day.has-event::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--color-warning); }
.mini-calendar-grid .cal-day.today.has-event::after { background: #fff; }

/* ---------------------------------------------------------------------
   21. UTILITIES
   --------------------------------------------------------------------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 10px; } .mb-2 { margin-bottom: 10px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.rounded-full { border-radius: var(--radius-full); }

/* ---------------------------------------------------------------------
   22. RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content, .sidebar.collapsed ~ .main-content { margin-left: 0; }
  .navbar-menu-btn { display: flex; }
  .navbar-search { display: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 99; opacity: 0; pointer-events: none; transition: opacity var(--transition-base); }
  .sidebar-backdrop.active { opacity: 1; pointer-events: auto; }
}

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .auth-visual { display: none; }
  .lomba-detail-hero { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
  .modal { max-width: 100%; margin: 0 8px; }
  .public-navbar { padding: 12px 16px; }
  .public-nav-links { display: none; }
}

@media (max-width: 480px) {
  .navbar { padding: 0 14px; }
  .navbar-user-info { display: none; }
  .page-title { font-size: 19px; }
}
