/* ==========================================================================
   Artadan Cell - Phone Service & Counter Management Design System
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #64748b;
  --success: #10b981;
  --success-dark: #059669;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --info: #0284c7;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --cyan: #06b6d4;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --sidebar-width: 250px;
  --header-height: 64px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

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

.menu-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  padding: 10px 12px 4px 12px;
  letter-spacing: 0.05em;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
  position: relative;
}

.menu-item i {
  font-size: 17px;
  opacity: 0.85;
}

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

.menu-item.active {
  background: var(--bg-sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.menu-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.menu-item-logout {
  color: #f87171 !important;
  margin-top: auto;
}

.menu-item-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
}

/* Header */
.top-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-main);
  cursor: pointer;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: #475569;
  font-weight: 500;
  border: 1px solid #e2e8f0;
}

/* Content Container */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* Flash Messages / Alerts */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #f0f9ff;
  color: #075985;
  border: 1px solid #bae6fd;
}

/* Dashboard Summary KPI Cards (Matching Wireframe Colors) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Colors matching wireframe: */
/* Unit Antre: Yellow / Amber */
.kpi-antre {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* Sedang Dikerjakan: Vibrant Blue */
.kpi-proses {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* Selesai: Teal / Green */
.kpi-selesai {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}

/* Pendapatan: Bright Emerald Green */
.kpi-pendapatan {
  background: linear-gradient(135deg, #059669, #047857);
}

.kpi-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.95;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}

/* Financial 3 Cards (Laporan Keuangan Wireframe) */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.fin-card {
  border-radius: var(--radius-md);
  padding: 20px 24px;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  position: relative;
}

.fin-omzet {
  background: linear-gradient(135deg, #10b981, #059669);
}

.fin-hpp {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.fin-laba {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.fin-card-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.95;
}

.fin-card-amount {
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
}

/* Card Container */
.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 22px;
}

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

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

.table-modern th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-modern td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 13.5px;
  vertical-align: middle;
}

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

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

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

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-purple {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-teal {
  background: #ccfbf1;
  color: #115e59;
}

.badge-cyan {
  background: #cffafe;
  color: #155e75;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
}

.nota-pill {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 600;
  font-size: 12.5px;
  background: #f1f5f9;
  color: #1e293b;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 15px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

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

.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-secondary {
  background: #ffffff;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background: #f8fafc;
  color: #1e293b;
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #1ebc59;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  font-size: 13.5px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.input-prefix-group {
  display: flex;
  position: relative;
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-right: none;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
}

.input-prefix-group .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Special Highlight Boxes (matching Wireframe Kasir Pelunasan) */
.pelunasan-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
}

.tagihan-highlight {
  background: #fff1f2;
  border: 2px solid #fecdd3;
  color: #be123c;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
}

.tagihan-highlight-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tagihan-highlight-amount {
  font-size: 26px;
  font-weight: 800;
}

.kembalian-highlight {
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
}

.kembalian-highlight-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.kembalian-highlight-amount {
  font-size: 28px;
  font-weight: 800;
  color: #34d399;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.22s ease-out;
  overflow: hidden;
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
}

.modal-close:hover {
  color: #1e293b;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Public Tracking Styles */
.tracking-wrapper {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px;
}

.stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 35px 0;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 8px;
  transition: all 0.25s ease;
}

.step-item.active .step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.step-item.completed .step-circle {
  border-color: var(--success);
  background: var(--success);
  color: #ffffff;
}

.step-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

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

/* Thermal Receipt Print Styles */
.thermal-receipt {
  width: 320px;
  margin: 20px auto;
  background: #ffffff;
  padding: 20px 16px;
  border: 1px dashed #cbd5e1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12.5px;
  color: #000000;
}

.thermal-receipt hr {
  border: none;
  border-top: 1px dashed #475569;
  margin: 10px 0;
}

.thermal-header {
  text-align: center;
  margin-bottom: 12px;
}

.thermal-title {
  font-size: 16px;
  font-weight: bold;
}

.thermal-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Media Print */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .sidebar, .top-header, .no-print, .btn, .modal-overlay {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .thermal-receipt {
    width: 100% !important;
    max-width: 80mm !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-page-a4 {
    padding: 20px !important;
    border: none !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .finance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.col-span-2 {
    grid-column: span 1;
  }
  .page-content {
    padding: 16px;
  }
}

/* ==========================================================================
   Pagination Component (Clean, Compact, Responsive)
   ========================================================================== */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

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

.pagination-bold {
  font-weight: 700;
  color: var(--text-main);
}

.pagination-list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.pagination-item {
  display: inline-flex;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  line-height: 1;
}

.pagination-prev-next {
  padding: 0 12px;
  font-size: 12.5px;
}

.pagination-btn i {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
}

.pagination-btn:hover:not(.pagination-dots) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--primary);
}

.pagination-item.active .pagination-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  cursor: default;
}

.pagination-item.disabled .pagination-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.65;
}

.pagination-dots {
  border: none;
  background: transparent;
  cursor: default;
  min-width: 20px;
  padding: 0;
}

/* Safety rule for any legacy or vendor pagination SVG */
nav[role="navigation"] svg,
.pagination svg,
svg.w-5.h-5 {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* ==========================================================================
   Mobile-First & Responsive Enhancements (Phones, Tablets & Small Screens)
   ========================================================================== */

/* Drawer Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Close Button (Mobile Only) */
.sidebar-close-btn {
  display: none;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ffffff;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -3px 12px rgba(15, 23, 42, 0.08);
  z-index: 990;
  padding: 0 6px env(safe-area-inset-bottom, 0px) 6px;
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 58px;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-nav-link,
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  min-width: 58px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link i {
  font-size: 20px;
  line-height: 1;
}

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

.mobile-nav-link-cta {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: var(--radius-md);
  height: 44px;
  padding: 0 12px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}

.mobile-nav-link-cta i {
  font-size: 18px;
}

.mobile-nav-link-cta:active {
  transform: scale(0.96);
}

/* Responsive Component Grids */
.non-services-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.non-services-layout-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

.finance-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.whatsapp-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.whatsapp-chat-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.cashier-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.detail-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar-container {
  padding: 16px 22px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.filter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.filter-select-box {
  width: 170px;
}

/* ==========================================================================
   Breakpoints & Media Queries
   ========================================================================== */

/* 1. Medium Tablets & Small Desktops (<= 992px) */
@media (max-width: 992px) {
  body.sidebar-open {
    overflow: hidden !important;
    touch-action: none;
  }

  /* Off-canvas drawer sidebar */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    max-width: 85vw;
    z-index: 1050;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  .sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.45);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
  }

  .mobile-toggle:hover {
    background: #f1f5f9;
  }

  /* Layout grids collapsing to 1 column */
  .non-services-layout-grid,
  .finance-tables-grid,
  .whatsapp-settings-grid,
  .whatsapp-chat-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }

  .non-services-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }
}

/* 2. Mobile Landscape & Portrait (<= 768px) */
@media (max-width: 768px) {
  /* Prevent iOS Safari intrusive auto-zoom on form focus */
  .form-control,
  select.form-control,
  input.form-control,
  textarea.form-control {
    font-size: 16px !important;
  }

  /* Bottom Nav visible on mobile phones */
  .mobile-bottom-nav {
    display: block;
  }

  .main-wrapper {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 12px)) !important;
  }

  /* Header adjustments */
  .top-header {
    padding: 0 14px !important;
    height: 56px !important;
  }

  .page-title {
    font-size: 17px !important;
  }

  .page-content {
    padding: 14px 12px !important;
  }

  /* Compact Cards */
  .card {
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
  }

  .card-header {
    padding: 12px 14px !important;
    flex-wrap: wrap;
    gap: 10px;
  }

  .card-body {
    padding: 14px !important;
  }

  /* Grids */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-group.col-span-2 {
    grid-column: span 1 !important;
  }

  .finance-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .cashier-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Quick action buttons on mobile */
  .dashboard-quick-actions a,
  .dashboard-quick-actions button {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    padding: 10px 12px;
    font-size: 12.5px;
    justify-content: center;
  }

  /* Filter form on mobile */
  .filter-bar-container {
    padding: 12px 14px !important;
  }

  .filter-search-box {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }

  .filter-select-box {
    flex: 1 1 calc(50% - 6px) !important;
    width: auto !important;
  }

  /* Tables with smooth touch scrolling */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
    margin: 0;
  }

  .table-modern th {
    padding: 10px 12px !important;
    font-size: 11.5px !important;
  }

  .table-modern td {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
  }

  /* Mobile Modals */
  .modal-overlay {
    padding: 10px;
  }

  .modal-container {
    max-width: 100% !important;
    max-height: 92vh !important;
    overflow-y: auto;
  }

  /* Touch-friendly buttons (min 42px touch target) */
  .btn {
    min-height: 40px;
    padding: 8px 14px;
  }

  .btn-sm {
    min-height: 34px;
    padding: 5px 10px;
  }

  /* Detail Action Buttons full-width / wrapping cleanly */
  .detail-action-buttons {
    width: 100%;
  }

  .detail-action-buttons .btn,
  .detail-action-buttons form {
    flex: 1 1 calc(50% - 4px);
  }

  .detail-action-buttons form .btn {
    width: 100%;
  }
}

/* 3. Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .date-badge {
    display: none !important;
  }

  .admin-name-text {
    display: none !important;
  }

  .kpi-card {
    padding: 12px 14px !important;
    min-height: 85px !important;
  }

  .kpi-value {
    font-size: 18px !important;
  }

  .kpi-title {
    font-size: 10px !important;
  }

  .fin-card-amount {
    font-size: 24px !important;
  }

  .dashboard-quick-actions a,
  .dashboard-quick-actions button {
    flex: 1 1 100% !important;
  }

  .filter-select-box {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  /* Stepper Public Tracking - Convert into vertical flow on small screens */
  .stepper {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin: 20px 0 !important;
    padding-left: 6px;
  }

  .stepper::before {
    top: 14px !important;
    bottom: 14px !important;
    left: 24px !important;
    right: auto !important;
    width: 3px !important;
    height: calc(100% - 28px) !important;
  }

  .step-item {
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    text-align: left !important;
    width: 100% !important;
  }

  .step-circle {
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .step-title {
    font-size: 13px !important;
  }
}

