/* ============================================================
   TrazaTickets - Stylesheet
   Creado por: LemusConcept (www.lemusconcept.com)
   ============================================================ */

:root {
  --primary:       #1A3A8A;
  --primary-light: #2B5CE6;
  --primary-dark:  #102266;
  --primary-faint: #EEF2FF;
  --accent:        #C8102E;
  --accent-light:  #E8213E;
  --accent-faint:  #FFF0F2;
  --bg:            #F0F2F5;
  --white:         #FFFFFF;
  --text:          #1C1E21;
  --muted:         #65676B;
  --border:        #DADDE1;
  --success:       #1E7E34;
  --success-bg:    #D4EDDA;
  --warning:       #856404;
  --warning-bg:    #FFF3CD;
  --danger:        #C8102E;
  --danger-bg:     #FFE0E4;
  --info:          #1A3A8A;
  --info-bg:       #EEF2FF;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.1);
  --shadow:        0 2px 8px rgba(0,0,0,.12);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.15);
  --radius:        10px;
  --radius-sm:     6px;
  --topnav-h:      58px;
  --sidebar-w:     240px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

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

.sidebar-toggle {
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  transition: background .2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.15); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #fff;
}
.brand-name span { color: var(--accent); }

.topnav-right { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.85);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

.badge-count {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--primary);
}

/* Notifications Panel */
.notif-wrapper { position: relative; }
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid var(--border);
}
.notif-clear { font-size: 13px; font-weight: 400; color: var(--primary); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: background .15s;
  cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-faint); }
.notif-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-text { font-size: 13px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-loading, .notif-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* User Menu */
.user-menu-wrapper { position: relative; }
.user-menu-btn {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 24px;
  padding: 5px 10px 5px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  transition: background .2s;
}
.user-menu-btn:hover { background: rgba(255,255,255,.25); }
.user-menu-name { font-size: 14px; font-weight: 600; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-lg { width: 44px; height: 44px; font-size: 18px; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-dropdown-name { font-weight: 700; font-size: 15px; }
.user-dropdown-role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 0; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--bg); text-decoration: none; }
.dropdown-item.dropdown-danger { color: var(--danger); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--topnav-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topnav-h));
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 900;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.sidebar-section {
  padding: 12px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: 2px 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-item:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.sidebar-item.active { background: var(--primary-faint); color: var(--primary); font-weight: 700; }
.sidebar-item.active .sidebar-icon { color: var(--primary); }
.sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.sidebar-item:hover .sidebar-icon, .sidebar-item.active .sidebar-icon { color: var(--primary); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.creator-sig {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.creator-sig:hover { color: var(--primary); text-decoration: none; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
  margin-top: var(--topnav-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--topnav-h));
  transition: margin-left .3s;
}

.main-content {
  padding: 24px;
  max-width: 1100px;
}

.overlay {
  display: none;
  position: fixed;
  top: var(--topnav-h); left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  z-index: 850;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  margin-left: var(--sidebar-w);
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  background: var(--white);
}
.app-footer a { color: var(--primary); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header h1 svg { color: var(--primary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.card-body { padding: 20px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.blue  { background: var(--primary-faint); color: var(--primary); }
.stat-icon.red   { background: var(--danger-bg); color: var(--danger); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange{ background: var(--warning-bg); color: var(--warning); }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-accent   { background: var(--accent); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-warning  { background: #F7B928; color: #333; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,138,.12);
}
.form-control::placeholder { color: #adb5bd; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

/* Photo Upload */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.photo-upload-area:hover { border-color: var(--primary); background: var(--primary-faint); }
/* El input cubre toda el área — el toque llega directo al selector nativo del SO.
   Esto hace que Android Chrome ofrezca Cámara + Galería igual que iOS. */
.photo-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.photo-upload-icon { color: var(--primary); margin-bottom: 8px; }
.photo-upload-text { font-size: 14px; color: var(--muted); }
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.photo-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.photo-preview-item .remove-photo {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-open       { background: #E3F2FD; color: #1565C0; }
.badge-assigned   { background: #FFF3E0; color: #E65100; }
.badge-progress   { background: #E8F5E9; color: #2E7D32; }
.badge-resolved   { background: #F3E5F5; color: #6A1B9A; }
.badge-validated  { background: var(--success-bg); color: var(--success); }
.badge-rejected   { background: var(--danger-bg); color: var(--danger); }
.badge-closed     { background: #ECEFF1; color: #546E7A; }
.badge-norte          { background: var(--primary-faint); color: var(--primary); }
.badge-sur            { background: #FFF0F2;               color: var(--accent); }
.badge-este           { background: #ECFDF5;               color: #059669; }
.badge-mantenimiento  { background: #FEFCE8;               color: #B45309; }

/* ============================================================
   TICKET CARDS
   ============================================================ */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }

.ticket-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .2s, transform .15s;
  text-decoration: none;
  color: var(--text);
}
.ticket-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}
.ticket-card.overdue { border-left: 4px solid var(--danger); }

.ticket-cat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--primary-faint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ticket-info { flex: 1; min-width: 0; }
.ticket-number { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.ticket-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.ticket-meta-item { display: flex; align-items: center; gap: 4px; }

.ticket-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* Timer */
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer-ok      { background: var(--success-bg); color: var(--success); }
.timer-warning { background: var(--warning-bg); color: var(--warning); }
.timer-danger  { background: var(--danger-bg);  color: var(--danger);  }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  background: var(--bg);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ============================================================
   TIMELINE (ticket history)
   ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 18px;
}
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-time { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.timeline-action { font-size: 13px; font-weight: 600; }
.timeline-comment { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #A8D5B5; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #FFBBC5; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #FFE580; }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #B0C4F5; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex;
  align-items: flex-start;        /* el modal empieza arriba, no centrado */
  justify-content: center;
  padding: 20px;
  overflow-y: auto;               /* el OVERLAY hace scroll en iOS */
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  margin: auto;                   /* centra verticalmente cuando el contenido es corto */
  transform: translateY(20px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.filters-bar .form-group { margin-bottom: 0; }
.filters-bar select, .filters-bar input { min-width: 140px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -200px; left: -150px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(200,16,46,.15);
  bottom: -150px; right: -100px;
}
.login-box {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px; height: 70px;
  border-radius: 18px;
  background: var(--primary);
  margin-bottom: 12px;
}
.login-app-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}
.login-app-name span { color: var(--accent); }
.login-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }

.login-creator {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   CORRIDOR INDICATOR
   ============================================================ */
.corridor-norte          { color: var(--primary); font-weight: 600; }
.corridor-sur            { color: var(--accent);  font-weight: 600; }
.corridor-este           { color: #059669;         font-weight: 600; }
.corridor-mantenimiento  { color: #B45309;         font-weight: 600; }

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-gallery a {
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color .2s;
}
.photo-gallery a:hover { border-color: var(--primary); }
.photo-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state svg { opacity: .3; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p  { font-size: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-wrapper { margin-left: 0; }
  .app-footer   { margin-left: 0; }
  .overlay.show { display: block; }
  .brand-name   { font-size: 18px; }
  .user-menu-name { display: none; }
  .main-content { padding: 16px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .ticket-card { flex-wrap: wrap; }
  .ticket-right { flex-direction: row; align-items: center; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .notif-panel { width: 300px; right: -60px; }
  .login-box { padding: 28px 20px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted    { color: var(--muted); }
.text-danger   { color: var(--danger); }
.text-success  { color: var(--success); }
.text-primary  { color: var(--primary); }
.fw-bold       { font-weight: 700; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-1         { gap: 8px; }
.gap-2         { gap: 16px; }
.mt-1          { margin-top: 8px; }
.mt-2          { margin-top: 16px; }
.mt-3          { margin-top: 24px; }
.mb-1          { margin-bottom: 8px; }
.mb-2          { margin-bottom: 16px; }
.mb-3          { margin-bottom: 24px; }
.icon-sm       { width: 16px; height: 16px; }
.icon-md       { width: 20px; height: 20px; }
.icon-lg       { width: 28px; height: 28px; }
.spinner {
  width: 20px; height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TICKET DETAIL RESPONSIVE LAYOUT
   ============================================================ */
.ticket-detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .ticket-detail-layout {
    grid-template-columns: 1fr;
  }
}
