/* ============================================================
   ENTE KONDOTTY — Smart Municipality Super App
   Design System v3.0
   Font: Poppins (Google Fonts loaded in base.html)
   Colors:
     Primary  : #0D9488 (teal)
     Secondary: #7C3AED (purple)
     BG       : #F8FAFC
     Card     : #FFFFFF
     Text     : #0F172A
     Muted    : #64748B
     Border   : #E2E8F0
   ============================================================ */

/* ---- Reset & Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #0D9488;
  --primary-d: #0B7A70;
  --primary-l: rgba(13,148,136,.1);
  --secondary: #7C3AED;
  --sec-l:     rgba(124,58,237,.12);
  --bg:        #F8FAFC;
  --card:      #FFFFFF;
  --text:      #0F172A;
  --muted:     #64748B;
  --border:    #E2E8F0;
  --danger:    #EF4444;
  --warning:   #F97316;
  --sidebar-w: 250px;
  --topbar-h:  64px;
  --statdock-h:64px;
  --shadow-sm: 0 1px 2px 0 rgba(15,23,42,.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.03), 0 2px 4px -2px rgba(15,23,42,.03);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.05), 0 4px 6px -4px rgba(15,23,42,.02);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

html, body { min-height: 100%; }

body {
  font-family: 'Poppins', Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---- Utility --------------------------------------------- */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.min-w-0 { min-width: 0; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.ml-auto { margin-left: auto; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.min-h-screen { min-height: 100vh; }
.space-y-5 > * + * { margin-top: 1.25rem; }

.text-primary { color: var(--primary); }
.text-muted   { color: var(--muted); }
.bg-slate-50  { background: var(--bg); }
.text-slate-950{ color: var(--text); }
.text-slate-700{ color: #334155; }

/* ---- App Shell ------------------------------------------- */
.app-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
}
.app-backdrop.open { display: block; }

.public-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar --------------------------------------------- */
.public-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 250px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-right: 1px solid #EEF2F7;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  scrollbar-width: none;
}
.public-sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0D9488 0%, #7C3AED 100%);
  flex-shrink: 0;
}
.brand-mark svg { width: 28px; height: 28px; color: white; }

.brand-lockup > span { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lockup em  { font-style: normal; font-size: 11px; font-weight: 600; color: #64748B; letter-spacing: 1px; }
.brand-lockup b   { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text); }
.brand-lockup small { font-size: 12px; font-weight: 500; color: #64748B; margin-top: 4px; }

/* Collapse button */
.sidebar-collapse {
  display: none;
}

/* Nav */
.public-nav {
  display: flex;
  flex-direction: column;
  padding: .25rem .75rem;
  gap: 6px;
  flex: 1;
}

.public-nav a,
.nav-auth-button {
  display: flex;
  align-items: center;
  gap: .65rem;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #475569;
  transition: background .2s, color .2s;
  white-space: nowrap;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.public-nav a:hover,
.nav-auth-button:hover {
  background: #F8FAFC;
  color: #475569;
}
.public-nav a.active {
  background: linear-gradient(135deg, #0D9488, #14B8A6);
  color: white;
  height: 52px;
  border-radius: 14px;
  padding: 0 16px;
  box-shadow: 0 10px 25px rgba(13,148,136,.20);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px !important;
  height: 20px !important;
  color: #64748B;
}
.nav-icon svg, .nav-icon i {
  display: block;
  width: 20px;
  height: 20px;
}
.public-nav a.active .nav-icon { color: white; }
.public-nav a.active .nav-icon svg, .public-nav a.active .nav-icon i { color: white; }

/* Nav badge */
.nav-danger-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #EF4444;
  margin-left: auto;
  flex-shrink: 0;
}

/* Get the App card */
.sidebar-app-card {
  margin: auto .75rem .75rem;
  padding: 16px;
  background: #F8FAFC;
  border-radius: 16px;
  border: none;
  flex-shrink: 0;
}
.sidebar-app-card p {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .15rem;
}
.sidebar-app-card small {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: .65rem;
}
.app-store-btns {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .7rem;
  border-radius: 8px;
  background: var(--text);
  color: white;
  font-size: 10px;
  font-weight: 700;
  transition: opacity .15s;
}
.app-store-btn:hover { opacity: .85; }
.app-store-btn svg { width: 13px; height: 13px; }

/* ---- Main area ------------------------------------------- */
main.min-w-0 {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Header ------------------------------------------ */
.public-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #EAECEF;
  gap: 12px;
}

/* SECTION 1: Location Area */
.topbar-location {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-location svg {
  width: 18px;
  height: 18px;
  color: #0D9488;
  flex-shrink: 0;
}
.topbar-location .loc-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.topbar-location .loc-text span:first-child {
  font-weight: 700;
  font-size: 13px;
  color: #0F172A;
}
.topbar-location .loc-text span:last-child {
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
}

/* SECTION 2: Search Bar */
.topbar-search {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 520px;
  height: 42px;
  display: flex;
  align-items: center;
  margin: 0 8px;
}
.topbar-search input {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #F8FAFC;
  border: 1.5px solid #E5E7EB;
  padding: 0 40px;
  font-size: 13px;
  color: #0F172A;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.topbar-search input:focus {
  border-color: #0D9488;
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
  background: #FFFFFF;
}
.topbar-search input::placeholder {
  color: #94A3B8;
}
.topbar-search .search-icon {
  position: absolute;
  left: 14px;
  color: #94A3B8;
  pointer-events: none;
  display: flex;
}
.topbar-search .search-icon svg { width: 16px; height: 16px; }
.topbar-search .clear-icon {
  position: absolute;
  right: 12px;
  color: #94A3B8;
  background: none;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.topbar-search .clear-icon svg { width: 14px; height: 14px; }
.topbar-search .clear-icon:hover { color: #0F172A; background: #F1F5F9; }

/* SECTION 3, 4, 5: Right Side */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

/* SECTION 3: Weather */
.topbar-weather {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-weather svg { width: 24px; height: 24px; color: #F59E0B; }
.topbar-weather .weather-text {
  display: flex;
  flex-direction: column;
}
.topbar-weather .weather-text small {
  font-size: 12px;
  color: #64748B;
  line-height: 1;
}
.topbar-weather .weather-text span {
  font-size: 16px;
  font-weight: 600;
  color: #0F172A;
  line-height: 1.2;
}

/* SECTION 4: Notifications */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: #0F172A;
  text-decoration: none;
}
.topbar-action-item:hover { color: #0D9488; }
.topbar-action-item span {
  font-size: 14px;
  font-weight: 600;
}
.topbar-action-item .icon-wrapper {
  position: relative;
  display: grid;
  place-items: center;
}
.topbar-action-item .icon-wrapper svg {
  width: 20px;
  height: 20px;
}
.topbar-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* SECTION 5: User Profile */
.profile-menu { position: relative; }

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.topbar-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #E2E8F0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0F172A;
  font-size: 14px;
}
.topbar-profile .profile-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.topbar-profile .profile-text b {
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
  line-height: 1.2;
}
.topbar-profile .profile-text small {
  font-size: 12px;
  color: #64748B;
  line-height: 1.2;
}
.topbar-profile .dropdown-arrow {
  color: #64748B;
  margin-left: 4px;
}
.topbar-profile .dropdown-arrow svg { width: 16px; height: 16px; }

/* Hide old top links — we use sidebar */
.top-public-links { display: none; }

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  z-index: 60;
  display: none;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: .5rem;
  box-shadow: var(--shadow-lg);
}
.profile-menu.open .profile-dropdown { display: grid; gap: 2px; }
.profile-dropdown a,
.profile-dropdown button {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 .75rem;
  border-radius: 8px;
  background: none;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.profile-dropdown a:hover,
.profile-dropdown button:hover { background: var(--primary-l); color: var(--primary); }

.login-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(13,148,136,.3);
  transition: background .15s;
}
.login-link:hover { background: var(--primary-d); }

/* ---- Content area ---------------------------------------- */
.public-content {
  padding: 1.1rem 1.25rem calc(var(--statdock-h) + 1.5rem);
  flex: 1;
}

/* ---- Avatar ---------------------------------------------- */
.avatar,
.gradient-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar.big { width: 56px; height: 56px; font-size: 20px; }

/* ---- Home 3-column layout -------------------------------- */
.public-home-v3 {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 1.1rem;
  align-items: start;
}

/* Left insight rail */
.home-left-main { display: contents; }
.home-insight-rail {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.home-insight-rail::-webkit-scrollbar { display: none; }

/* Feed zone (center column) */
.home-feed-zone {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.home-right-rail {
  grid-column: 3;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;          /* no fixed width — let grid control it */
  max-width: 380px;
  background: transparent;
  flex-shrink: 0;
}
.home-right-rail::-webkit-scrollbar { display: none; }

/* Content grid container */
.home-content-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 220px 1fr 380px;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

/* ---- Dashboard Panel (generic card) ---------------------- */
.dashboard-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem .5rem;
}
.panel-head h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.panel-head a {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  transition: opacity .15s;
}
.panel-head a:hover { opacity: .75; }

/* ---- Hero Carousel --------------------------------------- */
.home-hero-card {
  position: relative;
  grid-column: 1 / 3;
  grid-row: 1;
  height: 340px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 100%;
  background: #000;
}
@media (max-width: 1024px) { .home-hero-card { height: 280px; } }
@media (max-width: 768px) { .home-hero-card { height: 290px; } }

.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: none;
}
.hero-slide.active { display: block; }

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,90,85,.88) 0%, rgba(0,90,85,.65) 35%, rgba(0,90,85,.15) 70%, transparent 100%);
  z-index: 2;
}

.hero-copy {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 480px;
  z-index: 3;
  color: white;
}
@media (max-width: 768px) {
  .hero-copy { left: 24px; max-width: 80%; }
}

.hero-badge {
  display: inline-block;
  background: rgba(16,185,129,.18);
  color: #D1FAE5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-copy h2 {
  font-size: 38px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 12px;
}
@media (max-width: 1024px) { .hero-copy h2 { font-size: 32px; } }
@media (max-width: 768px) { .hero-copy h2 { font-size: 28px; } }

.hero-copy p {
  font-size: 15px;
  color: rgba(255,255,255,.92);
  max-width: 380px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) { .hero-copy p { font-size: 14px; } }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #14B8A6;
  color: white;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: #0D9488; color: white; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.btn-secondary i, .btn-secondary svg { width: 16px; height: 16px; }

/* Nav Arrows */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  border: none;
  color: #333;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.2s;
}
.hero-nav:hover { transform: translateY(-50%) scale(1.05); }
.hero-nav.prev { left: 24px; }
.hero-nav.next { right: 24px; }

/* Indicators */
.hero-dots {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
}
.hero-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
}
.hero-dots button.active { background: white; }

/* ---- Stories Strip --------------------------------------- */
.stories-panel { padding: .85rem 1rem 1rem; }
.stories-panel .panel-head { padding: 0 0 .65rem; }

.story-strip {
  display: flex;
  gap: .85rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scrollbar-width: none;
}
.story-strip::-webkit-scrollbar { display: none; }

.story-strip a,
.story-strip button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.story-strip b {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(13,148,136,.12), rgba(124,58,237,.12));
  border: 2.5px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.story-avatar:hover { transform: scale(1.06); }
.story-avatar img { width: 28px; height: 28px; object-fit: contain; }
.story-avatar.live {
  border-color: transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #EF4444, #F97316) border-box;
  border: 2.5px solid transparent;
}
.story-avatar.live img { filter: none; }

/* ---- Feed Tabs ------------------------------------------- */
.feed-tabs {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .75rem 1rem .5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tabs button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .75rem;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.feed-tabs button:hover { background: var(--bg); color: var(--text); }
.feed-tabs button.active {
  background: var(--primary-l);
  color: var(--primary);
  font-weight: 700;
}
.feed-tabs button svg { width: 14px; height: 14px; }

/* ---- Feed Composer --------------------------------------- */
.feed-composer { overflow: hidden; }

.composer-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem .65rem;
}
.composer-row button {
  flex: 1;
  text-align: left;
  height: 42px;
  padding: 0 1rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s;
}
.composer-row button:hover { border-color: var(--primary); }

.composer-actions {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: .45rem .5rem;
}
.composer-actions button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex: 1;
  justify-content: center;
  height: 36px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background .12s, color .12s;
}
.composer-actions button:hover { background: var(--bg); color: var(--text); }
.composer-actions button .original-icon { width: 16px; height: 16px; object-fit: contain; }

/* ---- Feed Stack ------------------------------------------ */
.feed-stack { display: flex; flex-direction: column; gap: .85rem; }

/* Load more */
.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s;
}
.load-more:hover { background: var(--primary-l); border-color: var(--primary); }

/* ---- Feed Card (social post) ----------------------------- */
.social-feed-card,
.feed-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow .2s;
}
.social-feed-card:hover { box-shadow: var(--shadow-lg); }

/* Feed author row */
.feed-author-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem .5rem;
}
.feed-author-copy { flex: 1; min-width: 0; }
.feed-author-copy > div {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.feed-author-copy b {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.verified-mark { width: 16px; height: 16px; color: var(--primary); }
.feed-author-copy small {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: .1rem;
  flex-wrap: wrap;
}
.feed-pill {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 99px;
  background: var(--primary-l);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}
.feed-author-row > button {
  color: var(--muted);
  padding: .25rem;
  border-radius: 8px;
  transition: background .12s;
}
.feed-author-row > button:hover { background: var(--bg); }
.feed-author-row > button .original-icon { width: 16px; height: 16px; }

/* Feed card body */
.social-feed-card h2,
.feed-card h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: .1rem 1rem 0;
}
.social-feed-card p,
.feed-card p {
  font-size: 13.5px;
  color: #334155;
  padding: .35rem 1rem 0;
  line-height: 1.6;
}

/* Hashtag styling */
.social-feed-card p a,
.feed-card p a {
  color: var(--primary);
  font-weight: 600;
}

/* Poll box */
.poll-box {
  margin: .75rem 1rem;
  display: grid;
  gap: .45rem;
}
.poll-box button {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: .6rem .85rem;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.poll-box button:hover { border-color: var(--primary); background: var(--primary-l); }

/* Feed media */
.feed-media {
  margin: .75rem 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-l), var(--sec-l));
  min-height: 200px;
  display: grid;
  place-items: center;
}
.feed-media img { width: 100%; height: 290px; object-fit: cover; border-radius: var(--radius-sm); }
.feed-media video { width: 100%; border-radius: var(--radius-sm); }
.feed-media a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1.5rem;
  color: var(--primary);
  font-weight: 700;
}
.feed-media svg { width: 20px; height: 20px; }

/* Feed insights (reaction counts) */
.feed-insights {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .45rem 1rem;
  border-top: 1px solid var(--border);
}
.feed-insights span {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.feed-insights svg { width: 13px; height: 13px; }

/* Feed actions bar */
.feed-actions {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: .25rem .5rem;
}
.feed-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex: 1;
  height: 38px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background .12s, color .12s;
}
.feed-actions button:hover { background: var(--bg); color: var(--text); }
.feed-actions button .original-icon { width: 16px; height: 16px; object-fit: contain; }
.feed-actions button svg { width: 16px; height: 16px; }

/* Comment form */
.comment-form {
  display: flex;
  gap: .5rem;
  padding: .5rem 1rem .75rem;
}
.comment-form.hidden { display: none; }
.comment-form input {
  flex: 1;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  padding: 0 1rem;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.comment-form input:focus { border-color: var(--primary); }
.comment-form button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 99px;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
}
.comment-form button svg { width: 16px; height: 16px; }

/* ---- Upcoming Events & Trending Panel Redesign ---- */
.upcoming-panel, .trending-panel {
  background: #FFFFFF;
  border: 1px solid #EEF2F7;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(15,23,42,.04);
}

.upcoming-panel .panel-head, .trending-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 16px 0;
}

.upcoming-panel .panel-head h2 { font-size: 16px; font-weight: 700; color: #0F172A; margin: 0; }
.trending-panel .panel-head h2.trending-title { font-size: 24px; font-weight: 700; color: #0F172A; margin: 0; }
.upcoming-panel .panel-head a { font-size: 13px; color: var(--primary); font-weight: 600; text-decoration: none; }

.upcoming-list, .trend-list {
  display: flex;
  flex-direction: column;
}

/* Event Item */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #F1F5F9;
}
.event-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.event-item:first-child {
  padding-top: 0;
}

.event-item time {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: #FEF2F2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.event-item time b {
  font-size: 28px;
  font-weight: 700;
  color: #DC2626;
  margin-bottom: 2px;
}
.event-item time span {
  font-size: 12px;
  font-weight: 600;
  color: #DC2626;
  text-transform: uppercase;
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.event-details b { font-size: 15px; font-weight: 600; color: #0F172A; }
.event-details small { font-size: 13px; color: #64748B; display: flex; align-items: center; gap: 4px; }

/* Trending Item */
.trend-list {
  gap: 16px;
  padding-top: 4px;
}
.trend-item {
  display: flex;
  align-items: center;
  gap: 14px;
}
.trend-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748B;
}
.trend-icon svg, .trend-icon i {
  width: 18px;
  height: 18px;
}
.trend-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trend-details b { font-size: 14px; font-weight: 600; color: #0F172A; }
.trend-details small { font-size: 12px; color: #64748B; }

/* Compact Empty State */
.empty-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #F8FAFC;
  border-radius: 12px;
  color: #64748B;
  margin-top: 8px;
}
.empty-compact svg, .empty-compact i { width: 20px; height: 20px; }
.empty-compact p { font-size: 13px; font-weight: 500; margin: 0; }

/* ---- Emergency / SOS Panel ------------------------------ */
.sos-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 110px;
  border-radius: 22px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  padding: 26px 24px;
  color: white;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}
.sos-mini-card .sos-left svg {
  width: 70px;
  height: 70px;
  color: white;
  opacity: 0.9;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.sos-mini-card .sos-center {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sos-mini-card h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.sos-mini-card p {
  font-size: 14px;
  color: rgba(255,255,255,.9);
  line-height: 1.3;
}
.sos-mini-card .sos-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: white;
  transition: transform 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
}
.sos-mini-card .sos-btn:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,.25);
}
.sos-mini-card .sos-btn svg { width: 24px; height: 24px; }

/* Emergency 6-grid */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.emergency-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 110px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid #EEF2F7;
  box-shadow: 0 4px 20px rgba(15,23,42,.05);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.emergency-grid button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.emergency-grid button .icon-wrap {
  font-size: 36px;
  line-height: 1;
}
.emergency-grid button b {
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
}
.emergency-grid button small {
  font-size: 12px;
  color: #64748B;
  font-weight: 500;
}

/* ---- Popular Services Panel ------------------------------ */
.popular-services-panel {
  background: #FFFFFF;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(15,23,42,.05);
  border: 1px solid #EEF2F7;
}
.popular-services-panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.popular-services-panel .panel-head h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0F172A;
}
.popular-services-panel .panel-head a {
  font-size: 14px;
  font-weight: 600;
  color: #0D9488;
  text-decoration: none;
}
.popular-services-panel .panel-head a:hover { text-decoration: underline; }

.service-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 14px;
}
.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #EEF2F7;
  border-radius: 18px;
  padding: 16px;
  height: 160px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15,23,42,.06);
}
.service-card .service-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #F1F5F9;
  display: grid;
  place-items: center;
  color: #0D9488;
}
.service-card .service-icon svg { width: 24px; height: 24px; }
.service-card b {
  font-size: 15px;
  font-weight: 600;
  color: #0F172A;
  line-height: 1.2;
}
.service-card .rating {
  font-size: 13px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 4px;
}
.service-card .rating svg { width: 14px; height: 14px; color: #F59E0B; }
.service-card .book-btn {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  background: #ECFDF5;
  color: #0D9488;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.service-card .book-btn:hover {
  background: #0D9488;
  color: #FFFFFF;
}

/* ---- AI Assistant inline card --------------------------- */
@keyframes float-ai {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.ai-suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}
.ai-suggest-row button {
  background: rgba(255,255,255,.18);
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.ai-suggest-row button:hover {
  background: rgba(255,255,255,.25);
}
.ai-inline-input {
  display: flex;
  background: white;
  height: 50px;
  border-radius: 14px;
  padding: 5px 5px 5px 16px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.ai-inline-input input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #0F172A;
}
.ai-inline-input input::placeholder {
  color: #94A3B8;
}
.ai-inline-input button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: white;
  color: #7C3AED;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.ai-inline-input button:hover {
  background: #F1F5F9;
}
.ai-inline-input button svg { width: 18px; height: 18px; }

/* ---- Statistics Dock ------------------------------------- */
/* ---- STATISTICS SECTION RE-DESIGN ---- */
.dashboard-stat-dock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  width: 100%;
  margin: 1.5rem 0 3rem;
}

.dashboard-stat-dock article {
  background: #FFFFFF;
  border: 1px solid #EEF2F7;
  border-radius: 18px;
  height: 78px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(15,23,42,.04);
  transition: transform 0.25s, box-shadow 0.25s;
}

.dashboard-stat-dock article:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}

.stat-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-box svg, .stat-icon-box i {
  width: 18px;
  height: 18px;
}

.dashboard-stat-dock div { min-width: 0; }

.dashboard-stat-dock b {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1;
}

.dashboard-stat-dock span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

/* ---- AI Panel (floating) --------------------------------- */
.ai-bubble {
  display: flex;
  align-items: center;
  gap: .5rem;
  height: 48px;
  padding: 0 1.2rem;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--secondary), #4F46E5);
  color: white;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(124,58,237,.4);
  transition: transform .2s, box-shadow .2s;
}
.ai-bubble:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124,58,237,.5); }
.ai-bubble svg { width: 18px; height: 18px; }

.ai-card {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + .75rem);
  width: 300px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
}
.ai-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.ai-card b { font-size: 14px; font-weight: 700; }
.ai-card > div:first-child button { color: var(--muted); }
.ai-card button[data-ai-suggest] {
  display: inline-block;
  margin: .25rem;
  padding: .3rem .75rem;
  border-radius: 99px;
  background: var(--primary-l);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  transition: background .12s;
}
.ai-card button[data-ai-suggest]:hover { background: var(--primary); color: white; }

/* ---- Auth Modal ------------------------------------------ */
body.auth-lock { overflow: hidden !important; touch-action: none; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain;
}
.auth-modal.open { opacity: 1; pointer-events: all; }
.auth-modal.open .auth-dialog.modern-auth-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.auth-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: none; border: 0; cursor: default; }

.auth-dialog.modern-auth-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(940px, 95vw);
  max-height: 85vh;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5) inset, 0 0 0 1px rgba(0,0,0,0.05);
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  color: #64748B;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.4);
}
.auth-close:hover { background: #FFFFFF; color: #0F172A; transform: scale(1.05); }
.auth-close i, .auth-close svg { width: 18px; height: 18px; }

.auth-showcase {
  flex: 0 0 42%;
  background: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(13,148,136,0.85) 100%), url('/static/public_portal/img/kondotty-aerial.png') center/cover no-repeat;
  padding: 2.5rem 2.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.auth-showcase::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, rgba(124, 58, 237, 0.2), transparent);
  pointer-events: none;
}
.auth-brand-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: max-content;
}
.auth-brand-card img { width: 44px; height: 44px; drop-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.auth-brand-card div { display: flex; flex-direction: column; }
.auth-brand-card span { font-size: 11px; font-weight: 600; opacity: 0.9; letter-spacing: 0.5px; text-transform: uppercase; }
.auth-brand-card b { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.auth-brand-card small { font-size: 11px; opacity: 0.8; }

.auth-showcase-copy .auth-kicker { display: inline-block; font-size: 12px; font-weight: 700; color: #2DD4BF; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.6rem; background: rgba(45, 212, 191, 0.15); padding: 3px 10px; border-radius: 99px; }
.auth-showcase-copy h2 { font-size: 26px; font-weight: 800; line-height: 1.2; margin: 0 0 0.6rem; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.auth-showcase-copy p { font-size: 14px; opacity: 0.85; line-height: 1.6; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

.auth-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.auth-feature-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
  cursor: default;
}
.auth-feature-pill:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(45, 212, 191, 0.3);
  transform: translateY(-2px);
}
.auth-feature-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: rgba(45, 212, 191, 0.18);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 8px;
  color: #2DD4BF;
}
.auth-feature-icon svg { width: 15px; height: 15px; flex-shrink: 0; }
.auth-feature-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.auth-feature-text b {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.auth-feature-text small {
  font-size: 10.5px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  line-height: 1.3;
}

.auth-panel {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: #FFFFFF;
}
.auth-hero { display: flex; align-items: center; gap: 1rem; }
.auth-hero span { 
  display: grid; place-items: center; 
  width: 56px; height: 56px; 
  border-radius: 16px; 
  background: linear-gradient(135deg, #F0FDFA, #CCFBF1); 
  flex-shrink: 0; 
  color: #0D9488; 
  box-shadow: 0 4px 12px rgba(13,148,136,0.1);
}
.auth-hero span i, .auth-hero span svg { width: 28px; height: 28px; color: #0D9488; }
.auth-hero .auth-kicker { font-size: 12px; color: #0D9488; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; display: block; }
.auth-hero h2 { font-size: 26px; font-weight: 800; margin: 0; color: #0F172A; letter-spacing: -0.5px; }
.auth-hero p, [data-auth-reason-text] { font-size: 14px; color: #64748B; margin-top: 4px; line-height: 1.5; }

.auth-tabs { display: flex; background: #F1F5F9; padding: 6px; border-radius: 14px; }
.auth-tabs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  border: none;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-tabs button:hover { color: #0F172A; }
.auth-tabs button.active { background: #FFFFFF; color: #0F172A; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.auth-pane { display: none; flex-direction: column; gap: 1.25rem; animation: authFadeIn 0.3s ease-out forwards; }
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-pane.active { display: flex; }
.auth-pane label { display: flex; flex-direction: column; gap: 0.5rem; font-size: 13.5px; font-weight: 600; color: #1E293B; }
.auth-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  background: #FFFFFF;
  padding: 0 1.25rem;
  height: 58px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.auth-field:hover { border-color: #CBD5E1; }
.auth-field:focus-within {
  border-color: #0D9488;
  box-shadow: 0 0 0 4px rgba(13,148,136,0.1);
}
.country-code { font-size: 15px; font-weight: 600; color: #64748B; padding-right: 0.75rem; border-right: 1px solid #E2E8F0; margin-right: 0.25rem; }
.auth-field input, .auth-field select {
  flex: 1;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 15px;
  color: #0F172A;
}
.auth-field input::placeholder { color: #94A3B8; }
.password-line button { color: #64748B; transition: color 0.2s; padding: 4px; margin-right: -4px; border-radius: 8px; border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.password-line button:hover { color: #0F172A; background: #F1F5F9; }
.password-line button i, .password-line button svg { width: 18px; height: 18px; }

.remember-row { flex-direction: row !important; align-items: center; gap: 0.75rem; font-weight: 500 !important; cursor: pointer; color: #475569 !important; }
.remember-row input { width: 18px; height: 18px; accent-color: #0D9488; cursor: pointer; }

.auth-pane button[type="submit"], .auth-pane button[data-auth-verify-otp] {
  height: 52px;
  border-radius: 14px;
  background: #0F172A;
  color: white;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15,23,42,0.15);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  border: none;
  cursor: pointer;
}
.auth-pane button[type="submit"]:hover, .auth-pane button[data-auth-verify-otp]:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,23,42,0.25);
  background: #1E293B;
}
.auth-pane button[type="submit"] i, .auth-pane button[type="submit"] svg { width: 18px; height: 18px; opacity: 0.9; }
.auth-pane button[type="submit"] img { display: none; }

.ghost-button {
  background: none;
  color: #64748B;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 0.75rem;
  border-radius: 12px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.ghost-button:hover { color: #0D9488; background: #F8FAFC; }
.auth-pane img { width: 18px; height: 18px; }

.otp-code-row { display: none !important; }
.otp-code-row.visible { display: flex !important; animation: authFadeIn 0.3s ease-out forwards; }

.register-step { display: none; flex-direction: column; gap: 1.25rem; }
.register-step.active { display: flex; animation: authFadeIn 0.3s ease-out forwards; }
.register-progress { height: 6px; border-radius: 99px; background: #F1F5F9; overflow: hidden; margin-top: 0.5rem; }
.register-progress span { display: block; height: 100%; border-radius: 99px; background: #0D9488; width: 25%; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

.auth-step-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.auth-step-actions .ghost-button { flex: 1; border: 1px solid #E2E8F0; }
.auth-step-actions .ghost-button:hover { border-color: #CBD5E1; background: #F8FAFC; color: #0F172A; }
.auth-step-actions [data-register-next], .auth-step-actions [data-register-submit] {
  flex: 2;
  height: 52px;
  border-radius: 14px;
  background: #0D9488;
  color: white;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.auth-step-actions [data-register-next]:hover, .auth-step-actions [data-register-submit]:hover {
  background: #0F766E;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13,148,136,0.3);
}
.auth-note { font-size: 13px; color: #64748B; background: #F8FAFC; padding: 12px 16px; border-radius: 10px; line-height: 1.5; border: 1px solid #EEF2F7; }
.auth-pane select {
  flex: 1;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 15px;
  color: #0F172A;
  -webkit-appearance: none;
}

.social-login-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1rem; 
  margin-top: 0.5rem; 
  border-top: 1px solid #F1F5F9; 
  padding-top: 1.5rem; 
}
.social-login-row button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  height: 52px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #F8FAFC;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}
.social-login-row button:hover { 
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  transform: translateY(-2px);
  color: #0F172A;
}
.social-login-row button .social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.social-login-row button .social-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.social-login-row button:hover svg {
  transform: scale(1.15);
}
.social-login-row button[data-social-login="google"]:hover svg { color: #EA4335; }
.social-login-row button[data-social-login="whatsapp"]:hover svg { color: #25D366; }
.social-login-row button[data-social-login="facebook"]:hover svg { color: #1877F2; }
.social-login-row button[data-social-login="apple"]:hover svg { color: #000000; }

/* ---- Toast Zone ------------------------------------------ */
.toast-zone {
  position: fixed;
  top: calc(var(--topbar-h) + .75rem);
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
             toast-fade-out 0.3s ease 3.9s forwards;
  pointer-events: auto;
  border-left: 4px solid var(--primary);
  max-width: 320px;
  word-wrap: break-word;
}
@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toast-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ---- Mobile toggle --------------------------------------- */
.mobile-menu-toggle {
  display: none;             /* hidden on desktop */
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-l);
  color: var(--primary);
  border: none;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.mobile-menu-toggle:hover { background: rgba(13,148,136,.18); transform: scale(1.05); }
.mobile-menu-toggle:active { transform: scale(.95); }
.mobile-menu-toggle svg { width: 20px; height: 20px; }

/* ---- Public grid for non-home pages ---------------------- */
.public-grid {
  display: grid;
  grid-template-columns: minmax(22rem, 1fr) minmax(16rem, .85fr) minmax(20rem, .95fr);
  gap: 1rem;
}
.feed-column, .middle-column, .right-column {
  display: grid;
  align-content: start;
  gap: 1rem;
}

/* ---- Generic Module Pages --------------------------------- */
.module-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 0;
}
.module-heading h1 {
  font-size: 28px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.module-heading p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 0.35rem;
}
.module-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.module-action:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}
.module-action svg, .module-action i {
  width: 16px;
  height: 16px;
}

.module-grid {
  display: grid;
  gap: 1.5rem;
}
.module-grid.two {
  grid-template-columns: 1fr 340px;
  align-items: start;
}
.module-grid.profile {
  grid-template-columns: 320px 1fr;
  align-items: start;
}
.module-grid.cards {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
@media (max-width: 1024px) {
  .module-grid.two, .module-grid.profile { grid-template-columns: 1fr; }
}

/* ---- Generic card styles for other pages ---------------- */
.public-card, .module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  width: 100%;
}
.empty-card svg {
  width: 48px;
  height: 48px;
  color: #94A3B8;
  margin-bottom: 1rem;
}
.empty-card strong {
  display: block;
  font-size: 16px;
  color: #334155;
  margin-bottom: 0.25rem;
}
.empty-inline {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 0;
  margin: 0;
}
.public-card h2, .module-card h2 { font-size: 15px; font-weight: 700; margin-bottom: .65rem; }
.public-card p, .module-card p { font-size: 13px; color: #334155; margin-top: .5rem; }
.module-card small, .compact-list small { display: block; color: var(--muted); font-size: 11.5px; }

/* compact list (used in other pages) */
.compact-list, .event-list { display: flex; flex-direction: column; }
.compact-list article, .event-list article {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.compact-list article:last-child, .event-list article:last-child {
  border-bottom: none;
}
.compact-list article:hover, .event-list article:hover {
  background: #F8FAFC;
  margin: 0 -1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-bottom-color: transparent;
}
.compact-list article div, .event-list article div { flex: 1; }
.compact-list > article > i, .compact-list > article > svg, .module-card > i, .module-card > svg {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: #F0FDFA;
  color: var(--primary);
  flex-shrink: 0;
}

/* button row (used in other pages) */
.button-row, .feed-card footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.button-row button, .button-row a,
.module-card > button, .compact-list button,
.event-list button, .service-grid button,
.stack-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 34px;
  padding: 0 .85rem;
  border-radius: 8px;
  background: var(--primary-l);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  transition: background .12s;
}
.button-row button:hover, .module-card > button:hover { background: var(--primary); color: white; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.section-head a, .section-head button { color: var(--primary); font-size: 12px; font-weight: 700; }

/* Service grid (other pages) */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.service-grid article { display: grid; gap: .3rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; }
.service-grid span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: var(--primary-l); color: var(--primary); }

/* Stack form layout */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

/* Stack form inputs */
.stack-form input, .stack-form textarea, .stack-form select {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  font-size: 14px;
  outline: none;
  transition: all .2s;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02) inset;
}
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13,148,136,.1);
}
.stack-form textarea { min-height: 100px; resize: vertical; }

/* Stack form submit button override — full-width, branded */
.stack-form > button[type="submit"],
.stack-form > button:not([data-auth-open]):not([data-api-action]) {
  width: 100%;
  height: 44px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d) 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all .2s;
  margin-top: .5rem;
}
.stack-form > button[type="submit"]:hover,
.stack-form > button:not([data-auth-open]):not([data-api-action]):hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 6px rgba(13,148,136,.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* SOS page */
.sos-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--secondary), #4F46E5);
  padding: 1.25rem;
  color: white;
}
.sos-hero svg { width: 4rem; height: 4rem; color: #F97316; }
.sos-grid, .sos-command { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 0.85rem; 
  padding: 1.25rem;
}

.sos-grid button, .sos-command button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 5.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sos-grid button svg, .sos-command button svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2px;
  color: var(--danger);
  transition: transform 0.2s ease;
}

.sos-grid button:hover, .sos-command button:hover { 
  transform: translateY(-2px);
  box-shadow: var(--shadow-md); 
  border-color: rgba(225, 29, 72, 0.3);
  color: var(--danger);
}

.sos-grid button:hover svg, .sos-command button:hover svg {
  transform: scale(1.15);
}

.share-location, .sos-command .wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.5rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--danger), #E11D48);
  color: white;
  font-weight: 800;
  font-size: 15px;
  border: none;
}

.share-location svg, .sos-command .wide svg {
  color: white;
  width: 22px;
  height: 22px;
}

.share-location:hover, .sos-command .wide:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(225, 29, 72, 0.35);
  color: white;
}

/* ============================================================
   BASE & RESET
   ============================================================ */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet — large */
@media (max-width: 1200px) {
  .public-home-v3,
  .home-content-grid {
    grid-template-columns: 200px 1fr 260px;
  }
  .home-right-rail { max-width: none; width: auto; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  main.min-w-0 { margin-left: 0; }
  .public-sidebar {
    transform: translateX(-100%);
    width: 250px;
    z-index: 40;
  }
  body.sidebar-open .public-sidebar { transform: translateX(0); }
  .mobile-menu-toggle { display: flex; }
  body.sidebar-open .app-backdrop { display: block; }

  /* 2-col layout: left+feed | right rail */
  .public-home-v3,
  .home-content-grid {
    grid-template-columns: 1fr 260px;
    gap: .75rem;
  }
  .home-hero-card   { grid-column: 1 / -1; }
  .home-insight-rail { grid-column: 1; position: static; max-height: none; overflow: visible; }
  .home-feed-zone   { grid-column: 1; }
  .home-right-rail  { grid-column: 2; grid-row: 2 / 10; width: auto; max-width: none;
    position: sticky; top: calc(var(--topbar-h) + 1rem);
    max-height: calc(100vh - var(--topbar-h) - 2rem); overflow-y: auto; }

  /* Topbar — tablet */
  .public-topbar { padding: 0 1.25rem; gap: 10px; }
  .topbar-weather { display: none; }
  .topbar-actions { gap: 12px; }
  .topbar-actions span { display: none; }
  .topbar-profile .profile-text { display: none; }
  .topbar-profile .dropdown-arrow { display: none; }
  .topbar-search { margin: 0 6px; }
  .topbar-right { gap: 12px; }
}

/* Mobile — full single column */
@media (max-width: 768px) {
  /* Full single-column home */
  .public-home-v3,
  .home-content-grid {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
  .home-hero-card    { grid-column: 1; grid-row: auto; height: 230px; }
  .home-insight-rail { grid-column: 1; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
  .home-feed-zone    { grid-column: 1; grid-row: auto; }
  .home-right-rail   { grid-column: 1; grid-row: auto; position: static; max-height: none; overflow: visible;
    width: 100%; max-width: none; display: grid; grid-template-columns: 1fr; gap: .75rem; }

  /* Hero text */
  .hero-copy h2 { font-size: 20px; }
  .hero-copy p  { font-size: 13px; }
  .hero-badge   { font-size: 11px; }

  /* Scrollable strips */
  .story-strip { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .5rem; scrollbar-width: none; }
  .story-strip::-webkit-scrollbar { display: none; }
  .feed-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .feed-tabs::-webkit-scrollbar { display: none; }
  .feed-tabs button { white-space: nowrap; flex-shrink: 0; }

  /* Topbar — mobile */
  .public-topbar { padding: 0 1rem; gap: 8px; height: 58px; }
  .topbar-weather { display: none; }
  .topbar-right { gap: 10px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions span { display: none; }
  .topbar-action-item .icon-wrapper { width: 36px; height: 36px; border-radius: 10px; background: #F8FAFC; }
  .topbar-profile .profile-text { display: none; }
  .topbar-profile .avatar { width: 34px; height: 34px; }

  /* Auth Modal mobile sheet */
  .auth-dialog.modern-auth-dialog {
    flex-direction: column;
    width: 100%;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
    max-height: 90vh;
  }
  .auth-showcase { display: none; }
  .auth-panel { padding: 2.5rem 1.5rem; }
}

@media (max-width: 640px) {
  /* Insight rail collapses to single col */
  .home-insight-rail { grid-template-columns: 1fr; }
  .home-right-rail { grid-template-columns: 1fr; }
  .emergency-grid { grid-template-columns: repeat(3, 1fr); }
  .complaint-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Extra small — 480px */
@media (max-width: 480px) {
  /* Topbar — extra small: icon-only mode */
  .public-topbar { padding: 0 .75rem; gap: 6px; height: 54px; }
  .topbar-location { display: none; }   /* hide location; burger shows navigation */
  .topbar-search { margin: 0 4px; }
  .topbar-search input { font-size: 12px; padding: 0 34px; }
  .topbar-right { gap: 6px; }
  .topbar-actions { gap: 4px; }
  .topbar-action-item .icon-wrapper { width: 34px; height: 34px; border-radius: 9px; }
  .topbar-profile .avatar { width: 32px; height: 32px; font-size: 12px; }
  /* Hero */
  .home-hero-card { height: 200px; border-radius: 14px; }
  .hero-copy h2 { font-size: 17px; }
  .hero-actions a { font-size: 11px; padding: 0 .7rem; height: 32px; }
}

/* md/lg flex helpers */
@media (min-width: 768px) { .md\:flex { display: flex; } }
@media (min-width: 1024px) { .lg\:flex { display: flex; } }

/* ============================================================
   v2 POLISH — Animations, Role Variants, Glassmorphism
   ============================================================ */

/* ---- Card entrance animations ---------------------------- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Apply entrance animation to main content cards */
.dashboard-panel,
.social-feed-card,
.sos-mini-card,
.emergency-grid,
.home-insight-rail .dashboard-panel:nth-child(2) { animation-delay: .1s; }
.home-feed-zone > *:nth-child(2) { animation-delay: .12s; }
.home-feed-zone > *:nth-child(3) { animation-delay: .18s; }
.home-right-rail > *:nth-child(2) { animation-delay: .1s; }
.home-right-rail > *:nth-child(3) { animation-delay: .15s; }
.home-right-rail > *:nth-child(4) { animation-delay: .2s; }

/* Card hover lift */
.dashboard-panel,
.social-feed-card { transition: box-shadow .25s, transform .25s; }
.dashboard-panel:hover { box-shadow: 0 16px 48px rgba(15,23,42,.12); }
.social-feed-card:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(15,23,42,.12); }

/* ---- Hero — per-tone overlay gradients ------------------- */

/* Hero eyebrow per tone */

/* Hero copy entrance animation */
@keyframes heroFadeInUp {
  from { opacity: 0; transform: translateY(calc(-50% + 20px)); }
  to   { opacity: 1; transform: translateY(-50%); }
}
.hero-slide.active .hero-copy { animation: heroFadeInUp .5s cubic-bezier(.22,1,.36,1) .15s both; }
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 11.5px;
  color: rgba(255,255,255,.7);
  margin-bottom: .35rem;
}
.hero-meta svg { width: 13px; height: 13px; }

/* ---- Stories — enhanced ring + pulse --------------------- */
.story-avatar.live { animation: pulseRing 2.2s infinite; }

.story-strip button:hover .story-avatar,
.story-strip a:hover .story-avatar { transform: scale(1.1); border-color: var(--primary); }

/* ---- Stats dock — glassmorphism v2 ----------------------- */
.dashboard-stat-dock b { animation: countUp .6s ease both; }

/* ---- Feed card — multi-image gallery --------------------- */
.feed-media-grid {
  display: grid;
  margin: .75rem 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  gap: 2px;
}
.feed-media-grid.count-1 { grid-template-columns: 1fr; }
.feed-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.feed-media-grid.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 180px 180px; }
.feed-media-grid.count-3 .feed-media-item:first-child { grid-column: 1 / -1; }
.feed-media-grid.count-4 { grid-template-columns: 1fr 1fr; }

.feed-media-item { position: relative; overflow: hidden; min-height: 140px; background: var(--primary-l); }
.feed-media-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.feed-media-item:hover img { transform: scale(1.04); }
.feed-media-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15,23,42,.55);
  color: white;
  font-size: 22px;
  font-weight: 800;
}

/* ---- Feed card — poll progress bars --------------------- */
.poll-option {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: .65rem .85rem;
  cursor: pointer;
  transition: border-color .15s;
}
.poll-option:hover { border-color: var(--primary); }
.poll-bar {
  position: absolute;
  inset: 0;
  background: var(--primary-l);
  transform-origin: left;
  transition: transform .6s cubic-bezier(.22,1,.36,1);
}
.poll-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ---- Quick Actions grid (role dashboards) ---------------- */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  padding: .75rem 1rem 1rem;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .8rem .5rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.quick-action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.quick-action-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  margin-bottom: .1rem;
}
.quick-action-icon svg { width: 18px; height: 18px; }

/* Quick action color variants */
.qa-teal   { background: rgba(13,148,136,.12);  color: #0D9488; }
.qa-purple { background: rgba(124,58,237,.12);  color: #7C3AED; }
.qa-blue   { background: rgba(37,99,235,.12);   color: #2563EB; }
.qa-amber  { background: rgba(245,158,11,.12);  color: #D97706; }
.qa-rose   { background: rgba(225,29,72,.12);   color: #E11D48; }
.qa-green  { background: rgba(16,185,129,.12);  color: #059669; }
.qa-orange { background: rgba(249,115,22,.12);  color: #EA580C; }
.qa-indigo { background: rgba(99,102,241,.12);  color: #4F46E5; }

/* ---- Role welcome banner --------------------------------- */
.role-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  color: white;
  margin-bottom: .25rem;
  overflow: hidden;
  position: relative;
}
.role-welcome-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="160" cy="40" r="80" fill="rgba(255,255,255,0.06)"/><circle cx="20" cy="180" r="100" fill="rgba(255,255,255,0.04)"/></svg>') no-repeat right center / cover;
}
.role-welcome-banner.student-banner  { background: linear-gradient(135deg, #7C3AED, #4F46E5); }
.role-welcome-banner.business-banner { background: linear-gradient(135deg, #0D9488, #0891B2); }
.role-welcome-banner.admin-banner    { background: linear-gradient(135deg, #0F172A, #1E293B); }

.role-banner-left { position: relative; z-index: 1; }
.role-banner-left h2 { font-size: 18px; font-weight: 800; margin-bottom: .25rem; }
.role-banner-left p  { font-size: 12.5px; opacity: .8; }
.role-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 99px;
  background: rgba(255,255,255,.2);
  font-size: 10px;
  font-weight: 700;
  margin-bottom: .45rem;
}
.role-banner-badge svg { width: 12px; height: 12px; }
.role-banner-right { position: relative; z-index: 1; flex-shrink: 0; text-align: right; }
.role-banner-right a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: 99px;
  background: rgba(255,255,255,.2);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid rgba(255,255,255,.3);
  transition: background .15s;
}
.role-banner-right a:hover { background: rgba(255,255,255,.3); }

/* ---- Role KPI cards (admin) ------------------------------ */
.role-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin-bottom: 1rem;
}
.role-kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: box-shadow .2s, transform .2s;
}
.role-kpi-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.role-kpi-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}
.role-kpi-icon svg { width: 20px; height: 20px; }
.role-kpi-card b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.role-kpi-card span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.role-kpi-card small {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-l);
  padding: .1rem .5rem;
  border-radius: 99px;
  margin-top: .2rem;
}

/* ---- Compact list (student exams, scholarships, etc.) ---- */
.compact-item-list { padding: .25rem .75rem .85rem; display: flex; flex-direction: column; gap: .55rem; }
.compact-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.compact-item:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.compact-item-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-l);
  color: var(--primary);
  flex-shrink: 0;
}
.compact-item-icon svg { width: 16px; height: 16px; }
.compact-item-body { flex: 1; min-width: 0; }
.compact-item-body b { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-item-body small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.compact-item-badge {
  padding: .2rem .55rem;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-teal   { background: var(--primary-l); color: var(--primary); }
.badge-purple { background: var(--sec-l); color: var(--secondary); }
.badge-amber  { background: rgba(245,158,11,.12); color: #D97706; }
.badge-rose   { background: rgba(225,29,72,.1); color: #E11D48; }
.badge-green  { background: rgba(16,185,129,.1); color: #059669; }

/* ---- AI Coach card (student/business variant) ------------ */
.ai-coach-card {
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  padding: 1rem;
  color: white;
  box-shadow: 0 8px 24px rgba(79,70,229,.3);
}
.ai-coach-card.business { background: linear-gradient(135deg, #0D9488 0%, #0891B2 100%); box-shadow: 0 8px 24px rgba(13,148,136,.3); }
.ai-coach-header { display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem; }
.ai-coach-header .ai-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.2); flex-shrink: 0;
}
.ai-coach-header .ai-icon svg { width: 20px; height: 20px; }
.ai-coach-header h3 { font-size: 15px; font-weight: 800; }
.ai-coach-header p { font-size: 11px; opacity: .8; margin-top: .1rem; }
.ai-coach-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.ai-coach-chips button {
  padding: .28rem .65rem; border-radius: 99px; background: rgba(255,255,255,.15);
  color: white; font-size: 10.5px; font-weight: 600; border: 1px solid rgba(255,255,255,.25);
  transition: background .15s; cursor: pointer;
}
.ai-coach-chips button:hover { background: rgba(255,255,255,.28); }
.ai-coach-input { display: flex; gap: .4rem; }
.ai-coach-input input {
  flex: 1; height: 38px; border-radius: 99px; background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3); padding: 0 .9rem; color: white; font-size: 12.5px;
  outline: none; transition: border-color .15s;
}
.ai-coach-input input::placeholder { color: rgba(255,255,255,.6); }
.ai-coach-input input:focus { border-color: white; background: rgba(255,255,255,.22); }
.ai-coach-input button {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 99px;
  background: white; color: var(--secondary); flex-shrink: 0; cursor: pointer; transition: opacity .15s;
}
.ai-coach-input button:hover { opacity: .85; }
.ai-coach-input button svg { width: 15px; height: 15px; }

/* ---- Mobile Bottom Navigation ----------------------------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 60px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15,23,42,.08);
}
.mobile-bottom-nav nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
}
.mobile-bottom-nav a,
.mobile-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color .15s;
  position: relative;
}
.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover { color: var(--primary); }
.mobile-bottom-nav .nav-sos { color: var(--danger); }
.mobile-bottom-nav .nav-sos:hover { color: #DC2626; }
.mobile-bottom-nav svg { width: 22px; height: 22px; }
.mobile-bottom-nav .nav-dot {
  position: absolute; top: 10px; right: calc(50% - 16px);
  width: 7px; height: 7px; border-radius: 99px; background: var(--danger);
  border: 1.5px solid white;
}

@media (max-width: 1024px) {
  .mobile-bottom-nav { display: block; }
  .public-content { padding-bottom: calc(60px + 1rem); }
}
@media (min-width: 1025px) {
  .mobile-bottom-nav { display: none; }
}

/* ---- Sidebar notification dot on Emergency -------------- */
.nav-danger-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 99px;
  background: var(--danger);
  margin-left: auto;
  flex-shrink: 0;
  animation: pulseRing 2s infinite;
}

/* ---- Shimmer loading skeleton --------------------------- */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--border) 25%, #f1f5f9 50%, var(--border) 75%);
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
}

/* ---- Hashtag + mention styling in feed ------------------ */
.feed-body a[href*="/tag/"],
.feed-body .hashtag { color: var(--primary); font-weight: 600; }
.feed-body .mention  { color: var(--secondary); font-weight: 600; }

/* ---- Role-specific body accent tokens ------------------- */
body.role-student  { --role-accent: #7C3AED; --role-accent-l: rgba(124,58,237,.12); }
body.role-business { --role-accent: #0D9488; --role-accent-l: rgba(13,148,136,.12); }
body.role-admin    { --role-accent: #0F172A; --role-accent-l: rgba(15,23,42,.06); }

/* ---- Responsive KPI row --------------------------------- */
@media (max-width: 900px) {
  .role-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .quick-actions-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .role-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .quick-actions-grid { grid-template-columns: repeat(3, 1fr); }
  .role-welcome-banner { flex-direction: column; align-items: flex-start; }
}


/* AI Assistant Redesign */
.ai-inline-card {
  width: 100%;
  min-height: 250px;
  height: auto;
  border-radius: 20px;
  padding: 18px 20px 22px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6D4AFF 0%, #8B5CF6 50%, #C4B5FD 100%);
  box-shadow: 0 20px 50px rgba(109,74,255,.25);
  margin: 0;
}

.ai-top-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-left-content {
  position: relative;
  z-index: 2;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: white;
}
.ai-title i, .ai-title svg {
  color: white;
  width: 20px !important;
  height: 20px !important;
}

.ai-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.9);
  margin-top: 6px;
}

.ai-robot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 70px;
  height: 70px;
  opacity: 0.9;
  animation: floatBot 3s ease-in-out infinite;
  z-index: 1;
}
@keyframes floatBot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.ai-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}
.ai-suggest-chips button {
  height: 32px;
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: background 0.2s;
}
.ai-suggest-chips button:hover {
  background: rgba(255,255,255,.25);
}

.ai-input-section {
  position: relative;
  margin-top: 20px;
  z-index: 2;
}

.ai-input-wrapper {
  background: white;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.ai-input-wrapper input {
  border: none;
  background: transparent;
  flex: 1;
  height: 100%;
  font-size: 15px;
  color: #64748B;
  outline: none;
}
.ai-input-wrapper input::placeholder {
  color: #64748B;
  font-size: 15px;
}

.ai-input-wrapper button {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #7C3AED;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.ai-input-wrapper button:hover {
  background: rgba(124,58,237,.08);
}

/* ============================================================
   PREMIUM FORM DESIGN SYSTEM v1.0
   Auth page, labeled fields, icon inputs, upload zones
   ============================================================ */

/* Auth Page Shell */
.auth-page {
  min-height: calc(100vh - var(--topbar-h));
  padding: 2rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 920px;
  align-items: start;
}

/* Auth Card */
.auth-card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-4px);
}

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, #0D9488 0%, #14B8A6 100%);
  color: white;
}
.auth-card-header.register {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
}
.auth-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  flex-shrink: 0;
}
.auth-card-icon svg,
.auth-card-icon i { width: 22px; height: 22px; color: white; }

.auth-card-header h1 {
  font-size: 17px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}
.auth-card-header p {
  font-size: 11.5px;
  color: rgba(255,255,255,.82);
  margin-top: 2px;
}

.auth-section { padding: 1.25rem 1.25rem 0; }
.auth-section + .auth-section { padding-top: .25rem; }
.auth-section:last-of-type { padding-bottom: 1.25rem; }

.auth-section-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.auth-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-card > .stack-form { padding: 1.25rem; }

/* Divider */
.form-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1.25rem;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  user-select: none;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form Field */
.form-field {
  display: flex;
  flex-direction: column;
  gap: .32rem;
}
.form-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: .025em;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.form-field label em {
  color: #EF4444;
  font-style: normal;
}

/* Field Input Wrap */
.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field-icon {
  position: absolute;
  left: .75rem;
  pointer-events: none;
  color: var(--muted);
  flex-shrink: 0;
  z-index: 1;
  display: flex;
  align-items: center;
}
.field-icon svg,
.field-icon i { width: 15px; height: 15px; }

.field-input-wrap input.with-icon,
.field-input-wrap select.with-icon {
  padding-left: 2.4rem !important;
  width: 100%;
}
.field-input-wrap input.has-toggle { padding-right: 2.75rem !important; }

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
  transition: color .15s;
  z-index: 1;
}
.password-toggle:hover { color: var(--text); }
.password-toggle svg,
.password-toggle i { width: 15px; height: 15px; }

/* Field Hint */
.field-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: .1rem;
}

/* Field Error */
.field-error-msg {
  font-size: 11.5px;
  color: #EF4444;
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .1rem;
}
.field-input-wrap.has-error input,
.field-input-wrap.has-error select { border-color: #EF4444 !important; }
.field-input-wrap.has-error .field-icon { color: #EF4444; }

/* Form Row – 2-column */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

/* Auth Submit Button */
.auth-submit-btn {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: white;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .12s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(13,148,136,.3);
  margin-top: .5rem;
}
.auth-submit-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(13,148,136,.38);
}
.auth-submit-btn.secondary {
  background: var(--bg);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
}
.auth-submit-btn.secondary:hover {
  background: var(--primary-l);
  box-shadow: none;
}
.auth-submit-btn svg,
.auth-submit-btn i { width: 17px; height: 17px; }

/* Upload Zone */
.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 110px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(13,148,136,.08);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone-icon { color: var(--primary); }
.upload-zone-icon svg,
.upload-zone-icon i { width: 30px; height: 30px; }
.upload-zone-text { font-size: 13px; font-weight: 600; color: var(--text); }
.upload-zone-hint { font-size: 11px; color: var(--muted); }
.upload-zone-placeholder { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.upload-zone-selected {
  display: none;
  align-items: center;
  gap: .5rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-l);
  padding: .4rem .8rem;
  border-radius: 99px;
}
.upload-zone.has-file .upload-zone-selected { display: flex; }
.upload-zone.has-file .upload-zone-placeholder { display: none; }

/* Responsive */
@media (max-width: 768px) {
  .auth-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-page { padding: 1rem .75rem 5rem; }
  .auth-card-header h1 { font-size: 15px; }
}
@media (max-width: 480px) {
  .auth-card { border-radius: var(--radius-md); }
}

/* Complaint portal */
.complaint-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.complaint-stat-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 86px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.complaint-stat-card svg,
.complaint-stat-card i {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  background: var(--primary-l);
  color: var(--primary);
}
.complaint-stat-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.complaint-stat-card strong {
  display: block;
  margin-top: .1rem;
  font-size: 22px;
  color: var(--text);
}
.complaint-portal-grid,
.complaint-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 1.25rem;
  align-items: start;
}
.complaint-submit-card .section-head > i,
.complaint-submit-card .section-head > svg {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 14px;
  background: #EFF6FF;
  color: var(--secondary);
}
.complaint-notice {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem;
  border-radius: var(--radius-sm);
  background: #FFFBEB;
  color: #92400E;
  font-size: 12px;
  font-weight: 600;
}
.complaint-location-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.complaint-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 48px;
  margin-top: .35rem;
  padding: .8rem 1rem;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}
.complaint-upload.has-file {
  border-color: var(--primary);
  background: var(--primary-l);
  color: var(--primary);
}
.complaint-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.complaint-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: .65rem;
  margin: .75rem 0 1rem;
}
.filter-input {
  position: relative;
}
.filter-input svg,
.filter-input i {
  position: absolute;
  left: .8rem;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
}
.filter-input input,
.complaint-filter-bar select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  padding: 0 .9rem;
  font-size: 13px;
}
.filter-input input {
  padding-left: 2.35rem;
}
.complaint-filter-bar button,
.secondary-action,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 40px;
  padding: 0 .9rem;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
}
.complaint-filter-bar button,
.secondary-action {
  border: 1px solid var(--border);
  background: #F8FAFC;
  color: var(--text);
}
.primary-action {
  border: 0;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d) 100%);
  color: #fff;
}
.stack-form > .secondary-action {
  width: auto;
  height: 40px;
  margin-top: 0;
  border: 1px solid var(--border);
  background: #F8FAFC;
  color: var(--text);
  box-shadow: none;
}
.stack-form > .primary-action {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d) 100%);
  color: #fff;
}
.complaint-record-list {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.complaint-record {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.complaint-record:hover {
  border-color: rgba(13,148,136,.35);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.complaint-record-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #FFF1F2;
  color: #E11D48;
  flex-shrink: 0;
}
.complaint-record-icon svg,
.complaint-record-icon i {
  width: 20px;
  height: 20px;
}
.complaint-record-main {
  min-width: 0;
}
.complaint-record-main strong,
.complaint-detail-head h2 {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.complaint-record-main small,
.complaint-record-meta small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: .18rem;
}
.complaint-record-meta {
  display: grid;
  justify-items: end;
  gap: .25rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: #EEF2FF;
  color: #4338CA;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-pill.new { background: #EFF6FF; color: #1D4ED8; }
.status-pill.assigned { background: #F5F3FF; color: #7C3AED; }
.status-pill.in_progress { background: #FFF7ED; color: #C2410C; }
.status-pill.resolved { background: #ECFDF5; color: #047857; }
.status-pill.closed { background: #F1F5F9; color: #475569; }
.complaint-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.complaint-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin: 1rem 0 1.2rem;
}
.complaint-info-grid div {
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #F8FAFC;
}
.complaint-info-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.complaint-info-grid dd {
  margin: .25rem 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.complaint-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  margin: 1.5rem 0 2rem;
  padding: 0 0.5rem;
  z-index: 1;
}
.complaint-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.3s ease;
  z-index: 2;
}
.complaint-step span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #F8FAFC;
  border: 3px solid #E2E8F0;
  color: var(--muted);
  transition: all 0.3s ease;
  box-shadow: 0 0 0 4px #fff;
  position: relative;
  z-index: 2;
}
.complaint-step svg {
  width: 20px;
  height: 20px;
}
/* Connecting line via pseudo element on each step */
.complaint-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 21px; /* (44px / 2) - half line height */
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 3px;
  background: #E2E8F0;
  z-index: 1;
  transition: background 0.3s ease;
}
.complaint-step.done:not(:last-child)::after {
  background: #10B981;
}

/* Done State */
.complaint-step.done {
  color: #10B981;
}
.complaint-step.done span {
  background: #10B981;
  border-color: #10B981;
  color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 4px 10px rgba(16, 185, 129, 0.2);
}

/* Current State */
.complaint-step.current {
  color: var(--primary);
  transform: translateY(-2px);
}
.complaint-step.current span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 8px 16px rgba(13, 148, 136, 0.3);
  animation: step-pulse 2s infinite;
}

@keyframes step-pulse {
  0% { box-shadow: 0 0 0 4px #fff, 0 0 0 0 rgba(13, 148, 136, 0.4); }
  70% { box-shadow: 0 0 0 4px #fff, 0 0 0 10px rgba(13, 148, 136, 0); }
  100% { box-shadow: 0 0 0 4px #fff, 0 0 0 0 rgba(13, 148, 136, 0); }
}
.complaint-resolution {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: #ECFDF5;
  color: #047857;
  border-left: 4px solid #10B981;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
}
.complaint-timeline {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.complaint-timeline article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.complaint-timeline article:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.complaint-timeline strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}
.complaint-timeline small,
.attachment-list small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: .2rem;
}
.complaint-timeline a,
.attachment-list a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.attachment-list {
  display: grid;
  gap: .65rem;
}
.attachment-list a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #F8FAFC;
}
@media (max-width: 1180px) {
  .complaint-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .complaint-portal-grid,
  .complaint-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .complaint-summary-grid,
  .complaint-location-row,
  .complaint-info-grid,
  .complaint-filter-bar { grid-template-columns: 1fr; }
  .complaint-record,
  .complaint-detail-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .complaint-record-meta,
  .complaint-detail-head > .status-pill {
    grid-column: 2;
    justify-items: start;
  }
  .complaint-progress {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
  }
  .complaint-step {
    flex-direction: row;
    width: 100%;
    text-align: left;
    transform: none !important;
  }
  .complaint-step:not(:last-child)::after {
    top: 44px;
    left: 20px; /* (44px / 2) - 1.5px half line width */
    right: auto;
    width: 3px;
    height: 1.25rem;
  }
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE OVERHAUL — All Pages
   Breakpoints: 1024px | 768px | 640px | 480px
   ============================================================ */

/* ---- Tablet (≤ 1024px) ----------------------------------- */
@media (max-width: 1024px) {
  .module-content-grid { grid-template-columns: 1fr; }
  .module-sidebar-col { position: static; max-height: none; }
  .complaint-portal-grid,
  .complaint-detail-grid { grid-template-columns: 1fr; }
  .complaint-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-feature-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Mobile (≤ 768px) ------------------------------------- */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  main.min-w-0 { margin-left: 0 !important; }

  /* Topbar */
  .public-topbar { padding: 0 .75rem; gap: .5rem; }
  .topbar-search { max-width: 160px; }
  .topbar-actions span { display: none; }
  .topbar-profile .profile-text { display: none; }
  .topbar-right { gap: 12px; }

  /* Public content */
  .public-content { padding: 1rem .75rem 5rem; }

  /* Home hero */
  .home-hero-card { height: 220px; border-radius: 16px; }
  .hero-copy { padding: 1.25rem; }
  .hero-copy h2 { font-size: 20px; }
  .hero-copy p { font-size: 13px; }
  .hero-badge { font-size: 11px; padding: 4px 10px; }
  .hero-actions { gap: .5rem; flex-wrap: wrap; }
  .hero-actions a { font-size: 12px; padding: 0 .85rem; height: 36px; }

  /* Home layout — single column */
  .home-content-grid { grid-template-columns: 1fr; gap: 1rem; }
  .home-insight-rail { grid-column: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .home-feed-zone { grid-column: 1; }
  .home-right-rail { grid-column: 1; position: static; max-height: none; }

  /* Scrollable strips */
  .story-strip { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .5rem; scrollbar-width: none; }
  .story-strip::-webkit-scrollbar { display: none; }
  .feed-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .feed-tabs::-webkit-scrollbar { display: none; }
  .feed-tabs button { white-space: nowrap; flex-shrink: 0; }

  /* Module page */
  .module-content-grid { grid-template-columns: 1fr; }
  .module-hero { min-height: 160px; padding: 1.25rem; }
  .module-hero h1 { font-size: 20px; }
  .module-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .module-tabs::-webkit-scrollbar { display: none; }
  .module-tabs button, .module-tabs a { white-space: nowrap; flex-shrink: 0; }

  /* Complaints */
  .complaint-summary-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .complaint-filter-bar { grid-template-columns: 1fr; gap: .5rem; }
  .complaint-location-row { grid-template-columns: 1fr; }
  .complaint-record { grid-template-columns: auto 1fr; }

  /* Auth cards */
  .auth-grid { grid-template-columns: 1fr; }
  .auth-page { padding: 1rem .75rem 5rem; }

  /* Social login */
  .social-login-row { gap: .5rem; }
  .social-login-row button { height: 46px; font-size: 13px; }

  /* Auth feature pills */
  .auth-feature-pill { padding: .5rem .65rem; }
  .auth-feature-icon { width: 28px; height: 28px; border-radius: 7px; }
  .auth-feature-icon svg { width: 13px; height: 13px; }
  .auth-feature-text b { font-size: 12px; }
  .auth-feature-text small { font-size: 10px; }

  /* AI panel */
  .ai-suggest-chips { flex-wrap: wrap; }
  .ai-suggest-chips button { font-size: 12px; padding: .3rem .65rem; }

  /* Emergency */
  .emergency-grid { grid-template-columns: repeat(3, 1fr); }

  /* Topbar action icons */
  .topbar-action-item .icon-wrapper { width: 36px; height: 36px; }
}

/* ---- Small Mobile (≤ 640px) ------------------------------- */
@media (max-width: 640px) {
  .home-insight-rail { grid-template-columns: 1fr; }
  .complaint-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-page { padding: .75rem .5rem 5rem; }
  .auth-card > .stack-form { padding: 1rem; }
  .auth-card-header { padding: 1rem 1.25rem; }
  .social-login-row button { font-size: 12px; padding: 0 .5rem; }
  .module-hero { min-height: 140px; border-radius: 12px; }
}

/* ---- Extra Small (≤ 480px) -------------------------------- */
@media (max-width: 480px) {
  /* Topbar */
  .topbar-location { display: none; }
  .topbar-search { max-width: 130px; margin: 0 4px; }
  .topbar-search input { font-size: 12px; }
  .topbar-right { gap: 8px; }
  .topbar-action-item { min-width: 36px; padding: 0; }

  /* Content */
  .public-content { padding: .75rem .5rem 5rem; }

  /* Hero */
  .home-hero-card { height: 200px; border-radius: 12px; }
  .hero-copy h2 { font-size: 18px; }
  .hero-actions a { font-size: 11px; padding: 0 .6rem; height: 32px; }

  /* Complaints */
  .complaint-stat-card { min-height: 70px; padding: .75rem; }
  .complaint-progress { padding: .5rem .75rem; }

  /* Social login */
  .social-login-row { gap: .4rem; }
  .social-login-row button { height: 42px; border-radius: 10px; font-size: 12px; }

  /* Auth feature pills — single col */
  .auth-feature-grid { grid-template-columns: 1fr; }

  /* Emergency grid */
  .emergency-grid { grid-template-columns: repeat(3, 1fr); gap: .5rem; }

  /* SOS card */
  .sos-mini-card { padding: .75rem; border-radius: 12px; }
  .sos-mini-card h2 { font-size: 14px; }
  .sos-mini-card p { font-size: 12px; }
}
