/* ===== নাগরিক সেবা — Design Tokens & Shared Components ===== */

:root {
  --green: #04724D;
  --green-dark: #035C3E;
  --green-light: #E8F5EE;
  --navy: #142B4F;
  --navy-light: #EEF2F8;
  --amber: #C97F1E;
  --amber-light: #FBF1E1;
  --red: #B3273D;
  --red-light: #FBEAEC;
  --bg: #FAFAF7;
  --ink: #16191C;
  --line: #E7E5DF;
  --muted: #6B7178;
}

* { -webkit-tap-highlight-color: transparent; }

html {
  font-size: 15px;
}
@media (min-width: 768px) {
  html {
    font-size: 17.5px;
  }
}

body {
  font-family: 'Hind Siliguri', sans-serif;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

.font-display { font-family: 'Hind Siliguri', sans-serif; }

/* ---- color utilities ---- */
.t-green { color: var(--green); }
.t-navy { color: var(--navy); }
.t-amber { color: var(--amber); }
.t-red, .text-red { color: var(--red); }
.t-muted { color: var(--muted); }
.bg-green { background: var(--green); }
.bg-navy { background: var(--navy); }
.bg-red { background: var(--red); }
.bg-line { background: var(--line); }
.bg-app { background: var(--bg); }
.bg-green-light { background: var(--green-light); }
.bg-green-dark { background: var(--green-dark); }
.bg-navy-light { background: var(--navy-light); }
.bg-amber-light { background: var(--amber-light); }
.bg-red-light { background: var(--red-light); }
.border-line { border-color: var(--line); }
.hover-green:hover { color: var(--green); }
.hover-bg-green:hover { background: var(--green); }
.hover-bg-green-dark:hover { background: var(--green-dark); }

/* ---- status chips ---- */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; }
.chip-submitted { background: var(--navy-light); color: var(--navy); }
.chip-resolved { background: var(--green-light); color: var(--green-dark); }
.chip-processing, .chip-reviewing, .chip-assigned, .chip-in_progress, .chip-under_review { background: #ede9fe; color: #7c3aed; }
.chip-action_taken { background: #ecfeff; color: #0891b2; }
.chip-pending { background: var(--amber-light); color: var(--amber); }
.chip-urgent, .chip-rejected, .chip-closed { background: var(--red-light); color: var(--red); }
.chip-unresolved { background: var(--red-light); color: var(--red); }
.chip-low { background: var(--green-light); color: var(--green-dark); }
.chip-medium { background: var(--navy-light); color: var(--navy); }
.chip-high { background: var(--red-light); color: var(--red); }
.chip-dot { width: .4rem; height: .4rem; border-radius: 999px; background: currentColor; }

/* ---- icon sizing ---- */
[data-lucide] { width: 20px; height: 20px; stroke-width: 1.8; }
.icon-sm [data-lucide] { width: 16px; height: 16px; }
.icon-lg [data-lucide] { width: 26px; height: 26px; }

/* ---- header / nav ---- */
.site-header { background: rgba(250,250,247,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-link { position: relative; color: var(--muted); font-weight: 700; font-size: .875rem; padding-bottom: 2px; }
.nav-link:hover, .nav-link.active { color: var(--green); }
.nav-link.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--green); border-radius: 2px; }

/* dropdown */
.has-dropdown { position: relative; }
.dropdown-panel {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(6px);
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease;
  background: #fff; border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 20px 40px -12px rgba(20,43,79,.15);
  z-index: 60;
}
.has-dropdown.open .dropdown-panel,
.has-dropdown:hover .dropdown-panel { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-panel a[href]:hover { background: var(--green-light); }

/* mobile drawer */
#mobile-drawer { transition: transform .28s ease; }
#mobile-drawer.hidden-drawer { transform: translateX(100%); }
#drawer-overlay { transition: opacity .28s ease; }
.caret { transition: transform .28s ease; }

/* ---- ticker ---- */
.ticker-track { display: flex; gap: 3rem; white-space: nowrap; animation: ticker 28s linear infinite; }
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- section ---- */
.section { padding-block: 3.5rem; }
@media (min-width: 1024px) { .section { padding-block: 4.5rem; } }
.section-tight { padding-block: 2.5rem; }

/* ---- cards ---- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 1.25rem; }
.card-hover { transition: box-shadow .25s ease, transform .25s ease; }
.card-hover:hover { box-shadow: 0 20px 40px -16px rgba(20,43,79,.18); transform: translateY(-3px); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 700; border-radius: .8rem; padding: .8rem 1.5rem; font-size: .9rem; transition: all .2s ease; cursor: pointer; border: none; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 10px 24px -8px rgba(4,114,77,.45); }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--navy); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-ghost-dark { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.btn-ghost-dark:hover { background: #fff; color: var(--navy); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a12030; }
.btn-sm { padding: .5rem 1rem; font-size: .8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

/* ---- form controls ---- */
.field-label { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.field-input {
  width: 100%;
  padding: .85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .75rem;
  font-size: .9rem;
  color: var(--ink);
  outline: none;
  transition: all 0.2s ease-in-out;
}
.field-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(4, 114, 77, 0.1);
}
.field-select {
  width: 100%;
  padding: .85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .75rem;
  font-size: .9rem;
  color: var(--ink);
  outline: none;
  transition: all 0.2s ease-in-out;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7178' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}
.field-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(4, 114, 77, 0.1);
}
select.pointer-events-none {
  background-image: none !important;
  padding-right: 1.1rem !important;
}
.field-textarea { min-height: 120px; resize: vertical; }

/* stepper */
.step-dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid var(--line);
  color: var(--muted);
  background: #fff;
  transition: all 0.25s ease-in-out;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
  line-height: 1 !important;
  padding: 0 !important;
  text-align: center !important;
}
.step-dot.is-active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
  box-shadow: 0 0 0 4px rgba(4, 114, 77, 0.15);
}
.step-dot.is-done {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

/* step label pills */
[data-step-label] {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background-color: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  transition: all 0.25s ease-in-out;
  white-space: nowrap;
}
.step-dot.is-active + [data-step-label] {
  background-color: var(--green-light);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(4, 114, 77, 0.08);
}
.step-dot.is-done + [data-step-label] {
  background-color: var(--green-light);
  border-color: rgba(4, 114, 77, 0.3);
  color: var(--green);
}

/* tab category pill */
.cat-card {
  border: 1.5px solid var(--line);
  background-color: #fff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.cat-card:hover {
  border-color: rgba(4, 114, 77, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(20, 43, 79, 0.12);
}
.cat-card:hover .icon-wrapper {
  background-color: var(--green-light);
}
.cat-pill input:checked + .cat-card {
  border-color: var(--green);
  background-color: var(--green-light);
  box-shadow: 0 8px 20px -6px rgba(4, 114, 77, 0.15);
}
.cat-pill input:checked + .cat-card .icon-wrapper {
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(4, 114, 77, 0.08);
}
.cat-pill input:checked + .cat-card p {
  color: var(--green-dark);
  font-weight: 500;
}
.cat-pill input:checked + .cat-card [data-lucide] {
  color: var(--green);
}
.border-green {
  border-color: var(--green) !important;
}

/* utility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}

/* ---- dashboard sidebar ---- */
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-radius: .7rem; font-size: .875rem; font-weight: 600; color: var(--muted); transition: all .15s ease; }
.sidebar-link:hover, .sidebar-link.active { background: var(--green-light); color: var(--green); }
.sidebar-link.active { font-weight: 700; }

/* ---- table ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: .75rem 1rem; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--line); }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); font-size: .875rem; }
.data-table tbody tr:hover { background: var(--green-light); }

/* ---- pagination ---- */
.pagination { display: flex; align-items: center; gap: .25rem; }
.pagination a, .pagination span { padding: .4rem .75rem; border-radius: .5rem; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.pagination a:hover { background: var(--green-light); border-color: var(--green); color: var(--green); }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; }

/* ---- toast ---- */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; }
.toast { padding: .75rem 1.25rem; border-radius: .75rem; margin-bottom: .5rem; font-size: .85rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.12); animation: slideIn .3s ease; }
.toast-success { background: var(--green-light); color: var(--green-dark); border-left: 4px solid var(--green); }
.toast-warning { background: var(--amber-light); color: var(--amber); border-left: 4px solid var(--amber); }
.toast-error { background: var(--red-light); color: var(--red); border-left: 4px solid var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- stats grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px rgba(20,43,79,0.08);
}

/* ---- empty state ---- */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state i { color: var(--muted); opacity: .5; }

/* ---- responsive helpers ---- */
@media (max-width: 768px) {
  .section { padding-block: 2rem; }
  .section-tight { padding-block: 1.5rem; }
}

/* Global Container Width Control */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
@media (min-width: 640px) {
  .container { max-width: 640px; }
}
@media (min-width: 768px) {
  .container { max-width: 768px; }
}
@media (min-width: 1024px) {
  .container { max-width: 960px; }
}
@media (min-width: 1280px) {
  .container { max-width: 1140px; }
}
@media (min-width: 1536px) {
  .container { max-width: 1140px; }
}


/* Better fonts for numbers and statistics to make them highly legible */
.stats-grid h4,
.stat-card h4,
.phone-number,
.contact-number,
[href^="tel:"],
[href^="mailto:"],
footer span.text-gray-300 {
  font-family: 'Inter', 'Segoe UI', Tahoma, -apple-system, sans-serif !important;
}

/* WebView & Mobile optimizations */
.safe-padding-top {
  padding-top: env(safe-area-inset-top);
}
.safe-padding-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}
/* Table responsive wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}
.table-responsive table {
  min-width: 600px;
}
/* Compact settings cards on mobile */
@media (max-width: 640px) {
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
  .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  .card {
    border-radius: 0.75rem;
  }
  .field-input, .field-select {
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
  }
}
