/* Shopify Polaris-inspired Admin Panel Styles */

:root {
  /* Primary Colors */
  --p-color-bg: #f6f6f7;
  --p-color-bg-surface: #ffffff;
  --p-color-bg-surface-secondary: #f6f6f7;
  --p-color-bg-surface-hover: #f1f2f3;
  --p-color-bg-surface-selected: #f2f7fe;

  /* Brand Colors */
  --p-color-bg-primary: #008060;
  --p-color-bg-primary-hover: #006e52;
  --p-color-bg-primary-active: #005c45;

  /* Status Colors */
  --p-color-bg-success: #aee9d1;
  --p-color-bg-success-strong: #008060;
  --p-color-bg-warning: #ffea8a;
  --p-color-bg-warning-strong: #b98900;
  --p-color-bg-critical: #fed3d1;
  --p-color-bg-critical-strong: #d72c0d;
  --p-color-bg-info: #a4e8f2;
  --p-color-bg-info-strong: #00a0ac;

  /* Text Colors */
  --p-color-text: #202223;
  --p-color-text-secondary: #6d7175;
  --p-color-text-disabled: #8c9196;
  --p-color-text-inverse: #ffffff;
  --p-color-text-success: #008060;
  --p-color-text-warning: #b98900;
  --p-color-text-critical: #d72c0d;
  --p-color-text-info: #00a0ac;

  /* Border Colors */
  --p-color-border: #e1e3e5;
  --p-color-border-hover: #c9cccf;
  --p-color-border-success: #008060;
  --p-color-border-warning: #b98900;
  --p-color-border-critical: #d72c0d;

  /* Shadows */
  --p-shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.05);
  --p-shadow-md: 0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px rgba(63, 63, 68, 0.15);
  --p-shadow-lg: 0 0 0 1px rgba(63, 63, 68, 0.05), 0 4px 12px rgba(0, 0, 0, 0.15);

  /* Spacing */
  --p-space-1: 4px;
  --p-space-2: 8px;
  --p-space-3: 12px;
  --p-space-4: 16px;
  --p-space-5: 20px;
  --p-space-6: 24px;
  --p-space-8: 32px;

  /* Border Radius */
  --p-border-radius-sm: 4px;
  --p-border-radius-md: 8px;
  --p-border-radius-lg: 12px;
  --p-border-radius-full: 9999px;

  /* Typography */
  --p-font-family: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --p-font-size-xs: 12px;
  --p-font-size-sm: 13px;
  --p-font-size-md: 14px;
  --p-font-size-lg: 16px;
  --p-font-size-xl: 20px;
  --p-font-size-2xl: 24px;
}

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

body {
  font-family: var(--p-font-family);
  font-size: var(--p-font-size-md);
  color: var(--p-color-text);
  background-color: var(--p-color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Top Navigation Bar */
.topbar {
  background: #1a1a1a;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--p-space-5);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--p-space-3);
}

.topbar-logo svg {
  width: 32px;
  height: 32px;
}

.topbar-logo span {
  color: #fff;
  font-size: var(--p-font-size-lg);
  font-weight: 600;
}

.topbar-nav {
  display: flex;
  gap: var(--p-space-1);
  overflow: visible;
}

.topbar-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: var(--p-space-2) var(--p-space-3);
  border-radius: var(--p-border-radius-sm);
  font-size: var(--p-font-size-sm);
  transition: all 0.15s ease;
}

.topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-nav a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Support Notification Badge */
.topbar-nav a {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #e53935;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  animation: badge-pulse 2s ease-in-out infinite;
}

.nav-badge.hidden {
  display: none;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Mobile nav badge */
.mobile-nav a {
  position: relative;
}

.mobile-nav .nav-badge {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--p-space-3);
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: var(--p-space-2);
  font-size: var(--p-font-size-xs);
  color: rgba(255, 255, 255, 0.7);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00c853;
}

.status-dot.warning {
  background: #ffc107;
}

.status-dot.critical {
  background: #f44336;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--p-space-6);
}

/* Page Header */
.page-header {
  margin-bottom: var(--p-space-6);
}

.page-header h1 {
  font-size: var(--p-font-size-2xl);
  font-weight: 600;
  color: var(--p-color-text);
  margin-bottom: var(--p-space-1);
}

.page-header p {
  color: var(--p-color-text-secondary);
  font-size: var(--p-font-size-md);
}

.page-header-actions {
  display: flex;
  gap: var(--p-space-3);
  margin-top: var(--p-space-4);
}

/* Cards */
.card {
  background: var(--p-color-bg-surface);
  border-radius: var(--p-border-radius-lg);
  box-shadow: var(--p-shadow-md);
  overflow: hidden;
}

.card-header {
  padding: var(--p-space-4) var(--p-space-5);
  border-bottom: 1px solid var(--p-color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: var(--p-font-size-lg);
  font-weight: 600;
}

.card-header p {
  color: var(--p-color-text-secondary);
  font-size: var(--p-font-size-sm);
  margin-top: var(--p-space-1);
}

.card-body {
  padding: var(--p-space-5);
}

.card-footer {
  padding: var(--p-space-4) var(--p-space-5);
  border-top: 1px solid var(--p-color-border);
  background: var(--p-color-bg-surface-secondary);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--p-space-4);
  margin-bottom: var(--p-space-6);
}

.stat-card {
  background: var(--p-color-bg-surface);
  border-radius: var(--p-border-radius-lg);
  box-shadow: var(--p-shadow-md);
  padding: var(--p-space-5);
}

.stat-card-label {
  font-size: var(--p-font-size-sm);
  color: var(--p-color-text-secondary);
  font-weight: 500;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--p-color-text);
  margin-top: var(--p-space-2);
}

.stat-card-value.success { color: var(--p-color-text-success); }
.stat-card-value.warning { color: var(--p-color-text-warning); }
.stat-card-value.critical { color: var(--p-color-text-critical); }
.stat-card-value.info { color: var(--p-color-text-info); }

.stat-card-change {
  font-size: var(--p-font-size-sm);
  margin-top: var(--p-space-2);
  display: flex;
  align-items: center;
  gap: var(--p-space-1);
}

.stat-card-change.positive { color: var(--p-color-text-success); }
.stat-card-change.negative { color: var(--p-color-text-critical); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--p-space-2);
  padding: var(--p-space-2) var(--p-space-4);
  border-radius: var(--p-border-radius-sm);
  font-size: var(--p-font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--p-color-bg-primary);
  color: var(--p-color-text-inverse);
}

.btn-primary:hover {
  background: var(--p-color-bg-primary-hover);
}

.btn-secondary {
  background: var(--p-color-bg-surface);
  color: var(--p-color-text);
  border: 1px solid var(--p-color-border);
}

.btn-secondary:hover {
  background: var(--p-color-bg-surface-hover);
}

.btn-critical {
  background: var(--p-color-bg-critical-strong);
  color: var(--p-color-text-inverse);
}

.btn-critical:hover {
  background: #c82333;
}

.btn-plain {
  background: transparent;
  color: var(--p-color-bg-primary);
  padding: var(--p-space-1) var(--p-space-2);
}

.btn-plain:hover {
  background: var(--p-color-bg-surface-hover);
}

.btn-sm {
  padding: var(--p-space-1) var(--p-space-3);
  font-size: var(--p-font-size-xs);
}

.btn-lg {
  padding: var(--p-space-3) var(--p-space-6);
  font-size: var(--p-font-size-md);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--p-space-1) var(--p-space-2);
  border-radius: var(--p-border-radius-full);
  font-size: var(--p-font-size-xs);
  font-weight: 500;
}

.badge-success {
  background: var(--p-color-bg-success);
  color: #0d5c3d;
}

.badge-warning {
  background: var(--p-color-bg-warning);
  color: #6b5900;
}

.badge-critical {
  background: var(--p-color-bg-critical);
  color: #8f1d0e;
}

.badge-info {
  background: var(--p-color-bg-info);
  color: #006872;
}

.badge-neutral {
  background: #e4e5e7;
  color: var(--p-color-text-secondary);
}

/* Banners / Alerts */
.banner {
  display: flex;
  gap: var(--p-space-4);
  padding: var(--p-space-4);
  border-radius: var(--p-border-radius-md);
  margin-bottom: var(--p-space-4);
}

.banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.banner-content {
  flex: 1;
}

.banner-title {
  font-weight: 600;
  margin-bottom: var(--p-space-1);
}

.banner-message {
  font-size: var(--p-font-size-sm);
}

.banner-success {
  background: var(--p-color-bg-success);
  border-left: 3px solid var(--p-color-bg-success-strong);
}

.banner-success .banner-icon { color: var(--p-color-bg-success-strong); }

.banner-warning {
  background: var(--p-color-bg-warning);
  border-left: 3px solid var(--p-color-bg-warning-strong);
}

.banner-warning .banner-icon { color: var(--p-color-bg-warning-strong); }

.banner-critical {
  background: var(--p-color-bg-critical);
  border-left: 3px solid var(--p-color-bg-critical-strong);
}

.banner-critical .banner-icon { color: var(--p-color-bg-critical-strong); }

.banner-info {
  background: var(--p-color-bg-info);
  border-left: 3px solid var(--p-color-bg-info-strong);
}

.banner-info .banner-icon { color: var(--p-color-bg-info-strong); }

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--p-color-bg-surface-secondary);
}

th {
  text-align: left;
  padding: var(--p-space-3) var(--p-space-4);
  font-size: var(--p-font-size-xs);
  font-weight: 600;
  color: var(--p-color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--p-color-border);
}

td {
  padding: var(--p-space-4);
  border-bottom: 1px solid var(--p-color-border);
  font-size: var(--p-font-size-sm);
}

tr:hover {
  background: var(--p-color-bg-surface-hover);
}

tr:last-child td {
  border-bottom: none;
}

/* Forms */
.form-group {
  margin-bottom: var(--p-space-4);
}

.form-label {
  display: block;
  font-size: var(--p-font-size-sm);
  font-weight: 500;
  color: var(--p-color-text);
  margin-bottom: var(--p-space-2);
}

.form-input {
  width: 100%;
  padding: var(--p-space-3);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-sm);
  font-size: var(--p-font-size-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--p-color-bg-primary);
  box-shadow: 0 0 0 1px var(--p-color-bg-primary);
}

.form-input:disabled {
  background: var(--p-color-bg-surface-secondary);
  color: var(--p-color-text-disabled);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236d7175' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-help {
  font-size: var(--p-font-size-xs);
  color: var(--p-color-text-secondary);
  margin-top: var(--p-space-1);
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--p-color-bg-surface-secondary);
  border-radius: var(--p-border-radius-full);
  overflow: hidden;
}

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

.progress-bar.success { background: var(--p-color-bg-success-strong); }
.progress-bar.warning { background: var(--p-color-bg-warning-strong); }
.progress-bar.critical { background: var(--p-color-bg-critical-strong); }
.progress-bar.info { background: var(--p-color-bg-info-strong); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--p-space-8);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--p-space-4);
  color: var(--p-color-text-secondary);
}

.empty-state h3 {
  font-size: var(--p-font-size-lg);
  font-weight: 600;
  margin-bottom: var(--p-space-2);
}

.empty-state p {
  color: var(--p-color-text-secondary);
  font-size: var(--p-font-size-sm);
  margin-bottom: var(--p-space-4);
}

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--p-color-border);
  border-top-color: var(--p-color-bg-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--p-space-8);
  color: var(--p-color-text-secondary);
}

.loading-state .spinner {
  margin-bottom: var(--p-space-4);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--p-color-bg-surface);
  border-radius: var(--p-border-radius-lg);
  box-shadow: var(--p-shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}

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

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

.modal-header h2 {
  font-size: var(--p-font-size-lg);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--p-space-2);
  color: var(--p-color-text-secondary);
  border-radius: var(--p-border-radius-sm);
}

.modal-close:hover {
  background: var(--p-color-bg-surface-hover);
}

.modal-body {
  padding: var(--p-space-5);
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  padding: var(--p-space-4) var(--p-space-5);
  border-top: 1px solid var(--p-color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--p-space-3);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--p-color-border);
  margin-bottom: var(--p-space-5);
}

.tab {
  padding: var(--p-space-3) var(--p-space-4);
  font-size: var(--p-font-size-sm);
  font-weight: 500;
  color: var(--p-color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.tab:hover {
  color: var(--p-color-text);
}

.tab.active {
  color: var(--p-color-text);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--p-color-bg-primary);
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--p-space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--p-space-4);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--p-space-4);
}

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

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar-nav { display: none; }
  .main-container { padding: var(--p-space-4); }
}

/* Utilities */
.text-success { color: var(--p-color-text-success); }
.text-warning { color: var(--p-color-text-warning); }
.text-critical { color: var(--p-color-text-critical); }
.text-info { color: var(--p-color-text-info); }
.text-secondary { color: var(--p-color-text-secondary); }

.bg-success { background: var(--p-color-bg-success); }
.bg-warning { background: var(--p-color-bg-warning); }
.bg-critical { background: var(--p-color-bg-critical); }
.bg-info { background: var(--p-color-bg-info); }

.font-mono { font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: var(--p-space-1); }
.mt-2 { margin-top: var(--p-space-2); }
.mt-3 { margin-top: var(--p-space-3); }
.mt-4 { margin-top: var(--p-space-4); }
.mt-5 { margin-top: var(--p-space-5); }
.mt-6 { margin-top: var(--p-space-6); }

.mb-1 { margin-bottom: var(--p-space-1); }
.mb-2 { margin-bottom: var(--p-space-2); }
.mb-3 { margin-bottom: var(--p-space-3); }
.mb-4 { margin-bottom: var(--p-space-4); }
.mb-5 { margin-bottom: var(--p-space-5); }
.mb-6 { margin-bottom: var(--p-space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--p-space-2); }
.gap-3 { gap: var(--p-space-3); }
.gap-4 { gap: var(--p-space-4); }

.hidden { display: none !important; }

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--p-space-2) var(--p-space-3);
  background: #1a1a1a;
  color: #fff;
  font-size: var(--p-font-size-xs);
  border-radius: var(--p-border-radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--p-border-radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Data list */
.data-list {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-3);
}

.data-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--p-space-2) 0;
  border-bottom: 1px solid var(--p-color-border);
}

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

.data-list-label {
  color: var(--p-color-text-secondary);
  font-size: var(--p-font-size-sm);
}

.data-list-value {
  font-weight: 500;
}

/* Resource list */
.resource-list {
  display: flex;
  flex-direction: column;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: var(--p-space-4);
  padding: var(--p-space-4);
  border-bottom: 1px solid var(--p-color-border);
  transition: background 0.15s ease;
}

.resource-item:hover {
  background: var(--p-color-bg-surface-hover);
}

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

.resource-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--p-border-radius-md);
  background: linear-gradient(135deg, var(--p-color-bg-primary), #00a67d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--p-font-size-lg);
}

.resource-content {
  flex: 1;
  min-width: 0;
}

.resource-title {
  font-weight: 600;
  margin-bottom: var(--p-space-1);
}

.resource-meta {
  font-size: var(--p-font-size-sm);
  color: var(--p-color-text-secondary);
  display: flex;
  gap: var(--p-space-4);
}

.resource-actions {
  display: flex;
  gap: var(--p-space-2);
}

/* Search input */
.search-input {
  position: relative;
}

.search-input input {
  padding-left: 40px;
}

.search-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--p-color-text-secondary);
}

/* ==========================================
   MOBILE RESPONSIVE STYLES
   ========================================== */

/* Hamburger Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-nav-overlay.active {
  display: block;
}

/* Mobile Navigation Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #1a1a1a;
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  padding-top: 60px;
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 15px;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-nav-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* Tablet - 1024px and below */
@media (max-width: 1024px) {
  .topbar-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .mobile-nav {
    display: block;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    padding: var(--p-space-4);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile - 768px and below */
@media (max-width: 768px) {
  .topbar {
    padding: 0 var(--p-space-3);
  }

  .topbar-right .user-info {
    display: none;
  }

  .main-content {
    padding: var(--p-space-3);
  }

  .page-header h1 {
    font-size: var(--p-font-size-xl);
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--p-space-3);
  }

  .stat-card {
    padding: var(--p-space-3);
  }

  .stat-value {
    font-size: var(--p-font-size-xl);
  }

  .card {
    padding: var(--p-space-3);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--p-space-2);
  }

  /* Tables scroll horizontally */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  th, td {
    padding: var(--p-space-2) var(--p-space-3);
    font-size: var(--p-font-size-sm);
  }

  .btn {
    padding: var(--p-space-2) var(--p-space-3);
    font-size: var(--p-font-size-sm);
  }

  .form-group {
    margin-bottom: var(--p-space-3);
  }
}

/* Small Mobile - 480px and below (iPhone) */
@media (max-width: 480px) {
  .topbar {
    height: 50px;
    padding: 0 var(--p-space-2);
  }

  .topbar .logo {
    font-size: var(--p-font-size-md);
  }

  .main-content {
    padding: var(--p-space-2);
  }

  .page-header {
    margin-bottom: var(--p-space-3);
  }

  .page-header h1 {
    font-size: var(--p-font-size-lg);
  }

  .page-description {
    font-size: var(--p-font-size-sm);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--p-space-2);
  }

  .stat-card {
    padding: var(--p-space-3);
  }

  .card {
    padding: var(--p-space-3);
    border-radius: var(--p-border-radius-sm);
  }

  .card-header h2 {
    font-size: var(--p-font-size-md);
  }

  table {
    min-width: 500px;
    font-size: var(--p-font-size-xs);
  }

  th, td {
    padding: var(--p-space-2);
  }

  .badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .btn {
    padding: 6px 10px;
    font-size: var(--p-font-size-xs);
  }

  .btn-sm {
    padding: 4px 8px;
  }

  /* Modal adjustments */
  .modal {
    width: 95%;
    max-height: 90vh;
    margin: 5vh auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--p-space-3);
  }

  /* Form inputs larger touch targets */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Inline stacks become vertical */
  .inline-stack {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-stack .btn {
    width: 100%;
    justify-content: center;
  }
}
