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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  background: #f0f4f9;
  color: #1e293b;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 240px;
  background: #0057b8;
  min-height: 100vh;
  padding: 24px 20px;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 36px;
  letter-spacing: -0.5px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.sidebar nav a .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* ─── Main Layout ─────────────────────────────────────── */
.main {
  flex: 1;
  padding: 28px 32px;
  margin-left: 240px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 700;
}

.topbar p {
  color: #64748b;
  font-size: 14px;
  margin-top: 2px;
}

.btn {
  background: #0057b8;
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.btn:hover { background: #0046a0; }

.btn-danger {
  background: #dc2626;
}
.btn-danger:hover { background: #b91c1c; }

.btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.btn-ghost:hover { background: #f8fafc; color: #1e293b; }

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

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-left: 4px solid #0057b8;
}

.stat-card.warning { border-left-color: #f59e0b; }
.stat-card.violation { border-left-color: #dc2626; }
.stat-card.resolved { border-left-color: #16a34a; }

.stat-card h2 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-card p {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 500;
}

/* ─── Section ─────────────────────────────────────────── */
.section {
  margin-bottom: 40px;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ─── Cards Grid ──────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.offense-card,
.ticket-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s;
}

.offense-card:hover,
.ticket-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.offense-card h3,
.ticket-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.offense-card p,
.ticket-card p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Ticket Photos Thumbnail ─────────────────────────── */
.ticket-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ticket-photos img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.15s;
}

.ticket-photos img:hover {
  transform: scale(1.05);
}

/* ─── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-warning { background: #fef3c7; color: #92400e; }
.badge-violation { background: #fee2e2; color: #991b1b; }
.badge-removal { background: #fce7f3; color: #9d174d; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-resolved { background: #dcfce7; color: #15803d; }

/* ─── Actions Row ─────────────────────────────────────── */
.actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px;
  color: #94a3b8;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ─── Modal ───────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.hidden { display: none !important; }

.modal-content {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

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

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

.modal-close {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: #e2e8f0; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: #0057b8;
}

.modal-content textarea {
  resize: vertical;
  min-height: 80px;
}

/* ─── Photo Upload Area ───────────────────────────────── */
.photo-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #f9fafb;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
  border-color: #0057b8;
  background: #eff6ff;
}

.photo-upload-area .upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.photo-upload-area p {
  font-size: 13px;
  color: #64748b;
}

.photo-upload-area input[type="file"] {
  display: none;
}

.photo-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
}

.photo-preview-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

.photo-preview-item .remove-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Ticket Full View Page ───────────────────────────── */
.ticket-page {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.ticket-view-card {
  width: 100%;
  max-width: 640px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  overflow: hidden;
}

.ticket-view-header {
  background: #0057b8;
  color: white;
  padding: 28px 32px;
}

.ticket-view-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 10px;
  margin-bottom: 6px;
}

.ticket-view-header p {
  opacity: 0.8;
  font-size: 14px;
}

.ticket-view-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ticket-photos-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.ticket-photos-full img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.15s;
}

.ticket-photos-full img:hover {
  transform: scale(1.03);
}

.resolve-form {
  background: #f8fafc;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resolve-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.resolve-form input[type="text"] {
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.resolved-banner {
  background: #dcfce7;
  border-radius: 12px;
  padding: 16px 20px;
  color: #15803d;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

/* ─── Lightbox ────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  cursor: zoom-out;
}

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

/* ─── Filter Bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
  background: #0057b8;
  border-color: #0057b8;
  color: white;
}

/* ─── Ticket link ─────────────────────────────────────── */
.ticket-link {
  font-size: 13px;
  color: #0057b8;
  text-decoration: none;
  font-weight: 600;
}

.ticket-link:hover { text-decoration: underline; }

/* ─── Notification Toast ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  animation: slideIn 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

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

/* ─── Page visibility ─────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 16px;
    gap: 8px;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .logo { margin-bottom: 0; width: 100%; }

  .main {
    margin-left: 0;
    padding: 20px;
  }

  body { flex-direction: column; }
}
