/* Modern Dark Theme Design System */
:root {
  --font-primary: 'Outfit', 'Plus Jakarta Sans', -apple-system, sans-serif;

  /* Color Palette */
  --bg-app: #090d16;
  --bg-surface: rgba(30, 41, 59, 0.45);
  --bg-surface-solid: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent Colors */
  --color-electricity: #3b82f6;
  --color-pdam: #06b6d4;
  --color-fuel: #f59e0b;
  --color-cng: #f43f5e;
  --color-accent: #8b5cf6;
  --color-success: #10b981;
  --color-danger: #ef4444;

  /* UI Components config */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  --glass-blur: blur(16px);
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Helpers */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Premium Glassmorphic Panels */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Buttons */
.btn {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  background: linear-gradient(135deg, #10b981, #047857);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  padding: 12px;
}

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

/* Forms styling */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 15px;
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  background: rgba(0, 0, 0, 0.35);
}

.input-helper {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-help-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

/* Form layouts */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-electricity);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

/* 1. AUTH SCREEN */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at 10% 20%, rgba(29, 78, 216, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 45%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  animation: fadeIn 0.4s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
}

.auth-links a {
  color: var(--color-electricity);
  text-decoration: none;
  transition: opacity 0.2s;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-links span {
  color: var(--text-muted);
}

/* 2. APP VIEW */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* App Header */
.app-header {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin: 16px;
  border-radius: var(--radius-md);
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.app-body {
  display: flex;
  flex: 1;
  position: relative;
}

.app-sidebar {
  width: 270px;
  margin: 0 0 16px 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 100;
}

.sidebar-hidden .app-sidebar {
  margin-left: -286px;
  opacity: 0;
  pointer-events: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-icon {
  color: currentColor;
  flex-shrink: 0;
  width: 22px !important;
  height: 22px !important;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-details {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--color-electricity);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* App Content Area */
.app-content {
  flex: 1;
  padding: 0 16px 16px 16px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Global Date Range Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.filter-title {
  font-weight: 600;
  font-size: 11px;
}

.filter-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-inline label {
  margin-bottom: 0;
  font-size: 10px;
}

.input-inline input {
  padding: 2px 4px;
  width: 105px;
  font-size: 10px;
  cursor: pointer;
  text-align: center;
}

.input-inline-wrapper {
  position: relative;
  display: inline-block;
}

.input-inline-wrapper input[type="date"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}

.input-inline-wrapper input[type="text"] {
  position: relative;
  z-index: 1;
}

.filter-bar .btn {
  padding: 4px 8px;
  font-size: 10px;
}

/* Pages routing style */
.app-page {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.app-page.active {
  display: block;
}

/* 3. DASHBOARD PAGE STYLE */
/* Revenue Summary Bar */
.revenue-summary-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.rev-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-val {
  font-size: 16px;
  font-weight: 700;
}

.rev-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
}

.rev-stat.highlight .stat-val {
  color: var(--color-accent);
}

/* Metrics Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metric-card {
  display: flex;
  padding: 16px;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.border-electricity {
  border-left: 4px solid var(--color-electricity);
}

.border-pdam {
  border-left: 4px solid var(--color-pdam);
}

.border-fuel {
  border-left: 4px solid var(--color-fuel);
}

.border-cng {
  border-left: 4px solid var(--color-cng);
}

.card-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.font-electricity {
  color: var(--color-electricity);
}

.font-pdam {
  color: var(--color-pdam);
}

.font-fuel {
  color: var(--color-fuel);
}

.font-cng {
  color: var(--color-cng);
}

.card-info {
  flex: 1;
}

.card-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Cost-to-revenue Progress Bar */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease-in-out;
}

.bg-electricity {
  background: var(--color-electricity);
}

.bg-pdam {
  background: var(--color-pdam);
}

.bg-fuel {
  background: var(--color-fuel);
}

.bg-cng {
  background: var(--color-cng);
}

/* 4. TABLES & LOGS PAGES */
.page-action-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.table-container {
  padding: 20px;
}

.table-header-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.responsive-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.data-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-morning {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-electricity);
}

.badge-evening {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-fuel);
}

.badge-night {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-accent);
}

.badge-scheduled {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-electricity);
}

.badge-completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.badge-overdue {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.badge-cancelled {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}


/* Mobile logs cards (used instead of table on small screens) */
.mobile-logs-list {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.mobile-log-card {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.mobile-card-title {
  font-weight: 600;
  font-size: 14px;
}

.mobile-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 12px;
}

.mobile-card-row-full {
  grid-column: span 2;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 6px;
  margin-top: 4px;
}

.m-label {
  color: var(--text-secondary);
}

.m-val {
  font-weight: 500;
}

.m-cost {
  color: var(--color-electricity);
  font-weight: 600;
}

/* 5. MODAL POPUPS STYLE */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.3s ease-out;
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-card.modal-sm {
  max-width: 400px;
}

.modal-card.modal-compact {
  max-width: 540px;
}

.modal-compact .modal-body {
  padding: 12px 20px;
}

.modal-compact .modal-header {
  padding: 14px 20px;
}

.modal-compact .modal-footer {
  padding: 12px 20px;
}

.modal-compact .form-group {
  margin-bottom: 10px;
}

.modal-compact label {
  font-size: 12px;
  margin-bottom: 4px;
}

.modal-compact input[type="text"],
.modal-compact input[type="number"],
.modal-compact input[type="date"],
.modal-compact input[type="time"],
.modal-compact input[type="datetime-local"],
.modal-compact select,
.modal-compact textarea {
  padding: 12px 14px;
  font-size: 14px;
}

.modal-compact .form-section-title {
  margin: 12px 0 6px 0;
  font-size: 11px;
  padding-bottom: 2px;
}

.modal-compact .input-helper {
  font-size: 10px;
  margin-top: 2px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
}

.scroll-y {
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Admin limits helper */
.admin-only.hidden {
  display: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success {
  background: #059669;
  border-left: 4px solid #10b981;
}

.toast-error {
  background: #b91c1c;
  border-left: 4px solid #ef4444;
}

.toast-info {
  background: #1e3a8a;
  border-left: 4px solid #3b82f6;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 6. RESPONSIVE DESIGN - MEDIA QUERIES */

/* For Tablet / Small Desktop (max 1024px) */
@media (max-width: 1024px) {
  .app-header {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
  }

  .app-sidebar {
    position: fixed;
    height: calc(100vh - 90px);
    top: 74px;
    left: 0;
    margin-left: -280px;
  }
  body:not(.sidebar-hidden) .app-sidebar {
    margin-left: 16px;
    box-shadow: var(--shadow-lg);
  }
}

/* For Mobile Devices (max 768px) */
@media (max-width: 768px) {
  .form-row-2,
  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Prevent full collapsing of columns in compact modals on mobile */
  .modal-compact .form-row-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  
  .modal-compact .form-row-3 {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
  }
  
  .modal-compact .form-row-4 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
  
  /* Additional vertical shrinkage on mobile */
  .modal-compact .modal-body {
    padding: 10px 16px !important;
  }
  
  .modal-compact .form-group {
    margin-bottom: 8px !important;
  }
  
  .modal-compact label {
    font-size: 11px !important;
    margin-bottom: 2px !important;
  }
  
  .modal-compact input[type="text"],
  .modal-compact input[type="number"],
  .modal-compact input[type="date"],
  .modal-compact input[type="time"],
  .modal-compact input[type="datetime-local"],
  .modal-compact select,
  .modal-compact textarea {
    padding: 12px 12px !important;
    font-size: 14px !important;
  }
  
  .modal-compact .form-section-title {
    margin: 8px 0 4px 0 !important;
    font-size: 10px !important;
    padding-bottom: 1px !important;
  }
  
  .modal-compact .modal-header {
    padding: 10px 16px !important;
  }
  
  .modal-compact .modal-header h2 {
    font-size: 15px !important;
  }
  
  .modal-compact .modal-footer {
    padding: 10px 16px !important;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .filter-inputs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .input-inline {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .input-inline input {
    width: 105px;
  }

  .revenue-summary-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    text-align: center;
  }

  .rev-divider {
    width: 100%;
    height: 1px;
  }

  /* Swap table for card views on mobile, but keep admin table visible */
  .responsive-table-wrapper {
    display: none;
  }

  #page-admin .responsive-table-wrapper {
    display: block;
  }

  .mobile-logs-list {
    display: flex;
  }

  .modal-overlay {
    padding: 8px !important;
  }

  .modal-card {
    max-height: 80vh;
    max-height: 80dvh;
  }

  .app-header {
    margin: 8px;
    padding: 12px;
  }

  .app-content {
    padding: 0 8px 8px 8px;
  }
}

/* Inventory Page Styles */
.inventory-grid {
  margin-top: 16px;
}

.inventory-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.inventory-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

.inventory-card-photo-wrapper {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.inventory-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-card-no-photo {
  font-size: 32px;
  opacity: 0.3;
}

.inventory-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.inventory-card-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.inventory-card-stock {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.inventory-card-stock-val {
  font-size: 15px;
  font-weight: 700;
}

.inventory-card-stock-val.stock-low {
  color: var(--color-danger);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.inventory-card-stock-val.stock-good {
  color: var(--color-success);
}

.inventory-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.inventory-card-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-inv-add {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-inv-add:hover {
  background: var(--color-success);
  color: #fff;
}

.btn-inv-take {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-inv-take:hover {
  background: var(--color-danger);
  color: #fff;
}

.inventory-card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-danger);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  z-index: 10;
}

.inventory-card-delete-btn:hover {
  background: var(--color-danger);
  color: #fff;
  transform: scale(1.1);
}

/* Global Loading Overlay */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.global-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gear-spinner {
  width: 64px;
  height: 64px;
  animation: spin 3s linear infinite;
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.4));
}

.loader-text {
  color: var(--text-primary, #f8fafc);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}