/* Buku Link Online — Modern Mobile-First CSS */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --success: #10b981;
  --success-dark: #047857;
  --success-light: #ecfdf5;
  
  --warning: #f59e0b;
  --warning-dark: #b45309;
  --warning-light: #fffbeb;
  
  --danger: #ef4444;
  --danger-dark: #b91c1c;
  --danger-light: #fef2f2;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Layout Structure */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background-color: var(--bg-app);
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 90px 16px; /* 90px bottom padding for mobile bottom bar */
}

@media (min-width: 900px) {
  .main-content {
    padding: 24px 32px 40px 32px;
    max-width: 1200px;
  }
}

/* Desktop Sidebar Menu */
.desktop-sidebar {
  display: none;
}

@media (min-width: 900px) {
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 250px;
    min-width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 50;
    overflow-y: auto;
  }
}

.sidebar-brand {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
}

.sidebar-user-card {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 14px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 12px 10px 4px 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-link svg {
  flex-shrink: 0;
  stroke-width: 2;
}

.sidebar-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.sidebar-link.active svg {
  stroke: var(--primary);
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link.text-danger:hover {
  background: var(--danger-light);
  color: var(--danger-dark);
}

/* Visibility responsive helpers */
.desktop-only {
  display: none;
}

.mobile-only {
  display: flex;
}

@media (min-width: 900px) {
  .desktop-only {
    display: block;
  }
  .mobile-only {
    display: none !important;
  }
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header & Top Bar */
.top-navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 900px) {
  .top-navbar {
    padding: 14px 32px;
  }
}

.top-navbar .brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: #e0e7ff;
  color: #3730a3;
  text-transform: uppercase;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Mobile Bottom Navigation (PRD 6.4: Beranda | Transaksi | Gudang | Riwayat | Lainnya) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 62px;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 3px;
  transition: color 0.15s ease;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.bottom-nav-item.active svg {
  stroke: var(--primary);
}

/* Mobile Bottom Nav FAB (Center Raised Circular Transaksi Button) */
.bottom-nav-item.bottom-nav-fab {
  position: relative;
  justify-content: flex-end;
  padding-bottom: 7px;
  overflow: visible;
}

.bottom-nav-fab .fab-circle {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border: 3.5px solid var(--bg-card);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.42);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background-color 0.15s ease;
}

.bottom-nav-fab .fab-circle svg,
.bottom-nav-fab.active .fab-circle svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff !important;
  stroke-width: 2.8;
}

.bottom-nav-fab span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease;
  line-height: 1;
}

.bottom-nav-fab:hover .fab-circle {
  transform: translateX(-50%) scale(1.08);
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
}

.bottom-nav-fab:active .fab-circle {
  transform: translateX(-50%) scale(0.93);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.bottom-nav-fab.active .fab-circle {
  background: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.55), 0 0 0 2.5px rgba(37, 99, 235, 0.25);
}

.bottom-nav-fab.active span {
  color: var(--primary);
  font-weight: 700;
}

@media (min-width: 900px) {
  .bottom-nav {
    display: none; /* Hide bottom nav on desktop */
  }
}

/* Cards & Surfaces */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Quick Action Buttons Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quick-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover,
.quick-action-btn:active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.quick-action-btn .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.blue { background: #dbeafe; color: #1e40af; }
.btn-icon.green { background: #dcfce7; color: #166534; }
.btn-icon.amber { background: #fef3c7; color: #92400e; }
.btn-icon.purple { background: #ede9fe; color: #5b21b6; }

/* Metrics / Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Highlighted Balance Card */
.balance-hero-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.balance-hero-card .hero-label {
  font-size: 0.85rem;
  color: #bfdbfe;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-hero-card .hero-amount {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 6px 0;
}

.balance-hero-card .hero-tap-hint {
  font-size: 0.75rem;
  color: #dbeafe;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Quota / Limit Bar (PRD 14) */
.quota-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}

.form-control, .form-select, textarea.form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 42px;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group-addon {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-right: none;
  padding: 0 12px;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  min-height: 44px; /* Touch friendly */
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  min-height: 32px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background: var(--success-dark);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f1f5f9;
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: var(--danger-dark);
  text-decoration: none;
}

/* Tabs Switcher */
.tab-nav {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  gap: 4px;
}

.tab-nav-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: all 0.15s ease;
}

.tab-nav-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.5);
}

.tab-nav-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Digital Subnav Segmented Switcher */
.digital-subnav {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.digital-subnav::-webkit-scrollbar {
  display: none;
}
.digital-subnav-btn {
  flex: 1;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.digital-subnav-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}
.digital-subnav-btn.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}

/* Form Grid Utilities */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.label-optional {
  font-size: 0.76rem;
  font-weight: normal;
  color: var(--text-muted);
  margin-left: 4px;
}
@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .form-grid-2 .form-group {
    min-width: 0;
  }
  .form-grid-2 .form-label {
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .form-grid-2 .form-select,
  .form-grid-2 .form-control {
    font-size: 0.8rem;
    padding: 7px 8px;
    min-width: 0;
  }
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Radio Scenario Cards for Tarik Tunai */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 540px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}
.scenario-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.15s ease;
  user-select: none;
}
.scenario-card input[type="radio"] {
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.scenario-card:hover {
  border-color: #94a3b8;
  background: #ffffff;
}
.scenario-card.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--primary);
}
.scenario-card-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}
.scenario-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Calculation Summary Card - Dynamic Validation Styling (Black Idle, Green Profit, Red Loss) */
.calc-summary-card {
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-top: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  transition: all 0.25s ease;
}
.calc-metric-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.calc-metric-label {
  font-size: 0.74rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: color 0.25s ease;
}
.calc-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}

/* [1] KOSONG / IDLE -> Background Hitam */
.calc-summary-card.state-idle {
  background: #0f172a !important; /* Hitam pekat / Slate dark */
  border: 1px solid #1e293b !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}
.calc-summary-card.state-idle .calc-metric-label {
  color: #94a3b8 !important;
}
.calc-summary-card.state-idle .calc-metric-value {
  color: #ffffff !important;
}
.calc-summary-card.state-idle .calc-metric-value.text-muted {
  color: #64748b !important;
}
.calc-summary-card.state-idle .profit-badge,
.calc-summary-card.state-idle .loss-badge {
  background: #1e293b !important;
  color: #94a3b8 !important;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
}

/* [2] UNTUNG / PROFIT -> Background Hijau */
.calc-summary-card.state-profit {
  background: #059669 !important; /* Hijau emerald pekat */
  border: 1px solid #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28) !important;
}
.calc-summary-card.state-profit .calc-metric-label {
  color: #d1fae5 !important;
}
.calc-summary-card.state-profit .calc-metric-value {
  color: #ffffff !important;
}
.calc-summary-card.state-profit .profit-badge {
  background: #ffffff !important;
  color: #065f46 !important;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  display: inline-block;
}

/* [3] RUGI / LOSS -> Background Merah */
.calc-summary-card.state-loss {
  background: #dc2626 !important; /* Merah menyala / Alert */
  border: 1px solid #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3) !important;
}
.calc-summary-card.state-loss .calc-metric-label {
  color: #fee2e2 !important;
}
.calc-summary-card.state-loss .calc-metric-value {
  color: #ffffff !important;
}
.calc-summary-card.state-loss .loss-badge {
  background: #ffffff !important;
  color: #991b1b !important;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  display: inline-block;
}

/* Penyesuaian Otomatis Warna Panel Form */
.digital-panel.panel-profit {
  border-color: #10b981 !important;
  border-top: 3px solid #10b981 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(16, 185, 129, 0.05) !important;
  transition: all 0.25s ease;
}
.digital-panel.panel-profit .form-control:focus,
.digital-panel.panel-profit .form-select:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.digital-panel.panel-loss {
  border-color: #ef4444 !important;
  border-top: 3px solid #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.08) !important;
  transition: all 0.25s ease;
}
.digital-panel.panel-loss .form-control:focus,
.digital-panel.panel-loss .form-select:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

@media (max-width: 640px) {
  .calc-summary-card {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .calc-metric-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .calc-metric-label {
    margin-bottom: 0;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success { background: var(--success-light); color: var(--success-dark); border: 1px solid #a7f3d0; }
.alert-error   { background: var(--danger-light); color: var(--danger-dark); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: var(--warning-dark); border: 1px solid #fde68a; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--primary-border); }
.alert a {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
  transition: opacity 0.15s ease;
}
.alert a:hover {
  opacity: 0.8;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.table th {
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table tr:hover {
  background-color: #f8fafc;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  align-items: flex-end; /* Bottom sheet on mobile */
  justify-content: center;
}

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

.modal-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-sheet {
    border-radius: var(--radius-lg);
    animation: fadeIn 0.2s ease-out;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }
}

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

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* Modern Employee Permission Components */
.perm-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.perm-preset-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.perm-preset-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.perm-group {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.perm-group-header {
  background: #f8fafc;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
}

.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
  margin: 0;
}

.perm-item:last-child {
  border-bottom: none;
}

.perm-item:hover {
  background: #f8fafc;
}

.perm-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #1e293b;
}

.perm-badge-sensitif {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

/* Modern iOS / Tailwind Style Switch */
.perm-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  margin: 0;
}

.perm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.perm-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s ease;
  border-radius: 20px;
}

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

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

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

/* Tenant Code Header Card Responsive */
.tenant-code-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .tenant-code-card-wrap {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
  }
}

.tenant-code-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tenant-code-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 14px;
  font-family: var(--font-mono, monospace);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #0f172a;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.tenant-code-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.tenant-code-buttons .btn {
  white-space: nowrap;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
}

.tenant-code-hint {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
  width: 100%;
}

@media (min-width: 768px) {
  .tenant-code-hint {
    max-width: 380px;
    width: auto;
    text-align: right;
  }
}

/* Plan Cards (Pricing) */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .plan-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s;
}

.plan-card.featured {
  border-color: var(--primary);
  background: #f8faff;
}

.plan-card .featured-tag {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.plan-price-display {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 10px 0 2px 0;
}

.plan-price-annual {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.plan-feature-list {
  list-style: none;
  margin: 14px 0 20px 0;
  flex: 1;
}

.plan-feature-list li {
  font-size: 0.86rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

/* QRIS Payment Display Box */
.qris-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  margin-bottom: 20px;
}

.qris-canvas-wrapper {
  display: inline-block;
  padding: 12px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin: 14px 0;
  box-shadow: var(--shadow-sm);
}

.unique-code-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px dashed #f59e0b;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 6px 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Compact Balance Item Styles */
.balance-compact-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.balance-list-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.balance-item-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}
.balance-item-compact:last-child {
  border-bottom: none;
}
.balance-item-compact:hover {
  background-color: #f8fafc;
}
.balance-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.balance-item-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.balance-amount {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: right;
  min-width: 110px;
}
.badge-cash { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-bank { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-ewallet { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-server { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-other { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Balance Action Icon Buttons with Striking/Vibrant Colors & Safe Spacing */
.balance-btn-group {
  display: flex;
  align-items: center;
  gap: 8px; /* Spasi aman antar tombol agar tidak salah klik */
}

.balance-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}
.balance-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  filter: brightness(1.08);
}
.balance-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.balance-action-btn.btn-topup {
  background: #16a34a;
  color: #ffffff;
}
.balance-action-btn.btn-topup:hover {
  background: #15803d;
  color: #ffffff;
}
.balance-action-btn.btn-withdraw {
  background: #ea580c;
  color: #ffffff;
}
.balance-action-btn.btn-withdraw:hover {
  background: #c2410c;
  color: #ffffff;
}
.balance-action-btn.btn-opname {
  background: #0284c7;
  color: #ffffff;
}
.balance-action-btn.btn-opname:hover {
  background: #0369a1;
  color: #ffffff;
}
.balance-action-btn.btn-edit {
  background: #7c3aed;
  color: #ffffff;
}
.balance-action-btn.btn-edit:hover {
  background: #6d28d9;
  color: #ffffff;
}

@media (max-width: 680px) {
  .balance-item-compact {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .balance-item-actions {
    justify-content: space-between;
    width: 100%;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
  }
  .balance-amount {
    font-size: 1rem;
    min-width: unset;
  }
  .balance-btn-group {
    gap: 8px;
  }
  .balance-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 7px;
  }
  .balance-btn-group .btn {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    min-height: 28px !important;
  }
}

/* Quick Filter Pills (Ultra Sleek Mobile & Desktop) */
.quick-filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-filter-pills::-webkit-scrollbar {
  display: none;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}
.filter-pill:hover {
  background: #e2e8f0;
}
.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   MODERN MINIMAL POS & CASHIER SYSTEM
   ========================================================================== */
.pos-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 6px;
}

.pos-catalog-pane {
  flex: 1.45;
  min-width: 0;
}

.pos-cart-pane {
  flex: 1;
  min-width: 320px;
  max-width: 400px;
  position: sticky;
  top: 15px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* POS Toolbar */
.pos-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.pos-search-box {
  position: relative;
  flex: 1;
}
.pos-search-box input {
  padding-left: 32px;
  padding-right: 28px;
  height: 38px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
}
.pos-search-box input:focus {
  border-color: #0f172a;
  outline: none;
}
.pos-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.pos-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  display: none;
}
.pos-tool-btn {
  height: 38px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.pos-tool-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Category Filter Tabs */
.pos-category-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pos-category-scroll::-webkit-scrollbar {
  display: none;
}
.pos-cat-chip {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.pos-cat-chip:hover {
  background: #f1f5f9;
  color: var(--text-main);
}
.pos-cat-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  font-weight: 600;
}

/* Compact & High Density Product Cards Grid (1:1 Square) */
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  align-content: start;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 2px;
}
.pos-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 10px 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  min-height: unset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.pos-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.pos-card:active {
  transform: scale(0.98);
}
.pos-card.out-of-stock {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
}
.pos-card-body {
  margin-bottom: 2px;
  min-width: 0;
}
.pos-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.pos-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-card-sku {
  font-family: monospace;
  font-size: 0.66rem;
  color: #94a3b8;
}
.pos-card-stock {
  font-size: 0.66rem;
  font-weight: 600;
}
.pos-card-stock.in-stock {
  color: #16a34a;
}
.pos-card-stock.low-stock {
  color: #d97706;
}
.pos-card-stock.empty-stock {
  color: #dc2626;
}
.pos-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 2px;
}
.pos-card-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.pos-in-cart-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pos-in-cart-pill.active {
  display: flex;
}

/* POS Cart / Receipt Pane */
.pos-cart-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-radius: 8px 8px 0 0;
}
.pos-cart-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pos-cart-items-wrap {
  padding: 8px 14px;
  max-height: 280px;
  overflow-y: auto;
  flex: 1;
}
.pos-cart-empty {
  text-align: center;
  padding: 30px 12px;
  color: var(--text-muted);
}
.pos-cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}
.pos-cart-row:last-child {
  border-bottom: none;
}
.pos-cart-item-info {
  flex: 1;
  min-width: 0;
}
.pos-cart-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-cart-item-sub {
  font-size: 0.72rem;
  color: #64748b;
}
.pos-cart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pos-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  height: 24px;
  background: #ffffff;
}
.pos-stepper-btn {
  width: 22px;
  height: 24px;
  border: none;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: background 0.1s ease;
}
.pos-stepper-btn:hover {
  background: #e2e8f0;
}
.pos-stepper-val {
  width: 28px;
  height: 24px;
  border: none;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  background: #ffffff;
  outline: none;
  padding: 0;
}
.pos-cart-subtotal {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  min-width: 65px;
}
.pos-del-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}
.pos-del-btn:hover {
  color: #ef4444;
}

/* POS Financial & Checkout Summary */
.pos-checkout-form {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}
.pos-checkout-box {
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 0 0 8px 8px;
}
.pos-total-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.pos-total-headline .label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
}
.pos-total-headline .amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

/* Destination Balance Selector */
.pos-dest-balance-wrap {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
}
.pos-dest-balance-wrap select {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}
.pos-dest-balance-wrap select:focus {
  border-color: #0f172a;
  outline: none;
  background-color: #ffffff;
}

/* Payment Method Buttons (Segmented Control) */
.pos-pay-methods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.pos-pay-btn {
  padding: 6px 2px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s ease;
  user-select: none;
}
.pos-pay-btn:hover {
  background: #f1f5f9;
}
.pos-pay-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Quick Cash Shortcuts */
.pos-cash-shortcuts {
  display: flex;
  gap: 4px;
}
.pos-cash-pill {
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: all 0.1s ease;
}
.pos-cash-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.pos-change-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  font-size: 0.78rem;
}
.pos-change-label {
  color: #64748b;
  font-weight: 500;
}
.pos-change-val {
  font-weight: 700;
}
.pos-change-val.ok {
  color: #16a34a;
}
.pos-change-val.kurang {
  color: #dc2626;
}

/* Customer Info Collapsible */
.pos-customer-collapse-wrap {
  margin-bottom: 8px;
}
.pos-customer-toggle-link {
  font-size: 0.74rem;
  color: #64748b;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.pos-customer-toggle-link:hover {
  color: #0f172a;
}
.pos-customer-fields {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px;
  margin-top: 6px;
}

/* Subtle Profit Preview */
.pos-profit-subtle {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
  padding: 2px 0;
}
.pos-profit-subtle:hover {
  color: #64748b;
}

/* Submit POS Button */
.pos-submit-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.pos-submit-btn:hover {
  background: #1e293b;
}
.pos-submit-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Custom Sleek Scrollbar for POS Panes */
.pos-cart-items-wrap::-webkit-scrollbar,
.pos-product-grid::-webkit-scrollbar,
.pos-checkout-box::-webkit-scrollbar {
  width: 5px;
}
.pos-cart-items-wrap::-webkit-scrollbar-thumb,
.pos-product-grid::-webkit-scrollbar-thumb,
.pos-checkout-box::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Mobile Floating Cart Summary Bar (Strictly Mobile Only) */
.pos-mobile-cart-bar {
  display: none !important;
  position: fixed;
  bottom: 65px;
  left: 12px;
  right: 12px;
  z-index: 99;
  background: #0f172a;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  justify-content: space-between;
  align-items: center;
  animation: slideUpMobileBar 0.2s ease;
  cursor: pointer;
}
@keyframes slideUpMobileBar {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.pos-mobile-cart-btn {
  background: #ffffff;
  color: #0f172a;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
}

/* ==========================================================================
   STRICT SEPARATION: DESKTOP WORKSTATION vs MOBILE TOUCH
   ========================================================================== */
@media (min-width: 992px) {
  .pos-container {
    height: calc(100vh - 145px);
    min-height: 520px;
    overflow: hidden;
    align-items: stretch;
    display: flex;
    gap: 16px;
    margin-top: 6px;
  }
  .pos-catalog-pane {
    flex: 1.45;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .pos-toolbar {
    flex-shrink: 0;
    margin-bottom: 8px;
  }
  .pos-category-scroll {
    flex-shrink: 0;
    margin-bottom: 8px;
  }
  .pos-product-grid {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: unset;
    padding-right: 4px;
    align-content: start;
  }
  .pos-cart-pane {
    flex: 1;
    min-width: 330px;
    max-width: 395px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: static;
    top: auto;
  }
  .pos-cart-header {
    flex-shrink: 0;
  }
  .pos-cart-items-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: unset;
    padding: 8px 12px;
  }
  .pos-checkout-form {
    flex-shrink: 0;
  }
  .pos-checkout-box {
    max-height: 380px;
    overflow-y: auto;
  }
  /* Desktop guarantees */
  .pos-mobile-close-btn {
    display: none !important;
  }
  .pos-mobile-cart-bar {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .pos-container {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 80px;
    height: auto;
    overflow: visible;
  }
  .pos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
  }
  .pos-search-box {
    flex: 1 1 100%;
    width: 100%;
  }
  .pos-search-box input {
    height: 42px;
    font-size: 16px !important; /* 16px prevents iOS Safari auto-zoom bug */
    border-radius: var(--radius-sm);
  }
  .pos-tool-btn {
    flex: 1;
    justify-content: center;
    height: 38px;
    font-size: 0.8rem;
    padding: 0 6px;
  }
  .pos-catalog-pane {
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    max-height: unset;
    overflow: visible;
  }
  .pos-cart-pane {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    width: 100%;
    z-index: 1000;
    border-radius: 0;
    background: #ffffff;
    display: none;
    overflow-y: auto;
  }
  .pos-cart-pane.mobile-active {
    display: flex;
    flex-direction: column;
  }
  .pos-cart-pane .pos-cart-header {
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .pos-cart-items-wrap {
    flex: 1;
    max-height: unset;
    overflow-y: visible;
  }
  .pos-mobile-cart-bar.is-visible {
    display: flex !important;
  }
  .pos-mobile-close-btn {
    display: inline-block !important;
  }
}

/* Printer Settings UI */
.printer-device-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

@media (min-width: 600px) {
  .printer-device-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.printer-device-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.printer-device-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.printer-device-meta {
  min-width: 0;
}

.printer-device-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  flex-wrap: wrap;
}

.printer-device-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.paper-selector {
  display: flex;
  gap: 8px;
}

.paper-selector-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  transition: all 0.15s ease;
  user-select: none;
}

.paper-selector-btn input[type="radio"] {
  accent-color: var(--primary);
  margin: 0;
  width: 15px;
  height: 15px;
}

.paper-selector-btn:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
