/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f1a2e;
  --sidebar-hover: #1a2c4a;
  --sidebar-active: rgba(33, 150, 243, 0.15);
  --primary: #2196F3;
  --primary-dark: #1976D2;
  --primary-light: #BBDEFB;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #333333;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #f44336;
  --purple: #9C27B0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

/* Dark Mode Variables */
html[data-theme="dark"] {
  --bg: #0f1419;
  --card-bg: #1a1f2e;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --border: #2d3748;
  --sidebar-bg: #0a0f1b;
  --sidebar-hover: #1a2332;
}

/* Dark Mode - Body & General */
html[data-theme="dark"] body {
  background: #0f1419;
  color: #e5e7eb;
  background-image: none;
}

html[data-theme="dark"] body::before {
  background: rgba(15, 20, 25, 0.5);
}

/* Dark Mode - Header */
html[data-theme="dark"] .top-header {
  background: linear-gradient(180deg, rgba(26, 31, 46, 0.98) 0%, rgba(20, 25, 40, 0.95) 100%);
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .menu-toggle {
  color: #e5e7eb;
}

html[data-theme="dark"] .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

html[data-theme="dark"] .icon-btn:hover {
  background: rgba(33, 150, 243, 0.15);
  color: #2196F3;
}

html[data-theme="dark"] .search-box {
  background: rgba(255, 255, 255, 0.08);
  border-color: #2d3748;
}

html[data-theme="dark"] .search-box:focus-within {
  background: rgba(255, 255, 255, 0.12);
  border-color: #2196F3;
}

html[data-theme="dark"] .search-box input {
  color: #e5e7eb;
  background: none;
}

html[data-theme="dark"] .search-box input::placeholder {
  color: #6b7280;
}

html[data-theme="dark"] .header-user {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.05) 100%);
  border-color: rgba(33, 150, 243, 0.2);
}

html[data-theme="dark"] .header-user:hover {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(33, 150, 243, 0.1) 100%);
  border-color: rgba(33, 150, 243, 0.4);
}

html[data-theme="dark"] .header-user-name {
  color: #e5e7eb;
}

html[data-theme="dark"] .header-user-role {
  color: #9ca3af;
}

/* Dark Mode - Page Content */
html[data-theme="dark"] .page-content {
  background: linear-gradient(180deg, #0f1419 0%, #1a1f2e 50%, #0f1419 100%);
}

html[data-theme="dark"] .page-header {
  background: linear-gradient(135deg, #1a2640 0%, #111d35 100%);
  border-color: rgba(33, 150, 243, 0.2);
}

html[data-theme="dark"] .page-header h1 {
  color: #ffffff;
}

html[data-theme="dark"] .page-header .page-subtitle {
  color: #b0c4ff;
}

/* Dark Mode - Cards */
html[data-theme="dark"] .card {
  background: linear-gradient(135deg, #1a1f2e 0%, #15192a 100%);
  border-color: #2d3748;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .card-header {
  background: linear-gradient(135deg, #1a1f2e 0%, #15192a 100%);
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .card-header h2 {
  color: #e5e7eb;
}

html[data-theme="dark"] .stat-card {
  background: linear-gradient(135deg, #1a1f2e 0%, #15192a 100%);
  border-color: #2d3748;
}

html[data-theme="dark"] .stat-value {
  color: #e5e7eb;
}

html[data-theme="dark"] .stat-label {
  color: #9ca3af;
}

/* Dark Mode - Tables */
html[data-theme="dark"] .data-table {
  background: #1a1f2e;
}

html[data-theme="dark"] .data-table thead {
  background: linear-gradient(90deg, #0f1d30 0%, #0a1525 100%);
}

html[data-theme="dark"] .data-table th {
  color: #e5e7eb;
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .data-table td {
  color: #e5e7eb;
  background: #1a1f2e;
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .data-table tbody tr:nth-child(odd) {
  background: rgba(33, 150, 243, 0.05);
}

html[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(33, 150, 243, 0.1);
}

html[data-theme="dark"] .empty-state {
  background: rgba(33, 150, 243, 0.03);
  color: #9ca3af;
}

html[data-theme="dark"] .table-footer {
  border-top-color: #2d3748;
}

/* Dark Mode - Forms */
html[data-theme="dark"] .form-group label {
  color: #e5e7eb;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select {
  background: #15192a;
  color: #e5e7eb;
  border-color: #2d3748;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .form-group input:hover,
html[data-theme="dark"] .form-group textarea:hover,
html[data-theme="dark"] .form-group select:hover {
  border-color: #3d4758;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus,
html[data-theme="dark"] .form-group select:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.3);
  background: #1a1f2e;
}

html[data-theme="dark"] .form-group input::placeholder,
html[data-theme="dark"] .form-group textarea::placeholder {
  color: #6b7280;
}

html[data-theme="dark"] .form-group input[readonly],
html[data-theme="dark"] .form-group textarea[readonly] {
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  border-color: #2d3748;
}

/* Dark Mode - Modal */
html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .modal {
  background: linear-gradient(135deg, #1a1f2e 0%, #15192a 100%);
  border: 1px solid #2d3748;
}

html[data-theme="dark"] .modal-header {
  background: linear-gradient(135deg, #1a1f2e 0%, #15192a 100%);
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .modal-header h2 {
  color: #e5e7eb;
}

html[data-theme="dark"] .modal-close {
  background: rgba(255, 255, 255, 0.1);
  color: #9ca3af;
}

html[data-theme="dark"] .modal-close:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}

html[data-theme="dark"] .modal-body {
  background: #1a1f2e;
}

html[data-theme="dark"] .modal-footer {
  background: linear-gradient(135deg, #15192a 0%, #0f1419 100%);
  border-top-color: #2d3748;
}

/* Dark Mode - Form Sections */
html[data-theme="dark"] .form-section {
  background: linear-gradient(135deg, #1a1f2e 0%, #15192a 100%);
  border-color: #2d3748;
}

html[data-theme="dark"] .form-section:hover {
  border-color: #3d4b5c;
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.1);
}

html[data-theme="dark"] .section-header h3 {
  color: #e5e7eb;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

html[data-theme="dark"] .section-subtitle {
  color: #d1d5db;
}

html[data-theme="dark"] .upload-helper-text {
  color: #cbd5e1;
}

html[data-theme="dark"] .form-section p {
  color: #d1d5db;
}

html[data-theme="dark"] .form-help-text {
  color: #a1a5ad;
}

html[data-theme="dark"] .upload-area label {
  color: #e5e7eb;
}

html[data-theme="dark"] .upload-area {
  color: #e5e7eb;
}

/* Dark Mode - Buttons */
html[data-theme="dark"] .btn-secondary {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #e5e7eb;
  border-color: #3d4b5c;
}

html[data-theme="dark"] .btn-secondary:hover {
  background: linear-gradient(135deg, #3d4b5c 0%, #2d3748 100%);
  border-color: #4d5b6c;
}

/* Dark Mode - Status Badge */
html[data-theme="dark"] .status-badge {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Dark Mode - Notification Panel */
html[data-theme="dark"] .notification-panel {
  background: #1a1f2e;
  border-color: #2d3748;
}

html[data-theme="dark"] .notification-header {
  background: linear-gradient(90deg, rgba(26, 31, 46, 0.5) 0%, rgba(26, 31, 46, 0.3) 100%);
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .notification-header h3 {
  color: #e5e7eb;
}

html[data-theme="dark"] .notification-item {
  background: #1a1f2e;
  border-bottom-color: #2d3748;
}

html[data-theme="dark"] .notification-item:hover {
  background: rgba(33, 150, 243, 0.08);
}

html[data-theme="dark"] .notification-title {
  color: #e5e7eb;
}

html[data-theme="dark"] .notification-message {
  color: #9ca3af;
}

/* Dark Mode - Theme Toggle Icon Animation */
html[data-theme="dark"] .theme-toggle-btn {
  animation: rotateIcon 0.3s ease;
}

@keyframes rotateIcon {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: url('assets/municipal_hall.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 26, 46, 0.70) 0%, rgba(33, 150, 243, 0.40) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  background: linear-gradient(135deg, rgba(15, 26, 46, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3) 0%, rgba(30, 64, 175, 0.2) 100%);
  min-height: 80px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.brand-logo .brand-expand-icon {
  display: none;
}

.sidebar-logo-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-logo-text {
  height: 35px;
  width: auto;
  object-fit: contain;
  margin-bottom: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
}

.brand-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--primary);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #ffffff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.4) 0%, rgba(37, 99, 235, 0.2) 100%);
  color: #ffffff;
  font-weight: 600;
  border-right: 3px solid #60a5fa;
}

.nav-item.active i {
  color: #60a5fa;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.user-profile-sidebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  transition: all var(--transition);
  cursor: pointer;
}

.user-profile-sidebar:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35) 0%, rgba(37, 99, 235, 0.2) 100%);
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.2);
  transform: translateY(-2px);
}

.user-avatar-sidebar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.user-info-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.user-name-sidebar {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-sidebar {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Logout Button Footer */
.logout-btn-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.logout-btn-footer:hover {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(244, 67, 54, 0.1) 100%);
  color: var(--danger);
  border-color: rgba(244, 67, 54, 0.3);
}

.sidebar.collapsed .logout-btn-footer {
  padding: 12px;
  justify-content: center;
}

.sidebar.collapsed .logout-btn-footer span {
  display: none;
}

.sidebar.collapsed .logout-btn-footer i {
  margin: 0;
}

/* Sidebar Collapse Button */
.sidebar-collapse-btn {
  width: 40px;
  height: 40px;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-collapse-btn:hover {
  background: rgba(96, 165, 250, 0.2);
  color: rgba(255,255,255,0.8);
  border-color: rgba(96, 165, 250, 0.4);
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
  --sidebar-width: 80px;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 20px 12px;
  min-height: 80px;
}

.sidebar.collapsed .brand-text {
  display: none;
}

.sidebar.collapsed .brand-logo {
  width: 48px;
  height: 48px;
  cursor: pointer;
}

.sidebar.collapsed .brand-logo .brand-expand-icon {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  color: #1c3a72;
  font-size: 20px;
  pointer-events: none;
}

.sidebar.collapsed .brand-logo:hover .sidebar-logo-icon,
.sidebar.collapsed .brand-logo:focus-visible .sidebar-logo-icon {
  opacity: 0.8;
}

.brand-logo:focus-visible {
  outline: 2px solid #69b4fa;
  outline-offset: 3px;
}

.sidebar.collapsed .sidebar-collapse-btn {
  display: none;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px;
}

.sidebar.collapsed .nav-item {
  padding: 12px 8px;
  justify-content: center;
  border-radius: 12px;
}

.sidebar.collapsed .nav-item span {
  display: none;
}

.sidebar.collapsed .nav-item.active {
  border-right: none;
  border-bottom: 3px solid #60a5fa;
  padding-bottom: 9px;
}

.sidebar.collapsed .user-profile-sidebar {
  display: none;
}

.sidebar.collapsed .user-info-sidebar {
  display: none;
}

.sidebar.collapsed .user-avatar-sidebar {
  width: 40px;
  height: 40px;
}

.sidebar.collapsed .sidebar-collapse-btn {
  margin: 0;
  order: 1;
}

.sidebar.collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-footer {
  flex-direction: column-reverse;
}

/* Adjust main content margin when sidebar is collapsed */
.sidebar-collapsed .main-content {
  margin-left: 80px;
  width: calc(100vw - 80px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  width: calc(100vw - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ===== TOP HEADER ===== */
.top-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 252, 0.95) 100%);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  backdrop-filter: blur(10px);
  height: 56px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--bg);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 50px;
  padding: 8px 14px;
  max-width: 400px;
  width: 100%;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.1);
}

.search-box i {
  color: var(--text-secondary);
  font-size: 14px;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: var(--bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== NOTIFICATION PANEL ===== */
.notification-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  max-height: 500px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  flex-direction: column;
  margin-top: 12px;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.notification-panel.active {
  display: flex;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.5) 0%, rgba(248, 250, 252, 0.3) 100%);
}

.notification-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.notification-clear-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.notification-clear-btn:hover {
  color: var(--danger);
  background: rgba(244, 67, 54, 0.1);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all var(--transition);
  background: var(--card-bg);
}

.notification-item:hover {
  background: var(--bg);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notification-icon.success {
  background: #E8F5E9;
  color: var(--success);
}

.notification-icon.info {
  background: #E3F2FD;
  color: var(--primary);
}

.notification-icon.warning {
  background: #FFF3E0;
  color: var(--warning);
}

.notification-icon.error {
  background: #FFEBEE;
  color: var(--danger);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px 0;
}

.notification-message {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
  word-break: break-word;
}

.notification-time {
  font-size: 11px;
  color: #9ca3af;
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.notification-close:hover {
  color: var(--danger);
}

.notification-empty {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
  margin: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.05) 0%, rgba(33, 150, 243, 0.02) 100%);
  border: 1px solid rgba(33, 150, 243, 0.1);
}

.header-user:hover {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(33, 150, 243, 0.08) 100%);
  border-color: rgba(33, 150, 243, 0.3);
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.12);
  transform: translateY(-1px);
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
  font-weight: 600;
  flex-shrink: 0;
}

.header-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.3px;
}

.header-user-role {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 50%, #f5f7fa 100%);
  max-width: 100%;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  margin-bottom: 28px;
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  padding: 32px;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(30, 64, 175, 0.3);
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.15);
  position: relative;
  overflow: hidden;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 15px;
  color: #e0e7ff;
  font-weight: 400;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, #fafbfc 100%);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(33, 150, 243, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.5);
}

.stat-icon-blue {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
}

.stat-icon-green {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #2E7D32;
}

.stat-icon-orange {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  color: #E65100;
}

.stat-icon-purple {
  background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  color: #6A1B9A;
}

.stat-icon-red {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  color: #D32F2F;
}

.stat-icon-yellow {
  background: linear-gradient(135deg, #FFFDE7 0%, #FFF9C4 100%);
  color: #F57F17;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

/* ===== CARDS ===== */
.card {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border-radius: var(--radius);
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  flex: 0 0 auto;
  letter-spacing: -0.3px;
}

.card-badge {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(21, 101, 192, 0.2);
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-recent-header .dashboard-view-all {
  margin-left: auto;
  white-space: nowrap;
}

.btn.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn.pdf-download-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

html[data-theme="dark"] .pdf-download-btn {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

html[data-theme="dark"] .pdf-download-btn:hover {
  background: #b91c1c;
  border-color: #f87171;
}

.date-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-separator {
  color: #999;
  font-size: 13px;
  font-weight: 500;
}

.table-search {
  max-width: 260px;
  flex: 1;
  min-width: 150px;
}

.table-search input {
  font-size: 13px;
}

.date-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.date-range-group input {
  flex: 0 0 auto;
  min-width: 140px;
}

.status-filter {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--card-bg);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.status-filter:hover {
  border-color: var(--primary);
}

.status-filter:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.admin-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.card-body {
  padding: 24px;
}

.admin-form-intro {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.admin-role-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-role-grid > .card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-role-grid > .card > .card-body { flex: 1; }
.admin-role-grid > .card:last-child > .card-body {
  display: flex;
  flex-direction: column;
}
.admin-role-form .admin-form-section {
  min-width: 0;
  padding: 20px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-form-section legend {
  padding: 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.admin-form-section legend > span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border-radius: 50%;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.admin-role-form .form-group { margin-bottom: 18px; }
.admin-role-form .form-group:last-child { margin-bottom: 0; }
.admin-role-form .form-help-text { margin-top: 6px; line-height: 1.5; color: var(--text-secondary); }
.admin-optional { font-size: 11px; font-weight: 400; color: var(--text-secondary); margin-left: 6px; }
.admin-password-control { position: relative; }
.admin-password-control input { padding-right: 48px; }
.admin-password-control button {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.admin-role-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
}
.admin-role-form .checkbox-label input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex: 0 0 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--primary);
}
.admin-role-form .checkbox-label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-role-form .checkbox-label:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.admin-super-option {
  padding: 8px 14px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.admin-super-option .form-help-text { margin-left: 30px; }
.admin-role-form .admin-access-submit { justify-content: center; min-height: 48px; margin-top: auto; }
.admin-role-form :is(input, select) { min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
  .admin-role-form { padding: 16px; }
  .admin-role-form .admin-form-section { padding: 14px; }
  .admin-role-form :is(.admin-feature-options, .admin-report-category-options) { grid-template-columns: minmax(0, 1fr); }
}

.admin-feature-options,
.admin-report-category-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admin-feature-options .checkbox-label,
.admin-report-category-options .checkbox-label {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.admin-feature-options .checkbox-label:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}

.submission-time-cell,
.submission-age-cell {
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.submission-age-cell {
  font-weight: 600;
  color: var(--primary);
}

.admin-role-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 14px;
  min-height: 220px;
}

.admin-roles-footer {
  margin: 18px -24px -24px;
  padding: 16px 24px 0;
}

.admin-role-item {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.03), rgba(25, 118, 210, 0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.admin-role-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-role-header h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
}

.admin-role-header .btn {
  padding: 8px 12px;
  font-size: 12px;
}

.admin-role-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.admin-role-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e0f2fe;
  color: #075985;
}

.admin-role-tag.super {
  background: #fef3c7;
  color: #92400e;
}

.admin-role-email {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-role-access {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 13px;
}

/* ===== TABLE ENHANCEMENTS ===== */
.table-card {
  transition: all var(--transition);
}

.table-card:hover {
  box-shadow: var(--shadow);
}

/* ===== TABLE ===== */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

.data-table thead {
  background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 100%);
}

.data-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid #f0f1f3;
  color: var(--text);
  background: var(--card-bg);
  vertical-align: middle;
}

.data-table td:nth-child(3),
.data-table td:nth-child(4) {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(33, 150, 243, 0.02);
}

.data-table tbody tr:hover {
  background: rgba(33, 150, 243, 0.06);
  border-left-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(33, 150, 243, 0.1);
}

.data-table tbody tr:hover td {
  background: transparent;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px !important;
  font-size: 14px;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.02) 0%, rgba(33, 150, 243, 0.01) 100%);
}

/* Table Footer */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.showing-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

/* ===== ANALYTICS GRID ===== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

/* ===== DASHBOARD SECTIONS ===== */
.dashboard-section {
  margin-top: 28px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-label i {
  font-size: 18px;
  color: var(--primary);
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-label span {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.3px;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(135deg, var(--card-bg) 0%, #fafbfc 100%);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-color: var(--primary);
}

.quick-action-card:active {
  transform: translateY(-1px);
}

.qa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.qa-icon-blue {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
}

.qa-icon-green {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #2E7D32;
}

.qa-icon-orange {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  color: #E65100;
}

.qa-icon-purple {
  background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  color: #6A1B9A;
}

.qa-icon-red {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  color: #D32F2F;
}

.qa-icon-yellow {
  background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
  color: #F57F17;
}

.qa-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.qa-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.2px;
}

.qa-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Dashboard 3-Column Grid */
.dashboard-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

/* Dashboard 2-Column Grid */
.dashboard-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 28px;
  margin-bottom: 40px;
}

@media (max-width: 1200px) {
  .dashboard-grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-grid-3col {
    grid-template-columns: 1fr;
  }

  .dashboard-grid-2col {
    grid-template-columns: 1fr;
  }
}

#performanceTrendChart {
  max-height: 350px !important;
  margin-top: 20px;
}

@media (max-width: 1024px) {
  .dashboard-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Compact Table for Dashboard */
.data-table-compact th {
  padding: 10px 14px;
  font-size: 11px;
}

.data-table-compact td {
  padding: 10px 14px;
  font-size: 13px;
}

/* Dashboard News List */
.dashboard-news-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.dashboard-news-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f1f3;
  transition: all var(--transition);
  cursor: pointer;
}

.dashboard-news-item:last-child {
  border-bottom: none;
}

.dashboard-news-item:hover {
  background: rgba(33, 150, 243, 0.04);
}

.dashboard-news-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.dashboard-news-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f2f5 0%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #b0b7c3;
  font-size: 20px;
  border: 1px solid var(--border);
}

.dashboard-news-content {
  flex: 1;
  min-width: 0;
}

.dashboard-news-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-news-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-news-date {
  font-size: 11px;
  color: #9ca3af;
}

/* System Status */
.system-status-list {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.system-status-list .status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid #f0f1f3;
}

.system-status-list .status-item:last-child {
  border-bottom: none;
}

.system-status-list .status-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  min-width: unset;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-indicator i {
  font-size: 14px;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-active {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.status-dot-inactive {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(244, 67, 54, 0.4);
}

.status-dot-checking {
  background: var(--warning);
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.analytics-card {
  padding: 24px;
}

.status-breakdown {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 0;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 90px;
  text-align: left;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.status-bar {
  flex: 1;
  height: 28px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
}

.status-fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  min-width: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pending-fill {
  background: linear-gradient(90deg, #FF9800, #FFB74D);
}

.reviewing-fill {
  background: linear-gradient(90deg, #1976D2, #42A5F5);
}

.resolved-fill {
  background: linear-gradient(90deg, #43A047, #66BB6A);
}

.processing-fill {
  background: linear-gradient(90deg, #8E24AA, #BA68C8);
}

.rejected-fill {
  background: linear-gradient(90deg, #D32F2F, #EF5350);
}

.status-count {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  min-width: 50px;
  text-align: right;
  letter-spacing: -0.5px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  border-left: 4px solid var(--primary);
}

.category-item-label {
  font-weight: 500;
  color: #111827;
}

.category-item-count {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  box-shadow: 0 8px 25px rgba(33, 150, 243, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  border: 1px solid #d1d5db;
  font-weight: 700;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Action Buttons in Table */
.action-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-edit {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
  border: 1px solid rgba(21, 101, 192, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-edit:hover {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-delete {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  color: #C62828;
  border: 1px solid rgba(198, 40, 40, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-delete:hover {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-info {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1976D2;
  border: 1px solid rgba(25, 118, 210, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-info:hover {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.access-confirm {
  text-align: center;
  padding: 8px 12px;
}

.access-confirm-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #c62828;
  background: #ffebee;
  font-size: 24px;
}

.access-confirm-icon.is-unblocking {
  color: #1565c0;
  background: #e3f2fd;
}

.access-confirm p {
  margin: 0 auto 10px;
  max-width: 280px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.access-confirm strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all var(--transition);
}

.status-pending {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  color: #E65100;
  border: 1px solid rgba(230, 81, 0, 0.2);
}

.status-processing {
  background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
  color: #6B21A8;
  border: 1px solid rgba(107, 33, 168, 0.2);
}

.status-resolved {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #1B5E20;
  border: 1px solid rgba(27, 94, 32, 0.2);
}

.status-reviewing {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
  border: 1px solid rgba(21, 101, 192, 0.2);
}

.status-rejected {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  color: #C62828;
  border: 1px solid rgba(198, 40, 40, 0.2);
}

.status-approved {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #1B5E20;
  border: 1px solid rgba(27, 94, 32, 0.2);
}

.status-verified {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #1B5E20;
  border: 1px solid rgba(27, 94, 32, 0.2);
}

.status-not-submitted {
  background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
  color: #4B5563;
  border: 1px solid rgba(107, 114, 128, 0.15);
}

.field-readonly {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  background: #f8fafc;
  color: #1f2937;
  display: flex;
  align-items: center;
  font-size: 14px;
  word-break: break-word;
}

.verification-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.verification-preview-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.verification-preview-item .preview-label {
  display: block;
  padding: 10px 12px;
  background: #eef2ff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.verification-preview-item img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.verification-preview-image {
  cursor: zoom-in;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.verification-preview-image:hover,
.verification-preview-image:focus-visible {
  opacity: 0.86;
  outline: 3px solid #3b82f6;
  outline-offset: -3px;
}

.image-lightbox {
  align-items: center;
  background: rgba(7, 12, 24, 0.88);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 32px;
  position: fixed;
  z-index: 500;
}

.image-lightbox.active {
  display: flex;
}

.image-lightbox img {
  border: 4px solid #ffffff;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  max-height: calc(100vh - 64px);
  max-width: min(1100px, 92vw);
  object-fit: contain;
}

.image-lightbox-close {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-radius: 50%;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  font-size: 20px;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 24px;
  top: 24px;
  width: 42px;
}

.image-lightbox-close:hover {
  background: #dbeafe;
}

body.image-lightbox-open {
  overflow: hidden;
}

.verification-preview-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: linear-gradient(135deg, var(--card-bg) 0%, #fafbfc 100%);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.25s ease;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-sm {
  max-width: 420px;
}

.modal-lg {
  max-width: 800px;
}

/* ===== MODAL FORM SECTIONS ===== */
.form-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  transition: all var(--transition);
}

.form-section:hover {
  border-color: #d0d9ff;
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.08);
}

.section-header {
  margin-bottom: 24px;
}

.section-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f1a2e;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #0f1a2e 0%, #1e3a5f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 13.5px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
}

.subsection {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 2px solid #e5e7eb;
}

.subsection h4 {
  font-size: 15px;
  font-weight: 700;
  color: #0f1a2e;
  margin: 0 0 8px 0;
}

.subsection-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 18px 0;
  font-weight: 500;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 12px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .stat-card {
    padding: 12px;
    gap: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 12px;
  }

  .card-header {
    padding: 12px;
  }

  .card-header h2 {
    font-size: 16px;
  }

  .card-header-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .search-box {
    max-width: 100%;
    padding: 8px 12px;
    font-size: 13px;
  }

  .status-filter {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 11px;
  }

  .data-table th {
    white-space: normal;
  }

  .action-btns {
    flex-wrap: wrap;
    gap: 4px;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
  }

  .modal {
    max-width: 100% !important;
    margin: 10px;
    border-radius: 12px;
  }

  .modal-body {
    max-height: 60vh;
  }

  .form-section {
    padding: 12px;
    margin-bottom: 12px;
  }

  .section-header h3 {
    font-size: 14px;
  }

  .section-subtitle {
    font-size: 12px;
  }

  .logo-upload-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .logo-preview {
    width: 80px;
    height: 80px;
  }

  .logo-preview i {
    font-size: 24px;
  }

  .upload-area-container {
    gap: 12px;
  }

  .table-footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
  }

  .pagination {
    width: 100%;
    gap: 2px;
    flex-wrap: wrap;
  }

  .page-btn {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 8px 10px;
    font-size: 13px;
  }

  .delete-icon {
    font-size: 40px;
  }

  .analytics-card {
    padding: 12px;
  }

  .status-item {
    gap: 8px;
    flex-direction: column;
  }

  .status-label {
    text-align: left;
    min-width: unset;
  }

  .status-bar {
    height: 20px;
    text-align: left;
    min-width: unset;
  }

  .category-item {
    padding: 8px;
    font-size: 12px;
  }

  .header-left {
    gap: 10px;
  }

  .top-header {
    padding: 10px 12px;
  }

  .toast {
    min-width: 280px;
    max-width: 90vw;
    padding: 12px 16px;
  }

  .placeholder-card {
    padding: 40px 20px;
  }

  .placeholder-icon {
    font-size: 48px;
  }

  .placeholder-card h3 {
    font-size: 18px;
  }

  .placeholder-card p {
    font-size: 13px;
  }
}

.upload-area-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.upload-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.upload-area label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.upload-helper-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 14px 0;
  line-height: 1.5;
  min-height: 40px;
}

.upload-area .logo-upload-wrapper {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
  padding: 18px 20px 20px;
}

.upload-area .logo-preview {
  width: 100%;
  max-width: 220px;
  height: 170px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .upload-area-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .upload-area-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 36px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f1a2e;
  letter-spacing: -0.5px;
}

.modal-close {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border: none;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  transform: rotate(90deg);
}

.modal-body {
  padding: 32px 36px;
  max-height: 70vh;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 36px;
  border-top: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  flex-shrink: 0;
}

/* Delete Confirmation */
.delete-confirm {
  text-align: center;
  padding: 16px 0;
}

.delete-icon {
  font-size: 48px;
  color: var(--danger);
  margin-bottom: 16px;
}

.delete-confirm p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}

/* ===== REVIEWS MODAL ===== */
#reviewsList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#reviewsList .review-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
}

#reviewsList .review-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Minimalist reviews modal styles */
#placeReviewsModal .modal-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

#placeReviewsModal .modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f1a2e;
  letter-spacing: -0.5px;
}

/* Dark Mode - Reviews Modal */
html[data-theme="dark"] #placeReviewsModal .modal-body {
  background: #1a1f2e;
  color: #e5e7eb;
}

html[data-theme="dark"] #placeReviewsModal .modal-header h2 {
  color: #e5e7eb;
}

html[data-theme="dark"] #reviewsList .review-card {
  background: #252d3d;
  border-color: #3d4b5c;
  color: #e5e7eb;
}

html[data-theme="dark"] #reviewsList .review-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: #2a3241;
}

html[data-theme="dark"] #reviewsList .review-card .review-header {
  color: #e5e7eb;
}

html[data-theme="dark"] #reviewsList .review-card .review-date {
  color: #9ca3af;
}

html[data-theme="dark"] #reviewsList .review-card .review-text {
  color: #d1d5db;
}

html[data-theme="dark"] #reviewsList .review-card .review-rating {
  color: #fbbf24;
}

/* ===== PROFILE MODAL ===== */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
  border: 4px solid #ffffff;
  position: relative;
}

.profile-avatar-large i {
  position: absolute;
}

.profile-avatar-large span {
  font-size: 40px;
  font-weight: 700;
}

.profile-avatar-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.form-section:has(h3:contains("Security")) {
  border-top: 2px solid #f3f4f6;
  margin-top: 32px;
}

@media (max-width: 640px) {
  .profile-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 36px;
  }

  .profile-avatar-large span {
    font-size: 28px;
  }

  .form-grid-2col {
    grid-template-columns: 1fr;
  }
}
.logo-upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #fafbfc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: all var(--transition);
}

.logo-upload-wrapper:hover {
  background: #f3f4f6;
  border-color: var(--primary);
}

.logo-preview {
  width: 120px;
  height: 120px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  gap: 8px;
}

.logo-preview:hover {
  border-color: var(--primary);
  background: #f0f4ff;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.logo-preview i {
  font-size: 36px;
  color: #cbd5e1;
}

.logo-preview span {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  font-weight: 500;
}

.preview-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.remove-image-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.remove-image-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.remove-image-btn:active {
  transform: scale(0.95);
}

.preview-file-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
}

.preview-file-wrapper i {
  font-size: 20px;
  color: #3b82f6;
}

.preview-file-wrapper span {
  font-size: 13px;
  color: #1f2937;
  word-break: break-all;
  flex: 1;
}

.preview-file-wrapper .remove-image-btn {
  position: static;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.2);
}

.preview-file-wrapper .remove-image-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.3);
}

.remove-image-btn:active {
  transform: scale(0.95);
}

.barangay-logo-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.barangay-logo-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0f1a2e;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.required {
  color: #ef4444;
  font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: #ffffff;
  transition: all var(--transition);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: #d1d5db;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.12), inset 0 1px 3px rgba(0, 0, 0, 0.05);
  background: #ffffff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
  font-weight: 500;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-group input[readonly],
.form-group textarea[readonly] {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #d1d5db;
}

.form-group input[readonly]:hover,
.form-group textarea[readonly]:hover {
  border-color: #d1d5db;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.form-group select:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #d1d5db;
  opacity: 1;
}

.form-group select:disabled:hover {
  border-color: #d1d5db;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== TRANSPARENCY TYPE BADGES ===== */
.type-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all var(--transition);
}

.type-annual_budget {
  background: linear-gradient(135deg, #FEF3C7 0%, #FCD34D 100%);
  color: #78350F;
  border: 1px solid rgba(120, 53, 15, 0.2);
}

.type-bids {
  background: linear-gradient(135deg, #DDD6FE 0%, #C4B5FD 100%);
  color: #4C1D95;
  border: 1px solid rgba(76, 29, 149, 0.2);
}

.type-executive_orders {
  background: linear-gradient(135deg, #FECACA 0%, #FCA5A5 100%);
  color: #7F1D1D;
  border: 1px solid rgba(127, 29, 29, 0.2);
}

.type-financial_reports {
  background: linear-gradient(135deg, #C7D2FE 0%, #A5B4FC 100%);
  color: #1E3A8A;
  border: 1px solid rgba(30, 58, 138, 0.2);
}

.type-legislative_ordinances {
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  color: #065F46;
  border: 1px solid rgba(6, 95, 70, 0.2);
}

.type-programs {
  background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
  color: #6B21A8;
  border: 1px solid rgba(107, 33, 168, 0.2);
}

/* ===== TOURIST CATEGORY BADGES ===== */
.category-beach {
  background: linear-gradient(135deg, #CFFAFE 0%, #A5F3FC 100%);
  color: #155E75;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(21, 94, 117, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-mountain {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  color: #15803D;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(21, 128, 61, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-historical {
  background: linear-gradient(135deg, #FEF3C7 0%, #FCD34D 100%);
  color: #78350F;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(120, 53, 15, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-cultural {
  background: linear-gradient(135deg, #FCE7F3 0%, #FBCFE8 100%);
  color: #831843;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(131, 24, 67, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-religious {
  background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
  color: #3730A3;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(55, 48, 163, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-nature {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  color: #15803D;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(21, 128, 61, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-adventure {
  background: linear-gradient(135deg, #FECACA 0%, #FCA5A5 100%);
  color: #7F1D1D;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(127, 29, 29, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-entertainment {
  background: linear-gradient(135deg, #DDD6FE 0%, #C4B5FD 100%);
  color: #4C1D95;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(76, 29, 149, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== PLACEHOLDER PAGES ===== */
.placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.placeholder-icon {
  font-size: 56px;
  color: var(--primary-light);
  margin-bottom: 20px;
}

.placeholder-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #111827;
}

.placeholder-card p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--primary);
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(10px);
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast i {
  font-size: 20px;
}

.toast-success i {
  color: var(--success);
}

.toast-error i {
  color: var(--danger);
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(33, 150, 243, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(33, 150, 243, 0.7);
}

/* Firefox scrollbar */
* {
  scrollbar-color: rgba(33, 150, 243, 0.5) rgba(0, 0, 0, 0.05);
  scrollbar-width: thin;
}

/* ===== TABLET RESPONSIVE (768px - 1024px) ===== */
@media (min-width: 641px) and (max-width: 1024px) {
  .page-content {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .analytics-container {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-wrap: wrap;
  }

  .card-header-actions {
    width: 100%;
  }

  .search-box {
    max-width: 100%;
  }

  .status-filter {
    max-width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
    font-size: 13px;
  }

  .form-grid-2col {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 90% !important;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    padding: 20px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .stat-card {
    padding: 18px 20px;
  }
}

/* ===== SMALL PHONES (360px - 480px) ===== */
@media (max-width: 360px) {
  :root {
    --sidebar-width: 200px;
  }

  .sidebar {
    width: 200px;
  }

  .sidebar-brand {
    padding: 16px 12px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-sub {
    font-size: 9px;
  }

  .nav-item {
    padding: 10px 12px;
    font-size: 12px;
  }

  .top-header {
    padding: 8px 10px;
  }

  .search-box {
    display: none;
  }

  .header-user-info {
    display: none;
  }

  .page-content {
    padding: 12px;
  }

  .page-header {
    padding: 12px;
    margin-bottom: 16px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 10px;
    gap: 10px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .stat-info {
    min-width: 0;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 18px;
  }

  .card {
    border-radius: 8px;
  }

  .card-header {
    padding: 10px;
    flex-direction: column;
  }

  .card-header h2 {
    font-size: 14px;
  }

  .card-header-actions {
    width: 100%;
    flex-direction: column;
    gap: 6px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    font-size: 11px;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px;
    font-size: 10px;
  }

  .data-table th {
    white-space: normal;
  }

  .action-btns {
    gap: 2px;
  }

  .btn-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .modal {
    max-width: 95vw !important;
    margin: 5px;
  }

  .modal-header {
    padding: 12px;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  .modal-body {
    padding: 12px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group label {
    font-size: 12px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 6px 8px;
    font-size: 12px;
  }

  .form-section {
    padding: 10px;
    margin-bottom: 10px;
  }

  .section-header h3 {
    font-size: 13px;
  }

  .section-subtitle {
    font-size: 11px;
  }

  .logo-preview {
    width: 60px;
    height: 60px;
  }

  .logo-preview i {
    font-size: 20px;
  }

  .table-footer {
    padding: 10px;
    gap: 6px;
  }

  .showing-text {
    font-size: 12px;
  }

  .page-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .analytics-card {
    padding: 10px;
  }

  .status-item {
    gap: 6px;
  }

  .status-label {
    font-size: 12px;
  }

  .status-bar {
    height: 18px;
  }

  .status-fill {
    font-size: 10px;
  }

  .status-count {
    font-size: 12px;
  }

  .category-item {
    padding: 6px;
    font-size: 11px;
  }

  .category-item-count {
    padding: 1px 6px;
    font-size: 11px;
  }

  .toast {
    min-width: 90vw;
    padding: 10px 12px;
  }

  .placeholder-card {
    padding: 20px;
  }

  .placeholder-icon {
    font-size: 40px;
  }

  .placeholder-card h3 {
    font-size: 16px;
  }

  .placeholder-card p {
    font-size: 12px;
  }
}

/* ===== EXTRA LARGE SCREENS (1400px+) ===== */
@media (min-width: 1400px) {
  .page-content {
    padding: 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
  }

  .analytics-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .modal {
    max-width: 900px;
  }

  .search-box {
    max-width: 500px;
  }
}

/* ===== LANDSCAPE MODE (PHONES) ===== */
@media (max-height: 600px) and (orientation: landscape) {
  .sidebar {
    width: 180px;
  }

  .sidebar-nav {
    padding: 8px;
  }

  .nav-item {
    padding: 8px 12px;
    font-size: 12px;
  }

  .page-header {
    padding: 12px;
    margin-bottom: 12px;
  }

  .page-header h1 {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 10px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
  }

  .stat-value {
    font-size: 18px;
  }

  .modal-body {
    max-height: 80vh;
  }

  .card-header-actions {
    flex-direction: row;
    gap: 8px;
  }

  .table-footer {
    flex-direction: row;
    justify-content: space-between;
  }

  .notification-panel {
    width: 320px;
    max-height: 400px;
  }
}

/* ===== TABLET RESPONSIVE (768px - 1024px) ===== */
@media (min-width: 641px) and (max-width: 1024px) {
  .notification-panel {
    width: 360px;
  }
}

/* ===== SMALL PHONES (360px - 480px) ===== */
@media (max-width: 360px) {
  .notification-panel {
    width: 95vw;
    max-width: 320px;
    right: -50vw;
    transform: translateX(50vw);
  }
}

/* Mobile sidebar backdrop overlay */
.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  /* When sidebar is opened on mobile, always show at full width */
  .sidebar.open {
    width: 260px !important;
    transform: translateX(0) !important;
  }

  /* Override collapsed state when open on mobile */
  .sidebar.collapsed.open .brand-text {
    display: flex !important;
  }

  .sidebar.collapsed.open .brand-logo .brand-expand-icon {
    display: none;
  }

  .sidebar.collapsed.open .sidebar-collapse-btn {
    display: flex !important;
  }

  .sidebar.collapsed.open .nav-item {
    justify-content: flex-start !important;
    padding: 12px 16px !important;
  }

  .sidebar.collapsed.open .nav-item span {
    display: inline !important;
  }

  .sidebar.collapsed.open .user-profile-sidebar {
    display: flex !important;
  }

  .sidebar.collapsed.open .sidebar-footer {
    flex-direction: column !important;
  }
}

/* ===== EXTRA SMALL SCREENS ===== */
@media (max-width: 480px) {
  .notification-panel {
    width: calc(100vw - 20px);
    max-height: 60vh;
    right: auto;
    left: 10px;
  }

  .notification-item {
    padding: 10px 12px;
  }

  .notification-header {
    padding: 12px;
  }

  .notification-header h3 {
    font-size: 14px;
  }

  .notification-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .notification-title {
    font-size: 12px;
  }

  .notification-message {
    font-size: 11px;
  }
}
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card {
    gap: 9px;
    min-width: 0;
    padding: 14px 12px;
  }

  .stat-icon {
    flex: 0 0 42px;
    height: 42px;
    width: 42px;
    font-size: 20px;
  }

  .stat-label {
    font-size: 10px;
    line-height: 1.15;
  }

  .stat-value {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  body::before {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.3) 0%, rgba(33, 150, 243, 0.2) 100%);
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .header-user-info {
    display: none;
  }

  .top-header {
    padding: 12px 16px;
  }

  .page-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .card-header-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .search-box.table-search {
    flex: 1;
    min-width: 150px;
    width: 100%;
  }

  .date-range-group {
    width: 100%;
  }

  .date-range-group input {
    flex: 1;
    min-width: 120px;
  }

  .table-search {
    max-width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .table-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .page-header {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 16px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .stat-value {
    font-size: 22px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .card-header h2 {
    font-size: 16px;
  }
}

/* ===== FILE INPUT & IMAGE PREVIEW ===== */
.file-input-wrapper {
  position: relative;
}

.file-input-wrapper input[type="file"] {
  padding: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.file-input-wrapper input[type="file"]:hover {
  border-color: var(--primary);
  background-color: rgba(33, 150, 243, 0.02);
}

.image-preview {
  margin-top: 10px;
  display: none;
}

.image-preview.active {
  display: block;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.image-preview .remove-image {
  margin-top: 8px;
  display: inline-block;
  padding: 6px 12px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: background var(--transition);
}

.image-preview .remove-image:hover {
  background: #d32f2f;
}

/* ===== MOBILE TABLE → CARD CONVERSION ===== */

/* Responsive table card on mobile — automatically converts any data-table to cards */
@media (max-width: 768px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none; /* Hide column headers */
  }

  .data-table tr {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    border-left: 4px solid var(--primary);
  }

  .data-table td {
    padding: 6px 0;
    border: none !important;
    background: transparent !important;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    text-align: right;
    white-space: normal !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-align: left;
    flex-shrink: 0;
    min-width: 90px;
  }

  .data-table td:empty::before { display: none; }

  .data-table td:first-child {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    padding-top: 0;
  }

  .data-table td[colspan] {
    text-align: center;
    justify-content: center;
  }
  .data-table td[colspan]::before { display: none; }

  .data-table td:last-child {
    padding-bottom: 0;
    border-bottom: none !important;
  }

  /* Action buttons row in card */
  .data-table td .action-btns {
    justify-content: flex-end;
    width: 100%;
  }

  /* Status badge */
  .data-table td .status-badge {
    font-size: 11px;
    padding: 4px 12px;
  }

  /* Table footer hides showing text, keeps pagination centered */
  .table-footer {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px;
  }

  .showing-text {
    font-size: 12px;
    order: 2;
  }

  .pagination {
    order: 1;
    justify-content: center;
    flex-wrap: wrap;
  }

  .page-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* Dashboard tables are also converted */
  .dashboard-grid-2col .data-table-compact th,
  .dashboard-grid-2col .data-table-compact td {
    display: block;
  }

  .dashboard-grid-2col .data-table-compact thead {
    display: none;
  }

  /* Card header actions stack */
  .card-header-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .search-box.table-search {
    max-width: 100%;
    width: 100%;
  }

  .status-filter {
    width: 100%;
    font-size: 12px;
    padding: 8px 10px;
  }

  .date-range-group {
    width: 100%;
  }

  .date-range-group input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ===== SMALL MOBILE (<=480px): compact card padding ===== */
@media (max-width: 480px) {
  .data-table tr {
    padding: 10px;
    margin-bottom: 10px;
  }
  .data-table td {
    font-size: 12px;
    padding: 4px 0;
  }
  .data-table td::before {
    min-width: 70px;
    font-size: 10px;
  }
  .data-table td:first-child {
    font-size: 14px;
  }

  .page-content {
    padding: 12px;
  }

  .page-header {
    padding: 12px;
    margin-bottom: 14px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .card-header {
    padding: 12px 14px;
  }

  .card-header h2 {
    font-size: 15px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
    gap: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-value {
    font-size: 22px;
  }

  /* Notification panel full-width */
  .notification-panel {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
  }
}

/* Dashboard Compact Tables */
.dashboard-grid-2col .data-table-compact th:nth-child(2),
.dashboard-grid-2col .data-table-compact td:nth-child(2) {
  display: none;
}

/* Enhanced Mobile Table Responsiveness */
@media (max-width: 768px) {
  /* Barangay Table - Hide Description on tablet */
  .barangay-page .data-table th:nth-child(3),
  .barangay-page .data-table td:nth-child(3) {
    display: none;
  }

  /* Reports Table - Hide Message and Attachments on tablet */
  .reports-page .data-table th:nth-child(2),
  .reports-page .data-table td:nth-child(2),
  .reports-page .data-table th:nth-child(5),
  .reports-page .data-table td:nth-child(5) {
    display: none;
  }

  /* Tourist Table - Hide Category and Description on tablet */
  .tourist-page .data-table th:nth-child(3),
  .tourist-page .data-table td:nth-child(3),
  .tourist-page .data-table th:nth-child(4),
  .tourist-page .data-table td:nth-child(4) {
    display: none;
  }

  .card-header {
    flex-wrap: wrap;
  }

  .card-header-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .search-box.table-search {
    flex: 1;
    min-width: 150px;
  }

  .table-responsive {
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  /* Barangay Table - Hide Logo and Description, show only essential columns */
  .barangay-page .data-table th:nth-child(1),
  .barangay-page .data-table td:nth-child(1),
  .barangay-page .data-table th:nth-child(3),
  .barangay-page .data-table td:nth-child(3) {
    display: none;
  }

  /* Reports Table - Show only Reporter Name, Status, and Actions */
  .reports-page .data-table th:nth-child(2),
  .reports-page .data-table td:nth-child(2),
  .reports-page .data-table th:nth-child(3),
  .reports-page .data-table td:nth-child(3),
  .reports-page .data-table th:nth-child(5),
  .reports-page .data-table td:nth-child(5),
  .reports-page .data-table th:nth-child(6),
  .reports-page .data-table td:nth-child(6),
  .reports-page .data-table th:nth-child(7),
  .reports-page .data-table td:nth-child(7) {
    display: none;
  }

  /* Tourist Table - Show only Name, Category, and Actions */
  .tourist-page .data-table th:nth-child(2),
  .tourist-page .data-table td:nth-child(2),
  .tourist-page .data-table th:nth-child(3),
  .tourist-page .data-table td:nth-child(3),
  .tourist-page .data-table th:nth-child(4),
  .tourist-page .data-table td:nth-child(4),
  .tourist-page .data-table th:nth-child(6),
  .tourist-page .data-table td:nth-child(6) {
    display: none;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .action-btns {
    gap: 2px;
  }

  .btn-sm {
    padding: 6px 8px;
    font-size: 10px;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .search-box.table-search input {
    font-size: 12px;
    padding: 6px 8px;
  }

  .status-filter {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
  }

  .table-footer {
    flex-direction: column;
    gap: 10px;
  }

  .showing-text {
    font-size: 12px;
  }

  .pagination {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 11px;
  }

  .data-table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .action-btns {
    gap: 0;
    justify-content: flex-end;
  }

  .btn-sm {
    padding: 4px 6px;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
  }

  .page-header {
    padding: 10px;
    margin-bottom: 10px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .card {
    border-radius: 8px;
  }

  .card-header {
    padding: 10px;
    gap: 8px;
  }

  .card-header h2 {
    font-size: 14px;
  }

  .card-header-actions {
    gap: 6px;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
}

.checkbox-label label {
  cursor: pointer;
  margin: 0;
  padding: 0;
  display: inline-block;
  user-select: none;
}

.form-help-text {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  margin-left: 0;
}

@media (max-width: 900px) {
  .admin-role-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings Page Styles */
.danger-card {
  border-left: 4px solid #ef4444;
}

.action-group {
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-group .btn {
  min-width: 150px;
}

.action-group p {
  margin: 0;
  flex: 1;
  margin-left: 20px;
}

/* ===== DASHBOARD WIDGETS ===== */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
}

.quick-action-btn:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(33, 150, 243, 0.15);
}

.action-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.action-icon-blue {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
}

.action-icon-green {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #2E7D32;
}

.action-icon-orange {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  color: #E65100;
}

.action-icon-purple {
  background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  color: #6A1B9A;
}

.action-label {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.3px;
}

.system-status {
  grid-column: 1 / -1;
}

.system-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  color: #1B5E20;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(27, 94, 32, 0.2);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.status-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

.status-item-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.status-item-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1565C0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.status-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-item-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-item-value {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

/* ===== SCHEDULE SECTION STABILITY FIX ===== */
input[type="checkbox"] {
  transition: none !important;
}

input[type="checkbox"]:hover {
  box-shadow: none !important;
  border-color: inherit !important;
}

#newsScheduleSection input[type="date"],
#newsScheduleSection input[type="time"] {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#newsScheduleSection input[type="date"]:hover,
#newsScheduleSection input[type="time"]:hover {
  border-color: #d1d5db;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

#schedulePreview {
  min-height: 24px;
  display: block;
  will-change: auto;
}

/* Keep dashboard statistics in one horizontal strip at every viewport width. */
@media (min-width: 769px) {
  .stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .stats-grid .stat-card {
    flex: 0 0 220px;
  }
}
.services-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.services-availability-trigger {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 11px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.services-availability-trigger:hover,
.services-availability-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.26);
  border-color: #fff;
  transform: translateY(-1px);
}

.services-availability-trigger:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 3px;
}

.appointment-availability-modal {
  overflow: hidden;
}

.appointment-availability-content {
  padding: 20px;
}

.appointment-availability-content > p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.appointment-closure-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.appointment-closure-form .form-group {
  flex: 1 1 200px;
  margin-bottom: 0;
}

.appointment-closure-form .btn {
  min-height: 42px;
}

.appointment-closure-list {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.appointment-closure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.appointment-closure-row > div {
  display: grid;
  gap: 2px;
}

.appointment-closure-row strong {
  color: var(--text);
}

@media (max-width: 640px) {
  .services-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .services-availability-trigger {
    width: 100%;
  }

  .appointment-closure-form .btn {
    width: 100%;
  }
}
.barangay-officials-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.about-us-editor {
  padding: 24px;
  overflow: visible;
}

#aboutUsPage .about-editor-toolbar {
  position: sticky;
  top: 72px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
#aboutSaveStatus { margin-top: 4px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
#aboutUsPage .about-section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
#aboutUsPage .about-section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
#aboutUsPage .about-section-nav a:hover { border-color: var(--primary); color: var(--primary); }
#aboutUsPage .form-section {
  scroll-margin-top: 190px;
  background: var(--card-bg);
  border-color: var(--border);
  padding: 24px;
  box-shadow: none;
}
#aboutUsPage .section-header { margin-bottom: 20px; }
#aboutUsPage .section-header h3 { color: var(--text); }
#aboutUsPage .section-subtitle { color: var(--text-secondary); line-height: 1.6; margin-top: 6px; }
#aboutUsPage .about-purpose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#aboutUsPage textarea { resize: vertical; min-height: 140px; line-height: 1.7; }
#aboutUsPage :is(.form-group, .official-fields, .charter-upload-copy) { min-width: 0; }
#aboutUsPage .charter-upload-copy span { overflow-wrap: anywhere; }
#aboutUsPage .about-image-preview { width: min(100%, 480px); }
#aboutUsPage .about-image-preview img { max-height: 280px; object-fit: contain; }
#aboutUsPage .charter-file-name { white-space: normal; overflow-wrap: anywhere; }
#aboutUsPage .barangay-official-row { grid-template-columns: 124px minmax(0, 1fr) auto; }
#aboutUsPage .official-photo-preview { max-width: 110px; }
#aboutUsPage .official-photo-button { min-height: 40px; }
#aboutUsPage .official-fields { grid-template-columns: minmax(0, 1fr); }
#aboutUsPage .official-remove-button { min-width: 40px; min-height: 40px; justify-content: center; }
#aboutUsPage .btn { white-space: normal; }
#aboutUsPage button:focus-visible, #aboutUsPage a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 768px) {
  #aboutUsPage .about-us-editor { padding: 12px; }
  #aboutUsPage .form-section { padding: 16px; scroll-margin-top: 230px; }
  #aboutUsPage .about-purpose-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #aboutUsPage .about-editor-toolbar { top: 70px; padding: 12px; }
  #aboutUsPage .charter-upload-panel { flex-wrap: wrap; }
  #aboutUsPage .charter-choose-button { width: 100%; justify-content: center; }
  #aboutUsPage .barangay-official-row { grid-template-columns: 110px minmax(0, 1fr); }
  #aboutUsPage .official-remove-button { grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 480px) {
  #aboutUsPage .about-editor-toolbar .btn { width: 100%; justify-content: center; min-height: 44px; }
  #aboutUsPage .barangay-official-row { grid-template-columns: minmax(0, 1fr); }
  #aboutUsPage .official-photo-controls { width: 138px; justify-self: center; }
  #aboutUsPage .official-remove-button { grid-column: 1; }
}

.about-us-editor > .btn {
  margin-left: auto;
}

.about-image-field {
  display: grid;
  gap: 10px;
}

.about-image-preview {
  width: min(100%, 360px);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  overflow: hidden;
}

.about-image-preview[hidden] {
  display: none;
}

.about-image-upload-panel {
  width: 100%;
}

.about-image-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.about-image-field .btn {
  justify-self: start;
}

.about-image-field .btn[hidden] {
  display: none;
}

.charter-files-list {
  display: grid;
  gap: 10px;
}

.charter-upload-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px dashed var(--primary);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 5%, var(--card-bg));
}

.charter-upload-icon,
.charter-file-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
  font-size: 18px;
}

.charter-upload-copy,
.charter-file-details {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.charter-upload-copy strong {
  color: var(--text);
  font-size: 14px;
}

.charter-upload-copy span {
  color: var(--text-secondary);
  font-size: 13px;
}

.charter-choose-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.charter-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

.charter-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}

.charter-file-row small {
  color: var(--text-secondary);
}

.charter-file-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.charter-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
  border-radius: 8px;
  color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.charter-view-button:hover,
.charter-view-button:focus-visible {
  color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 17%, var(--card-bg));
  border-color: var(--primary);
}

@media (max-width: 640px) {
  .charter-upload-panel,
  .charter-file-row {
    flex-wrap: wrap;
  }

  .charter-choose-button {
    width: 100%;
    justify-content: center;
  }

  .charter-file-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.image-gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 80px;
  align-items: center;
  color: var(--text-secondary);
}

.image-gallery-tile {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.image-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-gallery-tile span {
  position: absolute;
  bottom: 5px;
  left: 5px;
  padding: 2px 6px;
  border-radius: 5px;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  font-size: 11px;
}

.image-gallery-tile .remove-image-btn {
  position: absolute;
  top: 5px;
  right: 5px;
}

.barangay-official-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.official-photo-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 8px;
}

.official-photo-preview {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 30px;
}

.official-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.official-photo-button,
.official-photo-remove-button {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 6px 4px;
  white-space: normal;
}

.official-photo-remove-button[hidden] {
  display: none;
}

/* Shared drag and drop feedback for admin file upload controls. */
.file-drop-zone {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.file-drop-zone::after {
  content: attr(data-drop-hint);
  display: block;
  width: 100%;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.file-drop-zone.is-drag-over {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
}

.charter-upload-panel.file-drop-zone {
  border-color: var(--primary);
  flex-wrap: wrap;
}

.official-photo-controls.file-drop-zone {
  padding: 6px;
}

.official-photo-controls.file-drop-zone::after {
  font-size: 11px;
}

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

.official-fields .form-group {
  margin-bottom: 0;
}

/* Keep each barangay official compact while separating photo and record actions. */
#barangayModal .barangay-official-row {
  grid-template-columns: 224px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 18px;
  padding: 16px;
}

#barangayModal .official-photo-controls.file-drop-zone {
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  align-items: center;
  gap: 6px 10px;
  padding: 8px;
  background: var(--bg);
}

#barangayModal .official-photo-preview {
  grid-column: 1;
  grid-row: 1 / 4;
  width: 92px;
  max-width: none;
  border-radius: 9px;
}

#barangayModal .official-photo-button,
#barangayModal .official-photo-remove-button {
  grid-column: 2;
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
  white-space: nowrap;
}

#barangayModal .official-photo-button { grid-row: 1; }
#barangayModal .official-photo-remove-button { grid-row: 2; }

#barangayModal .official-photo-controls.file-drop-zone::after {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}

#barangayModal .official-fields {
  min-width: 0;
  align-items: end;
  gap: 14px;
}

#barangayModal .official-remove-button {
  grid-column: 3;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: start;
}

@media (max-width: 700px) {
  #barangayModal .barangay-official-row {
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: start;
    gap: 14px;
  }

  #barangayModal .official-photo-controls { grid-column: 1; width: min(100%, 260px); }
  #barangayModal .official-fields { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #barangayModal .official-remove-button { grid-column: 2; grid-row: 1; }
}

@media (max-width: 480px) {
  #barangayModal .official-fields { grid-template-columns: minmax(0, 1fr); }
}

#reportModal .report-details-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

#reportModal .modal-header { gap: 16px; }
#reportModal .modal-close { flex-shrink: 0; }
#reportModal .modal-body { min-height: 0; }
#reportModal .report-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  padding: 20px;
  margin-bottom: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
#reportModal .report-detail-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
#reportModal .report-detail-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#reportModal .report-detail-email {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}
#reportModal .status-badge { margin-top: 8px; white-space: normal; }
#reportModal .report-section-title { font-size: 15px; margin-bottom: 12px; }
#reportModal .report-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
  font-size: 14px;
  color: var(--text);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}
@media (max-width: 480px) {
  #reportModal .report-summary-grid { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  #reportModal .report-message { padding: 14px; }
}

.admin-access-dialog {
  margin: auto;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.admin-access-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.admin-access-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-access-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  font-size: 24px;
}

.admin-access-dialog h2 { font-size: 22px; margin-bottom: 12px; }
.admin-access-dialog p { line-height: 1.6; font-size: 14px; }
.admin-access-email {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.admin-access-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.admin-access-note i { margin-top: 4px; }
.admin-access-error { color: var(--danger); margin-top: 14px; }
.admin-access-error:empty { display: none; }
.admin-access-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.admin-access-actions .btn { flex: 1 1 150px; justify-content: center; min-height: 44px; white-space: normal; }
.admin-access-confirm { color: #fff; background: #dc2626; }
.admin-access-confirm:hover { background: #b91c1c; }
.admin-access-dialog button:disabled { opacity: 0.6; cursor: wait; }
.admin-access-dialog button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.edit-admin-role-dialog { width: min(620px, calc(100% - 32px)); }
.edit-admin-role-dialog .admin-access-heading { margin-bottom: 8px; }
.edit-admin-role-dialog .admin-access-heading h2 { margin: 0; }
.edit-admin-role-dialog .form-group { margin: 16px 0; }
.edit-admin-role-dialog .form-group > label { display: block; margin-bottom: 8px; font-weight: 700; }
.edit-admin-role-dialog .form-group[hidden] { display: none; }
.edit-admin-role-dialog .checkbox-label { display: flex; align-items: center; gap: 8px; }
.edit-admin-role-dialog .checkbox-label input { width: 18px; height: 18px; flex: 0 0 18px; }
.edit-admin-role-dialog :is(.admin-feature-options, .admin-report-category-options) { max-height: 220px; overflow-y: auto; }
@media (max-width: 600px) {
  .edit-admin-role-dialog :is(.admin-feature-options, .admin-report-category-options) { grid-template-columns: 1fr; }
}

/* Keep desktop filters compact; switch to a grid only on small screens. */
:is(#reportsPage, #touristPage) .card-header-actions {
  display: flex;
  flex: 0 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  width: auto;
}

:is(#reportsPage, #touristPage) .card-header-actions > * {
  flex: 0 1 auto;
  max-width: 100%;
  width: auto;
}

:is(#reportsPage, #touristPage) .search-box.table-search {
  width: 220px;
  min-width: 0;
}

#reportsPage .date-range-group input {
  width: 150px;
  min-width: 0;
}

:is(#reportsPage, #touristPage) .card-header-actions .btn {
  justify-content: center;
  white-space: normal;
}

:is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) :is(.modal-body, .form-group, .form-section) {
  min-width: 0;
  overflow-wrap: anywhere;
}

:is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) :is(input, select, textarea, img) {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 768px) {
  :is(#reportsPage, #touristPage) .card-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  :is(#reportsPage, #touristPage) .card-header-actions > *,
  :is(#reportsPage, #touristPage) .search-box.table-search,
  :is(#reportsPage, #touristPage) .search-box input {
    min-width: 0;
    width: 100%;
  }

  #reportsPage .date-range-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-column: 1 / -1;
  }

  #reportsPage .date-range-group input {
    width: 100%;
  }

  /* Reset the desktop sidebar reservation, including a collapsed sidebar. */
  .main-content,
  .sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }

  :is(#reportsPage, #touristPage) .table-responsive {
    padding: 12px;
  }

  /* Override legacy column-hiding rules after the table becomes cards. */
  :is(#reportsPage, #touristPage) .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 8px 0;
    text-align: left;
    overflow-wrap: anywhere;
  }

  :is(#reportsPage, #touristPage) .data-table td::before {
    display: block;
    min-width: 0;
    margin-bottom: 4px;
  }

  :is(#reportsPage, #touristPage) .data-table td[colspan] {
    text-align: center;
  }

  :is(#reportsPage, #touristPage) .data-table td[colspan]::before {
    display: none;
  }

  :is(#reportsPage, #touristPage) .data-table .status-badge {
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  :is(#reportsPage, #touristPage) .data-table .action-btns {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  #touristPage .tourist-review-summary {
    flex-wrap: wrap;
    max-width: 100%;
  }

  :is(#reportsPage, #touristPage) .btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    justify-content: center;
  }

  :is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) .modal {
    min-width: 0;
    max-height: 90dvh !important;
  }

  :is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) :is(.modal-header, .modal-body, .modal-footer) {
    padding: 16px;
  }

  :is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) .modal-body {
    min-height: 0;
    overflow-y: auto;
  }

  #touristModal .form-section {
    padding: 14px;
  }

  #touristModal :is(.form-row, .form-grid-2col) {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) .modal-footer {
    flex-wrap: wrap;
  }

  :is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) .btn {
    white-space: normal;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  :is(#reportsPage, #touristPage) .card-header-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #reportsPage .date-range-group {
    grid-template-columns: minmax(0, 1fr);
  }

  #reportsPage .date-separator {
    text-align: center;
  }

  :is(#reportModal, #editReportModal, #touristModal, #placeReviewsModal) .modal-footer .btn {
    flex: 1 1 100%;
    min-height: 44px;
  }
}

@media (max-width: 700px) {
  .barangay-official-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .official-fields {
    grid-template-columns: 1fr;
  }

  .official-remove-button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* Dark theme: use the sidebar's navy and blue palette throughout the admin area. */
html[data-theme="dark"] {
  --bg: #111b2b;
  --card-bg: #1d2c43;
  --text: #e9eef6;
  --text-secondary: #b3bfd0;
  --border: #344b68;
  --primary: #79b6ed;
  --primary-dark: #a7d1f4;
  --primary-light: #203d64;
  --sidebar-bg: #182333;
  --sidebar-hover: #223754;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .page-content { background: #111b2b; }
html[data-theme="dark"] body::before { display: none; }
html[data-theme="dark"] .top-header { background: #182840; border-color: #344b68; }
html[data-theme="dark"] .sidebar { background: #182333; box-shadow: none; }
html[data-theme="dark"] .sidebar-brand { background: #192d58; border-bottom-color: #33456b; }
html[data-theme="dark"] .sidebar .brand-sub { color: #7db7ed; }
html[data-theme="dark"] .sidebar .nav-item { color: #b8c0ca; }
html[data-theme="dark"] .sidebar .nav-item i { color: #aeb8c5; }
html[data-theme="dark"] .sidebar .nav-item:hover { background: #223754; color: #f2f5f9; }
html[data-theme="dark"] .sidebar .nav-item.active { background: #1c3a72; color: #f7f9fc; border-right-color: #69b4fa; }
html[data-theme="dark"] .sidebar .nav-item.active i { color: #75b7f4; }
html[data-theme="dark"] .sidebar.collapsed .nav-item.active { border-bottom-color: #69b4fa; }
html[data-theme="dark"] .sidebar-footer { border-top-color: #2b3c52; }
html[data-theme="dark"] .sidebar .user-profile-sidebar,
html[data-theme="dark"] .sidebar .logout-btn-footer { background: #1d3152; border-color: #2d507e; box-shadow: none; }
html[data-theme="dark"] .sidebar .user-profile-sidebar:hover { background: #25416a; border-color: #416a9a; box-shadow: none; transform: none; }
html[data-theme="dark"] .sidebar .logout-btn-footer:hover { background: #2c3c58; border-color: #6b5961; box-shadow: none; }
html[data-theme="dark"] .sidebar .user-avatar-sidebar { background: #228be0; border-color: #5eaeef; }
html[data-theme="dark"] .sidebar .sidebar-collapse-btn { background: #203a67; border-color: #315385; box-shadow: none; }
html[data-theme="dark"] .sidebar .sidebar-collapse-btn:hover { background: #294979; border-color: #4b75a8; box-shadow: none; }
html[data-theme="dark"] .header-user,
html[data-theme="dark"] .header-user:hover,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .search-box { background: #213653; border-color: #405b7c; }
html[data-theme="dark"] .icon-btn:hover,
html[data-theme="dark"] .search-box:focus-within { background: #29446a; border-color: #679bd0; color: #e9eef6; }

html[data-theme="dark"] .page-header { background: #20395b; border-color: #3b5b80; border-left: 4px solid #69b4fa; box-shadow: none; backdrop-filter: none; }
html[data-theme="dark"] .page-header .page-subtitle { color: #c1d2e5; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .form-section { background: #1d2c43; border-color: #344b68; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16); }
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .form-section:hover { transform: none; border-color: #506c8e; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16); }
html[data-theme="dark"] .stat-card::before { display: none; }
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-footer { background: #1d2c43; border-color: #344b68; }
html[data-theme="dark"] .stat-icon { box-shadow: none; }
html[data-theme="dark"] .stat-icon-blue { background: #25496c; color: #acd4f2; border-color: #426b92; }
html[data-theme="dark"] .stat-icon-green { background: #294b48; color: #b1d9ca; border-color: #426b65; }
html[data-theme="dark"] .stat-icon-orange { background: #4b4032; color: #ecd0a4; border-color: #706047; }
html[data-theme="dark"] .stat-icon-purple { background: #3c3d50; color: #c9cbe1; border-color: #5a5c74; }
html[data-theme="dark"] .stat-icon-red { background: #4a383c; color: #e5b6bc; border-color: #6d5358; }
html[data-theme="dark"] .stat-icon-yellow { background: #484336; color: #e3d5aa; border-color: #6c624c; }
html[data-theme="dark"] .card-badge,
html[data-theme="dark"] .admin-role-tag { background: #26486e; border-color: #436991; color: #c5dff6; }
html[data-theme="dark"] .admin-role-tag.super { background: #4b4233; border-color: #716149; color: #f0d9af; }
html[data-theme="dark"] .category-item-count { background: #2a5c92; color: #f5f8fa; }
html[data-theme="dark"] .category-item-label { color: #e8eef2; }

html[data-theme="dark"] .data-table,
html[data-theme="dark"] .data-table td { background: #1d2c43; }
html[data-theme="dark"] .data-table thead { background: #243f63; }
html[data-theme="dark"] .data-table tbody tr:nth-child(odd) td { background: #22344d; }
html[data-theme="dark"] .data-table tbody tr:hover { background: #294367; border-left-color: #79b6ed; box-shadow: none; }
html[data-theme="dark"] .data-table tbody tr:hover td { background: #294367; }
html[data-theme="dark"] .empty-state { background: #22344d; color: #b3bfd0; }

html[data-theme="dark"] .btn-primary { background: #285d96; border-color: #4077b0; color: #f5f8fa; box-shadow: none; }
html[data-theme="dark"] .btn-primary:hover { background: #326eaa; border-color: #578bc0; transform: none; box-shadow: none; }
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .pdf-download-btn { background: #75494f; border-color: #906067; color: #f8e9e9; box-shadow: none; }
html[data-theme="dark"] .btn-danger:hover,
html[data-theme="dark"] .pdf-download-btn:hover { background: #87555b; border-color: #a37178; transform: none; box-shadow: none; }
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-secondary:hover { background: #293f5c; border-color: #4e6c8f; color: #e9eef6; box-shadow: none; transform: none; }
html[data-theme="dark"] .form-group :is(input, textarea, select) { background-color: #17263d; border-color: #496282; box-shadow: none; }
html[data-theme="dark"] .form-group :is(input, textarea, select):hover { border-color: #6987aa; box-shadow: none; }
html[data-theme="dark"] .form-group :is(input, textarea, select):focus { background-color: #1c2e4b; border-color: #79b6ed; box-shadow: 0 0 0 2px rgba(121, 182, 237, 0.16); }
html[data-theme="dark"] .form-group :is(input, textarea)::placeholder { color: #9badb9; }
html[data-theme="dark"] .status-badge { box-shadow: none; }
html[data-theme="dark"] .status-pending { background: #3b342a; color: #dec394; border-color: #62553f; }
html[data-theme="dark"] .status-processing { background: #342f40; color: #c7b7da; border-color: #554d66; }
html[data-theme="dark"] :is(.status-resolved, .status-approved, .status-verified) { background: #2a3b34; color: #a8d1b8; border-color: #466452; }
html[data-theme="dark"] .status-reviewing { background: #293a49; color: #accadd; border-color: #476277; }
html[data-theme="dark"] .status-rejected { background: #3d2f34; color: #e0b1b8; border-color: #664a52; }
html[data-theme="dark"] .status-not-submitted { background: #2a343e; color: #b9c5cf; border-color: #455462; }
html[data-theme="dark"] .admin-role-item { background: #22344d; border-color: #496282; box-shadow: none; }
html[data-theme="dark"] .admin-select-menu { background: #22344d; border-color: #496282; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
html[data-theme="dark"] .logo-upload-wrapper:hover,
html[data-theme="dark"] .logo-preview:hover { background: #29446a; border-color: #679bd0; box-shadow: none; }
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .notification-item { background: #1d2c43; border-color: #344b68; }
html[data-theme="dark"] .notification-header { background: #20395b; border-color: #344b68; }
html[data-theme="dark"] .notification-item:hover { background: #29446a; }
html[data-theme="dark"] .modal-close:hover { background: #75494f; }
html[data-theme="dark"] #aboutUsPage .about-category-filter button[data-about-section][aria-pressed="true"] {
  background: #285d96;
  border-color: #4077b0;
}

/* About Us workspace: one section at a time, with a shared save action. */
#aboutUsPage .about-us-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
}
#aboutUsPage .about-editor-toolbar {
  grid-column: 1 / -1;
  position: static;
  margin: 0;
  padding: 24px 28px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
#aboutUsPage .about-editor-toolbar strong { display: block; font-size: 20px; margin-top: 5px; }
.about-editor-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.4px; color: var(--primary); }
#aboutUsPage .about-section-nav {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 20px 12px;
  margin: 0;
  gap: 6px;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
#aboutUsPage .about-section-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#aboutUsPage .about-section-nav button i { width: 18px; text-align: center; }
#aboutUsPage .about-section-nav button[aria-selected="true"] {
  color: var(--primary);
  background: var(--card-bg);
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
#aboutUsPage .about-section-nav button:hover { color: var(--primary); background: var(--card-bg); }
#aboutUsPage .form-section.about-category-panel {
  min-width: 0;
  padding: 28px;
  margin: 0;
  border: 0;
  border-radius: 0;
  min-height: 440px;
}
#aboutUsPage .about-category-panel[hidden] { display: none !important; }
#aboutUsPage .section-header h3 { font-size: 21px; letter-spacing: -0.4px; }
#aboutUsPage .section-header { padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
#aboutUsPage :is(#aboutHistorySection, #aboutGeographySection) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0 24px;
}
#aboutUsPage :is(#aboutHistorySection, #aboutGeographySection) .section-header { grid-column: 1 / -1; }
#aboutUsPage textarea { min-height: 240px; padding: 16px; font-size: 14px; }
#aboutUsPage .about-image-field { align-content: start; padding: 16px; background: var(--bg); border-radius: 12px; }
#aboutUsPage .about-image-upload-panel { flex-wrap: wrap; padding: 12px; }
#aboutUsPage .about-image-upload-panel .charter-upload-icon { display: none; }
#aboutUsPage .about-image-upload-panel .charter-choose-button { width: 100%; justify-content: center; }
#aboutUsPage .about-image-preview { width: 100%; background: var(--card-bg); }
#aboutUsPage .charter-files-list:has(> .form-help-text:only-child) { padding: 28px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; }
#aboutUsPage #municipalOfficialsList { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 20px; }
#aboutUsPage #municipalOfficialsList:empty::before { content: 'No officials added yet. Add an official to begin.'; padding: 32px; text-align: center; color: var(--text-secondary); border: 1px dashed var(--border); border-radius: 12px; }
#aboutUsPage .barangay-official-row { background: var(--bg); padding: 18px; }
@media (max-width: 1100px) {
  #aboutUsPage .about-us-editor { grid-template-columns: minmax(0, 1fr); }
  #aboutUsPage .about-section-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  #aboutUsPage .about-section-nav button { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 768px) {
  #aboutUsPage .about-editor-toolbar { padding: 20px; }
  #aboutUsPage .form-section.about-category-panel { padding: 20px; }
  #aboutUsPage :is(#aboutHistorySection, #aboutGeographySection) { grid-template-columns: minmax(0, 1fr); }
  #aboutUsPage textarea { min-height: 190px; }
  #aboutUsPage .section-header h3 { font-size: 19px; }
}

/* Category filter matches the other management page toolbars. */
#aboutUsPage .about-category-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}
#aboutUsPage .about-category-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
#aboutUsPage .about-category-filter button[data-about-section] {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#aboutUsPage .about-category-filter button[data-about-section]:hover { border-color: var(--primary); }
#aboutUsPage .about-category-filter button[data-about-section][aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
#aboutUsPage .about-category-filter #aboutSaveBtn { margin-left: auto; min-height: 44px; justify-content: center; }
#aboutUsPage .about-save-feedback { margin: 0; padding: 12px 28px; border-bottom: 1px solid var(--border); }
#aboutUsPage .about-save-feedback:empty { display: none; }
@media (max-width: 480px) {
  #aboutUsPage .about-category-filter { padding: 16px 20px; }
  #aboutUsPage .about-category-label { flex-basis: 100%; }
  #aboutUsPage .about-category-filter button { flex: 1 1 130px; }
}

/* Compact Reviews button without changing the Tourist Guide table layout. */
#touristPage .tourist-review-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #fcd34d;
  border-radius: 7px;
  background: #fffbeb;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
#touristPage .tourist-review-summary:hover { background: #fef3c7; }
#touristPage .tourist-review-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#touristPage .tourist-review-star { color: #f59e0b; font-size: 14px; line-height: 1; }

/* Upload controls share one dark palette across all admin pages. */
html[data-theme="dark"] .logo-upload-wrapper {
  background: #17263d;
  border-color: #496282;
  color: #e9eef6;
}
html[data-theme="dark"] .logo-upload-wrapper:hover {
  background: #29446a;
  border-color: #679bd0;
}
html[data-theme="dark"] .logo-preview {
  background: #17263d;
  border-color: #496282;
}
html[data-theme="dark"] .logo-preview:hover {
  background: #29446a;
  border-color: #679bd0;
}
html[data-theme="dark"] .logo-preview i { color: #afbec8; }
html[data-theme="dark"] .logo-preview span { color: #d0dce3; }
html[data-theme="dark"] .file-drop-zone { border-color: #5e7898; }
html[data-theme="dark"] .file-drop-zone::after { color: #afbec8; }
html[data-theme="dark"] .file-drop-zone.is-drag-over {
  border-color: #79b6ed;
  background: #29446a;
}
html[data-theme="dark"] .image-gallery-preview { color: #d0dce3; }
html[data-theme="dark"] .image-gallery-tile,
html[data-theme="dark"] .about-image-preview,
html[data-theme="dark"] .official-photo-preview,
html[data-theme="dark"] .barangay-logo-thumb-placeholder {
  background: #17263d;
  color: #d0dce3;
}
html[data-theme="dark"] .preview-file-wrapper {
  background: #29446a;
  border-color: #4d709b;
}
html[data-theme="dark"] .preview-file-wrapper span { color: #e9eef6; }
html[data-theme="dark"] .preview-file-wrapper .remove-image-btn { color: #e5b6bc; }
html[data-theme="dark"] .charter-upload-icon,
html[data-theme="dark"] .charter-file-icon,
html[data-theme="dark"] .charter-view-button { color: #a7d1f4; }
html[data-theme="dark"] .file-input-wrapper input[type="file"] {
  color-scheme: dark;
  background: #17263d;
  color: #e9eef6;
  border-color: #5e7898;
}
html[data-theme="dark"] .file-input-wrapper input[type="file"]:hover {
  background: #29446a;
  border-color: #79b6ed;
}

/* Modern dropdowns keep native select values and form behavior. */
select:not([multiple]) {
  appearance: none;
  padding-right: 36px;
  border-radius: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
select:not([multiple]):not(:disabled) { cursor: pointer; }
select:not([multiple]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
select:not([multiple])[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
html[data-theme="dark"] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23cbd5e1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-color: #151c2b;
  color: #e5e7eb;
  border-color: #42526a;
  color-scheme: dark;
}

.admin-select-menu {
  position: fixed;
  z-index: 1100;
  display: grid;
  align-content: start;
  gap: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
}
.admin-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 500 13px/1.35 'Inter', sans-serif;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.admin-select-option:hover,
.admin-select-option.is-active { background: color-mix(in srgb, var(--primary) 10%, var(--card-bg)); }
.admin-select-option.is-selected { color: var(--primary-dark); font-weight: 700; }
.admin-select-option.is-selected::after { content: '✓'; font-size: 15px; color: var(--primary); }
.admin-select-option:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.admin-select-empty { padding: 12px; color: var(--text-secondary); font-size: 13px; }
html[data-theme="dark"] .admin-select-menu {
  background: #1a2434;
  border-color: #42526a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .admin-select-option.is-selected { color: #93c5fd; }

/* Shared calendar for date filters and scheduling fields. */
input[type="date"] {
  appearance: none;
  min-height: 40px;
  padding-right: 38px;
  border-radius: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 18 18'%3E%3Crect x='2.5' y='4' width='13' height='11.5' rx='2' stroke='%23475569' stroke-width='1.5'/%3E%3Cpath d='M5.5 2.5v3M12.5 2.5v3M2.5 7.5h13' stroke='%23475569' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 18px;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  width: 20px;
  cursor: pointer;
}
input[type="date"][aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
html[data-theme="dark"] input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 18 18'%3E%3Crect x='2.5' y='4' width='13' height='11.5' rx='2' stroke='%23cbd5e1' stroke-width='1.5'/%3E%3Cpath d='M5.5 2.5v3M12.5 2.5v3M2.5 7.5h13' stroke='%23cbd5e1' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-color: #151c2b;
  color: #e5e7eb;
  border-color: #42526a;
  color-scheme: dark;
}

.admin-calendar {
  position: fixed;
  z-index: 1200;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.1);
  font-family: 'Inter', sans-serif;
}
.admin-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-calendar-header strong { font-size: 14px; font-weight: 700; }
.admin-calendar-nav {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 24px/1 'Inter', sans-serif;
  cursor: pointer;
}
.admin-calendar-nav:hover { background: color-mix(in srgb, var(--primary) 10%, var(--card-bg)); }
.admin-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.admin-calendar-weekday {
  display: grid;
  place-items: center;
  height: 27px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}
.admin-calendar-day,
.admin-calendar-blank { width: 100%; aspect-ratio: 1; }
.admin-calendar-day {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: 500 12px/1 'Inter', sans-serif;
  cursor: pointer;
}
.admin-calendar-day:hover:not(:disabled),
.admin-calendar-day.is-active:not(.is-selected) {
  background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
  color: var(--primary-dark);
}
.admin-calendar-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1.5px var(--primary); }
.admin-calendar-day.is-selected { background: var(--primary); color: #fff; font-weight: 700; }
.admin-calendar-day:disabled { color: var(--text-secondary); opacity: 0.42; cursor: not-allowed; }
.admin-calendar :is(button:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-calendar-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.admin-calendar-footer button {
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-dark);
  font: 700 12px 'Inter', sans-serif;
  cursor: pointer;
}
.admin-calendar-footer button:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 10%, var(--card-bg)); }
.admin-calendar-footer button:disabled { opacity: 0.45; cursor: not-allowed; }
html[data-theme="dark"] .admin-calendar { background: #1a2434; border-color: #42526a; box-shadow: 0 22px 50px rgba(0,0,0,0.48); }
html[data-theme="dark"] .admin-calendar-day:hover:not(:disabled),
html[data-theme="dark"] .admin-calendar-day.is-active:not(.is-selected),
html[data-theme="dark"] .admin-calendar-footer button { color: #93c5fd; }
.service-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

@media (max-width: 600px) {
  .service-details-grid { grid-template-columns: 1fr; }
  .service-details-grid > * { grid-column: auto !important; }
}

/* Keep late-loading controls in the same subdued dark palette. */
html[data-theme="dark"] :is(.status-filter, select:not([multiple]), input[type="date"], .admin-select-menu, .admin-calendar) {
  background-color: #22344d;
  border-color: #496282;
  color: #e9eef6;
}
html[data-theme="dark"] :is(select:not([multiple]), input[type="date"])[aria-expanded="true"] {
  border-color: #79b6ed;
  box-shadow: 0 0 0 2px rgba(121, 182, 237, 0.16);
}
html[data-theme="dark"] .admin-select-menu,
html[data-theme="dark"] .admin-calendar { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
html[data-theme="dark"] :is(.page-btn.active, .admin-calendar-day.is-selected) {
  background: #285d96;
  border-color: #4077b0;
  color: #f5f8fa;
}
html[data-theme="dark"] .admin-select-option.is-selected,
html[data-theme="dark"] .admin-calendar-footer button { color: #a7d1f4; }
html[data-theme="dark"] :is(.logo-upload-wrapper, .logo-preview):hover {
  background: #29446a;
  border-color: #679bd0;
  box-shadow: none;
}
html[data-theme="dark"] .file-drop-zone.is-drag-over { background: #29446a; border-color: #79b6ed; }
