:root {
  --bg: #f4f6f8;
  --bg-elevated: #fafbfc;

  --card: rgba(255, 255, 255, 0.96);
  --card-solid: #ffffff;
  --card-soft: #f8fafc;

  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;

  --primary: #111827;
  --primary-2: #1f2937;
  --blue: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --soft-blue: #eff6ff;
  --soft-green: #ecfdf5;
  --soft-amber: #fffbeb;
  --soft-red: #fef2f2;

  --shadow-xs: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.12);

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  --max-page: 1480px;
  --max-page-narrow: 760px;
  --max-page-auth: 420px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.04), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  color: var(--text);
}

body {
  padding: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
}

.page {
  max-width: var(--max-page);
  margin: 0 auto;
}

.page.narrow {
  max-width: var(--max-page-narrow);
}

.page.auth {
  max-width: var(--max-page-auth);
}

.brand {
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.brand.small {
  font-size: 28px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.5;
}

.topbar,
.section,
.card,
.auth-card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
}

.auth-card {
  margin-top: 10vh;
}

.topbar {
  position: relative;
}

.topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-left {
  min-width: 0;
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.officer-topbar {
  position: relative;
  padding: 14px 16px;
}

.officer-topbar-row {
  align-items: flex-start;
}

.officer-subtitle {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.menu-toggle-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.menu-toggle-btn:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-soft);
}

.menu-toggle-btn:active {
  transform: translateY(1px);
}

.officer-menu {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  right: 18px;
  width: 248px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
  padding: 8px;
  z-index: 1200;
}

.officer-menu.open {
  display: block;
}

.officer-menu-item {
  width: 100%;
  appearance: none;
  border: 0;
  background: white;
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.officer-menu-item:hover {
  background: #f8fafc;
}

.officer-menu-item.danger {
  color: var(--danger);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  padding: 11px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tab-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.tab-btn.active {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: white;
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-header,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--text);
  line-height: 1.05;
}

.section-sub,
.section-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.6;
}

.subtle,
.muted,
.row-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.btn,
.action-btn,
.submit-btn,
.icon-btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
.action-btn:hover,
.submit-btn:hover,
.icon-btn:hover {
  opacity: 0.98;
}

.btn:active,
.action-btn:active,
.submit-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.btn.dark,
.action-btn.dark,
.icon-btn.dark {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.14);
}

.btn.soft,
.action-btn.soft {
  background: var(--soft-blue);
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.btn.success,
.action-btn.success,
.submit-btn {
  background: linear-gradient(180deg, #22c55e, var(--success));
  color: white;
  box-shadow: 0 12px 22px rgba(22, 163, 74, 0.18);
}

.btn.warning,
.action-btn.warning {
  background: linear-gradient(180deg, #f59e0b, var(--warning));
  color: white;
}

.btn.danger,
.action-btn.danger {
  background: linear-gradient(180deg, #ef4444, var(--danger));
  color: white;
}

.btn.ghost,
.action-btn.ghost,
.icon-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.btn.ghost:hover,
.action-btn.ghost:hover,
.icon-btn:hover {
  border-color: #cbd5e1;
}

.action-row,
.top-actions,
.org-actions,
.user-actions,
.entity-actions,
.ticket-actions,
.section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.action-btn {
  min-height: 48px;
}

.form-grid,
.tickets-grid,
.org-grid,
.drawer-list,
.kpi-grid,
.performance-grid,
.vip-grid,
.users-grid,
.entity-grid {
  display: grid;
  gap: 12px;
}

.form-grid-2,
.grid-2,
.detail-grid,
.file-status-grid,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

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

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.kpi-card {
  background: linear-gradient(180deg, #ffffff, #fafafa);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow-xs);
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  font-weight: 800;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chart-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  height: 320px;
  box-shadow: var(--shadow-soft);
}

.chart-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.chart-box canvas {
  width: 100% !important;
  height: 250px !important;
}

.performance-grid,
.vip-grid,
.users-grid,
.entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.performance-card,
.vip-card,
.user-card,
.entity-card,
.live-card,
.file-status,
.meta-item,
.org-card,
.notif-item,
.ticket-card,
.list-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.performance-card h4,
.entity-card strong,
.user-card strong,
.org-main strong {
  margin: 0 0 8px 0;
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.performance-line,
.user-sub,
.entity-sub,
.vip-line,
.org-sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.performance-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.performance-line:last-child {
  border-bottom: none;
}

.performance-line strong {
  color: var(--text);
}

.ticket-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
}

.ticket-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ticket-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ticket-sub {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
}

.ticket-preview {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: #ffffff;
}

.ticket-preview-left {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  flex: 1;
  min-width: 0;
}

.preview-label,
.detail-label,
.meta-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  font-weight: 800;
}

.preview-value,
.detail-value,
.meta-value,
.row-title {
  font-size: 14px;
  font-weight: 800;
  word-break: break-word;
  color: var(--text);
}

.ticket-details {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px;
}

.ticket-details.open {
  display: block;
}

.ticket-body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.detail-box {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.ticket-images {
  display: grid;
  gap: 10px;
}

.image-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: #fcfcfd;
}

.image-card strong {
  display: block;
  margin-bottom: 8px;
}

.image-card img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.history-box {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: #fcfcfd;
}

.history-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}

.history-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.history-row:last-child {
  border-bottom: none;
}

.notice {
  display: none;
  margin-top: 10px;
  padding: 12px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  border: 1px solid transparent;
  font-weight: 700;
}

.notice.info {
  background: var(--soft-blue);
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.notice.success {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.notice.warning {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.notice.danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.status-box {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
  min-height: 52px;
  white-space: pre-wrap;
}

.submit-wrap {
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  z-index: 20;
}

.submit-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 12px;
  backdrop-filter: blur(10px);
}

.submit-btn {
  width: 100%;
  min-height: 56px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 16px;
}

.hidden-file {
  display: none;
}

.optional-tools {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.optional-tools summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  list-style: none;
}

.optional-tools summary::-webkit-details-marker {
  display: none;
}

.optional-tools summary::after {
  content: "Show";
  float: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.optional-tools[open] summary::after {
  content: "Hide";
}

.notifications-drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 360px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  padding: 14px;
  z-index: 1000;
  display: none;
  backdrop-filter: blur(10px);
}

.notifications-drawer.open {
  display: block;
}

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

.drawer-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.notif-item.unread {
  background: #f8fbff;
  border-color: #bfdbfe;
}

.notif-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.notif-message {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.notif-time {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.notif-badge {
  position: static;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 18px;
  margin: 0 auto;
  max-width: 460px;
  background: #111827;
  color: white;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
  z-index: 1100;
  display: none;
}

.toast.show {
  display: block;
}

.toast-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.5;
}

.link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.list-shell {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.list-head {
  background: linear-gradient(180deg, #fafafa, #f3f4f6);
}

.list-row {
  background: white;
  transition: background 0.15s ease;
}

.list-row:hover {
  background: #fcfcfd;
}

.row-actions .btn {
  min-width: 96px;
}

.pill {
  font-weight: 800;
}

.pill.dark {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #111827;
}

.pill.success,
.pill.warning {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.modal-card {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-title {
  letter-spacing: -0.03em;
}

#ticketMap {
  height: 560px;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}

.camera-modal.open {
  display: flex;
}

.camera-modal-card {
  width: 100%;
  max-width: 760px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 16px;
}

.camera-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.camera-modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.camera-modal-subtitle,
.camera-helper-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.camera-preview-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.camera-video,
.camera-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-canvas {
  display: none;
}

.camera-overlay-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guide-box {
  position: absolute;
  border: 2px dashed rgba(250, 204, 21, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.18);
}

.guide-box span {
  position: absolute;
  top: -28px;
  left: 0;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.ticket-number-guide {
  top: 8%;
  right: 10%;
  width: 40%;
  height: 9%;
}

.plate-guide {
  top: 31%;
  left: 7%;
  width: 60%;
  height: 9%;
}

.camera-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 1180px) {

  .kpi-grid,
  .filters-grid,
  .charts-grid,
  .ticket-preview-left,
  .ticket-body,
  .detail-grid,
  .form-grid-2,
  .grid-2,
  .file-status-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  #ticketMap {
    height: 420px;
  }
}

@media (max-width: 1100px) {
  .row-actions .btn {
    min-width: unset;
  }
}

@media (max-width: 980px) {
  .list-row {
    padding: 14px;
  }

  .row-actions .btn {
    min-width: unset;
  }
}

@media (max-width: 760px) {
  body {
    padding: 12px;
  }

  .topbar,
  .section,
  .card,
  .auth-card {
    padding: 14px;
    border-radius: 20px;
  }

  .brand {
    font-size: 26px;
  }

  .topbar-row,
  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .officer-topbar {
    padding: 14px 16px;
  }

  .officer-topbar-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .topbar-left {
    flex: 1;
    min-width: 0;
  }

  .topbar-right {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    align-self: flex-start;
  }

  .menu-toggle-btn {
    width: auto;
    padding: 10px 16px;
  }

  .officer-menu {
    right: 14px;
    left: 14px;
    width: auto;
    top: calc(100% - 4px);
  }

  .notifications-drawer {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .submit-btn {
    min-height: 58px;
    font-size: 18px;
  }

  .camera-modal {
    padding: 10px;
  }

  .camera-modal-card {
    padding: 12px;
  }

  .guide-box span {
    top: -24px;
    font-size: 11px;
    padding: 4px 7px;
  }

  .ticket-number-guide {
    width: 40%;
    height: 9%;
  }

  .plate-guide {
    width: 60%;
    height: 9%;
  }
}

/* ========================
   DARK MODE
   ======================== */

html.dark {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --card: rgba(30, 41, 59, 0.96);
  --card-solid: #1e293b;
  --card-soft: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #f1f5f9;
  --primary-2: #e2e8f0;
  --blue: #60a5fa;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --soft-blue: rgba(37, 99, 235, 0.15);
  --soft-green: rgba(22, 163, 74, 0.15);
  --soft-amber: rgba(217, 119, 6, 0.15);
  --soft-red: rgba(220, 38, 38, 0.15);
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.25);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.35);
}

html.dark body {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

html.dark input,
html.dark select,
html.dark textarea {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #475569;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.1);
}

html.dark .btn.dark,
html.dark .action-btn.dark,
html.dark .icon-btn.dark,
html.dark .tab-btn.active {
  background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
  color: #0f172a;
}

html.dark .btn.ghost,
html.dark .action-btn.ghost,
html.dark .icon-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

html.dark .tab-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

html.dark .kpi-card,
html.dark .chart-box,
html.dark .performance-card,
html.dark .vip-card,
html.dark .user-card,
html.dark .entity-card,
html.dark .live-card,
html.dark .ticket-card,
html.dark .list-shell,
html.dark .notif-item,
html.dark .org-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark .list-head {
  background: #0f172a;
}

html.dark .list-row {
  background: #1e293b;
}

html.dark .list-row:hover {
  background: #263450;
}

html.dark .ticket-top {
  background: linear-gradient(180deg, #1e293b, #1a2435);
}

html.dark .status-pill {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

html.dark .detail-box {
  background: #0f172a;
  border-color: #334155;
}

html.dark .history-box {
  background: #0f172a;
  border-color: #334155;
}

html.dark .notice.info { background: rgba(37, 99, 235, 0.15); border-color: #1e40af; color: #93c5fd; }
html.dark .notice.success { background: rgba(22, 163, 74, 0.15); border-color: #166534; color: #86efac; }
html.dark .notice.warning { background: rgba(217, 119, 6, 0.15); border-color: #92400e; color: #fcd34d; }
html.dark .notice.danger { background: rgba(220, 38, 38, 0.15); border-color: #991b1b; color: #fca5a5; }

html.dark .camera-modal-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark .notifications-drawer {
  background: rgba(30, 41, 59, 0.98);
  border-color: #334155;
}

html.dark .toast {
  background: #f1f5f9;
  color: #0f172a;
}

html.dark .toast-message {
  color: #475569;
}

/* Dark mode toggle button */
.dark-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  min-height: 40px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dark-toggle:hover {
  border-color: #94a3b8;
}

/* ========================
   LOADING SKELETONS
   ======================== */

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, transparent 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: 12px;
  border: none;
}

.skeleton-card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: var(--border);
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }
.skeleton-line.full { width: 100%; }

.skeleton-value {
  height: 36px;
  width: 80px;
  border-radius: 10px;
  background: var(--border);
  animation: skeletonPulse 1.5s ease-in-out infinite;
  margin-bottom: 8px;
}

.skeleton-grid {
  display: grid;
  gap: 12px;
}

.skeleton-grid-3 { grid-template-columns: repeat(3, 1fr); }
.skeleton-grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* ========================
   EMPTY STATES
   ======================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  min-height: 180px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--muted);
}

.empty-state-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-message {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 360px;
  margin-bottom: 16px;
}

.empty-state .btn {
  margin-top: 4px;
}

/* ========================
   TOAST WITH UNDO
   ======================== */

.toast-enhanced {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 18px;
  margin: 0 auto;
  max-width: 520px;
  background: #111827;
  color: white;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast-enhanced.show {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

html.dark .toast-enhanced {
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.toast-enhanced-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

.toast-enhanced-message {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.4;
}

html.dark .toast-enhanced-message {
  color: #64748b;
}

.toast-enhanced-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.toast-undo-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #facc15;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.toast-undo-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

html.dark .toast-undo-btn {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.06);
  color: #2563eb;
}

.toast-close-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  background: #facc15;
  border-radius: 2px;
  transition: width linear;
}

html.dark .toast-progress {
  background: rgba(0, 0, 0, 0.08);
}

html.dark .toast-progress-bar {
  background: #2563eb;
}