/* ==========================================================================
   Portfolio 2: Fixed Left-Sidebar Civic OS & Dashboard (Admin / SaaS Taste)
   Aesthetic: Vertical Sidebar, Dashboard Analytics Cards, Live Tickets, Civic App
   ========================================================================== */

:root {
  --sidebar-w: 280px;
  --bg-sidebar: #0f172a;      /* Dark Slate Sidebar */
  --bg-main: #f8fafc;         /* Clean Light Canvas */
  --primary-blue: #2563eb;    /* Tech / Civic Blue */
  --secondary-teal: #0d9488;  /* Smart City Teal */
  --accent-cyan: #06b6d4;
  --border-light: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.25s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-dark);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* ==========================================================================
   Fixed Left Sidebar
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  background-color: var(--bg-sidebar);
  color: #f1f5f9;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem 1.25rem;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.brand-gem {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-teal));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
}

.brand-text h2 {
  font-size: 1.15rem;
  color: #ffffff;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
  background: rgba(37, 99, 235, 0.15);
  color: #ffffff;
}

.nav-menu a i {
  font-size: 1.15rem;
  color: var(--accent-cyan);
}

.sidebar-bottom-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  border-radius: 12px;
  text-align: center;
}

.sidebar-bottom-card p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.btn-sidebar-hotline {
  background: var(--primary-blue);
  color: #fff;
  display: block;
  padding: 0.6rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
}

.btn-sidebar-hotline:hover {
  background: #1d4ed8;
}

/* ==========================================================================
   Main Content Layout (Shifted Right)
   ========================================================================== */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* Dashboard Topbar */
.dashboard-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ecfdf5;
  color: #059669;
  padding: 0.35rem 0.85rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Dashboard Content Body */
.dashboard-body {
  padding: 2.5rem;
  max-width: 1200px;
}

/* Hero / Welcome Banner */
.mayor-welcome-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.25);
}

.mayor-welcome-banner h1 {
  font-size: 2.35rem;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.mayor-welcome-banner h1 span {
  color: var(--accent-cyan);
}

.mayor-welcome-banner p {
  color: #cbd5e1;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.banner-portrait {
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.banner-portrait img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: top center;
}

/* 4 Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.metric-footer {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
}

/* Live Citizen Tickets & Masterplan Split */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.dashboard-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.panel-title h3 {
  font-size: 1.25rem;
}

/* Ticket List */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ticket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.ticket-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.ticket-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ticket-status {
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-resolved { background: #dcfce7; color: #166534; }
.status-progress { background: #fef3c7; color: #854d0e; }

/* Dashboard Footer */
.dashboard-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 2.5rem;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.mobile-sidebar-toggle {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mobile-sidebar-toggle:hover {
  background: var(--primary-blue);
  color: #fff;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.sidebar-backdrop.active {
  display: block;
}

@media (max-width: 1024px) {
  .mobile-sidebar-toggle { display: flex; }
  .topbar-aqi { display: none; }
  .topbar-right { display: none; }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px !important;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 999;
    transition: left 0.3s ease;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.25rem !important;
    box-shadow: 10px 0 30px rgba(0,0,0,0.25);
  }

  .sidebar.open {
    left: 0 !important;
  }

  .brand-text, .nav-menu a span, .sidebar-bottom-card {
    display: block !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-columns { grid-template-columns: 1fr; }
  .mayor-welcome-banner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .dashboard-body { padding: 1.25rem; }
  .footer-inner-grid { grid-template-columns: 1fr; }
  .dashboard-topbar { padding: 0.75rem 1rem; }
}
