/* =============================================
   雲林縣智慧黑板報修管理系統 - 主樣式檔
   ============================================= */

:root {
  --primary: #1a7340;
  --primary-dark: #145a32;
  --primary-light: #27ae60;
  --secondary: #2c3e50;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --border: #dee2e6;
  --text: #212529;
  --text-muted: #6c757d;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* =============================================
   Header
   ============================================= */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.site-header .logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}

.site-header .logo-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.site-header .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-header .logo-county {
  font-size: 0.78rem;
  opacity: 0.85;
  letter-spacing: 0.05em;
}

.site-header .logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-header .header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header .nav-link {
  color: rgba(255,255,255,0.85);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-header .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

.site-header .nav-link.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-weight: 600;
}

/* =============================================
   Page Container
   ============================================= */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.page-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* =============================================
   Cards
   ============================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.card-header {
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header .header-icon {
  color: var(--primary);
  font-size: 1rem;
}

.card-body {
  padding: 1.25rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card .stat-icon {
  font-size: 2rem;
  color: var(--primary);
  opacity: 0.15;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-success { background: #198754; color: #fff; border-color: #198754; }
.btn-success:hover { background: #146c43; border-color: #146c43; color: #fff; }

.btn-warning { background: #ffc107; color: #000; border-color: #ffc107; }
.btn-warning:hover { background: #ffca2c; color: #000; }

.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover { background: #b02a37; border-color: #b02a37; color: #fff; }

.btn-secondary { background: #6c757d; color: #fff; border-color: #6c757d; }
.btn-secondary:hover { background: #5c636a; color: #fff; }

.btn-light { background: #f8f9fa; color: var(--text); border-color: #dee2e6; }
.btn-light:hover { background: #e9ecef; }

.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.btn-block { display: flex; width: 100%; justify-content: center; }

/* =============================================
   Forms
   ============================================= */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: #dc3545;
  margin-left: 0.2rem;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236c757d' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.25rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,115,64,0.12);
}

.form-control::placeholder { color: #adb5bd; }

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.invalid-feedback {
  display: none;
  font-size: 0.8rem;
  color: #dc3545;
  margin-top: 0.3rem;
}

.is-invalid .form-control,
.is-invalid .form-select,
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}

.is-invalid .invalid-feedback,
.form-control.is-invalid + .invalid-feedback,
.form-select.is-invalid + .invalid-feedback {
  display: block;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-check-label { font-size: 0.875rem; cursor: pointer; }

/* =============================================
   Status Badges
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-lg {
  padding: 0.5rem 1.1rem;
  font-size: 0.95rem;
}

.badge-xl {
  padding: 0.7rem 1.5rem;
  font-size: 1.1rem;
}

/* 狀態顏色 */
.badge-pending      { background: #e9ecef; color: #495057; }  /* 待受理-灰 */
.badge-accepted     { background: #cfe2ff; color: #084298; }  /* 已受理-藍 */
.badge-assigned     { background: #ffe5d0; color: #7d3c00; }  /* 指派廠商-橙 */
.badge-confirmed    { background: #e8d5ff; color: #4a0072; }  /* 廠商確認-紫 */
.badge-processing   { background: #fff3cd; color: #664d03; }  /* 處理中-黃 */
.badge-completed    { background: #d1e7dd; color: #0a3622; }  /* 已完成-綠 */
.badge-cancelled    { background: #f8d7da; color: #58151c; }  /* 已取消-紅 */

/* Priority badges */
.badge-urgent { background: #dc3545; color: #fff; }
.badge-normal { background: #0dcaf0; color: #000; }

/* =============================================
   Wizard Steps
   ============================================= */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #dee2e6;
  z-index: 0;
}

.wizard-step.completed:not(:last-child)::after {
  background: var(--primary);
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dee2e6;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}

.wizard-step.active .step-circle {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(26,115,64,0.2);
}

.wizard-step.completed .step-circle {
  background: var(--primary);
  color: #fff;
}

.step-label {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.4rem;
  font-weight: 500;
  text-align: center;
}

.wizard-step.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

.wizard-pane { display: none; }
.wizard-pane.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Self-check Section (Step 1)
   ============================================= */
.selfcheck-box {
  background: #f0f9f4;
  border: 1.5px solid #a8d5b5;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.selfcheck-box .selfcheck-title {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.selfcheck-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.selfcheck-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(168,213,181,0.4);
  font-size: 0.88rem;
}

.selfcheck-steps li:last-child { border-bottom: none; }

.selfcheck-steps li .step-num {
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* =============================================
   Photo Upload
   ============================================= */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
  border-color: var(--primary);
  background: #f0f9f4;
}

.photo-upload-area .upload-icon {
  font-size: 2rem;
  color: var(--primary);
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.photo-upload-area .upload-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.photo-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(220,53,69,0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

/* =============================================
   Summary Confirm (Step 3)
   ============================================= */
.summary-table {
  width: 100%;
}

.summary-table tr td:first-child {
  width: 8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0.5rem 0.5rem 0;
  white-space: nowrap;
}

.summary-table tr td:last-child {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

/* =============================================
   Success Screen
   ============================================= */
.success-screen {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.success-icon {
  font-size: 5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.ticket-number-display {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  background: #f0f9f4;
  border: 2px solid #a8d5b5;
  border-radius: var(--radius-lg);
  padding: 1rem 2rem;
  display: inline-block;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
}

/* =============================================
   Vertical Timeline
   ============================================= */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.timeline-item {
  position: relative;
  padding-left: 52px;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: 8px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dee2e6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #6c757d;
  z-index: 1;
}

.timeline-item.active .timeline-dot,
.timeline-item.completed .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  color: #fff;
}

.timeline-item.active .timeline-dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--primary); }
  50%       { box-shadow: 0 0 0 5px rgba(26,115,64,0.3); }
}

.timeline-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
}

.timeline-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

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

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* =============================================
   Tables
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.875rem;
}

.data-table thead tr {
  background: #f8f9fa;
  border-bottom: 2px solid var(--border);
}

.data-table thead th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--secondary);
  white-space: nowrap;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.data-table tbody tr:hover { background: #f8fff9; }

.data-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.data-table .ticket-id {
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

/* =============================================
   Tabs
   ============================================= */
.nav-tabs-custom {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.nav-tab-item {
  padding: 0.55rem 1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-tab-item:hover { color: var(--primary); }

.nav-tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.tab-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 1rem;
  font-weight: 700;
}

/* =============================================
   Photo Gallery
   ============================================= */
.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.photo-gallery .gallery-item {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s;
}

.photo-gallery .gallery-item:hover {
  transform: scale(1.05);
}

.photo-gallery .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  line-height: 1;
}

/* =============================================
   Search/Filter Bar
   ============================================= */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-bar .filter-item { flex: 1; min-width: 160px; }

.filter-bar .filter-item label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   Alert / Toast
   ============================================= */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.alert-success { background: #d1e7dd; color: #0a3622; border: 1px solid #a3cfbb; }
.alert-danger  { background: #f8d7da; color: #58151c; border: 1px solid #f1aeb5; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; }
.alert-info    { background: #cff4fc; color: #055160; border: 1px solid #9eeaf9; }

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  animation: slideIn 0.3s ease;
}

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

.toast.toast-success { border-left: 4px solid #198754; }
.toast.toast-danger  { border-left: 4px solid #dc3545; }
.toast.toast-info    { border-left: 4px solid #0dcaf0; }

/* =============================================
   Login Page
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo .logo-circle {
  width: 72px;
  height: 72px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 2rem;
  color: #fff;
}

.login-logo h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 0.2rem;
}

.login-logo p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* =============================================
   Admin Layout
   ============================================= */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  background: var(--secondary);
  color: #fff;
  padding: 1.25rem 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-menu li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.sidebar-menu li a.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
  border-right: 3px solid var(--primary-light);
}

.admin-main { padding: 1.5rem; }

/* =============================================
   Modals
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
}

.modal-body { padding: 1.25rem; }

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* =============================================
   Utility
   ============================================= */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: #198754 !important; }
.text-danger { color: #dc3545 !important; }
.text-center { text-align: center; }

.d-flex { display: flex; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }
.fs-sm   { font-size: 0.8rem; }
.fs-xs   { font-size: 0.75rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .site-header .logo-county { display: none; }
  .site-header .logo-title { font-size: 0.9rem; }
  .site-header .logo-icon { width: 38px; height: 38px; font-size: 1.2rem; }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }

  .wizard-steps { padding: 1rem; }
  .step-label { font-size: 0.65rem; }

  .filter-bar { flex-direction: column; }
  .filter-bar .filter-item { min-width: 100%; }

  .page-container, .page-wide { padding: 1rem 0.75rem; }
  .card-body { padding: 1rem; }

  .ticket-number-display { font-size: 1.5rem; padding: 0.75rem 1.25rem; }

  .data-table { font-size: 0.8rem; }
  .data-table thead th,
  .data-table tbody td { padding: 0.6rem 0.65rem; }

  .photo-gallery .gallery-item { width: 70px; height: 70px; }
}

@media (max-width: 480px) {
  .wizard-steps { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .wizard-step::after { display: none; }
  .wizard-step { flex-direction: row; align-items: center; gap: 0.5rem; }
  .step-label { margin-top: 0; }
  .stat-card .stat-value { font-size: 1.8rem; }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
  .site-header,
  .wizard-steps,
  .btn,
  .filter-bar,
  .pagination,
  .nav-tabs-custom,
  .no-print { display: none !important; }

  body { background: #fff; color: #000; font-size: 12pt; }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .print-only { display: block !important; }

  .print-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #000;
  }

  .print-header h1 { font-size: 16pt; font-weight: bold; }
  .print-header p { font-size: 10pt; color: #555; }

  .ticket-number-display {
    font-size: 20pt;
    border: 2px solid #333;
    background: #f5f5f5;
    padding: 0.5rem 1rem;
  }

  .badge {
    border: 1px solid currentColor;
    background: transparent !important;
  }
}

.print-only { display: none; }
