/* ==========================================================================
   FamGateway Master Unified Design System (Soft-Blue Neo-Brutalist Theme)
   Identical to the Checkout & Payment Page Style
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --paper: #f0f4f8;
  --white: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-shadow: #60a5fa;
  --blue-bg: #eff6ff;
  --blue-border: #93c5fd;
  --blue-border-subtle: #bfdbfe;
  --blue-head: #dbeafe;
  --accent-yellow: #ffad00;
  --accent-green: #10b981;
  --accent-rose: #ef4444;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --dark-line: rgba(15, 23, 42, .12);
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--paper) !important;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Background Grid Pattern like Payment Page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.45;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(96, 165, 250, .35) 1px, transparent 1px), 
    linear-gradient(90deg, rgba(96, 165, 250, .35) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: -1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
  background: #93c5fd;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}

a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }

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

/* Sidebar Navigation (Deep Navy #0b1329) */
.sidebar {
  width: 260px;
  background-color: #0b1329 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 24px 16px;
  box-shadow: 4px 0 20px rgba(11, 19, 41, 0.4);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 22px;
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand img {
  height: 26px;
  width: auto;
  display: block;
}

.sidebar-brand-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid #60a5fa;
  color: #93c5fd;
  padding: 3px 8px;
  border-radius: 99px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

.sidebar-link svg {
  color: #64748b;
  transition: color 0.2s ease;
}

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

.sidebar-link:hover svg {
  color: #60a5fa;
}

.sidebar-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.1));
  border-left: 3px solid #3b82f6;
  font-weight: 700;
}

.sidebar-link.active svg {
  color: #60a5fa;
}

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

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffad00;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

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

.user-email {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: transparent;
  color: #94a3b8;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 34px 40px 80px;
  max-width: 1320px;
}

/* Header & Breadcrumbs */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title h1 {
  font-size: 27px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.page-title p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}

/* Common Buttons (Neo-Brutalist Solid Offset Shadow) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  border: 1px solid var(--primary-hover);
  box-shadow: 4px 4px 0 #1d4ed8;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #1e40af;
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1e40af;
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink) !important;
  border: 1px solid var(--blue-border-subtle);
  box-shadow: 3px 3px 0 var(--blue-border-subtle);
}

.btn-secondary:hover {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--blue-border);
}

.btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--blue-border);
}

.btn-success {
  background: #10b981;
  color: #ffffff !important;
  border: 1px solid #059669;
  box-shadow: 3px 3px 0 #047857;
}

.btn-success:hover {
  background: #059669;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #047857;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff !important;
  border: 1px solid #dc2626;
  box-shadow: 3px 3px 0 #b91c1c;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #991b1b;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--blue-border);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--primary-shadow);
  border-color: var(--primary);
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -1px;
  line-height: 1.1;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card Container (Neo-Brutalist Soft-Blue Window) */
.card {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: 8px 9px 0 var(--primary-shadow);
  position: relative;
}

/* Mac OS Style Window Head (Identical to pay.html) */
.product-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  background: #dbeafe;
}

.product-head span {
  color: #475569;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.product-head .live-badge {
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-head .live-badge i {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.dots {
  display: flex;
  gap: 6px;
}

.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dots i:nth-child(1) { background: #ef4444; }
.dots i:nth-child(2) { background: #eab308; }
.dots i:nth-child(3) { background: #22c55e; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--blue-border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}

/* Data Table Component */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--blue-border-subtle);
  border-radius: 10px;
}

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

.data-table th {
  padding: 12px 16px;
  color: #475569;
  background: #dbeafe;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--blue-border-subtle);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink);
  vertical-align: middle;
}

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

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-pending {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-expired {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--ink);
  font-size: 13.5px;
  transition: all 0.2s ease;
}

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

/* Custom Select Dropdown */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

.form-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
}

/* Guide Banner */
.guide-banner {
  background: #eff6ff;
  border: 1px solid var(--blue-border);
  box-shadow: 6px 6px 0 var(--primary-shadow);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Cashier Grid & Cards */
.cashier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.cashier-card {
  background: #ffffff;
  border: 1px solid var(--blue-border);
  box-shadow: 6px 6px 0 var(--blue-border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all 0.2s ease;
  position: relative;
}

.cashier-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--primary-shadow);
  border-color: var(--primary);
}

.cashier-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

/* Modals (Neo-Brutalist Window) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #eff6ff;
  border: 2px solid var(--blue-border);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px;
  box-shadow: 14px 15px 0 var(--primary-shadow);
  transform: translateY(15px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.modal-close {
  background: #ffffff;
  border: 1px solid var(--blue-border-subtle);
  color: var(--muted);
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--blue-border);
  background: #dbeafe;
}

/* Mobile App Bar */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #0b1329;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
}

.mobile-topbar-brand img {
  height: 24px;
  width: auto;
  display: block;
}

.mobile-hamburger-btn {
  background: transparent;
  color: #ffffff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.mobile-hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Backdrop Overlay for mobile drawer */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 41, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN RULES
   ========================================================================== */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .mobile-topbar {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  .sidebar.mobile-open,
  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 22px 18px 60px;
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-header > div:last-child > * {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    box-shadow: 4px 4px 0 var(--blue-border);
  }

  .stat-value {
    font-size: 26px;
  }

  .card {
    box-shadow: 6px 6px 0 var(--primary-shadow);
    padding: 20px 16px;
  }

  .modal-box {
    box-shadow: 8px 8px 0 var(--primary-shadow);
  }
}

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

  .page-title h1 {
    font-size: 23px;
  }

  .btn {
    padding: 9px 14px;
    font-size: 13px;
  }
}
