/* ── FeriBazaar Brand Colors ─────────────────────────────── */
:root {
  --pb-green:      #10B271;
  --pb-green-dark: #059669;
  --pb-green-light:#ECFDF5;
  --pb-saffron:    #FF9933;
  --pb-sidebar-bg: #0d1f18;
  --pb-sidebar-w:  240px;
}

/* Bootstrap primary override */
.btn-primary           { background-color: var(--pb-green) !important; border-color: var(--pb-green) !important; }
.btn-primary:hover     { background-color: var(--pb-green-dark) !important; border-color: var(--pb-green-dark) !important; }
.btn-outline-primary   { color: var(--pb-green) !important; border-color: var(--pb-green) !important; }
.btn-outline-primary:hover { background-color: var(--pb-green) !important; color: #fff !important; }
.text-primary          { color: var(--pb-green) !important; }
.bg-primary            { background-color: var(--pb-green) !important; }
.border-primary        { border-color: var(--pb-green) !important; }
.badge.bg-success, .btn-success { background-color: var(--pb-green) !important; border-color: var(--pb-green) !important; }
.nav-pills .nav-link.active { background-color: var(--pb-green) !important; }
.form-control:focus, .form-select:focus { border-color: var(--pb-green); box-shadow: 0 0 0 .2rem rgba(16,178,113,.2); }

/* ── Body & Font ─────────────────────────────────────────── */
body { font-family: 'Inter', 'Segoe UI', sans-serif; background: #f4f6f9; }

/* ── Login page ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--pb-green) 0%, var(--pb-green-dark) 60%, #064E3B 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { font-size: 3rem; line-height: 1; }
.otp-inputs input {
  width: 46px; height: 52px; text-align: center;
  font-size: 1.4rem; font-weight: 700;
  border: 2px solid #dee2e6; border-radius: 10px;
}
.otp-inputs input:focus { border-color: var(--pb-green); outline: none; box-shadow: 0 0 0 .15rem rgba(16,178,113,.25); }

/* ── Dashboard layout ────────────────────────────────────── */
.pb-sidebar {
  width: var(--pb-sidebar-w);
  min-height: 100vh;
  background: var(--pb-sidebar-bg);
  position: fixed; top: 0; left: 0; z-index: 100;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.pb-sidebar .brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pb-sidebar .brand-icon { font-size: 1.8rem; }
.pb-sidebar .brand-name { color: #fff; font-weight: 800; font-size: 1.1rem; margin-left: .5rem; }
.pb-sidebar .brand-sub  { color: rgba(255,255,255,.45); font-size: .7rem; margin-left: .5rem; }

.pb-sidebar .nav-section-label {
  color: rgba(255,255,255,.3);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 1rem 1.25rem .3rem;
}
.pb-sidebar .nav-link {
  color: rgba(255,255,255,.65);
  padding: .6rem 1.25rem;
  border-radius: 8px;
  margin: 2px .75rem;
  font-size: .875rem;
  font-weight: 500;
  display: flex; align-items: center; gap: .65rem;
  transition: all .15s;
}
.pb-sidebar .nav-link i { font-size: 1rem; width: 18px; text-align: center; }
.pb-sidebar .nav-link:hover  { background: rgba(255,255,255,.08); color: #fff; }
.pb-sidebar .nav-link.active { background: var(--pb-green); color: #fff !important; }

.pb-sidebar .sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.pb-sidebar .user-pill {
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  padding: .6rem .75rem;
  display: flex; align-items: center; gap: .6rem;
}
.pb-sidebar .user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--pb-green);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
}
.pb-sidebar .user-name { color: #fff; font-size: .8rem; font-weight: 600; }
.pb-sidebar .user-role { color: rgba(255,255,255,.4); font-size: .7rem; }

.pb-main {
  margin-left: var(--pb-sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.pb-topbar {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: .85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.pb-topbar .page-title { font-weight: 700; font-size: 1.1rem; color: #1a1a2e; margin: 0; }
.pb-content { padding: 1.5rem; flex: 1; }

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #f0f0f0;
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-value { font-size: 1.75rem; font-weight: 800; color: #1a1a2e; line-height: 1; }
.stat-label { font-size: .78rem; color: #6c757d; font-weight: 500; margin-top: 2px; }

/* ── Cards & Tables ──────────────────────────────────────── */
.pb-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
}
.pb-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.pb-card-header h6 { font-weight: 700; margin: 0; color: #1a1a2e; }
.pb-card-body { padding: 1.25rem; }

.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; font-weight: 600; border-top: none; }
.table td { vertical-align: middle; font-size: .875rem; }
.table-hover tbody tr:hover { background-color: var(--pb-green-light); }

/* ── Live route map ──────────────────────────────────────── */
#routeMap { height: 420px; border-radius: 12px; border: 1px solid #dee2e6; }

/* ── LIVE pulse badge ────────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--pb-green);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
  margin-right: 5px;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,178,113,.6); }
  50%       { box-shadow: 0 0 0 8px rgba(16,178,113,0); }
}

/* ── Toast container ─────────────────────────────────────── */
#toastContainer {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  min-width: 280px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .pb-sidebar { width: 100%; min-height: auto; position: relative; }
  .pb-main { margin-left: 0; }
}
