/* ==========================================================================
   CHARGELOG DESIGN SYSTEM & STYLESHEET (MOBILE OPTIMIZED)
   Aesthetics: Deep Dark Theme, Glassmorphism, Neon Cyber Gradient Accents
   ========================================================================== */

/* --- Design Variables --- */
:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-accent: 'Outfit', sans-serif;

  /* Color Palette */
  --bg-app: #080c10;
  --bg-gradient: linear-gradient(135deg, #06090e 0%, #0c121c 100%);
  --bg-sidebar: rgba(13, 17, 23, 0.85);
  --bg-card: rgba(22, 30, 44, 0.45);
  --bg-card-hover: rgba(28, 39, 58, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-focus: rgba(0, 242, 254, 0.4);
  
  /* Accent Colors */
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-green: #05ffc4;
  --accent-green-dark: #00c853;
  --accent-indigo: #7000ff;
  --accent-pink: #ff007f;
  
  /* Text Colors */
  --text-main: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #586069;
  
  /* Glow Shadows */
  --glow-cyan: 0 0 15px rgba(0, 242, 254, 0.35);
  --glow-green: 0 0 15px rgba(5, 255, 196, 0.35);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
  
  /* Safe Area variables for iPhone & modern Android models */
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
}

/* --- Base Reset --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* --- App Layout Structures --- */
#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Hide / Show Utilities for Devices */
.desktop-only {
  display: block !important;
}
.mobile-only {
  display: none !important;
}

/* --- Authentication View --- */
#auth-screen {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0f1a2e 0%, #05080f 100%);
  z-index: 100;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
  margin: 20px;
}

.auth-header {
  margin-bottom: 30px;
}

.logo-wrapper {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.1);
}

.logo-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0px 0px 8px rgba(0, 242, 254, 0.6));
}

.auth-header h1 {
  font-family: var(--font-accent);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 30px;
  padding: 4px;
  margin-bottom: 30px;
  border: 1px solid var(--border-glass);
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-tab.active {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  color: #05080f;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.auth-form.hidden {
  display: none;
}

.auth-notification {
  margin-top: 20px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-notification.success {
  background: rgba(5, 255, 196, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.auth-notification.error {
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid var(--accent-pink);
  color: var(--accent-pink);
}

/* --- Main Dashboard Layout --- */
#main-app {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

/* --- Mobile Header Elements (Hidden on Desktop) --- */
.mobile-header-bar {
  display: none;
}

/* --- Sidebar Menu (Desktop only) --- */
#sidebar {
  width: 280px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 90;
  transition: var(--transition-smooth);
}

.sidebar-header {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.logo-icon-small {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.4));
}

.brand-name {
  font-family: var(--font-accent);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(120deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(79, 172, 254, 0.12);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.nav-item.active .nav-icon {
  color: var(--accent-cyan);
}

.badge {
  background: var(--accent-pink);
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(255, 0, 127, 0.4);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-glass);
}

.user-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 12px;
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-blue) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  box-shadow: 0 0 10px rgba(112, 0, 255, 0.3);
}

.user-text {
  flex-grow: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(255, 0, 127, 0.1);
  color: var(--accent-pink);
}

.logout-btn svg {
  width: 18px;
  height: 18px;
}

/* --- Content Stage --- */
#app-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

/* --- View Header (Desktop only) --- */
.main-header {
  height: 80px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 80;
}

.header-titles h2 {
  font-family: var(--font-accent);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-titles p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-gradient {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #06090e;
  border: none;
  font-weight: 700;
  box-shadow: var(--glow-cyan);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.55);
}

/* --- View Sections Stage --- */
.view-stage {
  padding: 32px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-view {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-view.active {
  display: flex;
}

/* --- Dashboard Grid & Cards --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.bg-blue {
  background: rgba(79, 172, 254, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(79, 172, 254, 0.3);
}

.bg-green {
  background: rgba(5, 255, 196, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(5, 255, 196, 0.3);
}

.card-body {
  padding: 24px;
}

.metric-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.metric-row:last-child {
  margin-bottom: 0;
}

.metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.value {
  font-family: var(--font-accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.highlight-cyan {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.highlight-green {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(5, 255, 196, 0.2);
}

.card-divider {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 16px 0;
}

.main-metric .value {
  font-size: 1.7rem;
}

/* --- Accumulated Stats (6 Months) Card --- */
.stats-accumulated-card {
  background: linear-gradient(135deg, rgba(22, 30, 44, 0.45) 0%, rgba(13, 20, 31, 0.6) 100%);
  border-left: 4px solid var(--accent-cyan);
}

.flex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stats-icon {
  width: 28px;
  height: 28px;
}

.text-cyan { color: var(--accent-cyan); }

.grid-three-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.accumulated-metric {
  padding: 16px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.acc-val-wrapper {
  display: flex;
  align-items: baseline;
}

.acc-value {
  font-family: var(--font-accent);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.font-gradient-green {
  background: linear-gradient(to right, var(--accent-green), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.font-gradient-cyan {
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.font-gradient-indigo {
  background: linear-gradient(to right, #a05cff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Recharges Table View --- */
.recent-recharges-card {
  flex-grow: 1;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  background: rgba(0, 0, 0, 0.1);
}

.data-table tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-danger { color: var(--accent-pink); }
.pad-top { padding-top: 32px; }

/* --- Invoices Section Layout --- */
.grid-two-cols {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

.grid-two-cols-tight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.flex-vertical {
  display: flex;
  flex-direction: column;
}

.flex-grow {
  flex-grow: 1;
}

.scrollable-content {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Scrollbar customization */
.scrollable-content::-webkit-scrollbar,
#sidebar-nav::-webkit-scrollbar,
#app-content::-webkit-scrollbar {
  width: 6px;
}
.scrollable-content::-webkit-scrollbar-thumb,
#sidebar-nav::-webkit-scrollbar-thumb,
#app-content::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}
.scrollable-content::-webkit-scrollbar-thumb:hover,
#sidebar-nav::-webkit-scrollbar-thumb:hover,
#app-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.invoices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invoice-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.invoice-item-card:hover {
  border-color: var(--accent-blue);
  background: rgba(79, 172, 254, 0.04);
}

.invoice-item-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.invoice-item-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.invoice-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.invoice-item-actions {
  display: flex;
  gap: 10px;
}

.invoice-attachment-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-green);
  cursor: pointer;
  font-weight: 500;
}

/* --- Forms & Input Elements --- */
form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 16px; /* 16px prevents iOS Safari autofill zooming, perfect touch */
  height: 48px; /* Safe touch target height */
  transition: var(--transition-fast);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-cyan);
}

.checkbox-group label {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* File Upload Mock Style */
.file-upload-wrapper {
  position: relative;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

#file-preview-indicator {
  font-size: 0.78rem;
  color: var(--accent-green);
  margin-top: 6px;
  font-weight: 600;
}

/* --- Button Styling --- */
.btn {
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px; /* Touch target standard */
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--accent-blue);
  color: #06090e;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.btn-danger {
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid rgba(255, 0, 127, 0.3);
  color: var(--accent-pink);
}

.btn-danger:hover {
  background: var(--accent-pink);
  color: white;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.btn-group-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-group-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-icon-left svg {
  margin-right: 4px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  height: auto;
}

/* --- Export Page Accents --- */
.max-width-md {
  max-width: 500px;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.section-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.export-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-cyan);
}

/* --- System Configuration Panel --- */
.config-options-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.config-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.option-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.option-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-indicator-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator-tag.green {
  background: rgba(5, 255, 196, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(5, 255, 196, 0.2);
}

.status-indicator-tag.green::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

/* --- Admin Panel --- */
.special-admin-tab.active {
  background: rgba(255, 0, 127, 0.12);
  color: var(--accent-pink);
  border-left: 3px solid var(--accent-pink);
}

.badge-pending {
  background: rgba(255, 179, 0, 0.15);
  color: #ffb300;
  border: 1px solid rgba(255, 179, 0, 0.3);
}

.badge-approved {
  background: rgba(5, 255, 196, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(5, 255, 196, 0.3);
}

/* --- Dialog Modals (Centered Desktop Box) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 12, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-glass);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--font-accent);
  font-size: 1.25rem;
  font-weight: 700;
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 8px;
}

.close-modal-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  margin-top: 24px;
}

/* Attachment View Modal Content */
.attachment-modal-content {
  max-width: 600px;
}

.invoice-proof-img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.mock-pdf-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border-glass);
  color: var(--text-secondary);
}

.pdf-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: var(--accent-pink);
}

/* --- Glassmorphism Glass Class Utility --- */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--border-glass);
}

/* --- Utility Hidden Class --- */
.hidden {
  display: none !important;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}

.toast {
  background: rgba(13, 20, 31, 0.95);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  min-width: 300px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.toast-success {
  border-left-color: var(--accent-green);
}

.toast.toast-error {
  border-left-color: var(--accent-pink);
}

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
}

.toast-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding-left: 10px;
}

.toast-close:hover {
  color: var(--text-main);
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpMobile {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideDownMobile {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-pulse {
  animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* ==========================================================================
   MOBILE-FIRST SCREEN ADAPTATIONS & MEDIAS
   Matches Android devices, iPhones (SE, Pro, Pro Max models)
   ========================================================================== */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
  
  #app-container {
    flex-direction: column;
  }

  #main-app {
    flex-direction: column;
  }

  /* --- Top Sticky Mobile Bar --- */
  .mobile-header-bar {
    display: flex;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    padding: 0 16px;
    padding-top: var(--sat); /* Offset for system status notch */
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    z-index: 100;
  }

  .mobile-logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-title {
    font-family: var(--font-accent);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(120deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .mobile-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-logout-btn svg {
    width: 22px;
    height: 22px;
  }

  /* --- Hide Desktop Sidebar --- */
  #sidebar {
    display: none !important;
  }

  /* --- Hide Desktop Header --- */
  .main-header {
    display: none !important;
  }

  /* --- View Stage Adjustments --- */
  .view-stage {
    padding: 16px;
    padding-bottom: calc(85px + var(--sab)); /* Bottom padding offsets bottom navigation + safe area notch */
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .grid-two-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .grid-three-cols {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* --- Mobile Modals at the Top --- */
  .modal-overlay {
    align-items: flex-start; /* Align sheet to the top */
    padding-top: max(20px, var(--sat));
  }

  .modal-content {
    width: 92%;
    max-width: 450px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    animation: slideDownMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: 16px;
  }

  /* --- Floating Action Button (FAB) --- */
  .mobile-fab {
    display: flex !important;
    position: fixed;
    bottom: calc(75px + var(--sab)); /* Sits right above bottom bar */
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    z-index: 95;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
    cursor: pointer;
  }

  .mobile-fab svg {
    width: 24px;
    height: 24px;
    color: #06090e;
  }

  /* --- Bottom Navigation Tab Bar --- */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(65px + var(--sab)); /* Symmetrical height covering system notch */
    background: rgba(13, 20, 30, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-glass);
    z-index: 100;
    padding-bottom: var(--sab);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
  }

  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .bottom-nav-item.active {
    color: var(--accent-cyan);
  }
  
  .bottom-nav-item.active svg {
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.4));
  }

  /* --- Mobile Card List Layout for Recharge History --- */
  .recharges-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .recharge-mobile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .rec-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
  }

  .rec-card-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .rec-card-cost {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    font-weight: 800;
  }

  .rec-card-metrics {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .rec-card-odo {
    font-size: 0.9rem;
    font-weight: 600;
  }

  .rec-card-efficiency {
    font-size: 0.8rem;
    color: var(--accent-green);
  }

  .rec-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.04);
  }

  /* Toast Container Offset for Bottom Nav */
  .toast-container {
    bottom: calc(75px + var(--sab));
    right: 16px;
    left: 16px;
  }
  .toast {
    min-width: auto;
  }
}
