/* ============================================================
   KopdesOS (KOS) — Web Design System
   Platform Operasional Koperasi Desa Merah Putih
   Primary: #CC0000 | Theme: Merah Putih Nasional | Font: Poppins
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* ============================================================
   Section 1 — CSS Custom Properties
   ============================================================ */
:root {
  /* Brand — Merah Putih Nasional */
  --color-primary:        #CC0000;
  --color-primary-hover:  #A80000;
  --color-primary-light:  color-mix(in srgb, #CC0000 15%, transparent);

  /* Semantic */
  --color-success:        #16A34A;
  --color-success-light:  #DCFCE7;
  --color-warning:        #D97706;
  --color-warning-light:  #FEF3C7;
  --color-danger:         #DC2626;
  --color-danger-light:   #FEE2E2;
  --color-info:           #2563EB;
  --color-info-light:     #DBEAFE;
  --color-purple:         #8B5CF6;
  --color-purple-light:   #EDE9FE;

  /* Surface */
  --bg-page:     #F8FAFC;
  --bg-surface:  #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-sidebar:  #1A0000;
  --bg-hover:    #F1F5F9;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  /* Border */
  --border-default: #E2E8F0;
  --border-strong:  #CBD5E1;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

  /* Layout */
  --header-height: 60px;
  --sidebar-width: 240px;

  /* Z-index */
  --z-sidebar:       100;
  --z-dropdown:      150;
  --z-modal:         200;
  --z-modal-content: 201;
  --z-toast:         500;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-full: 9999px;

  /* Transition */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

[data-theme="dark"] {
  --bg-page:        #0F172A;
  --bg-surface:     #1E293B;
  --bg-elevated:    #293548;
  --bg-sidebar:     #0B0000;
  --bg-hover:       #1E293B;
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --border-default: rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.16);
  --color-success-light: #14532D;
  --color-danger-light:  #450A0A;
  --color-warning-light: #451A03;
  --color-info-light:    #1E3A5F;
}

/* ============================================================
   Section 2 — CSS Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: inherit; }

html {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ============================================================
   Section 3 — Layout & App Shell
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition-base);
  border-right: 1px solid var(--border-default);
  position: relative;
  z-index: var(--z-sidebar);
}
.app-sidebar.collapsed {
  width: 60px;
  overflow: visible;
  z-index: 1000;
}

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

.app-header {
  height: var(--header-height);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 10;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-page);
}

@media (max-width: 640px) {
  .app-content { padding: 16px; }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  display: none;
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   Section 4 — Sidebar Components
   ============================================================ */
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  /* TANPA border-bottom */
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-info { flex: 1; min-width: 0; }
.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section { margin-bottom: 4px; }

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 8px 16px 4px;
  display: block;
}

.nav-section-divider {
  display: none;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}
.nav-item.active {
  color: var(--color-primary);
  background: color-mix(in srgb, #CC0000 20%, transparent);
  border-left: 3px solid var(--color-primary);
}
.nav-item.active .nav-icon { color: var(--color-primary); }

.nav-icon  { width: 18px; flex-shrink: 0; text-align: center; }
.nav-label { flex: 1; }
.nav-arrow { font-size: 11px; transition: transform var(--transition-fast); }
.nav-item.open > .nav-arrow { transform: rotate(90deg); }

.nav-badge {
  font-size: 11px;
  background: var(--color-danger);
  color: white;
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 6px 16px 6px 44px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}
.nav-sub-item:hover { color: white; }
.nav-sub-item.active { color: var(--color-primary); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}
.btn-logout:hover {
  color: var(--color-danger);
  background: rgba(220,38,38,0.1);
}

/* === Collapsed State === */
.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-arrow,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .nav-section-label,
.app-sidebar.collapsed .user-info,
.app-sidebar.collapsed .btn-logout { display: none !important; }

.app-sidebar.collapsed .nav-section-divider { display: block; }
.app-sidebar.collapsed .nav-sub-item { display: none; }
.app-sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
  gap: 0;
}
.app-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
  position: relative;
}
.app-sidebar.collapsed .nav-item.active {
  border-left: 3px solid var(--color-primary);
  background: color-mix(in srgb, #CC0000 20%, transparent);
}
.app-sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}

/* Overflow visible di sidebar-nav agar tooltip tidak terpotong */
.app-sidebar.collapsed .sidebar-nav { overflow: visible; }

/* Tooltip via CSS — tanpa JS */
.app-sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
}
.app-sidebar.collapsed .nav-item:hover::after { opacity: 1; }

@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    left: -240px;
    z-index: var(--z-sidebar);
    transition: left var(--transition-base);
  }
  .app-sidebar.open { left: 0; }
}

/* ============================================================
   Section 5 — Header Bar
   ============================================================ */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.breadcrumb-sep     { color: var(--text-muted); }
.breadcrumb-current { font-weight: 600; color: var(--text-primary); }

.header-sync { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.bell-wrapper { position: relative; }
.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-surface);
}

/* ============================================================
   Section 6 — Buttons (explicit height)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}
.btn:hover   { filter: brightness(0.92); }
.btn:active  { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-xs { height: 24px; padding: 0 8px;  font-size: 11px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 16px; }
.btn-xl { height: 52px; padding: 0 24px; font-size: 16px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.btn-xs { width: 24px; height: 24px; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-icon.btn-lg { width: 44px; height: 44px; }

.btn-primary   { background: var(--color-primary); color: white; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}
.btn-outline   {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}
.btn-ghost     { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger    { background: var(--color-danger); color: white; }
.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}
.btn-success   { background: var(--color-success); color: white; }
.btn-link      {
  background: transparent;
  color: var(--color-primary);
  padding: 0;
  height: auto;
  text-decoration: underline;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-back:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Loading state */
.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-secondary.loading::after,
.btn-ghost.loading::after,
.btn-outline.loading::after {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--text-primary);
}

/* ============================================================
   Section 7 — Cards
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}
.card-header-actions { display: flex; gap: 8px; align-items: center; }

.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.card-body   { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* === Stat Card === */
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  border-top: 3px solid transparent;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-primary { border-top-color: var(--color-primary); }
.stat-success { border-top-color: var(--color-success); }
.stat-warning { border-top-color: var(--color-warning); }
.stat-danger  { border-top-color: var(--color-danger);  }
.stat-info    { border-top-color: var(--color-info);    }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-body  { flex: 1; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-trend {
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.trend-up   { color: var(--color-success); }
.trend-down { color: var(--color-danger);  }
.trend-flat { color: var(--text-muted);    }

/* ============================================================
   Section 8 — Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: #92400E; }
.badge-danger  { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-info    { background: var(--color-info-light);    color: var(--color-info);    }
.badge-purple  { background: var(--color-purple-light);  color: var(--color-purple);  }
.badge-gray    { background: var(--bg-elevated);         color: var(--text-muted);    }

.badge-outline { background: transparent; border: 1px solid currentColor; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Role badges */
.badge-role-admin   { background: #FEE2E2; color: #991B1B; }
.badge-role-manager { background: #DBEAFE; color: #1E40AF; }
.badge-role-user    { background: #D1FAE5; color: #065F46; }

/* KOS-specific status badges */
.badge-sync    { background: var(--color-success-light); color: var(--color-success); }
.badge-offline { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-diajukan  { background: var(--color-warning-light); color: #92400E; }
.badge-disetujui { background: var(--color-success-light); color: var(--color-success); }
.badge-ditolak   { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-lunas     { background: var(--color-info-light);    color: var(--color-info);    }

/* ============================================================
   Section 9 — Icon Color Helpers
   ============================================================ */
.icon-primary { background: var(--color-primary-light); color: var(--color-primary); }
.icon-success { background: var(--color-success-light); color: var(--color-success); }
.icon-warning { background: var(--color-warning-light); color: var(--color-warning); }
.icon-danger  { background: var(--color-danger-light);  color: var(--color-danger);  }
.icon-info    { background: var(--color-info-light);    color: var(--color-info);    }
.icon-muted   { background: var(--bg-elevated);         color: var(--text-muted);    }

[data-theme="dark"] .icon-success { background: rgba(22,163,74,0.15);  color: #4ADE80; }
[data-theme="dark"] .icon-warning { background: rgba(217,119,6,0.15);  color: #FCD34D; }
[data-theme="dark"] .icon-danger  { background: rgba(220,38,38,0.15);  color: #FCA5A5; }
[data-theme="dark"] .icon-info    { background: rgba(37,99,235,0.15);  color: #93C5FD; }
[data-theme="dark"] .icon-primary { background: rgba(204,0,0,0.2);     color: #FF6666; }
[data-theme="dark"] .icon-muted   { background: rgba(255,255,255,0.05); }

/* ============================================================
   Section 10 — Avatar
   ============================================================ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ============================================================
   Section 11 — Page Header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-sub   { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   Section 12 — Tables
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-surface);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr.selected { background: var(--color-primary-light); }

.col-no     { width: 48px; text-align: center; }
.col-action { width: 80px; }
.sortable   { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text-primary); }
.sort-icon  { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.table-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.empty-row td { padding: 0; border: none; }
.table-empty  { text-align: center; padding: 48px 24px; }
.table-empty-icon  { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; }
.table-empty-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.table-empty-sub   { font-size: 13px; color: var(--text-muted); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.pagination-btn:hover   { background: var(--bg-elevated); }
.pagination-btn.active  {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.pagination-ellipsis    { padding: 0 6px; color: var(--text-muted); }
.pagination-info        { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   Section 13 — Forms
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-control.error { border-color: var(--color-danger); }
.form-control:disabled {
  opacity: 0.5;
  background: var(--bg-surface);
  cursor: not-allowed;
}
.form-control-lg { height: 44px; font-size: 15px; }

textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; }

.form-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 36px 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
  outline: none;
}
.form-select-sm { height: 30px; font-size: 13px; }

.form-error { font-size: 12px; color: var(--color-danger); }
.form-hint  { font-size: 12px; color: var(--text-muted); }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-label { font-size: 14px; cursor: pointer; }

.form-row   { display: flex; gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 640px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.input-group { display: flex; position: relative; align-items: center; }
.input-prefix {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.input-suffix {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 14px;
}
.input-group .form-control { padding-left: 36px; }
.input-group .form-control.has-suffix { padding-right: 36px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}
.search-box .form-control { padding-left: 32px; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 12px;
  transition: background var(--transition-base);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   Section 14 — Modal
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  position: relative;
  z-index: var(--z-modal-content);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  max-width: 560px;
  animation: modal-in 0.2s ease;
}
.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.modal-close { color: var(--text-muted); }
.modal-close:hover { color: var(--text-primary); }

.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 95vh; }
}

/* ============================================================
   Section 15 — Dropdown
   ============================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
}
.dropdown-menu.open { display: block; }

[data-theme="dark"] .dropdown-menu { background: var(--bg-elevated); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger,
.dropdown-item.text-danger { color: var(--color-danger); }

.dropdown-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border-default);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: 4px 0;
}

/* ============================================================
   Section 16 — Toast
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.25s ease;
}
.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-info    { border-left-color: var(--color-info);    }

.toast-icon    { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.toast-body    { flex: 1; min-width: 0; }
.toast-title   { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.toast-close   { color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }

/* ============================================================
   Section 17 — Tabs
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tab-item:hover  { color: var(--text-primary); }
.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 500;
}

.tab-count {
  font-size: 11px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  margin-left: 4px;
  color: var(--text-muted);
}
.tab-item.active .tab-count {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tab-content { }
.tab-pane         { display: none; }
.tab-pane.active  { display: block; }

/* ============================================================
   Section 18 — Alerts
   ============================================================ */
.alert {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border-left: 4px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-icon  { flex-shrink: 0; margin-top: 1px; }
.alert-body  { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }

.alert-info    { background: var(--color-info-light);    border-left-color: var(--color-info);    color: #1E40AF; }
.alert-success { background: var(--color-success-light); border-left-color: var(--color-success); color: #065F46; }
.alert-warning { background: var(--color-warning-light); border-left-color: var(--color-warning); color: #92400E; }
.alert-danger  { background: var(--color-danger-light);  border-left-color: var(--color-danger);  color: #991B1B; }

/* ============================================================
   Section 19 — Progress Bar
   ============================================================ */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.progress-fill.success { background: var(--color-success); }
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger  { background: var(--color-danger);  }

/* ============================================================
   Section 20 — Empty State, Skeleton, Timeline, Filter Bar
   ============================================================ */

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-icon  { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; color: var(--text-muted); }

/* Skeleton */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text   { height: 14px; border-radius: var(--radius-sm); }
.skeleton-title  { height: 20px; width: 60%; border-radius: var(--radius-sm); }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; }

/* Skeleton line sizes */
.skeleton-line    { height: 14px; border-radius: var(--radius-sm); }
.skeleton-line-sm { width: 40%; }
.skeleton-line-md { width: 65%; }
.skeleton-line-lg { width: 85%; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-default);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-dot {
  position: absolute;
  left: -21px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  top: 2px;
}
.timeline-dot.active { background: var(--color-primary); border-color: var(--color-primary); }
.timeline-title   { font-weight: 600; font-size: 14px; }
.timeline-time    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--bg-surface);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.filter-chip:hover  { background: var(--bg-elevated); }
.filter-chip.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* Chart container */
.chart-container { position: relative; width: 100%; }

/* ============================================================
   Section 21 — Interactive States
   ============================================================ */
.nav-item:hover       { background: rgba(255,255,255,0.06); }
table tbody tr:hover  { background: var(--bg-hover); }
.dropdown-item:hover  { background: var(--bg-hover); }
.btn:active { transform: scale(0.98); }

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.nav-item:focus-visible,
.tab-item:focus-visible,
.pagination-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

table tbody tr.selected { background: var(--color-primary-light); }

.btn:disabled,
.form-control:disabled,
.form-select:disabled,
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   Section 22 — Animations & Keyframes
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade   { animation: fade-in 0.2s ease; }
.animate-spin   { animation: spin 1s linear infinite; }
.animate-pulse  { animation: pulse 2s ease-in-out infinite; }

/* ============================================================
   Section 23 — Scrollbar
   ============================================================ */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ============================================================
   Section 24 — Utility Classes
   ============================================================ */

/* Flex */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }

/* Grid */
.grid         { display: grid; gap: 20px; }
.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); }

/* Stat-grid: default 3 kolom (3x2 untuk 6 cards). Wide screen (≥1600px) auto fit 1 row. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 1600px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .stat-grid { grid-template-columns: 1fr; }
}

/* Gap */
.gap-1 { gap: 4px;  }
.gap-2 { gap: 8px;  }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* Margin */
.mt-1 { margin-top: 4px;  } .mt-2 { margin-top: 8px;  } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px;  } .mb-2 { margin-bottom: 8px;  } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }

/* Padding */
.p-2 { padding: 8px;  } .p-3 { padding: 12px; }
.p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

/* Typography */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; }
.text-2xl  { font-size: 20px; }
.text-3xl  { font-size: 24px; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-primary   { color: var(--text-primary);   }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted);     }
.text-success   { color: var(--color-success);  }
.text-warning   { color: var(--color-warning);  }
.text-danger    { color: var(--color-danger);   }
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase   { text-transform: uppercase; }
.capitalize  { text-transform: capitalize; }
.link        { color: var(--color-primary); cursor: pointer; }
.link:hover  { text-decoration: underline; }

/* Visual */
.w-full  { width: 100%;  }
.h-full  { height: 100%; }
.min-w-0 { min-width: 0; }

.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border        { border: 1px solid var(--border-default); }
.border-top    { border-top: 1px solid var(--border-default); }
.border-bottom { border-bottom: 1px solid var(--border-default); }

.bg-surface { background: var(--bg-surface); }
.bg-page    { background: var(--bg-page);    }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.overflow-hidden { overflow: hidden; }
.hidden  { display: none !important; }
.block   { display: block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Section 25 — KOS-Specific Components
   ============================================================ */

/* === Sensor Card (Cold Storage) === */
.sensor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: box-shadow var(--transition-fast);
}
.sensor-card:hover { box-shadow: var(--shadow-md); }

.sensor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sensor-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.sensor-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.sensor-humidity {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sensor-gauge { margin-bottom: 8px; }

.gauge-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-info);
  transition: width 0.5s ease;
}

.sensor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.sensor-time { font-size: 11px; color: var(--text-muted); }

.sensor-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.sensor-status.online  { background: var(--color-success-light); color: var(--color-success); }
.sensor-status.offline { background: var(--color-danger-light);  color: var(--color-danger);  }
.sensor-status.warning { background: var(--color-warning-light); color: var(--color-warning); }

/* === QRIS Preview === */
.qris-preview {
  background: var(--bg-surface);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
}

.qris-code {
  width: 120px;
  height: 120px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--text-muted);
  margin: 0 auto 16px;
}

.qris-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.qris-note {
  font-size: 13px;
  color: var(--text-muted);
}

/* === BEP Gauge === */
.bep-gauge {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.bep-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.bep-bar {
  position: relative;
  height: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.bep-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-warning));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.bep-target {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-success);
}

.bep-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.bep-current { font-weight: 700; color: var(--text-primary); }
.bep-target-val { color: var(--color-success); }

/* === NPL Badge === */
.npl-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.npl-high   { background: var(--color-danger-light);  color: var(--color-danger);  }
.npl-medium { background: var(--color-warning-light); color: var(--color-warning); }
.npl-low    { background: var(--color-success-light); color: var(--color-success); }

/* === Installment Row === */
.installment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-default);
}
.installment-row:last-child { border-bottom: none; }

.installment-info { flex: 1; }
.installment-no   { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.installment-date { font-size: 12px; color: var(--text-muted); }
.installment-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* === POS Kasir Layout === */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  height: calc(100vh - var(--header-height) - 48px);
}

.pos-products {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-products-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pos-cart {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-cart-title { font-size: 16px; font-weight: 600; }

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.pos-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-default);
}
.pos-cart-item:last-child { border-bottom: none; }

.pos-cart-item-name  { flex: 1; font-size: 13px; font-weight: 500; }
.pos-cart-item-price { font-size: 12px; color: var(--text-muted); }
.pos-cart-item-qty   {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.pos-cart-footer {
  padding: 16px;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.pos-total-label { font-size: 14px; color: var(--text-secondary); }
.pos-total-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* === Product Grid (POS) === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--bg-page);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.product-name  {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price { font-size: 14px; font-weight: 700; color: var(--color-primary); }
.product-stock { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* === Coming Soon Banner === */
.coming-soon-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  min-height: 400px;
}

.coming-soon-icon {
  font-size: 72px;
  color: var(--text-muted);
  margin-bottom: 24px;
  animation: pulse 3s ease-in-out infinite;
}

.coming-soon-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.coming-soon-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.6;
}

/* === Login Page (no sidebar) === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 24px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 16px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

/* === Info Row (key-value display) === */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-default);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 140px;
  flex-shrink: 0;
}
.info-value { font-size: 14px; color: var(--text-primary); flex: 1; }

/* === GPS / Map Container === */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
}

/* Responsive for POS */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .pos-cart {
    height: 400px;
  }
}
