/* ═══════════════════════════════════════════════════════════
   Al-Latif QR Print Dashboard — Brand Design System
   Brand: Dev Riasat | Al-Latif Digital & Telecom Center
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── 1. Color System ────────────────────────────────── */
  /* Primary */
  --color-primary-50:  #fef5f0;
  --color-primary-100: #fdeae2;
  --color-primary-200: #fbcebb;
  --color-primary-300: #ffa985;
  --color-primary-400: #ff773d;
  --color-primary-500: #ff4d00;
  --color-primary-600: #d64000;
  --color-primary-700: #ad3400;
  --color-primary-800: #852800;
  --color-primary-900: #5e2208;
  --color-primary-950: #3d1605;

  /* Secondary */
  --color-secondary-50:  #fef4f0;
  --color-secondary-100: #fde8e2;
  --color-secondary-200: #fbcabb;
  --color-secondary-300: #ffa185;
  --color-secondary-400: #ff6a3d;
  --color-secondary-500: #ff3c00;
  --color-secondary-600: #d63200;
  --color-secondary-700: #b32a00;
  --color-secondary-800: #851f00;
  --color-secondary-900: #5e1c08;
  --color-secondary-950: #3d1205;

  /* Accent */
  --color-accent-50:  #fffcf0;
  --color-accent-100: #fdf8e2;
  --color-accent-200: #fbefbb;
  --color-accent-300: #ffe785;
  --color-accent-400: #ffd83d;
  --color-accent-500: #ffcc00;
  --color-accent-600: #d6ab00;
  --color-accent-700: #ad8b00;
  --color-accent-800: #856a00;
  --color-accent-900: #5e4d08;
  --color-accent-950: #3d3205;

  /* Neutral */
  --color-neutral-50:  #f7f7f7;
  --color-neutral-100: #f0f0f0;
  --color-neutral-200: #dbdbdb;
  --color-neutral-300: #c2c2c2;
  --color-neutral-400: #9e9e9e;
  --color-neutral-500: #808080;
  --color-neutral-600: #6b6b6b;
  --color-neutral-700: #575757;
  --color-neutral-800: #424242;
  --color-neutral-900: #333333;
  --color-neutral-950: #141414;

  /* Theme Backgrounds & Surfaces */
  --bg-primary:        #0f0f0f;
  --bg-secondary:      #171717;
  --bg-card:           rgba(24, 24, 24, 0.88);
  --bg-glass:          rgba(255, 255, 255, 0.04);
  --bg-glass-hover:    rgba(255, 255, 255, 0.08);

  --text-primary:      #fdfdfd;
  --text-secondary:    #a3a3a3;
  --text-muted:        #737373;

  --accent-glow:       rgba(255, 77, 0, 0.28);
  --border:            rgba(255, 255, 255, 0.09);

  /* ── 2. Typography ──────────────────────────────────── */
  --font-sans:         'Inter', system-ui, -apple-system, sans-serif;
  --font-display:      'Playfair Display', Georgia, serif;

  --font-size-xs:      0.625rem;
  --font-size-sm:      0.75rem;
  --font-size-base:    1rem;
  --font-size-lg:      1.25rem;
  --font-size-xl:      1.5rem;
  --font-size-2xl:     1.875rem;
  --font-size-3xl:     3.75rem;

  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  /* ── 3. Borders & Shadows ───────────────────────────── */
  --radius-sm:   0.5rem;
  --radius-md:   0.75rem;
  --radius-lg:   1rem;
  --radius-xl:   1.25rem;
  --radius-full: 9999px;

  --shadow-sm: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.1) 0px 2px 4px -2px;
  --shadow-md: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -4px;
  --shadow-lg: rgba(0, 0, 0, 0.25) 0px 15px 30px -5px;
  --shadow-xl: rgba(255, 255, 255, 0.15) 0px 1px 0px 0px inset, rgba(0, 0, 0, 0.3) 0px 10px 25px -4px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 5% 10%, rgba(255, 77, 0, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 95% 90%, rgba(255, 204, 0, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-secondary-600));
  color: #ffffff;
  box-shadow: var(--shadow-xl), 0 3px 12px var(--accent-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-400), var(--color-secondary-500));
  box-shadow: var(--shadow-xl), 0 5px 18px var(--accent-glow);
}

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 7px 14px; font-size: 0.75rem; }

/* ═══ LOGIN SCREEN ════════════════════════════════════════ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 390px;
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.login-logo {
  font-size: 46px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px var(--accent-glow));
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  background: linear-gradient(135deg, #ffffff 40%, var(--color-primary-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.login-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

#loginForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#loginForm input {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
#loginForm input:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

#loginForm .btn {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  margin-top: 4px;
}

.login-error {
  margin-top: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: var(--font-weight-semibold);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ═══ HEADER ══════════════════════════════════════════════ */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(15, 15, 15, 0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.dash-logo {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.dash-header h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  background: linear-gradient(135deg, #ffffff 40%, var(--color-primary-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══ STATS ═══════════════════════════════════════════════ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 20px 24px 16px;
}

.stat-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
  backdrop-filter: blur(12px);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 77, 0, 0.3);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-400);
  margin-bottom: 4px;
}

.stat-pending .stat-value  { color: var(--color-accent-400); }
.stat-failed .stat-value   { color: #ef4444; }
.stat-rejected .stat-value { color: #f87171; }

.stat-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* ═══ FILTERS ═════════════════════════════════════════════ */
.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 24px 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}
.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--color-primary-500);
}

/* ═══ JOB LIST ════════════════════════════════════════════ */
.job-list-section { padding: 0 24px 24px; }

.job-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.job-list-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.job-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
}
.job-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--color-primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.job-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.job-info { flex: 1; min-width: 0; }

.job-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.job-meta {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-time {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.job-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.badge-pending   { background: rgba(255, 204, 0, 0.15); color: var(--color-accent-400); }
.badge-accepted  { background: rgba(255, 77, 0, 0.15); color: var(--color-primary-400); }
.badge-printed   { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-rejected  { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-failed    { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-expired   { background: rgba(115, 115, 115, 0.15); color: var(--text-muted); }

/* ═══ PAGINATION ══════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ═══ MODAL ═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.modal-image {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #ffffff;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.modal-details {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.modal-row:last-child { border-bottom: none; }
.modal-row span:first-child { color: var(--text-secondary); }
.modal-row span:last-child { font-weight: var(--font-weight-semibold); color: var(--text-primary); }

.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn { flex: 1; }

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

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}
.toast.success { background: #16a34a; color: #ffffff; }
.toast.error   { background: #dc2626; color: #ffffff; }
.toast.info    { background: var(--color-primary-600); color: #ffffff; }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ═══ RESPONSIVE ══════════════════════════════════════════ */
@media (max-width: 640px) {
  .stats-bar { grid-template-columns: repeat(3, 1fr); padding: 16px; }
  .filters-bar { flex-direction: column; padding: 0 16px 16px; }
  .job-list-section { padding: 0 16px 16px; }
  .job-list { grid-template-columns: 1fr; }
}
