@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #000000;
  --surface: #121212;
  --surface2: #1a1a1a;
  --surface3: #222222;
  --primary: #FFFFFF;
  --primary-dim: #FFFFFF;
  --primary-glow: rgba(255,255,255,0.05);
  --accent: #6366f1;
  --accent-glow: rgba(99,102,241,0.15);
  --danger: #ef4444;
  --danger-dim: #dc2626;
  --warning: #f59e0b;
  --success: #22c55e;
  --text: #FFFFFF;
  --text-dim: #888888;
  --text-muted: #666666;
  --border: #222222;
  --border-active: #FFFFFF;
  --glass: rgba(255,255,255,0.04);
  --bg-dark: #0a0a0a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.3);
}
[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --surface2: #F3F4F6;
  --surface3: #E5E7EB;
  --primary: #000000;
  --primary-dim: #000000;
  --primary-glow: rgba(0,0,0,0.05);
  --accent: #4f46e5;
  --accent-glow: rgba(79,70,229,0.12);
  --danger: #dc2626;
  --danger-dim: #b91c1c;
  --warning: #d97706;
  --success: #16a34a;
  --text: #000000;
  --text-dim: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --border-active: #000000;
  --glass: rgba(0,0,0,0.04);
  --bg-dark: #F3F4F6;
  --shadow: 0 20px 60px rgba(0,0,0,0.05);
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.05);
}

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

/* Prevent text cursor blinking on all clickable elements */
[onclick], button, a, label,
.folder-card, .stat-card, .nav-item, .folder-card-wrap,
.view-img-card, .img-card, .image-card,
[style*="cursor: pointer"], [style*="cursor:pointer"] {
  user-select: none;
  -webkit-user-select: none;
}

/* Allow text selection in inputs and text areas */
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ─── AUTH PAGE ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 48px; height: 48px;
  background: var(--text);
  color: var(--bg);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

.auth-logo-text h1 { font-size: 20px; font-weight: 700; }
.auth-logo-text p { font-size: 13px; color: var(--text-dim); }

.auth-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 32px; }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, .form-group select, .form-group textarea, .form-control, .status-dropdown {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
  }
  
  .form-control {
    width: auto;
    padding: 10px 14px;
    font-size: 14px;
  }

  .status-dropdown {
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
  }
  
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-control:focus, .status-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 102, 126, 234), 0.2);
  }

  /* Make Date Picker Calendar Icon blend with Dark/Light theme */
  input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
  }
  input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
  }
  [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
  }

.form-group textarea { resize: vertical; min-height: 80px; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px var(--primary-glow);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface3);
  border-color: var(--border-active);
}

.btn-danger {
  background: var(--text);
  color: var(--bg);
}
.btn-danger:hover:not(:disabled) { transform: translateY(-1px); opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--glass); color: var(--text); }

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: 8px; }

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

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-logo-text .shop-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.sidebar-logo-text .shop-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item.active { background: var(--primary-glow); color: var(--text); }
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  background: var(--text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg);
  flex-shrink: 0;
}

.sidebar-user-info .user-email {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main content */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 28px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title { font-size: 26px; font-weight: 800; }
.page-subtitle { color: var(--text-dim); font-size: 14px; margin-top: 2px; }

.page-body { padding: 24px 32px; }

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title { font-size: 16px; font-weight: 700; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover { border-color: var(--border-active); transform: translateY(-2px); }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-icon.green { background: var(--primary-glow); }
.stat-icon.purple { background: var(--accent-glow); }
.stat-icon.yellow { background: var(--glass); }

.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ─── FOLDER GRID ─── */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.folder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--text);
  opacity: 0;
  transition: opacity 0.2s;
}

.folder-card:hover { border-color: var(--border-active); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.folder-card:hover::before { opacity: 1; }

.folder-icon { font-size: 36px; margin-bottom: 12px; }

.folder-id {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Courier New', monospace;
  margin-bottom: 4px;
}

.folder-name { font-size: 14px; color: var(--text-dim); margin-bottom: 12px; }

.folder-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.folder-badge {
  background: var(--primary-glow);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}

.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; max-width: 300px; margin: 0 auto 24px; }

/* ─── IMAGE GRID ─── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.image-card {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;

}

.image-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.image-card:hover img { transform: scale(1.05); }

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  pointer-events: none;
}

.image-card:hover .image-overlay { opacity: 1; pointer-events: auto; }

.image-delete-btn {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
  pointer-events: auto;
}

.image-delete-btn:hover { background: var(--danger-dim); }

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--text);
  background: var(--primary-glow);
}

.upload-zone-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone p { color: var(--text-dim); font-size: 14px; }
.upload-zone strong { color: var(--text); }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--text);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.show .modal, .modal-overlay.active .modal { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all 0.15s;
}

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

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--text); }
.toast.error { border-left: 3px solid var(--text); }
.toast.info { border-left: 3px solid var(--text); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── BREADCRUMB ─── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--text-muted); }

/* ─── SEARCH ─── */
.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px 10px 40px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--text); }
.search-bar .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

/* ─── PUBLIC VIEW ─── */
.view-page {
  min-height: 100vh;
  background: #0a0a0f;
}

.view-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.view-header-logo-icon {
  width: 40px; height: 40px;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.view-header h1 { font-size: 18px; font-weight: 700; }
.view-header p { font-size: 12px; color: var(--text-dim); }

.view-body { padding: 32px; max-width: 1200px; margin: 0 auto; }

.view-tracking-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.view-tracking-id {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  font-family: 'Courier New', monospace;
}

.view-public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.view-img-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  aspect-ratio: 1;
  position: relative;
}

.view-img-card.selected { border-color: var(--accent); }
.view-img-card.selected img { opacity: 0.8; transform: scale(0.95); border-radius: 8px; }

/* CHECKBOX OVERLAY */
.select-checkbox { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 6px; background: rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.7); z-index: 10; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.view-img-card.selected .select-checkbox { background: var(--accent); border-color: var(--accent); }
.view-img-card.selected .select-checkbox::after { content: '\2713'; color: white; font-weight: bold; font-size: 14px; }

/* DELETE OVERLAY */
.customer-delete-btn { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 6px; background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; z-index: 10; cursor: pointer; opacity: 0; transition: opacity 0.2s; font-size: 14px; border: 1px solid var(--border); }
.view-img-card:hover .customer-delete-btn { opacity: 1; }

.view-img-card:hover { transform: scale(1.02); box-shadow: var(--shadow-sm); }
.view-img-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.lightbox.show { opacity: 1; visibility: visible; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }

.lightbox-close {
  position: fixed;
  top: 20px; right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s;
}

.lightbox-close:hover { background: var(--surface2); }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.2s;
  user-select: none;
}
.lightbox-nav:hover {
  background: var(--primary);
  border-color: var(--text);
  color: #000;
}
.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

@media (max-width: 768px) {
  .lightbox-nav { width: 44px; height: 44px; font-size: 28px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* ─── LOADING SPINNER ─── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--surface3);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.loading-state { text-align: center; padding: 80px 20px; }
.loading-state p { color: var(--text-dim); margin-top: 16px; }

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

/* ─── UTILS ─── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.font-mono { font-family: 'Courier New', monospace; }
.badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: var(--primary-glow); color: var(--text); }
.badge-purple { background: var(--primary-glow); color: var(--text); }
.badge-red { background: var(--primary-glow); color: var(--text); }
.badge-gray { background: var(--surface2); color: var(--text-muted); }

/* Windows Explorer Style File Table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.file-table th {
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
}
.file-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.file-table tr:hover {
  background: var(--surface2);
}
.file-icon-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  cursor: pointer;
}
.file-icon-name:hover {
  color: var(--text);
}
.file-thumb-mini {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Selection Bar & Customer View Actions */
.selection-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.selection-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-img-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border 0.2s;
  aspect-ratio: 1;
}

.view-img-card.selected {
  border: 3px solid var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.select-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  font-size: 16px;
}

.view-img-card.selected .select-checkbox {
  background: var(--primary);
  border-color: var(--text);
  color: #000;
  font-weight: bold;
}

.select-checkbox:after {
  content: '';
}
.view-img-card.selected .select-checkbox:after {
  content: '✓';
}

.customer-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  font-size: 14px;
}

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

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-header, .page-body { padding-left: 16px; padding-right: 16px; }
  .folders-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .view-body { padding: 16px; }
  .view-public-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ─── DATA TABLE (PRINTER/JEWEL) ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.data-table th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 600;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover {
  background: var(--surface2);
}
.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}
.badge-success { background: var(--primary-glow); color: var(--text); }
.badge-warning { background: var(--surface2); color: var(--text-muted); }
.badge-danger { background: var(--primary-glow); color: var(--text); }

/* ─── TRACKER STATUS UI ─── */
.status-tracker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 24px;
}
.tracker-status-box {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tracker-status-icon {
  font-size: 64px;
  margin-bottom: 16px;
}
.tracker-status-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.tracker-status-detail {
  color: var(--text-dim);
  font-size: 15px;
}
  
/* Fix for intl-tel-input in dark/light mode */  
.iti__country-list { background-color: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; }  
.iti__country-name { color: var(--text) !important; }  
.iti__dial-code { color: var(--text-dim) !important; }  
.iti__country.iti__highlight { background-color: var(--surface3) !important; }  
.iti__country.iti__active { background-color: var(--primary) !important; color: var(--bg) !important; }  
.iti__country.iti__active .iti__country-name, .iti__country.iti__active .iti__dial-code { color: var(--bg) !important; } 
.iti input::placeholder {
  color: var(--text-dim) !important;
  opacity: 0.6 !important;
} 

/* Selected country button (flag area) */
.iti__selected-country {
  background-color: rgba(255,255,255,0.05) !important;
  border-right: 1px solid var(--border) !important;
  border-radius: 8px 0 0 8px !important;
  padding: 0 12px !important;
}
.iti__selected-country:hover {
  background-color: rgba(255,255,255,0.1) !important;
}
.iti__selected-dial-code {
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.iti input {
  padding-left: 120px !important;
}
/* --- Delivery Timeline --- */
.delivery-timeline-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.delivery-timeline { position: relative; padding-left: 28px; margin-left: 8px; display: flex; flex-direction: column; gap: 20px; }
.delivery-timeline::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-left: 2px dashed var(--border); }
.delivery-timeline-item { position: relative; }
.delivery-timeline-node { position: absolute; left: -33px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--surface); transition: all 0.3s; }
.delivery-timeline-item.active .delivery-timeline-node { background: var(--text); box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); width: 14px; height: 14px; left: -34px; border-color: var(--surface); }
[data-theme=""light""] .delivery-timeline-item.active .delivery-timeline-node { box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); }
.delivery-timeline-label { font-weight: 600; font-size: 13px; color: var(--muted); }
.delivery-timeline-item.active .delivery-timeline-label { color: var(--text); font-weight: 700; }
.delivery-timeline-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* --- Table Container & Non-Studio Tracker Classes --- */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tracker-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
}
.tracker-emoji {
  font-size: 44px;
  margin-bottom: 12px;
}
.tracker-status-title {
  font-size: 20px;
  font-weight: 700;
}
.tracker-status-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}
.tracker-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tracker-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.tracker-info-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tracker-info-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text);
  display: inline-block;
}
.tracker-info-val {
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

/* --- Mobile Responsiveness Adjustments (< 768px) --- */
@media (max-width: 768px) {
  /* Base Layout & Spacing */
  .main-content {
    margin-left: 0 !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  .page-header {
    padding: 12px 12px 0 !important;
    margin-top: 8px !important;
  }
  .page-body {
    padding: 12px !important;
  }
  .page-title {
    font-size: 18px !important;
  }
  .page-subtitle {
    font-size: 11px !important;
  }

  /* Cards */
  .card {
    padding: 12px !important;
    border-radius: 12px !important;
  }
  .card-header {
    margin-bottom: 10px !important;
    gap: 6px !important;
  }
  .card-title {
    font-size: 13px !important;
  }

  /* Split & Grid layouts */
  .dashboard-split {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .billing-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .stat-card {
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }
  .stat-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }
  .stat-value {
    font-size: 18px !important;
  }
  .stat-label, .stat-title {
    font-size: 11px !important;
  }

  /* Form Elements */
  .form-group {
    margin-bottom: 8px !important;
  }
  .form-group label {
    font-size: 10px !important;
    margin-bottom: 2px !important;
  }
  .form-group input, .form-group select, .form-group textarea, .form-control, .status-dropdown {
    padding: 8px 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
  }
  .form-group textarea {
    min-height: 60px !important;
  }

  /* Buttons */
  .btn {
    padding: 8px 14px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }
  .btn-sm {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }

  /* Tables & Lists */
  .data-table th, .data-table td, .file-table th, .file-table td {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
  .badge {
    padding: 2px 6px !important;
    font-size: 10px !important;
  }

  /* Modals */
  .modal {
    padding: 12px !important;
    border-radius: 12px !important;
  }
  .modal-header {
    margin-bottom: 12px !important;
  }
  .modal-title {
    font-size: 14px !important;
  }
  .modal-footer {
    margin-top: 12px !important;
    gap: 6px !important;
  }

  /* Selection Bar & Breadcrumbs */
  .selection-bar {
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .selection-bar-content {
    gap: 8px !important;
  }
  .selection-actions {
    gap: 6px !important;
  }
  .breadcrumb {
    font-size: 11px !important;
  }
  
  /* Mobile tracker specific adjustments */
  .tracker-box {
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
  }
  .tracker-emoji {
    font-size: 28px !important;
    margin-bottom: 6px !important;
  }
  .tracker-status-title {
    font-size: 16px !important;
  }
  .tracker-info-card {
    padding: 10px !important;
  }
}

