/* ==========================================================================
   SBP HUB — Admin Web Portal Desktop Stylesheet
   Strict adherence to DESAIN.md (Layout, Structure, Hierarchy, No Emojis, WCAG AA)
   Brand Colors: 100% Matched to Android APK (sbp_primary: #009638, sbp_dark: #006027, sbp_darker: #00481D)
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------------
     1. PALET WARNA RESMI SBP HUB (Matched to APK colors.xml & DESAIN.md)
     ------------------------------------------------------------------------ */
  --brand-primary: #009638;        /* sbp_primary (Tombol utama, tab aktif, brand header) */
  --brand-primary-hover: #007A2E;  /* State hover */
  --brand-primary-dark: #006027;   /* sbp_dark */
  --brand-darker: #00481D;         /* sbp_darker */
  --brand-secondary: #007A2E;      /* sbp_secondary */
  --brand-lime: #7ED321;           /* sbp_lime */
  --brand-mint: #EEFFF2;           /* sbp_mint */
  --brand-mint-light: #F7FCF8;     /* sbp_mint_light */
  --brand-accent: #FF6D00;         /* sbp_orange */

  /* Sidebar Theme (Matched with APK Brand Dark Green) */
  --brand-sidebar-bg: #003816;
  --brand-sidebar-dark: #00270F;
  --sidebar-text: #E8F5EE;
  --sidebar-text-muted: #86EFAC;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #009638;

  /* Surfaces & Backgrounds (DESAIN.md Section 4.1 & APK Neutrals) */
  --surface-app: #F4F6F8;          /* gray_50 */
  --surface-card: #FFFFFF;         /* white */
  --surface-subtle: #F8FAFC;       /* panel sekunder */
  --surface-table-header: #F8FAFC; /* header tabel */
  --surface-table-hover: #F1F5F9;  /* hover baris */

  /* Typography Colors (DESAIN.md Section 4.1 & APK Grays) */
  --text-primary: #0F172A;         /* gray_900 (High contrast WCAG AA) */
  --text-secondary: #475569;       /* gray_600 */
  --text-muted: #64748B;           /* gray_500 */
  --text-light: #94A3B8;           /* gray_400 */

  /* Borders & Dividers (DESAIN.md Section 4.1) */
  --border-default: #E2E8F0;       /* gray_200 */
  --border-subtle: #EDF2F7;        /* divider tipis */

  /* Operational State Tokens (DESAIN.md Section 4.1 & APK colors.xml) */
  --state-success: #009638;        /* Berhasil / Aktif (sbp_primary) */
  --state-success-bg: #EEFFF2;     /* sbp_mint */
  --state-success-border: #BBF7D0;

  --state-warning: #B45309;        /* Perlu perhatian / Menunggu */
  --state-warning-bg: #FFF3E0;     /* sbp_orange_light */
  --state-warning-border: #FDE68A;

  --state-danger: #CC0000;         /* sbp_red */
  --state-danger-bg: #FEE2E2;      /* sbp_red_light */
  --state-danger-border: #FECACA;

  --state-info: #0055B8;           /* sbp_blue */
  --state-info-bg: #EFF6FF;        /* sbp_blue_light */
  --state-info-border: #BFDBFE;

  --state-disabled: #94A3B8;       /* gray_400 */

  /* ------------------------------------------------------------------------
     2. SPACING SYSTEM (Kelipatan 4 per DESAIN.md Section 4.3)
     ------------------------------------------------------------------------ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* ------------------------------------------------------------------------
     3. RADIUS & ELEVATION (DESAIN.md Section 4.3: 6-10dp, hindari radius ekstrem)
     ------------------------------------------------------------------------ */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 12px 24px -4px rgba(15, 23, 42, 0.15), 0 4px 8px -2px rgba(15, 23, 42, 0.08);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* BASE RESETS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden !important;
  overflow-y: hidden;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--surface-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  font-size: 13.5px;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

/* APP LAYOUT SHELL */
.app-layout {
  display: flex;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ==========================================================================
   1. SIDEBAR (SBP Brand Forest Green — Matched 100% to APK Bottom Nav)
   ========================================================================== */
.sidebar {
  width: 250px;
  background-color: var(--brand-sidebar-bg);
  background: linear-gradient(180deg, var(--brand-sidebar-bg) 0%, var(--brand-sidebar-dark) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 40;
  user-select: none;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-text h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-section-title {
  padding: 18px 20px 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
}

.nav-item .nav-chevron {
  width: 14px;
  height: 14px;
  margin-left: 4px;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.nav-item .nav-badge + .nav-chevron {
  margin-left: 2px;
}

.sidebar-nav-group.open .nav-item .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.sidebar-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 6px 18px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-nav-group.open .sidebar-submenu {
  display: flex;
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-subitem:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-subitem.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-meta {
  overflow: hidden;
}

.profile-meta .name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-meta .role {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-sidebar-logout svg {
  width: 15px;
  height: 15px;
}

.btn-sidebar-logout:hover {
  background: rgba(204, 0, 0, 0.2);
  border-color: rgba(204, 0, 0, 0.5);
  color: #FECACA;
}

/* ==========================================================================
   2. MAIN WRAPPER, TOPBAR & PERSISTENT SUBNAV BAR
   ========================================================================== */
.main-wrapper {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--surface-app);
}

/* Topbar Header */
.topbar {
  height: 64px;
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 20;
}

.topbar-header h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.topbar-header p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Topbar Real-time Clock Widget (DESAIN.md Section 4 & 11) */
.topbar-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-card, #FFFFFF);
  border: 1px solid var(--border-default, #D7DEE7);
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary, #182230);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.topbar-clock-pill:hover {
  background: var(--surface-subtle, #F4F6F8);
  border-color: #CBD5E1;
}

.topbar-clock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--state-success, #247A4B);
  box-shadow: 0 0 0 2px rgba(36, 122, 75, 0.2);
  display: inline-block;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.topbar-clock-pill.offline .topbar-clock-dot {
  background-color: var(--state-danger, #B42318);
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.2);
}

.topbar-clock-pill.offline {
  border-color: var(--state-danger-border, #FECACA);
  background: var(--state-danger-bg, #FEF2F2);
}

.topbar-clock-icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted, #748094);
  flex-shrink: 0;
}

.topbar-clock-date {
  font-weight: 500;
  color: var(--text-secondary, #596579);
  white-space: nowrap;
}

.topbar-clock-sep {
  color: #CBD5E1;
  font-size: 11px;
}

.topbar-clock-time {
  font-weight: 700;
  color: var(--text-primary, #182230);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Server Status Pill (DESAIN.md Section 4.1 State Tokens) */
.server-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.server-status-pill.online {
  background: var(--state-success-bg);
  color: var(--state-success);
  border: 1px solid var(--state-success-border);
}

.server-status-pill.offline {
  background: var(--state-danger-bg);
  color: var(--state-danger);
  border: 1px solid var(--state-danger-border);
}

.server-status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background-color: currentColor;
}

.server-status-pill.online .dot {
  box-shadow: 0 0 0 2px rgba(36, 122, 75, 0.25);
}

/* PERSISTENT SUB-NAVIGATION BAR (STAYS PINNED UNDER TOPBAR) */
.subnav-container {
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  padding: 8px 28px;
  flex-shrink: 0;
  z-index: 25;
  position: relative;
}

.subnav-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.subnav-dropdown-caption {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* CORPORATE SUB-MENU DROPDOWN (DESAIN.md Section 5.1 & 7.2) */
.sbp-nav-dropdown {
  position: relative;
  display: inline-block;
}

.sbp-nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  height: 36px;
  padding: 0 12px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.sbp-nav-dropdown-trigger:hover {
  border-color: var(--brand-secondary);
  background-color: var(--brand-mint-light);
}

.sbp-nav-dropdown.open .sbp-nav-dropdown-trigger {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 56, 0.14);
}

.sbp-dropdown-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background-color: var(--brand-mint);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.sbp-dropdown-trigger-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
}

.sbp-dropdown-trigger-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sbp-dropdown-trigger-chevron {
  width: 15px;
  height: 15px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.sbp-nav-dropdown.open .sbp-dropdown-trigger-chevron {
  transform: rotate(180deg);
  stroke: var(--brand-primary);
}

.sbp-nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 310px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 6px;
  z-index: 60;
  flex-direction: column;
  gap: 2px;
}

.sbp-nav-dropdown.open .sbp-nav-dropdown-menu {
  display: flex;
}

.subnav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.14s ease;
  text-decoration: none;
  text-align: left;
}

.subnav-item:hover {
  background-color: var(--surface-table-hover);
}

.subnav-item.active {
  background-color: var(--brand-mint);
  border-color: rgba(0, 150, 56, 0.22);
  color: var(--brand-primary);
  font-weight: 700;
}

.subnav-item .subnav-icon {
  width: 17px;
  height: 17px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  flex-shrink: 0;
}

.subnav-item.active .subnav-icon {
  stroke: var(--brand-primary);
}

.sbp-dropdown-item-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 1px;
}

.sbp-dropdown-item-title {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  line-height: 1.25;
}

.sbp-dropdown-item-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.25;
}

.subnav-item .subnav-badge,
.sbp-nav-dropdown-trigger .subnav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--brand-mint);
  color: var(--brand-primary);
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.subnav-item.active .subnav-badge {
  background: var(--brand-primary);
  color: #ffffff;
}

/* ==========================================================================
   3. BUTTONS (DESAIN.md Section 7.1)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
  line-height: 1.3;
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 1px 2px rgba(0, 150, 56, 0.25);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn-outline {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-outline:hover {
  background-color: var(--surface-subtle);
  border-color: var(--text-secondary);
}

.btn-danger-outline {
  background-color: transparent;
  color: var(--state-danger);
  border-color: var(--state-danger-border);
}

.btn-danger-outline:hover {
  background-color: var(--state-danger-bg);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ==========================================================================
   4. CONTENT SCROLL AREA & TAB PANES
   ========================================================================== */
.content-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 36px;
}

.tab-pane {
  display: none;
}

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

.sub-pane {
  display: none;
}

.sub-pane.active {
  display: block;
}

/* ==========================================================================
   5. CORPORATE KPI METRICS PANEL (DESAIN.md Section 4, 6.2 & 7.3)
   Clean unified executive panel with hairline vertical dividers, neutral slate
   surfaces, tabular typography, and subtle semantic status indicators.
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  margin-bottom: 20px;
  min-width: 0;
  overflow: hidden;
}

.stat-card {
  background: var(--surface-card);
  border: none;
  border-right: 1px solid var(--border-default);
  border-radius: 0;
  padding: 16px 20px 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 108px;
  min-width: 0;
  box-shadow: none;
  transition: background-color 0.15s ease;
  position: relative;
}

.stats-grid > .stat-card:last-child {
  border-right: none;
}

.stat-card:hover {
  background-color: #FAFBFD;
  transform: none;
  box-shadow: none;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid > .stat-card:nth-child(2n) {
    border-right: none;
  }
  .stats-grid > .stat-card:nth-child(1),
  .stats-grid > .stat-card:nth-child(2) {
    border-bottom: 1px solid var(--border-default);
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid > .stat-card {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
  }
  .stats-grid > .stat-card:last-child {
    border-bottom: none;
  }
}

/* Remove decorative rainbow left borders (DESAIN.md Section 4) */
.stat-card.stat-card-amber,
.stat-card.stat-card-green,
.stat-card.stat-card-red,
.stat-card.stat-card-blue,
.stat-card.stat-card-purple,
.stats-grid > .stat-card:nth-child(1),
.stats-grid > .stat-card:nth-child(2),
.stats-grid > .stat-card:nth-child(3),
.stats-grid > .stat-card:nth-child(4) {
  border-left: none;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-icon,
.stat-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: #F8FAFC;
  border: 1px solid var(--border-default);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg,
.stat-icon-badge svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.85;
}

/* Subtle corporate icon tinting without loud pastel backgrounds */
.stat-icon-badge.green {
  background-color: #F4FAF6;
  border-color: #D1EADF;
  color: var(--brand-primary-dark);
}

.stat-icon-badge.amber {
  background-color: #FCF9F2;
  border-color: #EDE0C8;
  color: #946200;
}

.stat-icon-badge.red {
  background-color: #FDF6F6;
  border-color: #F3D4D4;
  color: #B42318;
}

.stat-icon-badge.blue,
.stat-icon-badge.purple {
  background-color: #F8FAFC;
  border-color: #E2E8F0;
  color: #334155;
}

.stat-value-row {
  margin-top: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-number,
.stat-card.stat-card-amber .stat-number,
.stat-card.stat-card-green .stat-number,
.stat-card.stat-card-red .stat-number,
.stat-card.stat-card-blue .stat-number,
.stat-card.stat-card-purple .stat-number {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary) !important;
  line-height: 1.15;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 1px 7px;
  border-radius: 4px;
}

.stat-desc {
  margin: auto -20px 0 -20px;
  padding: 7px 20px;
  background-color: #F8FAFC;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-desc::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #64748B;
  flex-shrink: 0;
}

.stat-card.stat-card-green .stat-desc::before {
  background-color: var(--brand-primary);
}

.stat-card.stat-card-amber .stat-desc::before {
  background-color: #D97706;
}

.stat-card.stat-card-red .stat-desc::before {
  background-color: var(--state-danger);
}

.stat-card.stat-card-blue .stat-desc::before {
  background-color: var(--brand-primary-dark);
}

.stat-card.stat-card-purple .stat-desc::before {
  background-color: #475569;
}

/* ==========================================================================
   6. CARDS & DATA TABLES (DESAIN.md Section 7.3 & 11)
   ========================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header-bar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
  background-color: var(--surface-card);
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.card-title-group {
  min-width: 220px;
  flex: 1 1 auto;
}

.card-title-group h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-title-group p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Search Box (Clean corporate border) */
.search-input-wrap {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.search-input-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  stroke-width: 2;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 6px 12px 6px 34px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background-color: var(--surface-card);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 56, 0.15);
}

/* DATA TABLE */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--surface-app);
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: var(--surface-table-header);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 11px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.8px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--surface-table-hover);
}

.cell-code {
  font-weight: 700;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.cell-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* STATUS BADGES (DESAIN.md Section 7.4) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: currentColor;
}

.badge-active {
  background-color: var(--state-success-bg);
  color: var(--state-success);
  border: 1px solid var(--state-success-border);
}

.badge-inactive {
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

/* ==========================================================================
   PIC (SALES) & DRIVER STRUCTURED CELLS (DESAIN.md Section 4.1, 4.4, 7.5)
   ========================================================================== */
.person-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 128px;
}

.person-cell-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #182230; /* DESAIN.md text.primary */
  line-height: 1.35;
}

.person-cell-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #D7DEE7; /* DESAIN.md border.default */
}

.person-cell-icon svg {
  width: 12.5px;
  height: 12.5px;
  stroke: currentColor;
  stroke-width: 2;
}

.person-cell-icon.pic-icon {
  background-color: #F4F6F8; /* DESAIN.md surface.app */
  color: #17365D;            /* DESAIN.md brand.primary */
  border-color: #D7DEE7;
}

.person-cell-icon.driver-icon {
  background-color: #E9EEF3; /* DESAIN.md surface.subtle */
  color: #2F5D8A;            /* DESAIN.md brand.secondary */
  border-color: #D7DEE7;
}

.person-cell-meta {
  font-size: 11.5px;
  font-weight: 500;
  color: #596579; /* DESAIN.md text.secondary */
  line-height: 1.3;
  padding-left: 29px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.person-cell-meta-muted {
  color: #748094; /* DESAIN.md text.muted */
}

.person-cell-plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #182230;
  background-color: #F4F6F8;
  border: 1px solid #D7DEE7;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.person-cell-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #748094; /* DESAIN.md text.muted */
}

.person-cell-unassigned-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #A7B0BC; /* DESAIN.md state.disabled */
  flex-shrink: 0;
}

/* Role Badges (DESAIN.md Section 4.1 & 7.4 — Structured 6px Radius, High Contrast) */
.role-badge-sales {
  background: #F4F6F8;
  color: #17365D;
  border: 1px solid #D7DEE7;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.role-badge-canvasing {
  background: #ECFDF3;
  color: #247A4B;
  border: 1px solid #ABEFC6;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.role-badge-delivery {
  background: #E9EEF3;
  color: #2F5D8A;
  border: 1px solid #CBD5E1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.role-badge-admin {
  background: rgba(23, 54, 93, 0.08);
  color: #17365D;
  border: 1px solid rgba(23, 54, 93, 0.22);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.role-badge-administrator {
  background: #17365D;
  color: #FFFFFF;
  border: 1px solid #102844;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Status Pills for PO (DESAIN.md Section 4.1 & 7.4 State Tokens) */
.status-pill-waiting,
.status-pill-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  background: #FEF7E6;
  color: #946200;
  border: 1px solid #F5D68E;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

.status-pill-approved,
.status-pill-delivery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  background: #EBF3FC;
  color: #17365D;
  border: 1px solid #B9D5F3;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

.status-pill-processing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  background: #E9EEF3;
  color: #2F5D8A;
  border: 1px solid #CBD5E1;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

.status-pill-delivering {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  background: #EFF6FF;
  color: #175CD3;
  border: 1px solid #BFDBFE;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

.status-pill-completed,
.status-pill-delivered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  background: #ECFDF3;
  color: #247A4B;
  border: 1px solid #ABEFC6;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

.status-pill-cancelled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  background: #FEF3F2;
  color: #B42318;
  border: 1px solid #FECDCA;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

/* PO Modal Items Table & Split Notice */
.po-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12.5px;
}
.po-items-table th {
  background: var(--surface-table-header);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-default);
}
.po-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}
.input-dispatch-qty {
  width: 80px;
  padding: 5px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  text-align: center;
}
.input-dispatch-qty:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.split-delivery-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.4;
}

/* Toggle Switch (Hak Akses) */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: middle;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-default);
  transition: 0.2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--brand-primary);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Table Footer */
.table-footer-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-default);
  background-color: var(--surface-card);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   7. FORM PENDAFTARAN OUTLET (TAB 1.3)
   ========================================================================== */
.form-registration-card {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
  padding: 24px;
}

@media (max-width: 1024px) {
  .form-registration-card {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

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

.form-control {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  background-color: var(--surface-card);
  outline: none;
  transition: border-color 0.15s ease;
}

textarea.form-control {
  height: auto;
  min-height: 84px;
  resize: vertical;
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 56, 0.15);
}

.barcode-preview-container {
  background: var(--surface-table-header);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.barcode-preview-box {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   8. LIVE GPS SPLIT LAYOUT (TAB 2)
   ========================================================================== */
.gps-split-layout {
  display: grid;
  grid-template-columns: 52% 48%;
  gap: 16px;
  height: 520px;
}

@media (max-width: 1100px) {
  .gps-split-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.gps-map-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.gps-map-card .card-header-bar {
  padding: 14px 18px;
}

#map-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.gps-table-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.gps-table-card .card-header-bar {
  padding: 14px 18px;
}

.gps-table-scroll {
  flex: 1;
  overflow-y: auto;
}

/* ==========================================================================
   9. MODALS (DESAIN.md Section 7.6)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 39, 15, 0.6);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-default);
}

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

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-default);
  background-color: var(--surface-table-header);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   10. LOGIN SCREEN (Authentic SBP Portal Gateway)
   ========================================================================== */
html.is-authenticated .login-overlay {
  display: none !important;
}

html.is-authenticated .app-layout {
  display: flex !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #00220c 0%, #003816 50%, #005022 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-circle {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border-radius: 50%;
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  padding: 10px;
}

.login-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.login-brand-header p {
  font-size: 11px;
  font-weight: 700;
  color: var(--sidebar-text-muted);
  letter-spacing: 0.08em;
  margin-top: 4px;
  text-transform: uppercase;
}

.login-card {
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-default);
}

.login-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.login-card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 4px;
  margin-bottom: 20px;
}

.alert-box.error {
  background-color: var(--state-danger-bg);
  color: var(--state-danger);
  border: 1px solid var(--state-danger-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.btn-login-submit {
  width: 100%;
  height: 42px;
  background-color: var(--brand-primary);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  transition: background 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 150, 56, 0.3);
}

.btn-login-submit:hover {
  background-color: var(--brand-primary-hover);
}

.login-hint-box {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.login-secure-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  text-align: center;
}

.login-secure-footer .secure-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-secure-footer .secure-badge svg {
  color: var(--brand-primary);
}

.login-secure-footer .secure-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
  margin-bottom: 0;
}

/* Toast Notifications (DESAIN.md Section 7.7) */
.portal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  z-index: 1000;
  display: none;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   OFFICIAL SBP QR CODE STICKER (100% IDENTIK STANDAR RESMI PT SURABRAJA PUTRA)
   ========================================================================== */
#modal-barcode .modal-card {
  max-width: 440px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

#modal-barcode .modal-body {
  overflow-y: auto;
  max-height: calc(94vh - 120px);
}

.sbp-official-sticker {
  width: 330px;
  height: 520px;
  background: #FFFFFF;
  border: 3px solid #008832;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media print {
  @page {
    margin: 0;
  }

  body * {
    visibility: hidden !important;
  }

  /* Mode 1: Cetak Stiker Standard (A4 / Kertas Stiker Lebar) */
  body:not(.print-mode-58mm):not(.print-mode-surat-jalan):not(.print-mode-bod-report):not(.print-mode-kpi-slip) #barcode-print-area,
  body:not(.print-mode-58mm):not(.print-mode-surat-jalan):not(.print-mode-bod-report):not(.print-mode-kpi-slip) #barcode-print-area * {
    visibility: visible !important;
  }
  body:not(.print-mode-58mm):not(.print-mode-surat-jalan) #barcode-print-area {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    box-shadow: none !important;
    border: 3px solid #008832 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Mode 2: Cetak Stiker QR Toko ke Thermal 58mm (Blueprint MPOS 332) */
  body.print-mode-58mm #barcode-print-area,
  body.print-mode-58mm #barcode-print-area * {
    visibility: visible !important;
  }
  body.print-mode-58mm #barcode-print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 200px !important;
    max-width: 58mm !important;
    height: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 6px !important;
    border: 2px solid #000000 !important;
    border-radius: 6px !important;
    transform: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.print-mode-58mm #barcode-print-area svg {
    max-width: 140px !important;
    max-height: 140px !important;
    margin: 4px auto !important;
  }

  /* Mode 3: Cetak Struk Surat Jalan Thermal 58mm (Blueprint MPOS 332) */
  body.print-mode-surat-jalan #thermal-surat-jalan-print-area,
  body.print-mode-surat-jalan #thermal-surat-jalan-print-area * {
    visibility: visible !important;
  }
  body.print-mode-surat-jalan #thermal-surat-jalan-print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 205px !important;
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 4px 6px !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #000000 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Mode 4: Cetak Laporan Resmi Dewan Direksi (BOD) */
  body.print-mode-bod-report #bod-report-printable-area,
  body.print-mode-bod-report #bod-report-printable-area * {
    visibility: visible !important;
  }
  body.print-mode-bod-report #bod-report-printable-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 20px 28px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Mode 5: Cetak Slip Insentif Sales */
  body.print-mode-kpi-slip #modal-kpi-slip-body,
  body.print-mode-kpi-slip #modal-kpi-slip-body * {
    visibility: visible !important;
  }
  body.print-mode-kpi-slip #modal-kpi-slip-body {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

}

/* --------------------------------------------------------------------------
   STRATA PRICING & FILTER CHIPS STYLING
   -------------------------------------------------------------------------- */
.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.filter-chip:hover {
  background: var(--surface-subtle);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.filter-chip.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}

.tier-pill {
  display: inline-block;
  padding: 3px 8px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  color: #1E293B;
  white-space: nowrap;
}

.savings-pill {
  display: inline-block;
  padding: 2px 7px;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  color: #92400E;
  white-space: nowrap;
}

.brand-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #EEF2F6;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* TOP Approval Filter Buttons & Badges */
.btn-filter-top {
  background: transparent;
  color: var(--text-secondary, #64748b);
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-top:hover {
  background: var(--surface-table-hover, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

.btn-filter-top.active {
  background: #ffffff !important;
  color: var(--brand-primary, #009638) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

#subtab-badge-top-approval.has-pending {
  background: #d97706 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   11. DELIVERY TRACKING TIMELINE & POD PROOF (Strict DESAIN.md & SPX Ref)
   ========================================================================== */

.po-tracking-section {
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.po-tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
}

.po-tracking-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.po-tracking-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Timeline Container */
.delivery-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 4px;
}

.timeline-step {
  display: flex;
  position: relative;
  min-height: 48px;
}

.timeline-step:last-child {
  min-height: auto;
}

/* Left: Time Column */
.timeline-time-col {
  width: 90px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 14px;
  padding-top: 1px;
}

.timeline-date {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.timeline-clock {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Center: Node and Line Column */
.timeline-axis-col {
  width: 24px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #CBD5E1;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #CBD5E1;
  z-index: 2;
  margin-top: 2px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

/* Active / Latest Step Dot */
.timeline-step.active .timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--brand-primary);
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--brand-primary), 0 2px 4px rgba(0, 150, 56, 0.25);
  margin-top: 1px;
}

.timeline-step.failed .timeline-dot {
  background: var(--state-danger);
  box-shadow: 0 0 0 2px var(--state-danger);
}

/* Vertical Connecting Line */
.timeline-line {
  position: absolute;
  top: 16px;
  bottom: -4px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background-color: var(--border-default);
  z-index: 1;
}

.timeline-step:last-child .timeline-line {
  display: none;
}

/* Right: Content Column */
.timeline-content-col {
  flex: 1;
  padding-left: 10px;
  padding-bottom: 16px;
}

.timeline-step:last-child .timeline-content-col {
  padding-bottom: 4px;
}

.timeline-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-step.active .timeline-heading {
  color: var(--brand-primary);
}

.timeline-step.failed .timeline-heading {
  color: var(--state-danger);
}

.timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 3px;
}

.timeline-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* POD Proof Grid & Cards */
.pod-proof-wrapper {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.pod-proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .pod-proof-grid {
    grid-template-columns: 1fr;
  }
}

.pod-card {
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.pod-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.pod-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pod-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pod-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #17365D;
  background: #F0F5FA;
  border: 1px solid #CFE0F0;
  padding: 1px 5px;
  border-radius: 3px;
}

.pod-badge-sig {
  color: #008832;
  background: #EEFFF2;
  border-color: #BBF7D0;
}

.pod-thumb-box {
  position: relative;
  width: 100%;
  height: 130px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pod-sig-box {
  background: #FFFFFF;
}

.pod-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.pod-sig-img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  filter: contrast(1.1);
}

.pod-card:hover .pod-thumb-img {
  transform: scale(1.03);
}

.pod-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pod-card:hover .pod-thumb-overlay {
  opacity: 1;
}

.pod-card-footer {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pod-meta-caption {
  font-size: 10.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



/* Segmented Navigation Subtabs for Anti-Slop UI */
.btn-subtab {
  background: transparent;
  color: #475569;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-subtab:hover {
  background: #F1F5F9;
  color: #17365D;
}
.btn-subtab.active {
  background: #17365D !important;
  color: #FFFFFF !important;
  border: 1px solid #17365D !important;
}
.btn-subtab.active .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   EXECUTIVE BOD & MONITORING KPI DASHBOARD STYLES
   -------------------------------------------------------------------------- */
.bod-dashboard-banner {
  background: linear-gradient(135deg, #064E3B 0%, #065F46 50%, #047857 100%);
  border-radius: 12px;
  padding: 20px 24px;
  color: #FFFFFF;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 14px rgba(23, 54, 93, 0.15);
}
.bod-dashboard-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bod-dashboard-subtitle {
  font-size: 13px;
  color: #CBD5E1;
  margin: 0;
  line-height: 1.4;
}
.bod-executive-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bod-executive-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.bod-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.bod-card-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.bod-card-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin: 4px 0 8px 0;
}
.bod-card-sub {
  font-size: 12px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bod-progress-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 4px 0;
}
.bod-progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}
.bod-leaderboard-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bod-leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #EDF2F7;
  transition: background 0.15s ease;
}
.bod-leaderboard-row:hover {
  background: #F1F5F9;
}
.bod-pilar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px dashed #E2E8F0;
}
.bod-pilar-item:last-child {
  border-bottom: none;
}
.bod-pilar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #1E293B;
}
.bod-commentary-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #166534;
  font-size: 12.5px;
  line-height: 1.5;
  margin-top: 14px;
}
.bod-report-paper {
  background: #FFFFFF;
  padding: 32px 36px;
  color: #0F172A;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
}

/* =============================================================================
   LOG AKTIVITAS SALES VIEW (MODERN CORPORATE GREEN THEME)
   ============================================================================= */
.sales-log-banner {
  background: linear-gradient(135deg, #064E3B 0%, #065F46 50%, #047857 100%);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.18);
  margin-bottom: 20px;
}

.sales-log-banner-watermark {
  position: absolute;
  right: 180px;
  top: -15px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
}

.sales-log-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .sales-log-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .sales-log-stats-grid {
    grid-template-columns: 1fr;
  }
}

.sales-log-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sales-log-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-period-pill {
  background: transparent;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  border-radius: 20px;
  padding: 6px 16px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-period-pill:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.btn-period-pill.active {
  background: #009638 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 150, 56, 0.3);
}

.btn-sales-log-map {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
  font-weight: 700;
  font-size: 12px;
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease-in-out;
}

.btn-sales-log-map:hover {
  background: #DCFCE7;
  border-color: #4ADE80;
  color: #14532D;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15);
}

.sales-log-table tr:hover td {
  background-color: #F8FAFC;
}

/* =============================================================================
   KPI & INSENTIF SALES VIEW (MATCHING NEW EXECUTIVE DASHBOARD THEME)
   ============================================================================= */
.btn-kpi-nav-pill {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #334155;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease-in-out;
}

.btn-kpi-nav-pill:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.btn-kpi-nav-pill.active {
  background: #064E3B !important;
  border-color: #064E3B !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(6, 78, 59, 0.25);
}

.kpi-scorecard {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-scorecard:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.filter-chip-kpi {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip-kpi:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.filter-chip-kpi.active {
  background: #009638 !important;
  border-color: #009638 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 150, 56, 0.25);
}

.kpi-dashboard-banner {
  background: linear-gradient(135deg, #064E3B 0%, #065F46 50%, #047857 100%);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.18);
  margin-bottom: 20px;
}

.kpi-dashboard-banner-watermark {
  position: absolute;
  right: 180px;
  top: -20px;
  opacity: 0.10;
  pointer-events: none;
  z-index: 1;
}

/* =============================================================================
   PAGINATION CONTROLS (SHARED REUSABLE COMPONENT)
   ============================================================================= */
.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

.pagination-btn.active {
  background: #009638 !important;
  border-color: #009638 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 150, 56, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #94A3B8;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: #94A3B8;
  font-weight: 700;
  font-size: 13px;
  user-select: none;
}

.btn-success-outline {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-success-outline:hover {
  background-color: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.user-status-pill.locked {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.user-status-pill.locked svg {
  color: #dc2626;
}

.user-status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.user-status-pill.locked .status-dot {
  background-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}
.btn-segmented {
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-segmented.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================================================== */
/* 4.10 LOG ACTIVITY CAROUSEL TABS & STYLES (MATCHING SCREENSHOT)             */
/* ========================================================================== */
.activity-tabs-nav-bar {
  display: flex;
  align-items: center;
  position: relative;
  background: #ffffff;
  border-bottom: 2px solid #E2E8F0;
  padding: 0 4px;
  margin-bottom: 20px;
  gap: 12px;
}

.activity-carousel-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #475569;
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.activity-carousel-arrow:hover {
  background: #1e293b;
  transform: scale(1.08);
}

.activity-tabs-slider {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
  padding: 4px 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.activity-tabs-slider::-webkit-scrollbar {
  display: none;
}

.activity-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: #64748B;
  padding: 12px 6px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.activity-tab-btn:hover {
  color: #009638;
}

.activity-tab-btn.active {
  color: #009638 !important; /* SBP Green */
  border-bottom-color: #009638 !important;
}

.activity-tab-btn .tab-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.activity-tab-btn:hover .tab-icon {
  transform: scale(1.1);
}

.activity-tab-btn .tab-badge {
  background: #F1F5F9;
  color: #475569;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
  margin-left: 2px;
  transition: all 0.2s ease;
}

.activity-tab-btn.active .tab-badge {
  background: #E8F8EC;
  color: #009638;
  border: 1px solid #BBF7D0;
}

.badge-action-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-action-password {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-action-email {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.badge-action-profile {
  background: #ECFEFF;
  color: #0E7490;
  border: 1px solid #A5F3FC;
}

.badge-action-created {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-action-unlocked {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-action-status {
  background: #FDF2F8;
  color: #BE185D;
  border: 1px solid #FBCFE8;
}

.badge-action-deleted {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.badge-error-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
}

.badge-error-404 {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.badge-error-500 {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.badge-error-js {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #D8B4FE;
}

.badge-error-timeout {
  background: #FFEDD5;
  color: #9A3412;
  border: 1px solid #FDBA74;
}


/* Profile Avatar Custom Styles */
.profile-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.profile-avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block !important;
}

.person-cell-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 2px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
  margin-right: 10px !important;
}
