/* ==========================================================================
   CollegeComplaint Web Application - Modern Design System
   ========================================================================== */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #0f172a;
  
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-gradient: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  --secondary: #0284c7;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --status-pending-bg: #fffbeb;
  --status-pending-text: #b45309;
  --status-pending-border: #fde68a;
  
  --status-progress-bg: #f0f9ff;
  --status-progress-text: #0284c7;
  --status-progress-border: #bae6fd;
  
  --status-resolved-bg: #ecfdf5;
  --status-resolved-text: #047857;
  --status-resolved-border: #a7f3d0;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(15, 23, 42, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(226, 232, 240, 0.6) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(241, 245, 249, 0.8) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(248, 250, 252, 1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  background: none;
  -webkit-text-fill-color: #0f172a;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background: #1e293b;
  border-color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-outline {
  background: #ffffff;
  color: #475569;
  border-color: #e2e8f0;
}

.btn-outline:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.form-control::placeholder, .form-textarea::placeholder {
  color: #94a3b8;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

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

/* ==========================================================================
   Main Layout & Views
   ========================================================================== */
.main-container {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 1.5rem 2rem;
}

/* View visibility */
.view {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
  display: block;
}

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

/* ==========================================================================
   Full-Screen Edge-to-Edge Split Login View
   ========================================================================== */
#login-view.active {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: #ffffff;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.login-wrapper-modern {
  display: contents;
}

/* Left Hero Image Panel */
.login-hero-card {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #0f172a;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}

.hero-top-badge {
  position: absolute;
  top: 2.25rem;
  left: 2.5rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  padding: 0.42rem 0.95rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.hero-tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-overlay-text {
  position: relative;
  z-index: 2;
  padding: 3rem;
}

.hero-overlay-text h2 {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.7);
  margin: 0;
}

/* Right Form Panel */
.login-form-card {
  position: relative;
  height: 100vh;
  width: 100%;
  background: #ffffff;
  color: #111827;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 3.5rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.login-form-inner {
  max-width: 420px;
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
}

.login-floating-db-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 10;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.login-floating-db-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.login-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
  text-align: center;
}

.brand-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.login-brand-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #111827;
  text-transform: uppercase;
}

.login-main-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
  margin: 0 0 0.25rem 0;
  text-align: center;
}

.login-sub-title {
  font-size: 0.82rem;
  color: #6b7280;
  text-align: center;
  margin: 0 0 1.1rem 0;
}

/* Role Switcher in Modern Card */
.role-switcher-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 1.25rem;
}

.role-switcher-modern .role-tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.role-switcher-modern .role-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Input Fields */
.modern-input-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modern-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  text-align: left;
}

.modern-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #0f172a;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  outline: none;
}

.modern-input:focus {
  background: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.modern-input::placeholder {
  color: #94a3b8;
}

/* Extra Row */
.login-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.3rem 0 1.2rem 0;
  font-size: 0.82rem;
}

.remember-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.remember-checkbox-label input[type="checkbox"] {
  accent-color: #0f172a;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.forgot-link {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.82rem;
}

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

/* Sign In Black Button */
.btn-signin-black {
  width: 100%;
  background: #000000;
  color: #ffffff;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-signin-black:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.btn-signin-black:active {
  transform: translateY(0);
}

/* Demo Pills */
.modern-demo-container {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
}

.demo-sub-divider {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  text-align: center;
}

.demo-pills-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.demo-btn-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1e293b;
}

.demo-btn-pill:hover {
  border-color: #0f172a;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.signup-prompt-row {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
}

.signup-prompt-row a {
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
  margin-left: 0.2rem;
}

.signup-prompt-row a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Dashboard Common Components
   ========================================================================== */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-title-area h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.dashboard-title-area p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.08);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-icon.stat-icon-total {
  background: #eef2ff;
  color: #4f46e5;
}

.stat-icon.stat-icon-pending {
  background: #fffbeb;
  color: #b45309;
}

.stat-icon.stat-icon-progress {
  background: #f0f9ff;
  color: #0284c7;
}

.stat-icon.stat-icon-resolved {
  background: #ecfdf5;
  color: #047857;
}

.stat-icon.stat-icon-rate {
  background: #f5f3ff;
  color: #7c3aed;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.stat-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Modern Segmented Navigation Tabs */
.tabs-nav {
  display: inline-flex;
  gap: 0.35rem;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  margin-bottom: 1.75rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: #0f172a;
}

.tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.tab-badge {
  background: #0f172a;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
  margin-left: 4px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

/* ==========================================================================
   Student Portal Elements
   ========================================================================== */
.card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.file-upload-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #f8fafc;
}

.file-upload-box:hover, .file-upload-box.dragover {
  border-color: #0f172a;
  background: #f1f5f9;
}

.file-upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.tracker-card {
  max-width: 750px;
  margin: 0 auto;
}

.tracker-search-box {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.tracker-info-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-bottom: 1.75rem;
}

.tracker-id {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.tracker-remarks-box {
  margin-top: 1rem;
  padding: 0.95rem 1.15rem;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  color: #1e3a8a;
}

.tracker-remarks-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  color: #2563eb;
  display: block;
  margin-bottom: 0.25rem;
  letter-spacing: 0.04em;
}

.timeline-container {
  margin-top: 1.5rem;
  position: relative;
  padding-left: 2rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-step {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.timeline-step.completed .timeline-dot {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.timeline-step.active .timeline-dot {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
}

.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.timeline-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Table & Badges
   ========================================================================== */
.table-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.table-toolbar {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  width: 290px;
  transition: var(--transition);
}

.search-input-group:focus-within {
  background: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.search-input-group input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 100%;
  margin-left: 0.5rem;
}

.search-input-group input::placeholder {
  color: #94a3b8;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: #f8fafc;
  padding: 0.95rem 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 1.05rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
  vertical-align: middle;
  color: #1e293b;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr {
  transition: background 0.15s ease;
}

.custom-table tbody tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.badge-progress {
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
  border: 1px solid var(--status-progress-border);
}

.badge-resolved {
  background: var(--status-resolved-bg);
  color: var(--status-resolved-text);
  border: 1px solid var(--status-resolved-border);
}

.category-tag {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}

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

.modal-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #fafafa;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.modal-info-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.modal-complaint-id {
  font-weight: 800;
  color: #0f172a;
  font-size: 1.05rem;
}

.modal-evidence-tag {
  font-size: 0.78rem;
  color: #0284c7;
  font-weight: 600;
}

.db-table-title {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  color: #0f172a;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.db-table-title code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #475569;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #0f172a;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
}

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

.toast.toast-success {
  border-color: #a7f3d0;
  border-left: 4px solid #10b981;
}

.toast.toast-error {
  border-color: #fecaca;
  border-left: 4px solid #ef4444;
}

.toast.toast-info {
  border-color: #cbd5e1;
  border-left: 4px solid #0f172a;
}

/* ==========================================================================
   SQL Database Inspector & Code View
   ========================================================================== */
.sql-table-code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: #0f172a;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 860px) {
  .login-wrapper-modern {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .login-hero-card {
    min-height: 280px;
  }
  .login-form-card {
    padding: 2rem 1.5rem;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .navbar {
    padding: 0.75rem 1rem;
  }
  .tabs-nav {
    display: flex;
    width: 100%;
  }
  .tab-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   MONOCHROME THEME (Black & White) — overrides coloured accents
   ========================================================================== */
:root {
  --bg-primary: #fafafa;
  --border-color: #e5e5e5;
  --text-primary: #0a0a0a;
  --text-secondary: #525252;
  --text-muted: #737373;
  --secondary: #404040;

  --status-pending-bg: #ffffff;
  --status-pending-text: #404040;
  --status-pending-border: #a3a3a3;
  --status-progress-bg: #e5e5e5;
  --status-progress-text: #171717;
  --status-progress-border: #d4d4d4;
  --status-resolved-bg: #0a0a0a;
  --status-resolved-text: #ffffff;
  --status-resolved-border: #0a0a0a;
  --danger: #0a0a0a;
  --danger-bg: #ffffff;
  --danger-border: #0a0a0a;
}

body {
  background: #fafafa;
  background-image: none;
}

.badge-pending { border-style: dashed; }

.stat-icon,
.stat-icon.stat-icon-total,
.stat-icon.stat-icon-pending,
.stat-icon.stat-icon-progress,
.stat-icon.stat-icon-resolved,
.stat-icon.stat-icon-rate {
  background: #f5f5f5;
  color: #0a0a0a;
  border: 1px solid #e5e5e5;
  filter: grayscale(1);
}

.tabs-nav { background: #f0f0f0; border-color: #e5e5e5; }
.category-tag { background: #f5f5f5; color: #262626; border-color: #e5e5e5; }

.tracker-remarks-box { background: #f5f5f5; border-left-color: #0a0a0a; color: #171717; }
.tracker-remarks-title { color: #0a0a0a; }
#track-disp-remarks { color: #171717 !important; }

.timeline-step.completed .timeline-dot { background: #0a0a0a; border-color: #0a0a0a; }
.timeline-step.active .timeline-dot { background: #737373; border-color: #737373; box-shadow: 0 0 0 4px rgba(0,0,0,0.08); }
.timeline-dot { filter: grayscale(1); }

.modal-evidence-tag, .evidence-line { color: #525252; }
.toast.toast-success { border-color: #e5e5e5; border-left-color: #0a0a0a; }
.toast.toast-error { border-color: #e5e5e5; border-left-color: #525252; }
.toast svg { filter: grayscale(1) brightness(0); }
.login-hero-card .hero-bg-img { filter: grayscale(1) contrast(1.05); }
.pill-dot { filter: grayscale(1); }
.db-table-title span { filter: grayscale(1); }

/* ==========================================================================
   HOD / WARDEN ANALYTICS DASHBOARD
   ========================================================================== */
#admin-view.active {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.admin-header-box {
  margin-bottom: 1.5rem;
}

.admin-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.admin-top-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.admin-top-left h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0a0a0a;
  margin: 0;
  line-height: 1.2;
}

.admin-top-right {
  display: flex;
  align-items: center;
}

.admin-subtitle-row {
  color: #525252;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0;
}

.last-updated {
  font-size: 0.75rem;
  color: #737373;
  white-space: nowrap;
}

.scope-toggle {
  display: inline-flex;
  background: #f0f0f0;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 3px;
}

.scope-btn {
  border: none;
  background: transparent;
  padding: 0.42rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #737373;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
}

.scope-btn.active {
  background: #0a0a0a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 1.15rem 1.2rem 0.9rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #0a0a0a;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.15);
}

.kpi-top { display: flex; gap: 0.85rem; align-items: center; }

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0a0a0a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-label { font-size: 0.8rem; font-weight: 600; color: #525252; }
.kpi-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: #0a0a0a; }

.kpi-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.kpi-delta { display: flex; flex-direction: column; font-size: 0.72rem; color: #737373; line-height: 1.3; }
.kpi-delta strong { font-size: 0.82rem; color: #0a0a0a; }
.kpi-spark { width: 55%; height: 36px; overflow: visible; }

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  min-height: 310px;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.chart-card-header h3 { font-size: 0.98rem; font-weight: 800; color: #0a0a0a; letter-spacing: -0.01em; }

.chart-select {
  width: auto !important;
  padding: 0.32rem 1.9rem 0.32rem 0.7rem !important;
  font-size: 0.75rem !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  background-position: right 0.55rem center !important;
}

.toolbar-select {
  width: auto !important;
  padding: 0.5rem 2.2rem 0.5rem 0.85rem !important;
  font-size: 0.82rem !important;
  background-color: #ffffff !important;
}

.chart-legend { display: flex; gap: 1rem; justify-content: center; font-size: 0.75rem; color: #525252; margin-bottom: 0.25rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.lg-line { display: inline-block; width: 18px; height: 0; border-top: 3px solid #0a0a0a; border-radius: 2px; }
.lg-line.lg-gray { border-top-color: #9ca3af; }
.lg-line.lg-dash { border-top: 2px dashed #525252; }

.chart-body { flex: 1; display: flex; align-items: center; justify-content: center; }
.chart-svg { width: 100%; height: auto; }
.axis-text { font-size: 11px; fill: #a3a3a3; font-family: 'Plus Jakarta Sans', sans-serif; }

.chart-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawLine 1.1s ease forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

.chart-dot { transition: r 0.15s ease; cursor: pointer; }
.chart-dot:hover { r: 6; }

.donut-wrap { flex: 1; display: flex; align-items: center; gap: 1.25rem; }
.donut-body { flex: 0 0 52%; }
.donut-svg { width: 100%; max-width: 190px; }
.donut-seg { transition: stroke-width 0.2s ease; cursor: pointer; animation: fadeIn 0.6s ease; }
.donut-seg:hover { stroke-width: 32; }
.donut-total { font-size: 30px; font-weight: 800; fill: #0a0a0a; font-family: 'Plus Jakarta Sans', sans-serif; }
.donut-sub { font-size: 12px; fill: #737373; font-family: 'Plus Jakarta Sans', sans-serif; }

.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 0.85rem; }
.donut-legend-row { display: flex; align-items: center; gap: 0.55rem; font-size: 0.82rem; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #d4d4d4; flex-shrink: 0; }
.lg-label { color: #404040; flex: 1; }
.lg-val { font-weight: 800; color: #0a0a0a; white-space: nowrap; }
.lg-val em { font-style: normal; font-weight: 500; color: #737373; }

.cat-bars { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 0.85rem; }
.cat-row { display: grid; grid-template-columns: 118px 1fr 28px; align-items: center; gap: 0.7rem; font-size: 0.8rem; }
.cat-name { color: #404040; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-track { height: 10px; background: #f0f0f0; border-radius: 99px; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 99px; transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.cat-count { font-weight: 800; color: #0a0a0a; text-align: right; }

/* Table extras */
.person-cell { display: flex; align-items: center; gap: 0.7rem; }
.person-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f0f0f0;
  border: 1px solid #e5e5e5;
  color: #0a0a0a;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.evidence-line { display: flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; margin-top: 0.2rem; }

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-top: 1px solid #f0f0f0;
  font-size: 0.8rem;
  color: #737373;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.table-footer:empty { display: none; }
.page-btns { display: flex; gap: 0.3rem; }
.page-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  color: #262626;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: #0a0a0a; }
.page-btn.active { background: #0a0a0a; color: #ffffff; border-color: #0a0a0a; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid .chart-card:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .kpi-grid, .charts-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Attachment Viewer & Live Preview System
   ========================================================================== */
#attachment-preview-modal {
  z-index: 1200;
}

.modal-evidence-container {
  margin-top: 0.6rem;
}

.evidence-pill-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-top: 0.4rem;
}

.evidence-pill-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  font-size: 0.84rem;
  color: #0f172a;
  font-weight: 600;
  min-width: 0;
}

.evidence-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.btn-view-attachment {
  padding: 0.35rem 0.85rem !important;
  font-size: 0.78rem !important;
  border-radius: 7px !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  background: #0a0a0a !important;
  color: #ffffff !important;
  border-color: #0a0a0a !important;
  cursor: pointer;
  transition: var(--transition);
}

.btn-view-attachment:hover {
  background: #262626 !important;
  transform: translateY(-1px);
}

/* Submission Live Preview Card */
.submission-preview-card {
  margin-top: 0.85rem;
  background: #ffffff;
  border: 1px solid #0a0a0a;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  animation: fadeIn 0.25s ease;
}

.submission-preview-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.submission-thumb-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #f0f0f0;
  flex-shrink: 0;
  cursor: pointer;
}

.submission-file-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #0a0a0a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.submission-meta {
  min-width: 0;
}

.submission-meta-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0a0a0a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.submission-meta-sub {
  font-size: 0.73rem;
  color: #737373;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.submission-btn-remove {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  color: #525252;
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.submission-btn-remove:hover {
  background: #0a0a0a;
  color: #ffffff;
  border-color: #0a0a0a;
}

/* Modal Attachment Viewer */
.attachment-img-preview {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  background: #ffffff;
}

.attachment-pdf-sheet {
  width: 100%;
  max-width: 620px;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
  padding: 2.25rem 2.5rem;
  text-align: left;
  box-shadow: 0 12px 36px rgba(0,0,0,0.08);
}

.attachment-pdf-header {
  border-bottom: 2px solid #0a0a0a;
  padding-bottom: 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attachment-pdf-body {
  font-size: 0.9rem;
  color: #262626;
  line-height: 1.6;
}

.table-evidence-btn {
  background: #f0f0f0;
  border: 1px solid #e5e5e5;
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.74rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  transition: var(--transition);
  margin-top: 0.2rem;
  text-decoration: none;
}

.table-evidence-btn:hover {
  background: #0a0a0a;
  color: #ffffff;
  border-color: #0a0a0a;
}

/* ==========================================================================
   HIGH-FIDELITY RESPONSIVE SYSTEM (All Devices: Mobile, Tablet, Laptops)
   ========================================================================== */

/* 1. Large Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  #login-view.active {
    grid-template-columns: 1fr 1fr;
  }

  .login-form-card {
    padding: 2rem 2.5rem;
  }

  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .kpi-grid,
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.85rem !important;
  }

  .table-toolbar {
    flex-wrap: wrap;
    gap: 0.85rem;
  }
}

/* 2. Tablets & Mobile Portrait (<= 900px) */
@media (max-width: 900px) {
  #login-view.active {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .login-wrapper-modern {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .login-hero-card {
    position: relative !important;
    width: 100% !important;
    height: 320px !important;
    min-height: 320px !important;
    flex-shrink: 0 !important;
  }

  .hero-top-badge {
    top: 1.25rem !important;
    left: 1.25rem !important;
  }

  .hero-overlay-text {
    padding: 1.5rem !important;
  }

  .hero-overlay-text h2 {
    font-size: 1.85rem !important;
  }

  .login-form-card {
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    width: 100% !important;
    padding: 2.25rem 1.75rem 3.5rem !important;
    overflow-y: visible !important;
  }

  .login-form-inner {
    max-width: 460px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .login-floating-db-btn {
    top: 1rem !important;
    right: 1.25rem !important;
  }

  .admin-header-box {
    padding: 1.25rem 1rem !important;
  }

  .admin-top-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .admin-top-left {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .admin-top-left h2 {
    font-size: 1.35rem !important;
    width: 100% !important;
    margin-bottom: 0.2rem !important;
  }

  .admin-top-left .btn {
    flex: 1 1 calc(50% - 0.25rem) !important;
    justify-content: center !important;
    min-height: 42px !important;
  }

  .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.85rem 1rem !important;
  }

  .table-toolbar-left {
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .toolbar-select {
    flex: 1 1 calc(50% - 0.25rem) !important;
    width: auto !important;
  }

  .search-input-group {
    width: 100% !important;
    min-width: 100% !important;
  }
}

/* 3. Small Tablets & Phones (<= 680px) */
@media (max-width: 680px) {
  .navbar {
    padding: 0.65rem 0.85rem !important;
  }

  .brand-info h1 {
    font-size: 1.15rem !important;
  }

  .brand-info span {
    display: none !important;
  }

  .nav-actions {
    gap: 0.35rem !important;
  }

  .user-details {
    display: none !important;
  }

  .user-badge {
    padding: 0.25rem 0.45rem !important;
  }

  .user-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.82rem !important;
  }

  #nav-db-btn,
  #nav-logout-btn {
    padding: 0.38rem 0.65rem !important;
    font-size: 0.76rem !important;
  }

  .kpi-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  .kpi-card,
  .stat-card {
    padding: 0.85rem 0.95rem !important;
  }

  .kpi-value,
  .stat-value {
    font-size: 1.45rem !important;
  }

  .kpi-spark {
    display: none !important;
  }

  .donut-wrap {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1.25rem !important;
  }

  .donut-body {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 220px !important;
  }

  .donut-legend {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    text-align: left !important;
  }

  .table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .custom-table {
    min-width: 640px !important;
  }

  .custom-table th,
  .custom-table td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.82rem !important;
  }

  .table-footer {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }

  /* Modals on Mobile (App-style bottom sheet) */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-header {
    padding: 1rem 1.15rem !important;
    flex-shrink: 0 !important;
  }

  .modal-header h3 {
    font-size: 1.05rem !important;
  }

  .modal-body {
    padding: 1.15rem !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-footer {
    padding: 0.85rem 1.15rem !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
    background: #ffffff !important;
    border-top: 1px solid #f1f5f9 !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  .submission-preview-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .submission-preview-left {
    width: 100% !important;
  }

  .submission-meta-name {
    max-width: 100% !important;
  }

  .attachment-img-preview {
    max-height: 48vh !important;
    width: 100% !important;
  }

  .demo-accounts-grid {
    grid-template-columns: 1fr !important;
    gap: 0.45rem !important;
  }
}

/* 4. Extra Small Phones (<= 440px) */
@media (max-width: 440px) {
  .login-hero-card {
    height: 230px !important;
    min-height: 230px !important;
  }

  .hero-overlay-text {
    padding: 1rem !important;
  }

  .hero-overlay-text h2 {
    font-size: 1.45rem !important;
  }

  .hero-brand-pill {
    font-size: 0.76rem !important;
    padding: 0.32rem 0.65rem !important;
  }

  .hero-tagline {
    display: none !important;
  }

  .login-form-card {
    padding: 1.75rem 1.15rem 2.5rem !important;
  }

  .login-main-title {
    font-size: 1.45rem !important;
  }

  .login-sub-title {
    font-size: 0.8rem !important;
  }

  .admin-top-left .btn {
    flex: 1 1 100% !important;
  }

  .kpi-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .toolbar-select {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .form-row {
    flex-direction: column !important;
  }
}

/* 5. Touch Optimizations for All Touchscreens */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .tab-btn,
  .role-tab-btn,
  .page-btn,
  .table-evidence-btn,
  .btn-view-attachment {
    min-height: 40px;
  }

  .form-control,
  .form-select,
  .modern-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }
}


