/* ================================================================
   InfraFix — MODERN SAAS DESIGN SYSTEM
   Palette: Warm Navy / Teal / Sand
   Typography: Inter
   ================================================================ */

/* ==================== DESIGN TOKENS ==================== */
:root {
  --primary: #0D9488;
  --primary-hover: #0F766E;
  --primary-dark: #115E59;
  --secondary: #0F172A;
  --accent: #F59E0B;
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --error: #DC2626;

  --bg: #F4F6F7;
  --card: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #5E6C75;
  --border: #DDE3E7;
  --border-strong: #C5CDD3;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.14), 0 4px 12px -4px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 24px 56px -12px rgba(15, 23, 42, 0.22);

  --ring: 0 0 0 4px rgba(37, 99, 235, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-grad: linear-gradient(120deg, #0F172A 0%, #134E4A 45%, #0D9488 100%);
}

/* ==================== RESET & BASE ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 24px;
  font-size: 15px;
  overscroll-behavior-y: none;
}

::selection { background: rgba(37, 99, 235, 0.18); }

/* Elegant scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.02em; color: var(--secondary); }
a { color: var(--primary); }

/* Focus visibility for keyboard navigation (a11y) */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ==================== HEADER / NAVIGATION ==================== */
.app-header {
  background: var(--header-grad);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  backdrop-filter: saturate(1.2);
}

.app-header .logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}
.app-header .logo a { color: #fff; }

.app-header .nav-icons { display: flex; gap: 10px; align-items: center; }
.app-header .nav-icons a,
.app-header .nav-icons button {
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.app-header .nav-icons a:hover,
.app-header .nav-icons button:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.app-header .nav-icons a:active,
.app-header .nav-icons button:active { transform: translateY(0); }

/* ==================== CONTAINERS & CARDS ==================== */
.container { max-width: 520px; margin: 0 auto; padding: 24px 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-bottom: 12px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.45);
}
.btn-primary:hover { box-shadow: 0 8px 22px -4px rgba(37, 99, 235, 0.5); }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transition: left 0.5s;
}
.btn-primary:hover::after { left: 100%; }

.btn-secondary {
  background: linear-gradient(135deg, #0891B2 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(6, 182, 212, 0.4);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(239, 68, 68, 0.4);
}
.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.4);
}
.btn-outline {
  background: var(--card);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #EFF6FF;
}

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #94A3B8; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563EB' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ==================== STUDENT HOME ==================== */
.action-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}
.action-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--secondary);
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease, color 0.2s ease;
}
.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  color: var(--primary);
}
.action-btn:active { transform: translateY(-1px) scale(0.99); }
.action-btn .icon { font-size: 2.4rem; display: block; margin-bottom: 10px; }

/* ==================== BLOCK / ROOM GRID ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.grid-block, .room-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.grid-block:hover, .room-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.grid-block:active, .room-btn:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(0.97);
}

/* ==================== 3-LAYER VIEW ==================== */
.layer-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: #EEF2F7;
  padding: 5px;
  border-radius: var(--radius);
}
.layer-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.layer-tab:hover { color: var(--text); }
.layer-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.layer-content { display: none; }
.layer-content.active { display: block; animation: chatFadeIn 0.25s ease; }

.item-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.item-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
}

/* ==================== REPORT LIST ==================== */
.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  padding: 18px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}
.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.report-card.status-pending { border-left-color: var(--danger); }
.report-card.status-progress,
.report-card.status-in-progress { border-left-color: var(--warning); }
.report-card.status-resolved { border-left-color: var(--success); }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-pending { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.badge-progress,
.badge-in-progress { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.badge-resolved { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }

/* ==================== ADMIN SECTIONS ==================== */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
  letter-spacing: -0.01em;
}
.alert-section .section-title { color: var(--danger); }
.submission-section .section-title { color: var(--primary); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  background: var(--card);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  line-height: 1.7;
}

/* ==================== MODAL (BOTTOM SHEET) ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 200;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal-content { border-radius: var(--radius-xl); animation: modalPop 0.28s cubic-bezier(0.4, 0, 0.2, 1); }
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes modalPop { from { transform: scale(0.94) translateY(12px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.small { font-size: 0.85rem; color: var(--text-secondary); }

/* ==================== ADMIN WIDE LAYOUT ==================== */
.admin-container {
  max-width: 1280px !important;
  padding: 28px 32px;
}

/* ==================== SECTION HEADER ROW ==================== */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 14px;
}

.badge-count {
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  min-width: 28px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.history-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  padding: 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.history-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ==================== FADE OVERLAY ==================== */
.section-box { position: relative; }
.fade-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 90px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  display: none;
  z-index: 2;
}

/* ==================== ADMIN FULL LIST PAGES (2-COLUMN GRID) ==================== */
.admin-report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.admin-report-grid .report-card {
  margin-bottom: 0; /* gap handles spacing in grid layout */
}
.admin-report-grid .empty-state {
  grid-column: 1 / -1; /* empty message spans full width */
}
@media (max-width: 768px) {
  .admin-report-grid {
    grid-template-columns: 1fr; /* single column on mobile */
  }
  .admin-report-grid .thumb {
    height: 200px; /* taller on mobile since cards span full width */
  }
}

/* ==================== ADMIN FULL LIST PAGES (2-COLUMN GRID) ==================== */
.admin-report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.admin-report-grid .report-card {
  margin-bottom: 0; /* gap handles spacing in grid layout */
}
.admin-report-grid .empty-state {
  grid-column: 1 / -1; /* empty message spans full width */
}
@media (max-width: 768px) {
  .admin-report-grid {
    grid-template-columns: 1fr; /* single column on mobile */
  }
  .admin-report-grid .thumb {
    height: 200px; /* taller on mobile since cards span full width */
  }
}

/* ==================== VIEW ALL LINK ==================== */
.view-all-row { text-align: center; margin-top: 4px; margin-bottom: 20px; }
.view-all-row a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease;
}
.view-all-row a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ==================== DISABLED BUTTON ==================== */
.btn-disabled {
  background: #E2E8F0 !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed;
  opacity: 0.75;
  border: none;
  box-shadow: none !important;
  transform: none !important;
}

/* ==================== RESOLVED SECTION ==================== */
.resolved-section .section-title { color: var(--success); }
.resolved-section .report-card { border-left: 4px solid var(--success) !important; }
.resolved-section .btn-disabled {
  background: #ECFDF5 !important;
  color: #047857 !important;
  border: 1px solid #A7F3D0;
  cursor: default;
  opacity: 1;
}

/* ==================== HISTORY GRID LAYOUT ==================== */
.history-wide { max-width: 1200px !important; }

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 40px;
}

@media (max-width: 900px) {
  .history-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .history-wide { max-width: 800px !important; }
}
@media (max-width: 600px) {
  .history-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ==================== COMPACT HISTORY CARD ==================== */
.history-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  border-left: 4px solid var(--success);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.history-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.history-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.history-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}
.history-card .meta { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 3px; }
.history-card .meta-name {
  font-size: 0.8rem;
  color: #94A3B8;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-card .desc-snippet {
  font-size: 0.8rem;
  color: #94A3B8;
  font-style: italic;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-card .thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: #F1F5F9;
}
.history-card .thumb-placeholder {
  width: 100%;
  height: 60px;
  background: #F1F5F9;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 0.75rem;
  margin-bottom: 10px;
}
.history-card .date-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.history-card .date-footer span { display: block; }

/* ==================== IMAGE LIGHTBOX ==================== */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.lightbox-overlay.active { display: flex; }
.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.7rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

/* Fixed-size damage thumbnail (dashboard preview + admin list pages) */
.report-card .thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #f0f2f5;
}

/* Clickable thumbnail hint */
.thumb-wrapper {
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.thumb-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}
.thumb-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-image: url('../Icons/report-images.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.thumb-wrapper:hover::before { opacity: 1; }
.thumb-wrapper:hover::after { opacity: 1; }
.thumb-wrapper img { transition: transform 0.3s ease; }
.thumb-wrapper:hover img { transform: scale(1.05); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==================== FILTER BAR (HISTORY & MY REPORTS) ==================== */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filter-group select,
.filter-group input[type="date"] {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  min-width: 170px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-group input[type="date"] { cursor: text; }
.filter-group select:focus,
.filter-group input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.filter-divider { color: var(--border-strong); font-size: 1.2rem; padding-bottom: 8px; }

.filter-bar label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.filter-bar select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-bar select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

.btn-search {
  padding: 9px 15px;
  background: #F1F5F9;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-search:hover {
  background: #E2E8F0;
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-count {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-bottom: 8px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .filter-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-divider { display: none; }
  .filter-count { margin-left: 0; text-align: center; padding-bottom: 0; }
  .filter-group { flex-direction: row; align-items: center; gap: 10px; }
  .filter-group label { min-width: 90px; margin-bottom: 0; }
  .filter-group select,
  .filter-group input[type="date"] { flex: 1; }
}
@media (max-width: 600px) {
  .filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-count { margin-left: 0; text-align: center; }
}

/* ==================== [INDEX] LOGIN PAGE — PASSWORD TOGGLE ==================== */
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input {
  width: 100%;
  padding: 12px 46px 12px 14px !important;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.15s ease;
  outline: none;
}
.toggle-password:hover { opacity: 0.85; }
.toggle-password:active { transform: translateY(-50%) scale(0.9); }
.toggle-password svg { width: 20px; height: 20px; fill: var(--text-secondary); }

/* ==================== [STUDENT-HOME] PROFILE DROPDOWN ==================== */
.profile-dropdown { position: relative; display: inline-block; }
.profile-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-btn:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.profile-btn:focus-visible { box-shadow: var(--ring); outline: none; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: dropdownIn 0.18s ease;
}
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu.show { display: block; }
.dropdown-item {
  padding: 12px 16px;
  color: var(--text) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.dropdown-item:hover,
.dropdown-item:focus-visible { background: #F1F5F9; outline: none; }
.dropdown-item.logout { color: var(--danger) !important; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Mobile: keep dropdown usable on small screens */
@media (max-width: 480px) {
  .profile-dropdown { position: static; }
  .dropdown-menu {
    position: fixed;
    top: auto;
    right: 12px;
    left: auto;
    margin-top: 8px;
    min-width: 180px;
    max-width: calc(100vw - 24px);
    border-radius: var(--radius);
    animation: none;
  }
  .dropdown-item {
    padding: 14px 16px;
    font-size: 0.95rem;
  }
}

/* ==================== [STUDENT-HOME] ACCOUNT DETAILS MODAL ==================== */
.account-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.account-overlay.show { opacity: 1; visibility: visible; }
.account-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.account-overlay.show .account-box { transform: scale(1); }
@media (min-width: 768px) {
  .account-box { max-width: 550px; width: 80%; }
  .account-header { padding: 32px 40px; }
  .account-avatar { font-size: 4rem; }
  .account-name { font-size: 1.5rem; }
  .account-body { padding: 28px 40px; }
  .detail-row { padding: 16px 0; }
  .detail-label { font-size: 1rem; }
  .detail-value { font-size: 1.1rem; }
  .edit-group { margin-bottom: 18px; }
  .edit-group label { font-size: 0.9rem; }
  .edit-input { padding: 14px 16px; font-size: 1.05rem; }
  .account-buttons { padding: 0 40px 28px; }
  .account-btn { padding: 16px; font-size: 1rem; }
}
@media (min-width: 1200px) { .account-box { max-width: 650px; } }

.account-header {
  background: var(--header-grad);
  color: #fff;
  padding: 28px 24px;
  text-align: center;
}
.account-avatar { font-size: 3rem; margin-bottom: 8px; }
.account-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.account-role { font-size: 0.85rem; opacity: 0.85; }
.account-body { padding: 20px; }
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.detail-value { font-weight: 600; color: var(--text); font-size: 0.92rem; }
.account-buttons { display: flex; gap: 10px; padding: 0 20px 20px; }
.account-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s ease;
}
.account-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.account-btn:active { transform: translateY(0); }
.btn-edit { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3); }
.btn-close { background: #F1F5F9; color: var(--text-secondary); }
.btn-save { background: var(--success); color: #fff; box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3); }
.btn-cancel { background: #F1F5F9; color: var(--text-secondary); }
.edit-group { margin-bottom: 14px; }
.edit-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.edit-input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.edit-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* ==================== [STUDENT-HOME] MY ROOM BUTTON ==================== */
.my-room-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease, transform 0.15s ease;
}
.my-room-btn:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }

/* ==================== [STUDENT-HOME] FIRST-TIME NOTIFICATION MODAL ==================== */
.notify-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.notify-overlay.show { opacity: 1; visibility: visible; }
.notify-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.notify-overlay.show .notify-box { transform: scale(1); }
.notify-icon { font-size: 3rem; margin-bottom: 12px; }
.notify-title { font-size: 1.25rem; font-weight: 700; color: var(--secondary); margin-bottom: 8px; letter-spacing: -0.01em; }
.notify-text { color: var(--text-secondary); margin-bottom: 22px; line-height: 1.6; }
.notify-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  border: none;
  padding: 13px 32px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.45);
  transition: all 0.2s ease;
}
.notify-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.5); }

/* ==================== [REPORT-ROOMS] INTERACTIVE MAP ==================== */
.map-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  touch-action: none;
  box-shadow: var(--shadow);
}
.map-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; cursor: grab; }
.map-container:active { cursor: grabbing; }
.room-rect { transition: all 0.25s ease; cursor: pointer; stroke: #fff; stroke-width: 2; }
.room-rect:hover { filter: brightness(1.08); stroke-width: 3; }
.room-rect.selected { stroke: var(--primary); stroke-width: 4; filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.4)); }
.floor-rail {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.floor-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.floor-btn.active {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.floor-btn:not(.active):hover { background: #F1F5F9; color: var(--text); }
.zoom-rail { position: absolute; left: 16px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.zoom-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
  font-size: 1.2rem;
}
.zoom-btn:hover { border-color: var(--primary); color: var(--primary); }
.zoom-btn:active { transform: scale(0.92); }
.room-tooltip {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 20;
  min-width: 160px;
}
.room-tooltip.visible { opacity: 1; transform: translateY(0); }
.legend-bar {
  position: absolute;
  bottom: 24px;
  right: 80px;
  left: 80px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
  z-index: 10;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.action-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}
.action-bar.open { transform: translateY(0); }
.block-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  color: var(--primary-dark);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  border: 1px solid #DBEAFE;
}
@media (max-width: 640px) {
  .legend-bar { display: none; }
  .floor-rail { right: 8px; }
  .zoom-rail { left: 8px; bottom: 80px; }
}

/* ==================== [REPORT-LAYERS] ROOM INSPECTION VIEWER ==================== */
.breadcrumb-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.breadcrumb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.pill-block { background: #EFF6FF; color: var(--primary-dark); border: 1px solid #DBEAFE; }
.pill-room { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.pill-floor { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }

.room-viewer {
  position: relative;
  width: 100%;
  height: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  touch-action: none;
  box-shadow: var(--shadow);
}
.room-svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.1s ease-out;
  cursor: grab;
}
.room-svg:active { cursor: grabbing; }

.layer-group { transition: opacity 0.35s ease, filter 0.35s ease; }
.layer-group .item-shape {
  transition: all 0.2s ease;
  cursor: pointer;
  stroke: #fff;
  stroke-width: 1.5;
}
.layer-group .item-shape:hover { filter: brightness(1.15); stroke-width: 3; }

#room-svg.stacked .layer-group { opacity: 0.5; }
#room-svg.stacked .layer-group:hover { opacity: 0.85; }

#room-svg.preview-ground #layer-ground { opacity: 1; filter: none; }
#room-svg.preview-ground #layer-wall,
#room-svg.preview-ground #layer-ceiling { opacity: 0.05; filter: grayscale(1); pointer-events: none; }

#room-svg.preview-wall #layer-wall { opacity: 1; filter: none; }
#room-svg.preview-wall #layer-ground,
#room-svg.preview-wall #layer-ceiling { opacity: 0.05; filter: grayscale(1); pointer-events: none; }

#room-svg.preview-ceiling #layer-ceiling { opacity: 1; filter: none; }
#room-svg.preview-ceiling #layer-ground,
#room-svg.preview-ceiling #layer-wall { opacity: 0.05; filter: grayscale(1); pointer-events: none; }

#room-svg.focus-ground #layer-ground { opacity: 1; filter: none; }
#room-svg.focus-ground #layer-wall,
#room-svg.focus-ground #layer-ceiling { opacity: 0; filter: grayscale(1); pointer-events: none; }

#room-svg.focus-wall #layer-wall { opacity: 1; filter: none; }
#room-svg.focus-wall #layer-ground,
#room-svg.focus-wall #layer-ceiling { opacity: 0; filter: grayscale(1); pointer-events: none; }

#room-svg.focus-ceiling #layer-ceiling { opacity: 1; filter: none; }
#room-svg.focus-ceiling #layer-ground,
#room-svg.focus-ceiling #layer-wall { opacity: 0; filter: grayscale(1); pointer-events: none; }

#room-svg.elem-hover-ground #layer-ground { opacity: 1; filter: none; }
#room-svg.elem-hover-ground #layer-wall,
#room-svg.elem-hover-ground #layer-ceiling { opacity: 0.05; filter: grayscale(1); pointer-events: none; }

#room-svg.elem-hover-wall #layer-wall { opacity: 1; filter: none; }
#room-svg.elem-hover-wall #layer-ground,
#room-svg.elem-hover-wall #layer-ceiling { opacity: 0.05; filter: grayscale(1); pointer-events: none; }

#room-svg.elem-hover-ceiling #layer-ceiling { opacity: 1; filter: none; }
#room-svg.elem-hover-ceiling #layer-ground,
#room-svg.elem-hover-ceiling #layer-wall { opacity: 0.05; filter: grayscale(1); pointer-events: none; }

.layer-rail {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.layer-rail-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.layer-rail-btn:hover { background: #F1F5F9; transform: scale(1.05); }
.layer-rail-btn.active {
  border-color: var(--primary);
  background: #EFF6FF;
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.rail-divider { height: 1px; background: var(--border); margin: 2px 6px; }
.stack-btn { font-size: 0.9rem; color: var(--text-secondary); }
.stack-btn.active { color: var(--primary); background: #EFF6FF; border-color: var(--primary); }

.map-instructions {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .zoom-rail { left: 8px; bottom: 16px; }
  .layer-rail { right: 8px; }
}

/* ==================== [SUPPORT] AI CHAT — FULLSCREEN ==================== */
body:has(.chat-container) {
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.chat-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 1;
}

.chat-header {
  background: var(--header-grad);
  color: #fff;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}
.chat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.chat-header-top .back-btn {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.95;
  transition: opacity 0.2s;
}
.chat-header-top .back-btn:hover { opacity: 1; }
.chat-header-top .page-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.chat-header-bottom {
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.chat-header-bottom h2 { font-size: 1.15rem; margin: 0; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.chat-header-bottom .status {
  font-size: 0.8rem;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 auto;
  font-weight: 500;
}
.status-dot {
  width: 8px;
  height: 8px;
  background: #34D399;
  border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 5%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; border: none; }

.message {
  max-width: 80%;
  padding: 13px 17px;
  border-radius: var(--radius-lg);
  font-size: 0.93rem;
  line-height: 1.6;
  animation: chatFadeIn 0.3s ease;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.message.bot {
  background: #fff;
  color: var(--text);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}
.message.bot .bot-name {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.message.user {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 0 5%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.quick-reply {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid #DBEAFE;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.quick-reply:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.chat-input-area {
  background: #fff;
  padding: 14px 5%;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 13px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.93rem;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.send-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45); }
.send-btn:active { transform: scale(0.93); }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 13px 17px;
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}
.typing-dot {
  width: 8px;
  height: 8px;
  background: #94A3B8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

@media (min-width: 768px) {
  .chat-header-top { padding: 14px 24px; }
  .chat-header-top .page-title { font-size: 1.05rem; }
  .chat-header-bottom { padding: 18px 24px; }
  .chat-header-bottom h2 { font-size: 1.35rem; }
  .chat-header-bottom .status { font-size: 0.85rem; }
  .message { font-size: 0.98rem; padding: 14px 18px; }
  .chat-input { padding: 14px 20px; font-size: 0.98rem; }
  .send-btn { width: 50px; height: 50px; }
}

/* ==================== [SUPPORT] FLOATING AI WIDGET (ALL PAGES) ==================== */
/* Floating action button — bottom-left, visible on every page */
.ai-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(37, 99, 235, 0.55);
  z-index: 9000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 30px -6px rgba(37, 99, 235, 0.65); }
.ai-fab:active { transform: scale(0.94); }
.ai-fab .ai-fab-icon { line-height: 1; display: block; }
.ai-fab .ai-fab-icon.icon-close { display: none; font-size: 1.4rem; }
.ai-widget.open .ai-fab .ai-fab-icon.icon-chat { display: none; }
.ai-widget.open .ai-fab .ai-fab-icon.icon-close { display: block; }
/* Small attention dot */
.ai-fab::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #34D399;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: aiFabPulse 2s infinite;
}
.ai-widget.open .ai-fab::after { display: none; }
@keyframes aiFabPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Chat panel */
.ai-panel {
  position: fixed;
  left: 20px;
  bottom: 92px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: var(--bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 8999;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.ai-widget.open .ai-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header inside the panel (overrides full-page chat-header) */
.ai-panel .chat-header {
  box-shadow: none;
  border-radius: 20px 20px 0 0;
}
.ai-panel .chat-header-bottom {
  flex-direction: row;
  text-align: left;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 16px;
  gap: 12px;
}
.ai-panel .assistant-avatar {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.ai-panel .assistant-meta h2 { font-size: 1rem; margin: 0; color: #fff; }
.ai-panel .assistant-meta .status { justify-content: flex-start; font-size: 0.75rem; }
.ai-panel .ai-close-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.ai-panel .ai-close-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* Messages + input inside the panel */
.ai-panel .chat-messages {
  padding: 16px 14px;
  gap: 10px;
  background: var(--bg);
}
.ai-panel .message { font-size: 0.88rem; padding: 11px 14px; max-width: 88%; }
.ai-panel .quick-replies { padding: 0 14px; }
.ai-panel .quick-reply { font-size: 0.78rem; padding: 7px 12px; }
.ai-panel .chat-input-area { padding: 12px 14px; gap: 8px; }
.ai-panel .chat-input { padding: 11px 16px; font-size: 0.88rem; }
.ai-panel .send-btn { width: 42px; height: 42px; font-size: 1rem; }

@media (max-width: 480px) {
  .ai-fab { left: 16px; bottom: 16px; width: 56px; height: 56px; }
  .ai-panel {
    right: 12px; left: 12px; bottom: 84px;
    width: auto;
    height: calc(100vh - 110px);
    max-height: none;
    border-radius: 18px;
  }
}

/* ==================== RESOLVED PHOTO (ADMIN DASHBOARD) ==================== */
.resolved-thumb-wrapper {
  cursor: zoom-in;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #F1F5F9;
}
.resolved-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.resolved-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease;
}
.resolved-thumb-wrapper:hover .resolved-thumb { transform: scale(1.02); }

/* History page gets taller thumbnails */
.history-card .resolved-thumb { height: 120px; }

/* ==================== PHOTO COMPARISON (HISTORY) ==================== */
.photo-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.photo-box { display: flex; flex-direction: column; gap: 4px; }
.photo-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 600px) {
  .photo-comparison { grid-template-columns: 1fr; }
}

/* ==================== ADMIN DASHBOARD LAYOUT ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.kpi-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 24px;
  margin-bottom: 32px;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--secondary);
  letter-spacing: -0.01em;
}
.chart-wrapper { position: relative; height: 300px; }

/* Action Grid (Side by side) */
.action-grid-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

/* Responsive Dashboard — Tablet */
@media (max-width: 1024px) {
  .admin-container { max-width: 100% !important; padding: 20px 24px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .action-grid-admin { grid-template-columns: 1fr; }
  .chart-wrapper { height: 260px; }
}

/* Mobile */
@media (max-width: 600px) {
  .admin-container { padding: 16px 16px; }
  .kpi-card { padding: 18px 16px; }
  .kpi-value { font-size: 1.9rem; }
  .chart-wrapper { height: 220px; }
}

/* ==================== MOBILE RESPONSIVE FIXES (ADMIN) ==================== */
@media (max-width: 768px) {
  .app-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .app-header .logo { font-size: 1rem; }
  .app-header .nav-icons { gap: 8px; }
  .section-header-row { flex-wrap: wrap; gap: 8px; margin: 20px 0 10px; }
  .section-title { font-size: 0.95rem; }
  .action-grid-admin { grid-template-columns: 1fr !important; gap: 16px; }
  .kpi-card, .chart-card { padding: 16px; }
  .kpi-value { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .report-card { padding: 14px; }
  .report-card > div[style*="display:flex"]:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px;
  }
  .report-card .btn { width: 100% !important; padding: 10px !important; font-size: 0.9rem !important; }
  .admin-container { padding: 16px 12px !important; }
}

/* ==================== AGGRESSIVE MOBILE SCALING (ADMIN CARDS) ==================== */
@media (max-width: 600px) {
  .alert-section .report-card,
  .submission-section .report-card,
  .resolved-section .report-card { padding: 12px !important; margin-bottom: 10px !important; }
  .report-card strong { font-size: 0.95rem !important; }
  .report-card .small { font-size: 0.75rem !important; line-height: 1.3 !important; }
  .alert-section .thumb,
  .submission-section .thumb {
    height: 100px !important; /* Reduced for mobile */
    object-fit: cover;
  }
  
  /* Make the resolved thumbnails smaller too */
  .resolved-section .resolved-thumb {
    height: 60px !important; 
  }

  /* Tighten the gap between elements inside the card */
  .report-card > div {
    margin-top: 6px !important;
  }
}

/* ==================== AGGRESSIVE MOBILE SCALING (HISTORY CARDS) ==================== */
@media (max-width: 600px) {
  .history-card { padding: 14px !important; }
  .history-card .card-title { font-size: 0.9rem !important; }
  .history-card .meta,
  .history-card .meta-name,
  .history-card .desc-snippet { font-size: 0.75rem !important; }
  .history-card .thumb { height: 80px !important; }
  .history-card .photo-comparison { gap: 8px !important; }
  .history-card .photo-label { font-size: 0.65rem !important; }
  .history-card .date-footer { font-size: 0.7rem !important; padding-top: 8px !important; }
  .filter-bar { padding: 12px !important; gap: 10px !important; }
  .filter-group label { font-size: 0.7rem !important; }
  .filter-group select,
  .filter-group input[type="date"] { padding: 7px 10px !important; font-size: 0.85rem !important; min-width: 140px !important; }
}

/* ==================== LOCATIONS GRID ==================== */
.location-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.location-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--secondary);
  padding: 22px 14px;
  text-align: center;
  border-radius: var(--radius-lg);
  cursor: pointer;
  position: relative;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.location-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.location-card:active { transform: scale(0.97); }
.location-card.disabled {
  border-color: var(--border);
  color: #94A3B8;
  background: #F8FAFC;
  box-shadow: none;
}
.location-card.disabled:hover { transform: none; border-color: var(--border); color: #94A3B8; }

.coming-soon-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #F1F5F9;
  color: var(--text-secondary);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 600px) { .location-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .location-grid { grid-template-columns: repeat(4, 1fr); } }

/* ==================== COMING SOON MODAL ==================== */
.coming-soon-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.coming-soon-overlay.show { opacity: 1; visibility: visible; }
.coming-soon-box {
  background: #fff;
  border-radius: var(--radius-xl);
  max-width: 360px;
  width: 90%;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.coming-soon-overlay.show .coming-soon-box { transform: scale(1); }

.hazard-tape {
  height: 22px;
  background: repeating-linear-gradient(
    45deg,
    var(--warning),
    var(--warning) 10px,
    var(--secondary) 10px,
    var(--secondary) 20px
  );
}
.coming-soon-content { padding: 28px 24px; }
.coming-soon-content h3 { color: var(--secondary); font-size: 1.3rem; margin-bottom: 12px; letter-spacing: -0.01em; }
.coming-soon-content p { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.coming-soon-content button { width: 100%; }

/* ================================================================
   AUTH PAGES (login / signup) — static, no scrolling
   ================================================================ */
.auth-page {
  height: 100vh;
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.auth-page .container {
  width: 100%;
  padding-top: 0 !important;
  padding-bottom: 0;
}

/* Decorative shapes removed from document flow so they
   don't create overflow / scrollbars */
.floating-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-shapes .shape {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06), transparent 70%);
  animation: floatShape 20s ease-in-out infinite;
}

@keyframes floatShape {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* Compact the auth layout on shorter screens so the full form
   stays visible without any scrolling */
@media (max-height: 800px) {
  .auth-page .container { max-width: 460px; padding-left: 16px; padding-right: 16px; }
  .auth-page .container > .text-center.mb-2 { margin-bottom: 8px !important; }
  .auth-page .container > .text-center > div:first-child { font-size: 1.6rem !important; }
  .auth-page .container h1,
  .auth-page .container h2 { margin: 0 0 2px; font-size: 1.25rem; }
  .auth-page .container .small { margin: 0; }
  .auth-page .card { padding: 14px 20px; margin-bottom: 0; }
  .auth-page .form-group { margin-bottom: 8px; }
  .auth-page .form-group label { margin-bottom: 3px; font-size: 0.78rem; }
  .auth-page .form-group input { padding: 8px 12px; font-size: 0.9rem; }
  .auth-page .form-group .small { font-size: 0.75rem; }
  .auth-page .btn { padding: 10px 16px; margin-top: 2px; }
  .auth-page .card .mt-2 { margin-top: 8px !important; }
}

/* ================================================================
   ANIMATED GRADIENT BACKGROUND  (vanilla port of shadcn GradientBackground)
   Recreates the React + Framer Motion component without React.
   Uses the same 5 gradient stops and loops the background position
   to mimic the animated `background` CSS transition.
   ================================================================ */
.gradient-background {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

/* The animated layer. Background-size is enlarged (500%) so the
   background-position can be animated smoothly from 0% to 100%. */
.gradient-background::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(135deg, #2d1b69 0%, #11998e 100%),
    linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%),
    linear-gradient(135deg, #0f3460 0%, #e94560 100%),
    linear-gradient(135deg, #134e5e 0%, #71b280 100%),
    linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
  background-size: 500% 500%, 500% 500%, 500% 500%, 500% 500%, 500% 500%;
  background-position: 0% 50%, 25% 50%, 50% 50%, 75% 50%, 100% 50%;
  background-repeat: no-repeat;
  animation: gradientShift var(--gradient-duration, 8s) ease-in-out
             var(--gradient-delay, 0.5s) infinite;
}

/* Optional dark overlay (overlay + overlayOpacity props) */
.gradient-background .gradient-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: 0;
}

/* Content wrapper sits above the animated layer */
.gradient-background .gradient-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loop the crossfade across the 5 gradients, then snap back —
   the first and last gradients are identical, so the loop is seamless. */
@keyframes gradientShift {
  0%   { background-position: 0% 50%,   25% 50%,  50% 50%,  75% 50%, 100% 50%; }
  20%  { background-position: 25% 50%,  25% 50%,  50% 50%,  75% 50%, 100% 50%; }
  40%  { background-position: 50% 50%,  50% 50%,  50% 50%,  75% 50%, 100% 50%; }
  60%  { background-position: 75% 50%,  75% 50%,  75% 50%,  75% 50%, 100% 50%; }
  80%  { background-position: 100% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 50%; }
  100% { background-position: 0% 50%,   25% 50%,  50% 50%,  75% 50%, 100% 50%; }
}

/* Login page uses the gradient behind the existing auth card.
   The card stays readable on top of the coloured background. */
.auth-page.gradient-background {
  background: #2d1b69;
}
.auth-page.gradient-background .gradient-content {
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}
.auth-page.gradient-background .container {
  z-index: 2;
}
/* Make the brand text legible on the dark gradient */
.auth-page.gradient-background .auth-brand h1 { color: #fff !important; }
.auth-page.gradient-background .auth-brand .small { color: rgba(255, 255, 255, 0.85); }
.auth-page.gradient-background .brand-badge {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
  .gradient-background::before { animation: none; }
}

/* ================================================================
   USER THEME ENHANCEMENTS (body.user-app)
   Premium SaaS polish for student-facing pages
   ================================================================ */
.user-app {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(37, 99, 235, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(6, 182, 212, 0.07), transparent),
    linear-gradient(-45deg, #F8FAFC, #F1F5F9, #EFF6FF, #F8FAFC);
  background-size: auto, auto, 400% 400%;
  animation: gradientBG 18s ease infinite;
  min-height: 100vh;
}

@keyframes gradientBG {
  0% { background-position: 0 0, 0 0, 0% 50%; }
  50% { background-position: 0 0, 0 0, 100% 50%; }
  100% { background-position: 0 0, 0 0, 0% 50%; }
}

/* Soft glass cards on user pages */
.user-app .card,
.user-app .action-btn,
.user-app .grid-block,
.user-app .room-btn,
.user-app .item-card,
.user-app .location-card:not(.disabled),
.user-app .report-card,
.user-app .history-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-app .card:hover,
.user-app .action-btn:hover,
.user-app .grid-block:hover,
.user-app .room-btn:hover,
.user-app .item-card:hover,
.user-app .location-card:not(.disabled):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.35);
}

.coming-soon-content button {
  width: 100%;
}

/* ==================== PRINT STYLES ==================== */
#print-area {
  display: none;
}

@media print {
  /* Remove all default browser margins */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide everything except print-area completely */
  body > *:not(#print-area) {
    display: none !important;
  }
  
  #print-area {
    display: block !important;
    width: 100%;
    padding: 15px;
    color: #000;
  }
  
  /* === SHARED HEADER STYLES === */
  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #1a5f7a;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .print-logo {
    max-height: 50px;
    width: auto;
  }
  .print-title {
    text-align: right;
  }
  .print-title h1 {
    color: #1a5f7a;
    font-size: 1.3rem;
    margin: 0;
  }
  .print-title p {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
  }
  
  .print-section {
    margin-bottom: 12px;
  }
  .print-section h2 {
    font-size: 1rem;
    color: #1a5f7a;
    border-bottom: 1px solid #ddd;
    padding-bottom: 3px;
    margin-bottom: 6px;
  }
  
    /* === SHARED SIGNATURE STYLES (SIDE BY SIDE) === */
  .print-signatures {
    margin-top: 100px; /* Increased to drop it lower on the page */
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important; /* Centers them with space around */
    width: 100%;
    page-break-inside: avoid; 
  }
  .print-sign-line {
    border-top: 1px solid #000;
    width: 280px; /* Increased width for more signing space */
    text-align: center;
    padding-top: 10px; /* More space below the line */
    font-size: 0.85rem;
  }

  /* === INDIVIDUAL REPORT SPECIFIC (FORCED TO 1 PAGE) === */
  .print-individual-report {
    page-break-inside: avoid;
    display: flex;
    flex-direction: column;
    min-height: 95vh; 
  }
  /* Pushes the signature section to the bottom of the individual report */
  .print-individual-report .print-signatures {
    margin-top: auto;
    padding-bottom: 10px;
  }
  .print-individual-report .print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
  }
  .print-individual-report .print-item {
    margin-bottom: 4px;
    font-size: 0.85rem;
  }
  .print-individual-report .print-photos {
    display: flex;
    gap: 10px;
    margin-top: 8px;
  }
  .print-individual-report .print-photo-box img {
    max-width: 100%;
    height: 130px; 
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  .print-individual-report .print-photo-label {
    font-weight: bold;
    margin-top: 3px;
    display: block;
    font-size: 0.8rem;
  }

  /* === MONTHLY SUMMARY TABLE SPECIFIC (ALLOWS MULTIPLE PAGES) === */
  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.85rem;
  }
  .print-table th, .print-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }
  .print-table th {
    background-color: #f0f4f8 !important;
    color: #1a5f7a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-table tr:nth-child(even) {
    background-color: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-table thead {
    display: table-header-group;
  }
  .print-table tr {
    page-break-inside: avoid;
  }

}

/* ==================== TOAST NOTIFICATIONS ==================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-info { background: var(--primary); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); }
.toast-danger, .toast-error { background: var(--danger); }

/* ==================== HOVER STATUS TOOLTIP ==================== */
#hover-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  background: var(--text);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none; /* never blocks the cursor or hover targets */
  opacity: 0;
  transition: opacity 0.15s ease;
}

#hover-tooltip.visible {
  opacity: 1;
}

#hover-tooltip.tooltip-info { background: var(--primary); }
#hover-tooltip.tooltip-success { background: var(--success); }
#hover-tooltip.tooltip-warning { background: var(--warning); }
#hover-tooltip.tooltip-danger, #hover-tooltip.tooltip-error { background: var(--danger); }

/* ==================== SVG TOOLTIP (report-layers viewer) ==================== */
.svg-tooltip {
  position: absolute;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
  white-space: nowrap;
  transform: translate(-50%, -130%);
}
.svg-tooltip.visible {
  opacity: 1;
}

/* ==================== DUPLICATE WARNING ==================== */
.dup-warning {
  background: #fff3cd;
  color: #856404;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  border: 1px solid #ffeeba;
  display: none;
}

/* ==================== REPORT PHOTO PREVIEW ==================== */
.photo-preview {
  display: none;
  margin-top: 10px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8fafc;
}

.photo-preview.active {
  display: block;
}

.photo-preview img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}
/* ==================== [REPORT-ROOMS] BLOCK B PLACEHOLDER ROOMS ==================== */
/* Non-reportable spaces: warden room, power room, laundry, hallway, toilets, storage. */
.placeholder-rect { fill: #f1f5f9; stroke: #94a3b8; stroke-width: 1.5; stroke-dasharray: 5 3; cursor: default; }
.placeholder-text { font-size: 11px; font-weight: 600; fill: #64748b; pointer-events: none; }