/* ============================================================
   Delivra — Internal Dashboard Shell
   assets/css/dashboard.css
   Teamseven Private Limited | teamseven.ltd
   ============================================================ */

/* ── Shell Layout ── */
.db-layout {
  display: flex;
  min-height: 100vh;
  background: var(--clr-bg-dark-1);
}

body.light-mode .db-layout {
  background: #EEF8EE;
}

/* ── Sidebar ── */
.db-sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: rgba(7, 14, 6, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255,255,255,0.07);
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

body.light-mode .db-sidebar {
  background: rgba(15, 40, 15, 0.97);
  border-right-color: rgba(22,163,74,0.15);
}

.db-sidebar.collapsed { width: 64px; }

.db-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  min-height: 64px;
}

.db-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  background: linear-gradient(135deg, #22C55E 0%, #86EFAC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
}

.db-brand span {
  background: linear-gradient(135deg, #F97316 0%, #FCD34D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.db-sidebar.collapsed .db-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
  -webkit-background-clip: unset;
  background-clip: unset;
  font-size: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.db-sidebar.collapsed .db-brand span { display: none; }
.db-sidebar.collapsed .db-brand::after {
  content: 'D';
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-family: var(--font-display);
  line-height: 1;
}

.db-sidebar-pin {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(240,253,244,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.db-sidebar-pin:hover { background: rgba(22,163,74,0.15); color: #22C55E; }

/* Nav */
.db-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.db-nav::-webkit-scrollbar { width: 3px; }
.db-nav::-webkit-scrollbar-thumb { background: rgba(22,163,74,0.20); border-radius: 2px; }

.db-nav-group { margin-bottom: 6px; }

.db-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(240,253,244,0.28);
  padding: 10px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.db-sidebar.collapsed .db-nav-label { opacity: 0; height: 0; padding: 0; margin: 0; }

.db-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(240,253,244,0.55);
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
  position: relative;
}

.db-nav-link:hover {
  background: rgba(22,163,74,0.10);
  color: rgba(240,253,244,0.85);
}

.db-nav-link.active {
  background: rgba(22,163,74,0.15);
  color: #22C55E;
  font-weight: 600;
}

.db-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 2px;
  background: #22C55E;
}

.db-nav-link svg { flex-shrink: 0; }
.db-nav-link-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.db-sidebar.collapsed .db-nav-link-text { display: none; }
.db-sidebar.collapsed .db-nav-badge, .db-sidebar.collapsed .db-nav-count { display: none; }
.db-sidebar.collapsed .db-nav-link { justify-content: center; padding: 10px; }
.db-sidebar.collapsed .db-nav-link::before { display: none; }

.db-nav-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(22,163,74,0.20);
  color: #22C55E;
  border: 1px solid rgba(22,163,74,0.30);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.db-nav-count {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(249,115,22,0.15);
  color: #FB923C;
}

/* Sidebar footer */
.db-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 14px 12px;
  flex-shrink: 0;
}

.db-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.db-user:hover { background: rgba(255,255,255,0.05); }

.db-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.db-user-info { flex: 1; overflow: hidden; }
.db-sidebar.collapsed .db-user-info { display: none; }
.db-sidebar.collapsed .db-user-menu-btn { display: none; }
.db-sidebar.collapsed .db-user { justify-content: center; }

.db-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(240,253,244,0.80);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-user-role {
  font-size: 0.68rem;
  color: rgba(240,253,244,0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-user-menu-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(240,253,244,0.35);
  border-radius: 6px;
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
}

.db-user-menu-btn:hover { background: rgba(255,255,255,0.08); color: rgba(240,253,244,0.70); }

/* ── Body (right side) ── */
.db-body {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

.db-sidebar.collapsed ~ .db-body { margin-left: 64px; }

/* ── Topbar ── */
.db-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10,20,9,0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

body.light-mode .db-topbar {
  background: rgba(240,253,244,0.88);
  border-bottom-color: rgba(22,163,74,0.12);
}

.db-topbar-start { display: flex; align-items: center; gap: 14px; }
.db-topbar-end   { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.db-topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(240,253,244,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.db-topbar-btn:hover { background: rgba(22,163,74,0.12); color: #22C55E; border-color: rgba(22,163,74,0.20); }

body.light-mode .db-topbar-btn {
  background: rgba(7,26,6,0.05);
  border-color: rgba(7,26,6,0.12);
  color: rgba(7,26,6,0.55);
}
body.light-mode .db-topbar-btn:hover { background: rgba(22,163,74,0.10); color: #16A34A; }

.db-page-title h1 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: rgba(240,253,244,0.90);
}

body.light-mode .db-page-title h1 { color: rgba(7,26,6,0.85); }

.db-breadcrumb {
  font-size: 0.68rem;
  color: rgba(240,253,244,0.35);
}

body.light-mode .db-breadcrumb { color: rgba(7,26,6,0.40); }

/* Search */
.db-search {
  position: relative;
  display: flex;
  align-items: center;
}

.db-search-icon {
  position: absolute;
  left: 10px;
  color: rgba(240,253,244,0.30);
  pointer-events: none;
}

body.light-mode .db-search-icon { color: rgba(7,26,6,0.30); }

.db-search input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 7px 12px 7px 32px;
  font-size: 0.8rem;
  color: rgba(240,253,244,0.80);
  font-family: var(--font-body);
  width: 220px;
  outline: none;
  transition: all 0.2s;
}

.db-search input::placeholder { color: rgba(240,253,244,0.28); }
.db-search input:focus { border-color: rgba(22,163,74,0.35); background: rgba(22,163,74,0.05); width: 260px; }

body.light-mode .db-search input {
  background: rgba(7,26,6,0.05);
  border-color: rgba(7,26,6,0.12);
  color: rgba(7,26,6,0.75);
}
body.light-mode .db-search input::placeholder { color: rgba(7,26,6,0.28); }

/* Notification bell */
.db-notif-btn { position: relative; }
.db-notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #EF4444;
  border: 1.5px solid rgba(10,20,9,0.90);
}

body.light-mode .db-notif-dot { border-color: rgba(240,253,244,0.90); }

/* Topbar user avatar */
.db-topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(22,163,74,0.30);
  transition: border-color 0.2s;
}

.db-topbar-avatar:hover { border-color: rgba(22,163,74,0.60); }

/* ── Main Content ── */
.db-main {
  flex: 1;
  padding: 28px 28px 48px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Stat / KPI Cards ── */
.db-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1280px) { .db-stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .db-stat-grid { grid-template-columns: 1fr; } }

.db-kpi {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.db-kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

body.light-mode .db-kpi {
  background: rgba(255,255,255,0.85);
  border-color: rgba(22,163,74,0.12);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.db-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(240,253,244,0.40);
  margin-bottom: 10px;
}

body.light-mode .db-kpi-label { color: rgba(7,26,6,0.45); }

.db-kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: 8px;
}

.db-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
}

.db-kpi-delta.up   { background: rgba(22,163,74,0.12); color: #22C55E; }
.db-kpi-delta.down { background: rgba(239,68,68,0.12); color: #F87171; }

.db-kpi-accent {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  opacity: 0.12;
}

/* ── Panels / Cards ── */
.db-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
}

body.light-mode .db-panel {
  background: rgba(255,255,255,0.88);
  border-color: rgba(22,163,74,0.10);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.db-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

body.light-mode .db-panel-header { border-bottom-color: rgba(22,163,74,0.08); }

.db-panel-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(240,253,244,0.85);
}

body.light-mode .db-panel-title { color: rgba(7,26,6,0.80); }

.db-panel-body { padding: 20px; }
.db-panel-body-flush { padding: 0; }

/* ── Tables ── */
.db-table-wrap { overflow-x: auto; }

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}

.db-table thead tr {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

body.light-mode .db-table thead tr { border-bottom-color: rgba(22,163,74,0.10); }

.db-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(240,253,244,0.38);
  white-space: nowrap;
}

body.light-mode .db-table th { color: rgba(7,26,6,0.40); }

.db-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(240,253,244,0.72);
  vertical-align: middle;
}

body.light-mode .db-table td {
  border-bottom-color: rgba(22,163,74,0.06);
  color: rgba(7,26,6,0.68);
}

.db-table tbody tr:hover td {
  background: rgba(22,163,74,0.04);
}

.db-table tbody tr:last-child td { border-bottom: none; }

/* ── Filter Bar ── */
.db-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.db-filter-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: rgba(240,253,244,0.75);
  font-family: var(--font-body);
  outline: none;
  transition: all 0.2s;
}

.db-filter-input:focus { border-color: rgba(22,163,74,0.35); }
.db-filter-input::placeholder { color: rgba(240,253,244,0.28); }

body.light-mode .db-filter-input {
  background: rgba(255,255,255,0.80);
  border-color: rgba(22,163,74,0.15);
  color: rgba(7,26,6,0.75);
}
body.light-mode .db-filter-input::placeholder { color: rgba(7,26,6,0.30); }
body.light-mode .db-filter-input:focus { border-color: #16A34A; }

.db-filter-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 8px 28px 8px 12px;
  font-size: 0.82rem;
  color: rgba(240,253,244,0.75);
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(240,253,244,0.35)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all 0.2s;
}

.db-filter-select:focus { border-color: rgba(22,163,74,0.35); }

body.light-mode .db-filter-select {
  background-color: rgba(255,255,255,0.80);
  border-color: rgba(22,163,74,0.15);
  color: rgba(7,26,6,0.75);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(7,26,6,0.35)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ── Pagination ── */
.db-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.78rem;
  color: rgba(240,253,244,0.40);
  flex-wrap: wrap;
}

body.light-mode .db-pagination {
  border-top-color: rgba(22,163,74,0.08);
  color: rgba(7,26,6,0.40);
}

.db-pagination-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.db-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: rgba(240,253,244,0.35);
  font-size: 0.78rem;
  user-select: none;
}

body.light-mode .db-pagination-ellipsis { color: rgba(7,26,6,0.30); }

.db-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(240,253,244,0.55);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.db-page-btn:hover { background: rgba(22,163,74,0.12); border-color: rgba(22,163,74,0.25); color: #22C55E; }
.db-page-btn.active { background: linear-gradient(135deg,#16A34A,#22C55E); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,0.30); }
.db-page-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

body.light-mode .db-page-btn {
  border-color: rgba(7,26,6,0.12);
  background: rgba(7,26,6,0.04);
  color: rgba(7,26,6,0.55);
}
body.light-mode .db-page-btn:hover { background: rgba(22,163,74,0.10); border-color: rgba(22,163,74,0.30); color: #15803D; }
body.light-mode .db-page-btn.active { background: linear-gradient(135deg,#16A34A,#22C55E); border-color: transparent; color: #fff; }

/* ── Form elements (internal) ── */
.db-form-group { margin-bottom: 20px; }

.db-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(240,253,244,0.65);
  margin-bottom: 6px;
}

body.light-mode .db-label { color: rgba(7,26,6,0.65); }

.db-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 9px;
  color: rgba(240,253,244,0.85);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: all 0.2s;
}

.db-input:focus { border-color: rgba(22,163,74,0.40); background: rgba(22,163,74,0.04); box-shadow: 0 0 0 3px rgba(22,163,74,0.10); }
.db-input::placeholder { color: rgba(240,253,244,0.28); }

body.light-mode .db-input {
  background: rgba(255,255,255,0.80);
  border-color: rgba(22,163,74,0.18);
  color: rgba(7,26,6,0.80);
}
body.light-mode .db-input::placeholder { color: rgba(7,26,6,0.28); }
body.light-mode .db-input:focus { border-color: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,0.10); }

.db-select {
  width: 100%;
  padding: 9px 32px 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 9px;
  color: rgba(240,253,244,0.85);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(240,253,244,0.35)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all 0.2s;
}

.db-select:focus { border-color: rgba(22,163,74,0.40); }

body.light-mode .db-select {
  background-color: rgba(255,255,255,0.80);
  border-color: rgba(22,163,74,0.18);
  color: rgba(7,26,6,0.80);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(7,26,6,0.35)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Toggle switch */
.db-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.light-mode .db-toggle-row { border-bottom-color: rgba(22,163,74,0.07); }
.db-toggle-row:last-child { border-bottom: none; }

.db-toggle-info { flex: 1; }
.db-toggle-name { font-size: 0.85rem; font-weight: 600; color: rgba(240,253,244,0.80); margin-bottom: 2px; }
.db-toggle-desc { font-size: 0.72rem; color: rgba(240,253,244,0.38); }
body.light-mode .db-toggle-name { color: rgba(7,26,6,0.78); }
body.light-mode .db-toggle-desc { color: rgba(7,26,6,0.42); }

.db-switch {
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.db-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(240,253,244,0.60);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.25s;
}

.db-switch.on {
  background: var(--gradient-primary);
  border-color: transparent;
}

.db-switch.on::after {
  transform: translateX(20px);
  background: #fff;
}

body.light-mode .db-switch {
  background: rgba(7,26,6,0.10);
  border-color: rgba(7,26,6,0.18);
}
body.light-mode .db-switch::after { background: rgba(7,26,6,0.40); }

/* ── Chart container ── */
.db-chart-wrap {
  position: relative;
  width: 100%;
}

/* ── Status Badges (inline) ── */
.db-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.db-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.db-status.delivered  { background: rgba(22,163,74,0.14); color: #22C55E; }
.db-status.preparing  { background: rgba(249,115,22,0.14); color: #FB923C; }
.db-status.confirmed  { background: rgba(234,179,8,0.14); color: #FDE047; }
.db-status.on-the-way { background: rgba(20,184,166,0.14); color: #2DD4BF; }
.db-status.cancelled  { background: rgba(239,68,68,0.14); color: #F87171; }
.db-status.online     { background: rgba(22,163,74,0.14); color: #22C55E; }
.db-status.offline    { background: rgba(100,116,139,0.14); color: #94A3B8; }
.db-status.busy       { background: rgba(234,179,8,0.14); color: #FDE047; }
.db-status.active     { background: rgba(22,163,74,0.14); color: #22C55E; }
.db-status.inactive   { background: rgba(100,116,139,0.14); color: #94A3B8; }
.db-status.paused     { background: rgba(249,115,22,0.14); color: #FB923C; }
.db-status.closed     { background: rgba(239,68,68,0.14); color: #F87171; }
.db-status.enabled    { background: rgba(22,163,74,0.14); color: #22C55E; }
.db-status.disabled   { background: rgba(100,116,139,0.14); color: #94A3B8; }

/* Status dot color helper */
.db-status.delivered  .db-status-dot { background: #22C55E; box-shadow: 0 0 5px #22C55E; }
.db-status.on-the-way .db-status-dot { background: #2DD4BF; box-shadow: 0 0 5px #2DD4BF; animation: pulse-dot 2s infinite; }
.db-status.online     .db-status-dot { background: #22C55E; box-shadow: 0 0 5px #22C55E; animation: pulse-dot 2s infinite; }
.db-status.preparing  .db-status-dot { background: #FB923C; }
.db-status.confirmed  .db-status-dot { background: #FDE047; }
.db-status.cancelled  .db-status-dot { background: #F87171; }
.db-status.offline    .db-status-dot { background: #94A3B8; }

/* ── Avatar stack ── */
.db-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.db-avatar.warm { background: var(--gradient-warm); }
.db-avatar.teal { background: linear-gradient(135deg,#14B8A6,#2DD4BF); }
.db-avatar.gold { background: linear-gradient(135deg,#EAB308,#FBBF24); }

/* ── Section header row ── */
.db-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.db-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(240,253,244,0.85);
}

body.light-mode .db-section-title { color: rgba(7,26,6,0.82); }

/* ── Grid helpers ── */
.db-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.db-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.db-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.db-grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.db-grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

@media (max-width: 1100px) {
  .db-grid-4 { grid-template-columns: repeat(2,1fr); }
  .db-grid-3 { grid-template-columns: repeat(2,1fr); }
  .db-grid-2-1, .db-grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .db-grid-2, .db-grid-3, .db-grid-4 { grid-template-columns: 1fr; }
  .db-main { padding: 16px 16px 40px; }
}

/* ── Mini progress bar ── */
.db-mini-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

body.light-mode .db-mini-bar-wrap { background: rgba(7,26,6,0.08); }

.db-mini-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--gradient-primary);
}

/* ── Map mockup ── */
.db-map-canvas {
  width: 100%;
  height: 100%;
  background: #0A1409;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 14px 14px;
}

/* ── Card list item ── */
.db-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.db-list-item:last-child { border-bottom: none; }
.db-list-item:hover { background: rgba(22,163,74,0.04); }

body.light-mode .db-list-item { border-bottom-color: rgba(22,163,74,0.06); }
body.light-mode .db-list-item:hover { background: rgba(22,163,74,0.03); }

/* ── Color swatch picker (branding) ── */
.db-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.db-color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 3px rgba(22,163,74,0.40); }

/* ── Mobile sidebar overlay ── */
.db-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  backdrop-filter: blur(4px);
}

@media (max-width: 900px) {
  .db-sidebar {
    transform: translateX(-100%);
    width: 260px !important;
  }
  .db-sidebar.mobile-open { transform: translateX(0); }
  .db-sidebar-overlay.visible { display: block; }
  .db-body { margin-left: 0 !important; }
  .db-topbar { padding: 0 16px; }
}

/* ── Dashboard Buttons ─────────────────────────────────────── */
.db-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s, border-color 0.18s;
  white-space: nowrap;
  text-decoration: none;
}
.db-btn:active { transform: scale(0.97); }

.db-btn-primary {
  background: linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(22, 163, 74, 0.30);
}
.db-btn-primary:hover {
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.45);
  transform: translateY(-1px);
}

.db-btn-outline {
  background: transparent;
  color: #22C55E;
  border-color: rgba(34, 197, 94, 0.35);
}
.db-btn-outline:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.60);
}

.db-btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.30);
}
.db-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.50);
}

.db-btn-sm {
  padding: 5px 12px;
  font-size: 0.75rem;
  border-radius: 7px;
}

/* Table / panel action button */
.db-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(240, 253, 244, 0.75);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.db-action-btn:hover {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.30);
  color: #22C55E;
}

body.light-mode .db-btn-outline {
  color: #15803D;
  border-color: rgba(22, 163, 74, 0.40);
}
body.light-mode .db-btn-outline:hover {
  background: rgba(22, 163, 74, 0.08);
  border-color: #16A34A;
}
body.light-mode .db-action-btn {
  background: rgba(7, 26, 6, 0.05);
  border-color: rgba(7, 26, 6, 0.12);
  color: rgba(7, 26, 6, 0.65);
}
body.light-mode .db-action-btn:hover {
  background: rgba(22, 163, 74, 0.10);
  border-color: rgba(22, 163, 74, 0.30);
  color: #15803D;
}
