/* ==========================================================================
   PT TIGA JAYA - Design System v3
   Charcoal + Red | Industrial Enterprise
   ========================================================================== */

/* --- Fonts --- */
/* --- Design Tokens --- */
:root {
  --navy: #111827;
  --navy-50: #F8FAFC;
  --navy-100: #F1F5F9;
  --navy-200: #E2E8F0;
  --navy-300: #CBD5E1;
  --navy-400: #94A3B8;
  --navy-500: #64748B;
  --navy-600: #475569;
  --navy-700: #334155;
  --navy-800: #1E293B;
  --navy-900: #0B1120;
  --red: #C0262D;
  --red-50: #FEF2F2;
  --red-100: #FEE2E2;
  --red-200: #FECACA;
  --red-300: #FCA5A5;
  --red-400: #F87171;
  --red-500: #EF4444;
  --red-600: #DC2626;
  --red-700: #B91C1C;
  --red-800: #991B1B;
  --red-900: #7F1D1D;
  --cyan: #C0262D;
  --cyan-50: #FEF2F2;
  --cyan-100: #FEE2E2;
  --cyan-200: #FECACA;
  --cyan-300: #FCA5A5;
  --cyan-400: #F87171;
  --cyan-500: #EF4444;
  --cyan-600: #DC2626;
  --cyan-700: #B91C1C;
  --cyan-800: #991B1B;
  --cyan-900: #7F1D1D;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --success: #22C55E;
  --success-bg: #F0FDF4;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 56px;
  --bottom-nav-height: 64px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 200ms ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-700); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* --- Typography --- */
h1, .h1 { font-size: 32px; font-weight: 800; line-height: 1.15; font-family: var(--font-heading); }
h2, .h2 { font-size: 24px; font-weight: 700; line-height: 1.25; font-family: var(--font-heading); }
h3, .h3 { font-size: 20px; font-weight: 700; line-height: 1.3; font-family: var(--font-heading); }
h4, .h4 { font-size: 16px; font-weight: 600; line-height: 1.4; font-family: var(--font-heading); }
.body-large { font-size: 16px; }
.body-small { font-size: 12px; color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-cyan { color: var(--red); }
.text-red { color: var(--red); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Layout --- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-body { display: flex; flex: 1; padding-top: var(--topbar-height); }
.main { flex: 1; margin-left: var(--sidebar-width); padding: 24px; max-width: 1440px; transition: margin var(--transition); }
.main.wide { margin-left: var(--sidebar-collapsed); }
.container { max-width: 1200px; }
.container-wide { max-width: 100%; }

/* --- Topbar --- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-height); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; font-family: var(--font-heading); color: var(--navy); }
.topbar-brand svg { color: var(--red); }
.topbar-search {
  display: flex; align-items: center; background: var(--navy-50);
  border-radius: var(--radius-sm); padding: 0 12px; width: 280px; height: 34px; gap: 6px;
}
.topbar-search input {
  flex: 1; border: none; background: transparent; height: 100%;
  font-size: 14px; color: var(--text); outline: none;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search svg { color: var(--text-muted); stroke-width: 1.5; }
.search-hint {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 10px; color: var(--text-muted); background: var(--surface);
}
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto; z-index: 200;
  display: none;
}
.search-dropdown.open { display: block; }
.search-dropdown-group { padding: 6px 0; }
.search-dropdown-group + .search-dropdown-group { border-top: 1px solid var(--border); }
.search-dropdown-label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: 0.5px;
}
.search-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 28px; text-decoration: none; color: var(--text);
  font-size: 13px; transition: background 0.1s;
}
.search-dropdown-item:hover,
.search-dropdown-item.active { background: var(--navy-50); }
.search-dropdown-item-title { font-weight: 500; }
.search-dropdown-item-sub {
  font-size: 11px; color: var(--text-muted); margin-left: auto;
}
.search-dropdown-empty {
  padding: 24px 16px; text-align: center; font-size: 13px; color: var(--text-muted);
}
.search-dropdown-footer {
  padding: 8px 12px; font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--border); text-align: center;
}
.search-dropdown-footer kbd {
  display: inline-block; padding: 1px 5px; font-size: 10px;
  background: var(--navy-50); border: 1px solid var(--border);
  border-radius: 3px; margin: 0 1px;
}
.topbar-search { position: relative; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.topbar-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-secondary); transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--navy-50); color: var(--navy); }
.topbar-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface);
}
.topbar-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--red); color: white; display: flex; align-items: center;
  justify-content: center; font-weight: 600; font-size: 13px; cursor: pointer;
}
.topbar-profile { position: relative; }
.profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 110;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  min-width: 200px; display: none; animation: dropdownIn 150ms ease;
}
.profile-dropdown.open { display: block; }
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.profile-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.profile-name { font-size: 14px; font-weight: 600; color: var(--text); }
.profile-role { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.profile-menu { padding: 8px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  transition: all var(--transition); text-decoration: none;
}
.profile-menu-item:hover { background: var(--navy-50); }
.profile-menu-item svg { width: 16px; height: 16px; color: var(--text-secondary); }

/* --- Sidebar --- */
.sidebar {
  position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width); background: var(--navy-900); z-index: 90;
  display: flex; flex-direction: column; transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 8px; border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 56px;
}
.sidebar-brand img { flex-shrink: 0; }
.sidebar-brand span { font-size: 15px; font-weight: 700; color: white; letter-spacing: 0.3px; }
.sidebar.collapsed .sidebar-brand span { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px 8px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--navy-400); padding: 12px 12px 6px;
}
.sidebar.collapsed .sidebar-label { display: none; }
.sidebar-item { margin-bottom: 1px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--navy-300);
  font-size: 14px; font-weight: 500; transition: all var(--transition);
  text-decoration: none; position: relative; white-space: nowrap;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active {
  background: rgba(192,38,45,0.12); color: var(--red);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.sidebar-link svg { flex-shrink: 0; stroke-width: 1.5; }
.sidebar-link .badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--danger);
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
}
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-link .badge-dot { right: 6px; top: 6px; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.06); padding: 8px 12px; margin-top: auto; }
.sidebar.collapsed .sidebar-footer { padding: 8px; }
.sidebar-footer .sidebar-link { color: var(--navy-400); font-size: 13px; }

/* --- Mobile Bottom Navigation --- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-nav-height); background: var(--surface);
  border-top: 1px solid var(--border);
  justify-content: space-around; align-items: center; padding: 0 4px;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 10px; font-weight: 500; transition: all var(--transition);
  text-decoration: none; min-width: 56px;
}
.bottom-nav-item svg { stroke-width: 1.5; }
.bottom-nav-item.active { color: var(--red); }
.bottom-nav-item.active svg { stroke-width: 2; }
.bottom-nav-item:hover { color: var(--text-secondary); }

/* --- Hero Card --- */
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px;
}
.hero-greeting { font-size: 22px; font-weight: 800; font-family: var(--font-heading); color: var(--navy); margin-bottom: 2px; }
.hero-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; gap: 1px; }
.hero-stat-value { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1; }
.hero-stat-label { font-size: 12px; color: var(--text-secondary); }

/* --- Quick Actions --- */
.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px;
}
.quick-action-btn {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); transition: all var(--transition);
  text-decoration: none; color: var(--text);
}
.quick-action-btn:hover { box-shadow: var(--shadow); border-color: var(--navy-200); }
.quick-action-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quick-action-icon.cyan { background: var(--red-50); color: var(--red); }
.quick-action-icon.red { background: var(--red-50); color: var(--red); }
.quick-action-icon.orange { background: var(--warning-bg); color: var(--warning); }
.quick-action-icon.blue { background: var(--info-bg); color: var(--info); }
.quick-action-icon.purple { background: #F3E8FF; color: #9333EA; }
.quick-action-btn span { font-size: 13px; font-weight: 500; }

/* --- Dashboard Grid --- */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dashboard-col { min-width: 0; }

/* --- Activity Timeline --- */
.activity-timeline { padding: 8px 0; }
.timeline-item {
  display: flex; gap: 12px; padding: 10px 16px; align-items: flex-start;
  border-bottom: 1px solid var(--navy-100); transition: background var(--transition);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item:hover { background: var(--navy-50); }
.timeline-icon {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.timeline-icon.green { background: var(--success-bg); color: var(--success); }
.timeline-icon.orange { background: var(--warning-bg); color: var(--warning); }
.timeline-icon.blue { background: var(--info-bg); color: var(--info); }
.timeline-icon.neutral { background: var(--navy-50); color: var(--text-muted); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 14px; font-weight: 500; color: var(--text); }
.timeline-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--navy-300); display: inline-block; }
.timeline-status { flex-shrink: 0; }

/* --- Page Header --- */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.page-header h1 { font-size: 20px; font-weight: 800; font-family: var(--font-heading); color: var(--navy); }
.page-header p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 1px solid transparent;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
  text-decoration: none; line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: white; border-color: var(--red); }
.btn-primary:hover:not(:disabled) { background: var(--red-600); border-color: var(--red-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--navy-50); border-color: var(--navy-200); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #DC2626; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--navy-50); color: var(--text); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #16A34A; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: #D97706; }
.btn-info { background: var(--info); color: white; }
.btn-info:hover:not(:disabled) { background: #2563EB; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 30px; }
.btn-icon.btn-xs { width: 24px; }
.btn svg { flex-shrink: 0; }
.btn-block { width: 100%; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: all var(--transition); appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,38,45,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input.error, .form-select.error, .form-textarea.error { border-color: var(--danger); }
.form-input.error:focus, .form-select.error:focus, .form-textarea.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled { background: var(--navy-50); cursor: not-allowed; }
.form-textarea { height: auto; padding: 12px 16px; resize: vertical; min-height: 100px; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.has-error .form-input, .has-error .form-select, .has-error .form-textarea { border-color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 24px; }
.form-search {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all var(--transition); min-width: 220px; max-width: 100%;
}
.form-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,38,45,0.1); }
.form-search input {
  flex: 1; border: none; background: transparent; height: 100%; outline: none; font-size: 14px;
}
.form-search input::placeholder { color: var(--text-muted); }
.form-search svg { color: var(--text-muted); flex-shrink: 0; }

/* --- Card --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; transition: all var(--transition);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-header p { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.card-body { padding: 16px 20px; }
.card-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--navy-50); display: flex; justify-content: flex-end; gap: 8px;
}

/* --- KPI Card --- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; transition: all var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.kpi-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon.cyan { background: var(--red-50); color: var(--red); }
.kpi-icon.green { background: var(--success-bg); color: var(--success); }
.kpi-icon.orange { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.red { background: var(--danger-bg); color: var(--danger); }
.kpi-icon.blue { background: var(--info-bg); color: var(--info); }
.kpi-icon.purple { background: #F3E8FF; color: #9333EA; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.kpi-change { font-size: 12px; font-weight: 500; margin-top: 6px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* --- Badge --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: #16A34A; }
.badge-warning { background: var(--warning-bg); color: #D97706; }
.badge-danger { background: var(--danger-bg); color: #DC2626; }
.badge-info { background: var(--info-bg); color: #2563EB; }
.badge-neutral { background: var(--navy-50); color: var(--text-secondary); }
.badge-secondary { background: #E5E7EB; color: #6B7280; }
.badge-cyan { background: var(--red-50); color: var(--red-700); }
.badge-red { background: var(--red-50); color: var(--red-700); }

/* --- Table --- */
.table-container {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; gap: 8px; flex-wrap: wrap;
}
.table-toolbar-left { display: flex; align-items: center; gap: 8px; }
.table-toolbar-right { display: flex; align-items: center; gap: 6px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead { position: sticky; top: 0; z-index: 2; }
.table-container .table-wrap { max-height: 600px; overflow-y: auto; }
.table th {
  padding: 10px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-secondary); background: var(--navy-50);
  text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--navy); }
.table td {
  padding: 10px 12px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--navy-100); vertical-align: middle;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--navy-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.table .actions .btn { height: 28px; padding: 0 8px; font-size: 12px; border-radius: var(--radius-sm); white-space: nowrap; }

/* --- Mobile Card View --- */
.mobile-cards { display: none; gap: 12px; }
.mobile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.mobile-card-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.mobile-card-label { color: var(--text-secondary); font-size: 12px; }
.mobile-card-value { font-weight: 500; text-align: right; word-break: break-word; }
.mobile-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* --- Pagination --- */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; gap: 8px; flex-wrap: wrap;
}
.pagination-info { font-size: 12px; color: var(--text-secondary); }
.pagination-list { display: flex; gap: 4px; }
.page-btn {
  min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; color: var(--text); background: var(--surface);
  transition: all var(--transition); cursor: pointer;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); color: white; border-color: var(--red); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn var(--transition);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--transition); }
.modal-close:hover { background: var(--navy-50); color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }

/* --- Drawer --- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.3);
  display: none;
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: -480px; bottom: 0; z-index: 210;
  width: 480px; max-width: 100vw; background: var(--surface);
  box-shadow: var(--shadow-lg); transition: right 250ms ease; display: flex; flex-direction: column;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.drawer.open { right: 0; }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-header h3 { font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

/* --- Toast --- */
.toast-container {
  position: fixed; top: 72px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  min-width: 300px; max-width: 400px; animation: toastIn 250ms ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }
.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }
.toast-body { flex: 1; }
.toast-title { font-size: 14px; font-weight: 600; }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { flex-shrink: 0; color: var(--text-muted); cursor: pointer; padding: 4px; }

/* --- Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--navy-100) 25%, var(--navy-50) 50%, var(--navy-100) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }
.skeleton-line { height: 48px; margin-bottom: 8px; border-radius: var(--radius-md); }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; color: var(--navy-200); }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-secondary); max-width: 360px; margin: 0 auto 20px; }

/* --- Alert --- */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px;
  font-size: 13px; line-height: 1.4;
}
.alert-success { background: var(--success-bg); color: #15803D; border: 1px solid #BBF7D0; }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.alert-danger { background: var(--danger-bg); color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: var(--info-bg); color: #1E40AF; border: 1px solid #BFDBFE; }
.alert svg { flex-shrink: 0; }
.alert-dismiss { margin-left: auto; cursor: pointer; padding: 4px; color: inherit; opacity: 0.6; }
.alert-dismiss:hover { opacity: 1; }

/* --- Tabs --- */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; gap: 0; }
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  border-bottom: 2px solid transparent; cursor: pointer; transition: all var(--transition);
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--red); border-bottom-color: var(--red); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* --- Detail Grid --- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { }
.detail-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.detail-value { font-size: 14px; font-weight: 500; color: var(--text); }

/* --- Breadcrumb --- */
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 12px; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* --- Auth --- */
.auth-page {
  min-height: 100vh; display: flex; background: var(--bg);
  font-family: var(--font);
}
.auth-wrapper {
  display: flex; width: 100%; min-height: 100vh;
}
.auth-left {
  flex: 1; background: var(--navy-900);
  display: flex; align-items: center; justify-content: center;
  padding: 48px; position: relative; overflow: hidden;
}
.auth-left::before {
  content: ''; position: absolute; top: -50%; right: -50%;
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, rgba(192,38,45,0.12) 0%, transparent 70%);
}
.auth-left-content {
  max-width: 420px; position: relative; z-index: 1;
}
.auth-logo-full { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.auth-logo-full svg { color: var(--red); }
.auth-logo-full h1 { font-size: 32px; font-weight: 800; font-family: var(--font-heading); color: white; }
.auth-logo-full h1 span { color: var(--red); }
.auth-tagline { font-size: 16px; color: var(--navy-300); line-height: 1.6; margin-bottom: 40px; }
.auth-features { display: flex; flex-direction: column; gap: 16px; }
.auth-feature { display: flex; align-items: center; gap: 12px; color: var(--navy-200); font-size: 14px; }
.auth-feature svg { color: var(--red); flex-shrink: 0; }
.auth-right {
  width: 480px; display: flex; align-items: center; justify-content: center;
  padding: 48px; background: var(--surface);
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 400px; overflow: hidden;
}
.auth-header {
  padding: 0 0 24px; text-align: center;
}
.auth-title { font-size: 24px; font-weight: 800; font-family: var(--font-heading); color: var(--navy); margin-bottom: 4px; }
.auth-logo { font-size: 28px; font-weight: 800; font-family: var(--font-heading); color: var(--navy); }
.auth-logo span { color: var(--red); }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
.auth-body { padding: 0; }
.auth-footer { text-align: center; padding: 24px 0 0; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 32px; }
.password-wrapper { position: relative; }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); padding: 4px; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm); transition: all var(--transition);
}
.password-toggle:hover { background: var(--navy-50); color: var(--text); }

/* --- Notification List --- */
.notif-list { }
.notif-item {
  display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--transition); cursor: pointer; position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-body { pointer-events: none; }
.notif-item .notif-icon { pointer-events: none; }
.notif-item:hover { background: var(--navy-50); }
.notif-item.unread { background: var(--red-50); }
.notif-item.unread:hover { background: var(--red-100); }
.notif-icon {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-icon.info { background: var(--info-bg); color: var(--info); }
.notif-icon.success { background: var(--success-bg); color: var(--success); }
.notif-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notif-icon.danger { background: var(--danger-bg); color: var(--danger); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.notif-time::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

/* --- Notification Dropdown --- */
.notif-dropdown {
  position: fixed; top: calc(var(--topbar-height) + 8px); right: 80px; z-index: 120;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  width: 380px; max-height: 480px; overflow-y: auto;
  display: none; animation: dropdownIn 150ms ease;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.notif-dropdown-header h4 { font-size: 14px; font-weight: 600; }
.notif-dropdown-header a { font-size: 12px; cursor: pointer; color: var(--red); }
.notif-dropdown-header a:hover { text-decoration: underline; }
.notif-dropdown-empty {
  padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 13px;
}
.notif-dropdown .notif-item { cursor: pointer; }
.notif-dropdown .notif-item:hover { background: var(--navy-50); }
@media (max-width: 768px) {
  .notif-dropdown { right: 16px; left: 16px; width: auto; max-height: 360px; top: calc(var(--topbar-height) + 8px); }
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.filter-bar .form-input, .filter-bar .form-select { width: auto; min-width: 130px; }
.filter-bar .form-search { min-width: 200px; flex: 1; max-width: 280px; }

/* Active Filter Indicator */
.active-filters {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 4px 0; margin-bottom: 12px; font-size: 12px;
}
.active-filters-label {
  font-weight: 600; color: var(--text-secondary); margin-right: 4px;
}
.active-filter-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: var(--red-50); color: var(--red-700);
  border-radius: var(--radius-full); font-size: 12px; font-weight: 500;
}
.active-filter-badge svg { width: 14px; height: 14px; }
.filter-actions {
  display: flex; gap: 8px; align-items: center;
}
.filter-actions .btn { flex-shrink: 0; }

/* --- Loading Spinner --- */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { border-color: rgba(255,255,255,0.3); border-top-color: white; }

/* --- Backdrop --- */
.backdrop {
  position: fixed; inset: 0; z-index: 89; background: rgba(0,0,0,0.3);
  display: none;
}
.backdrop.open { display: block; }

/* --- Utilities --- */
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .gap-4 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 32px; }
.p-3 { padding: 16px; } .p-4 { padding: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ====== RESPONSIVE ====== */

/* Tablet & below */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .topbar-search { width: 200px; }
  .drawer { width: 400px; }
}

/* --- Permission Checkbox Grid --- */
.perm-groups { display: flex; flex-direction: column; gap: 24px; }

.perm-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.perm-group:hover {
  border-color: var(--navy-200);
  box-shadow: var(--shadow-sm);
}

.perm-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--navy-50), #F1F5F9);
  border-bottom: 1px solid var(--border);
}
.perm-group-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.perm-group-title::before {
  content: '';
  width: 3px; height: 18px;
  background: var(--red);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.perm-select-all {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.3px; user-select: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.perm-select-all:hover {
  background: rgba(192,38,45,0.08);
  color: var(--red);
}
.perm-select-all input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--red);
  cursor: pointer;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 12px;
}

.perm-checkbox {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
  min-height: 48px;
  border: 1.5px solid transparent;
}
.perm-checkbox:hover {
  background: var(--navy-50);
  border-color: var(--navy-100);
}
.perm-checkbox:active { transform: scale(0.98); }

.perm-checkbox input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}

.perm-checkmark {
  width: 22px; height: 22px;
  border: 2px solid var(--navy-300);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface);
  position: relative;
}
.perm-checkbox:hover .perm-checkmark {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,38,45,0.1);
}
.perm-checkbox input:checked ~ .perm-checkmark {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 2px 6px rgba(192,38,45,0.3);
  transform: scale(1.05);
}
.perm-checkbox input:checked ~ .perm-checkmark::after {
  content: '';
  position: absolute;
  width: 6px; height: 10px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px);
  top: 3px;
}

.perm-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  transition: color 150ms ease;
}
.perm-checkbox input:checked ~ .perm-label {
  color: var(--red-800);
  font-weight: 600;
}

.perm-checkbox.checked {
  background: var(--red-50);
  border-color: var(--red-200);
}
.perm-checkbox.checked .perm-checkmark {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 2px 6px rgba(192,38,45,0.3);
}
.perm-checkbox.checked .perm-checkmark::after {
  content: '';
  position: absolute;
  width: 6px; height: 10px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px);
  top: 3px;
}
.perm-checkbox.checked .perm-label {
  color: var(--red-800);
  font-weight: 600;
}

@media (max-width: 1200px) {
  .perm-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px; }
  .perm-group-header { padding: 14px 18px; }
  .perm-checkbox { padding: 10px 12px; min-height: 44px; }
}
@media (max-width: 992px) {
  .perm-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 10px; }
}
@media (max-width: 768px) {
  .perm-grid { grid-template-columns: 1fr; gap: 4px; padding: 8px; }
  .perm-group-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .perm-group-title { font-size: 14px; }
  .perm-checkbox { padding: 10px 12px; min-height: 44px; }
  .perm-checkmark { width: 20px; height: 20px; }
  .perm-label { font-size: 13px; }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 250ms ease; }
  .sidebar.open { transform: translateX(0); width: var(--sidebar-width); }
  .main { margin-left: 0; padding: 16px 12px; }
  .bottom-nav { display: flex; }
  .app-body { padding-bottom: var(--bottom-nav-height); }
  .topbar { padding: 0 12px; }
  .topbar-search { display: none; }
  .topbar-search.mobile-show { display: flex; width: 100%; position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); }
  .topbar-brand span { display: none; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header h1 { font-size: 18px; }
  .page-actions { justify-content: stretch; flex-direction: column; }
  .page-actions > *, .page-actions form { flex: 1; }
  .page-actions form { display: flex !important; }
  .page-actions form .btn { width: 100%; justify-content: center; }
  .page-actions .btn { flex: 1; justify-content: center; width: 100%; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 20px; }
  .kpi-card { padding: 12px; }
  .kpi-icon { width: 32px; height: 32px; }
  .table-wrap { display: none; }
  .mobile-cards { display: grid; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-input, .filter-bar .form-select { width: 100%; min-width: 0 !important; }
  .filter-bar .form-search { max-width: none; width: 100%; min-width: 0; }
  .filter-bar .filter-actions { flex-direction: column; }
  .filter-bar .filter-actions .btn { width: 100%; justify-content: center; }
  .item-row { grid-template-columns: 1fr !important; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-toolbar-left { width: 100%; }
  .table-toolbar-left .form-search { width: 100%; }
  .toast-container { left: 12px; right: 12px; top: auto; bottom: calc(var(--bottom-nav-height) + 12px); }
  .toast { min-width: 0; max-width: 100%; }
  .drawer { width: 100vw; right: -100vw; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  #addItem, button#addItem { width: 100%; justify-content: center; }
  .pagination { flex-direction: column; align-items: center; }
  .active-filters { flex-direction: column; align-items: flex-start; }
  .active-filter-badge { width: 100%; }
  .modal { max-width: 100%; margin: 12px; }
  .auth-wrapper { flex-direction: column; }
  .auth-left { padding: 24px 16px; min-height: 200px; }
  .auth-left-content { text-align: center; }
  .auth-logo-full { justify-content: center; }
  .auth-tagline { margin-bottom: 20px; }
  .auth-features { display: none; }
  .auth-right { width: 100%; padding: 24px 16px; }
  .auth-card { max-width: 100%; }
  .hero-card { padding: 16px; }
  .hero-greeting { font-size: 20px; }
  .hero-stats { gap: 20px; }
  .hero-stat-value { font-size: 20px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .quick-action-btn { padding: 10px 12px; }
  .quick-action-icon { width: 32px; height: 32px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 16px; }
  .timeline-item { padding: 8px 12px; }
  .profile-dropdown { right: -8px; }
  .search-hint { display: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .main { padding: 12px 8px; }
  .card-body { padding: 12px 16px; }
  .card-header { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .quick-action-btn { flex-direction: column; text-align: center; padding: 10px 8px; gap: 6px; }
  .quick-action-btn span { font-size: 12px; }
  .quick-action-icon { width: 28px; height: 28px; }
  .hero-card { padding: 16px; border-radius: var(--radius-lg); }
  .kpi-card { padding: 12px; }
  .kpi-value { font-size: 18px; }
}
