@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #1a5f7a;
  --primary-dark: #124156;
  --primary-light: #e8f2f5;
  --accent: #ff8c42;
  --accent-dark: #e6712a;
  --bg: #f3f6f8;
  --card-bg: #ffffff;
  --text: #202b33;
  --muted: #6c7a86;
  --border: #e3e9ec;
  --success: #2e7d32;
  --error: #c62828;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(18, 65, 86, .06);
  --shadow-md: 0 8px 24px rgba(18, 65, 86, .10);
  --shadow-lg: 0 16px 40px rgba(18, 65, 86, .16);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { text-decoration: none; }

.brand-logo {
  height: 40px; width: auto;
  object-fit: contain;
  display: block;
}
.brand-logo-lg { height: 78px; width: auto; object-fit: contain; display: block; margin: 0 auto; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }

/* =========================================================
   Animations
   ========================================================= */
@keyframes zoomIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .25); }
  50% { box-shadow: 0 0 0 8px rgba(198, 40, 40, 0); }
}
@keyframes popIn {
  0% { opacity: 0; transform: scale(.6); }
  70% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.zoom-in { animation: zoomIn .5s cubic-bezier(.22, 1, .36, 1) both; }
.fade-up { animation: fadeUp .5s ease both; }
.pop-in  { animation: popIn .45s cubic-bezier(.34, 1.56, .64, 1) both; }

.stagger > * { animation: zoomIn .5s cubic-bezier(.22, 1, .36, 1) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .09s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .21s; }
.stagger > *:nth-child(5) { animation-delay: .27s; }
.stagger > *:nth-child(6) { animation-delay: .33s; }

.hover-lift { transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s ease; }
.hover-lift:hover { transform: translateY(-4px) scale(1.015); box-shadow: var(--shadow-lg); }

/* =========================================================
   Buttons (Bootstrap overrides)
   ========================================================= */
.btn-brand {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: var(--shadow-sm);
}
.btn-brand:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); filter: brightness(1.06); color: #fff; }
.btn-brand:active { transform: translateY(0); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border: none; font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: #fff; }

.btn-outline-brand {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
  font-weight: 600;
  transition: all .2s ease;
}
.btn-outline-brand:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* =========================================================
   Badges
   ========================================================= */
.badge-status { font-weight: 600; padding: .45em .8em; border-radius: 20px; letter-spacing: .2px; }
.badge-new { background: #eceff1; color: #455a64; }
.badge-assigned { background: #e3f2fd; color: #1565c0; }
.badge-investigation { background: #f3e5f5; color: #7b1fa2; }
.badge-progress { background: #fff8e1; color: #f57f17; }
.badge-resolved { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #efebe9; color: #6d4c41; }
.badge-overdue { background: #ffebee; color: var(--error); animation: pulseGlow 2s infinite; }

/* =========================================================
   Cards / general surfaces
   ========================================================= */
.card-surface {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   PUBLIC: Step Wizard
   ========================================================= */
.wizard-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(13,46,61,.72) 0%, rgba(13,46,61,.85) 55%, rgba(13,46,61,.94) 100%),
    url('../images/bg.jpg') center/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.wizard-shell {
  width: 100%;
  max-width: 460px;
}
.wizard-brand {
  text-align: center;
  color: #eaf4f7;
  margin-bottom: 16px;
}
.wizard-brand .brand-icon { font-size: 2rem; }
.wizard-brand h5 { font-weight: 700; margin: 6px 0 2px; }
.wizard-brand p { font-size: .85rem; opacity: .85; margin: 0; }

.wizard-card {
  background: var(--card-bg);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  min-height: 360px;
}

.progress-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 22px;
}
.progress-dots span {
  height: 6px;
  flex: 1;
  border-radius: 6px;
  background: var(--border);
  transition: background .35s ease;
}
.progress-dots span.done { background: var(--primary); }
.progress-dots span.current { background: var(--accent); }

.step { display: none; }
.step.active { display: block; animation: zoomIn .4s cubic-bezier(.22, 1, .36, 1) both; }

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--primary-dark);
}
.step-sub { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }

.lang-choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all .2s ease;
  text-align: left;
}
.lang-choice-btn:hover, .lang-choice-btn:focus {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-sm);
}
.lang-choice-btn small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }

.big-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 1.05rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.big-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.choice-tile {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  font-weight: 600;
  height: 100%;
}
.choice-tile .tile-icon { font-size: 1.7rem; display: block; margin-bottom: 6px; }
.choice-tile:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.choice-tile.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-light);
  transform: translateY(-2px) scale(1.03);
}

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 10px; }

.contact-pref-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.contact-pref-row label {
  flex: 1;
  min-width: 100px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: all .2s ease;
}
.contact-pref-row input { display: none; }
.contact-pref-row input:checked + span { color: var(--primary); }
.contact-pref-row label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }

/* =========================================================
   Public success / track pages
   ========================================================= */
.slim-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 0;
}
.slim-header .brand { color: #fff; font-weight: 700; font-size: 1.05rem; }
.slim-header .lang-switch a { color: #dceef2; margin-left: 10px; font-size: .85rem; padding: 4px 10px; border-radius: 6px; }
.slim-header .lang-switch a.active { background: rgba(255,255,255,.18); }

.complaint-id-value {
  font-size: 1.8rem; font-weight: 800; letter-spacing: 1px; color: var(--primary-dark);
}
.qr-wrap img { border-radius: 14px; box-shadow: var(--shadow-md); padding: 10px; background: #fff; }

/* =========================================================
   ADMIN: Sidebar layout
   ========================================================= */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary-dark), #0d2e3d);
  color: #eaf4f7;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; font-weight: 700; color: #fff; font-size: 1.05rem; }
.sidebar-brand .brand-badge { font-size: 1.4rem; }

.sidebar-nav { flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #cfe4ea;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all .2s ease;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.sidebar-user { font-size: .82rem; color: #b9d4da; padding: 0 10px 8px; }

.main-content { margin-left: 250px; flex: 1; min-width: 0; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}
.topbar h1 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.sidebar-toggle { display: none; }

.admin-page-body { padding: 24px; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
}

/* =========================================================
   ADMIN: Dashboard stat cards + charts
   ========================================================= */
.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: block;
}
.stat-card .stat-icon {
  position: absolute; right: 14px; top: 14px; font-size: 2.3rem; opacity: .35;
}
.stat-card .stat-number { font-size: 2.1rem; font-weight: 800; display: block; }
.stat-card .stat-label { font-size: .85rem; opacity: .9; }
.stat-card.bg-pending { background: linear-gradient(135deg, #607d8b, #37474f); }
.stat-card.bg-progress { background: linear-gradient(135deg, #f9a825, #e65100); }
.stat-card.bg-resolved { background: linear-gradient(135deg, #43a047, #1b5e20); }
.stat-card.bg-overdue { background: linear-gradient(135deg, #e53935, #b71c1c); }

.chart-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.chart-card h6 { font-weight: 700; margin-bottom: 14px; color: var(--primary-dark); }

/* =========================================================
   Professional tables
   ========================================================= */
.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-modern { margin-bottom: 0; border-collapse: separate; border-spacing: 0; }
.table-modern thead th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  border-bottom: none;
  padding: 14px 16px;
}
.table-modern tbody td { padding: 13px 16px; vertical-align: middle; font-size: .9rem; border-color: var(--border); position: relative; }
.table-modern tbody tr {
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s ease, background .22s ease;
  position: relative;
}
.table-modern tbody tr td:first-child { border-left: 3px solid transparent; transition: border-color .22s ease; }
.table-modern tbody tr:hover {
  background: #f6fafb;
  transform: translateY(-2px) scale(1.004);
  box-shadow: 0 6px 18px rgba(18,65,86,.12);
  z-index: 2;
}
.table-modern tbody tr:hover td:first-child { border-left-color: var(--accent); }
.table-modern tbody tr .btn {
  transition: transform .2s ease, box-shadow .2s ease;
}
.table-modern tbody tr:hover .btn {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}
.table-modern tbody tr.row-overdue { background: #fff5f5; }
.table-modern tbody tr.row-overdue:hover { background: #ffecec; }

/* =========================================================
   Login
   ========================================================= */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(180deg, rgba(13,46,61,.72) 0%, rgba(13,46,61,.85) 55%, rgba(13,46,61,.94) 100%),
    url('../images/bg.jpg') center/cover no-repeat fixed;
  padding: 16px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
  width: 100%;
  max-width: 380px;
}
.login-card .login-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 14px;
}

/* =========================================================
   Printable letterhead (resume-style header for printed reports)
   ========================================================= */
.print-letterhead {
  display: none;
}
.letterhead-onscreen {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.letterhead-onscreen .lh-titles h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.letterhead-onscreen .lh-titles p { margin: 0; font-size: .8rem; opacity: .9; }
.letterhead-meta { margin-left: auto; text-align: right; font-size: .78rem; opacity: .9; }

@media print {
  .print-letterhead {
    display: flex !important;
    align-items: center;
    gap: 18px;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 14px;
    margin-bottom: 18px;
  }
  .print-letterhead .lh-titles h2 { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--primary-dark); }
  .print-letterhead .lh-titles p { margin: 1px 0 0; font-size: .82rem; color: var(--muted); }
  .print-letterhead .lh-meta { margin-left: auto; text-align: right; font-size: .78rem; color: var(--muted); }
  .print-letterhead .lh-meta strong { color: var(--text); }
  .letterhead-onscreen { display: none !important; }
}

/* =========================================================
   Smooth page-load feel
   ========================================================= */
.page-fade { animation: fadeUp .45s ease both; }

@media print {
  .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

