@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Cairo:wght@400;600;700&display=swap");
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css");

@font-face {
  font-family: "Serchawa";
  src: url("../fonts/77_Sarchia_Rojnama_1.woff") format("woff"),
       url("../fonts/77_Sarchia_Rojnama_1.ttf") format("truetype"),
       url("../fonts/77_Sarchia_Rojnama_1.eot") format("embedded-opentype"),
       url("../fonts/77_Sarchia_Rojnama_1.svg#Serchawa") format("svg");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --primary: #1d4ed8;
  --accent: #0ea37f;
  --amber: #f59e0b;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.92);
  --ink: #0f172a;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Serchawa", "Peshang", "Plus Jakarta Sans", "Cairo", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f4f6fb;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.glass-card {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.86));
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  border-radius: var(--radius);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
  min-height: 44px;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}
.ghost-btn:focus-visible,
.primary-btn:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.25);
  outline-offset: 3px;
}

.ghost-btn.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.2);
  background: rgba(254, 226, 226, 0.6);
}

.primary-btn {
  border: none;
  background: linear-gradient(140deg, var(--primary), #0ea5e9);
  color: #fff;
  padding: 14px;
  border-radius: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(29, 78, 216, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 70px rgba(14, 165, 233, 0.45);
}
.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 12px 40px rgba(14, 165, 233, 0.35);
}

.app-shell {
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.14), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.18), transparent 30%),
              #eef2ff;
  min-height: 100vh;
  padding: 0;
}

.app-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 96px;
}

.page-standalone {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom, 0px));
}

.page-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-nav {
  position: sticky;
  top: 12px;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e0e7ff;
  display: grid;
  place-items: center;
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.12);
}

.brand-title {
  margin: 0;
  font-weight: 800;
  color: var(--primary);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 2px;
}

.nav-links-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 4px;
}

.nav-link-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-link-pills::-webkit-scrollbar {
  display: none;
}

.nav-link-pills li a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
  transition: 0.18s ease;
  white-space: nowrap;
}

.nav-link-pills li a:hover {
  background: rgba(29, 78, 216, 0.06);
}

.nav-link-pills li a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 16px 40px rgba(29, 78, 216, 0.25);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}

.tab-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 10px;
}

.tab-pill {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  color: var(--ink);
  transition: 0.18s ease;
}

.tab-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 18px 50px rgba(29, 78, 216, 0.3);
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 18px;
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
  font-weight: 800;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.requested {
  background: var(--amber);
}

.dot.parked {
  background: var(--primary);
}

.stacked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.pager .ghost-btn {
  min-width: 44px;
  height: 44px;
  justify-content: center;
}

.page-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.page-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.15);
  transition: 0.2s ease;
  border: none;
  padding: 0;
  cursor: pointer;
}

.page-dots .dot.active {
  background: var(--primary);
  width: 16px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.3);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 26px 12px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.ticket-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.ticket-card.requested {
  border-inline-start: 6px solid var(--amber);
}

.ticket-card.parked {
  border-inline-start: 6px solid var(--primary);
}

.ticket-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.car-chip {
  min-width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0b1220;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
}

.plate {
  font-size: 1.05rem;
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
}

.status-chip.requested {
  background: #fef3c7;
  color: #92400e;
}

.status-chip.parked {
  background: #e0e7ff;
  color: #1d4ed8;
}

.ticket-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 180px;
}

.btn-deliver {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 44px;
  box-shadow: 0 16px 40px rgba(14, 163, 127, 0.35);
}

.btn-deliver:hover {
  background: #0c8f6a;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-card:hover {
  border-color: rgba(29, 78, 216, 0.25);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.input-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  background: #f8fafc;
}

.input-icon i {
  color: var(--muted);
}

.input-icon .form-control {
  border: none;
  background: transparent;
  padding: 8px 0;
  box-shadow: none;
}

.form-control {
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.2s ease-in-out;
}

.form-control:focus {
  background-color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(14, 163, 127, 0.25);
}

.form-label {
  margin-bottom: 6px;
}

.mobile-actions {
  position: static;
  padding: 16px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  margin-top: 16px;
  text-align: center;
}

.request-popup {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 540px);
  z-index: 2000;
  pointer-events: none;
}

.request-popup-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(29, 78, 216, 0.12), rgba(14, 163, 127, 0.1));
  box-shadow: 0 18px 50px rgba(29, 78, 216, 0.25);
  transform: translateY(-140%);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.25s ease;
  pointer-events: auto;
}

.request-popup.show .request-popup-card {
  transform: translateY(0);
  opacity: 1;
}

.request-popup .icon-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(29, 78, 216, 0.15));
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.35), 0 12px 32px rgba(29, 78, 216, 0.28);
  animation: pulse-ring 1.8s infinite;
}

.request-popup .request-popup-copy {
  color: #0f172a;
}

.request-popup .request-popup-body {
  font-weight: 700;
  font-size: 15px;
}

.request-popup .btn-close {
  filter: invert(1) grayscale(1) brightness(0.3);
}

.request-popup:hover .request-popup-card {
  box-shadow: 0 22px 60px rgba(29, 78, 216, 0.3);
}

.toast {
  min-width: 320px;
}
.toast {
  min-width: 320px;
}

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 24px;
  padding: 12px 8px calc(12px + env(safe-area-inset-bottom, 0px));
}

.admin-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 12px 0;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.stat-card h4 {
  margin: 0;
  font-weight: 800;
  color: var(--primary);
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pill-select {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  padding-inline: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.modern-table tbody tr {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.modern-table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.modern-table tbody tr td {
  border: none;
}

.modern-table .btn.btn-sm {
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.modern-table .btn.btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

/* Login */
body.login-bg {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.login-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.login-logo {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.btn-login {
  background-color: var(--accent);
  border: none;
  color: white;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background-color: #0f9a6a;
  transform: scale(1.02);
}

/* Settings / Admin */
.settings-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.settings-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.settings-list .setting-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.25s, transform 0.2s;
}

.settings-list .setting-item:hover {
  background: #f0fdf4;
  transform: translateX(4px);
}

.setting-name {
  font-weight: 600;
  color: #1f2937;
}

.setting-value {
  background: #e6f8f0;
  color: #047857;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
}

.btn-edit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s;
}

.btn-edit:hover {
  background: #0f9a6e;
}

/* Global notifications */
@keyframes pulse-ring {
  0% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.35), 0 12px 32px rgba(29, 78, 216, 0.28); }
  50% { transform: scale(1.06); box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.45), 0 16px 38px rgba(29, 78, 216, 0.35); }
  100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.35), 0 12px 32px rgba(29, 78, 216, 0.28); }
}

@keyframes pulse-badge {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

#globalPendingBadge {
  animation: pulse-badge 2s infinite;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.pwa-install-banner {
  position: fixed;
  right: 16px;
  left: auto;
  bottom: 16px;
  z-index: 1080;
  display: grid;
  gap: 12px;
  padding: 16px;
  align-items: center;
  width: min(420px, calc(100% - 32px));
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pwa-install-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

.pwa-install-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pwa-install-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  overflow: hidden;
}

.pwa-install-icon img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.pwa-install-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive tweaks for handhelds / Sunmi */
@media (max-width: 768px) {
  .app-wrapper {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 110px;
  }

  .app-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-right {
    width: 100%;
    justify-content: space-between;
  }

  .tab-switcher {
    grid-template-columns: 1fr;
  }

  .tab-pill {
    justify-content: space-between;
  }

  .ticket-card {
    grid-template-columns: 1fr;
  }

  .ticket-actions {
    justify-content: flex-start;
  }

  .toast {
    min-width: 260px;
  }

  .pwa-install-banner {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 12px;
  }

  .pwa-install-actions {
    flex-direction: row-reverse;
  }
}
