/* Self-hosted Vazirmatn (no external/CDN requests) */
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 900; font-display: swap; src: url('fonts/Vazirmatn-Black.woff2') format('woff2'); }

:root {
  --bg-outer: #E6EAE7;
  --bg-shell: #FFFFFF;
  --bg-surface: #F6F7F6;
  --card: #FFFFFF;
  --border: #E8ECE9;
  --border-strong: #D5DDD7;
  --text: #111827;
  --text-soft: #374151;
  --muted: #7E8780;
  --primary: #155E36;
  --primary-dark: #0E4426;
  --primary-mid: #237A48;
  --primary-light: #4FA874;
  --primary-tint: #E7F4EC;
  --warning-bg: #FEF6E0;
  --warning-text: #B47809;
  --danger: #DC2626;
  --danger-bg: #FDECEC;
  --danger-text: #B91C1C;
  --success: #15803D;
  --success-bg: #E6F6EC;
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-shell: 0 24px 60px rgba(15, 35, 23, 0.08);
  --shadow-card: 0 2px 10px rgba(16, 24, 20, 0.025);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, system-ui, sans-serif;
  background: var(--bg-outer);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-frame {
  min-height: 100vh;
  padding: 18px;
  display: flex;
  justify-content: center;
}

.layout {
  width: 100%;
  max-width: 1560px;
  background: var(--bg-shell);
  border-radius: 30px;
  padding: 16px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-shell);
  min-height: calc(100vh - 36px);
}

.sidebar {
  width: 256px;
  background: var(--bg-surface);
  border-radius: 22px;
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
  height: calc(100vh - 68px);
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 24px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #9AA29C;
  letter-spacing: 0.5px;
  padding: 12px 14px 6px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.18s ease;
}

.nav-link-main { display: flex; align-items: center; gap: 12px; }

.nav-ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #858E88;
  transition: color 0.18s ease;
}

.nav-link:hover { color: var(--text); background: rgba(21, 94, 54, 0.05); }
.nav-link:hover .nav-ico { color: var(--primary); }

.nav-link.active {
  color: var(--text);
  font-weight: 800;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(16, 24, 20, 0.04);
}
.nav-link.active .nav-ico { color: var(--primary); }

.nav-link.active::before {
  content: "";
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 28px;
  background: var(--primary);
  border-radius: 99px 0 0 99px;
}

.nav-badge {
  background: var(--primary-dark);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.3;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sidebar-promo {
  margin-top: auto;
  background:
    radial-gradient(circle at 85% 15%, rgba(82, 183, 136, 0.32) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(27, 117, 66, 0.55) 0%, transparent 60%),
    linear-gradient(145deg, #092614 0%, #134E2B 60%, #0D381E 100%);
  border-radius: 20px;
  padding: 18px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(10, 42, 22, 0.18);
}

.sidebar-promo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(
    circle at 100% 100%,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 2px,
    transparent 2px,
    transparent 14px
  );
  pointer-events: none;
}

.promo-badge-ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.promo-title { font-size: 14.5px; font-weight: 800; line-height: 1.4; margin-bottom: 4px; position: relative; z-index: 1; }
.promo-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.72); margin-bottom: 14px; position: relative; z-index: 1; }

.promo-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary-mid);
  color: #FFFFFF;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: background 0.18s ease, transform 0.15s ease;
}
.promo-btn:hover { background: #2B9358; transform: translateY(-1px); }

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  background: var(--bg-surface);
  border-radius: 22px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-pill {
  background: #FFFFFF;
  border-radius: var(--radius-pill);
  padding: 7px 10px 7px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  max-width: 440px;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-pill:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(21, 94, 54, 0.08);
}

.search-pill-ico {
  color: #6B7280;
  display: flex;
  align-items: center;
  padding-right: 4px;
}

.search-pill label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.search-pill select {
  border: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', 'Vazirmatn', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  outline: none;
  cursor: pointer;
  padding: 4px 2px;
}

.kbd-badge {
  background: #F1F3F2;
  color: #525854;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  white-space: nowrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  border: none;
  cursor: pointer;
}

.icon-circle-btn:hover {
  background: var(--primary-tint);
  color: var(--primary);
  transform: translateY(-1px);
}

.icon-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  border: 1.5px solid #FFFFFF;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 14px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FDECE6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-name {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text);
}

.user-mail {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.page-canvas {
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 26px;
  flex: 1;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-hero-title {
  margin: 0;
  font-size: 29px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-hero-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}

.page-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Donezo KPI Cards Grid */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 1150px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr; }
}

.kpi {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 158px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 24, 20, 0.06);
}

.kpi.kpi-featured {
  background: linear-gradient(135deg, #0F4726 0%, #1E7442 100%);
  color: #FFFFFF;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.kpi.kpi-featured .kpi-title {
  color: rgba(255, 255, 255, 0.92);
}

.kpi-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #D1D5DB;
  background: #FFFFFF;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.kpi-arrow:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.kpi.kpi-featured .kpi-arrow {
  background: #FFFFFF;
  color: var(--primary-dark);
  border-color: #FFFFFF;
}

.kpi-value {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  margin: 12px 0 10px;
  font-family: 'Plus Jakarta Sans', 'Vazirmatn', sans-serif;
  letter-spacing: -1px;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.kpi.kpi-featured .kpi-foot {
  color: #A7F3D0;
}

.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid rgba(21, 94, 54, 0.15);
}

.kpi.kpi-featured .kpi-chip {
  background: rgba(255, 255, 255, 0.14);
  color: #D1FAE5;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Donezo Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr 1.05fr;
  gap: 16px;
  margin-bottom: 16px;
}

.bento-bottom {
  display: grid;
  grid-template-columns: 1.45fr 1.05fr 1.05fr;
  gap: 16px;
}

@media (max-width: 1200px) {
  .bento-grid, .bento-bottom {
    grid-template-columns: 1fr;
  }
}

.card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(232, 236, 233, 0.6);
}

.bento-grid .card, .bento-bottom .card {
  margin-bottom: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card h2, .card-title {
  margin: 0 0 14px;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text);
}

.card-head h2, .card-head .card-title {
  margin: 0;
}

/* Donezo Pill Bar Chart */
.pill-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 170px;
  padding: 26px 6px 6px;
}

.pill-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.pill-bar-wrap {
  width: 100%;
  max-width: 46px;
  height: 122px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.pill-bar {
  width: 100%;
  border-radius: 999px;
  position: relative;
  transition: height 0.3s ease, transform 0.2s ease;
}

.pill-bar:hover { transform: translateY(-3px); }
.pill-bar.solid-dark { background: #14532D; }
.pill-bar.solid-mid { background: #2D7A4D; }
.pill-bar.solid-light { background: #52B788; }
.pill-bar.striped {
  background: repeating-linear-gradient(
    -45deg,
    #8A948E,
    #8A948E 3px,
    #FFFFFF 3px,
    #FFFFFF 7px
  );
  border: 1px solid #D5DDD7;
}

.pill-tip {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1px solid #D5DDD7;
  color: var(--primary-dark);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.pill-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.spotlight-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spotlight-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.35;
  margin: 6px 0 6px;
}

.spotlight-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.app-mini-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.app-mini-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.app-mini-item:hover { background: var(--bg-surface); }

.app-mini-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 15px;
}

.app-mini-ico.c1 { background: #EEF2FF; color: #3730A3; }
.app-mini-ico.c2 { background: #E6F6EC; color: #155E36; }
.app-mini-ico.c3 { background: #FEF3C7; color: #B45309; }
.app-mini-ico.c4 { background: #FCE7F3; color: #9D174D; }
.app-mini-ico.c5 { background: #E0F2FE; color: #0369A1; }

.app-mini-body { flex: 1; min-width: 0; }
.app-mini-title { font-weight: 800; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-mini-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.collab-list { display: flex; flex-direction: column; gap: 12px; }
.collab-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.collab-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.collab-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.collab-avatar.a1 { background: #FDECE6; color: #C2410C; }
.collab-avatar.a2 { background: #ECFCCB; color: #3F6212; }
.collab-avatar.a3 { background: #E0E7FF; color: #3730A3; }
.collab-avatar.a4 { background: #FEF3C7; color: #A16207; }
.collab-title { font-weight: 800; font-size: 13.5px; color: var(--text); }
.collab-sub { font-size: 12px; color: var(--muted); }
.collab-sub b { color: var(--text); font-weight: 700; }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 0 2px; }
.gauge-svg { width: 220px; height: 125px; overflow: visible; }
.gauge-center-val { font-size: 36px; font-weight: 800; color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; margin-top: -42px; line-height: 1; }
.gauge-center-sub { font-size: 12px; color: var(--muted); margin-top: 4px; margin-bottom: 14px; }
.gauge-legend { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; font-size: 11.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-dot.d-mid { background: #2D7A4D; }
.legend-dot.d-dark { background: #0E4426; }
.legend-dot.d-stripe { background: repeating-linear-gradient(-45deg, #8A948E, #8A948E 2px, #FFF 2px, #FFF 4px); border: 1px solid #9AA29C; }

.tracker-card {
  background:
    radial-gradient(circle at 85% 20%, rgba(82, 183, 136, 0.28) 0%, transparent 55%),
    radial-gradient(circle at 15% 85%, rgba(21, 94, 54, 0.65) 0%, transparent 60%),
    linear-gradient(145deg, #072112 0%, #124A29 58%, #092816 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.tracker-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 2px, transparent 2px, transparent 14px);
  pointer-events: none;
}
.tracker-title { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.9); position: relative; z-index: 1; }
.tracker-time { font-size: 36px; font-weight: 800; font-family: 'Plus Jakarta Sans', monospace; letter-spacing: 1px; text-align: center; margin: 14px 0; position: relative; z-index: 1; }
.tracker-actions { display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; z-index: 1; }
.tracker-btn { width: 44px; height: 44px; border-radius: 50%; border: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; transition: transform 0.15s ease; }
.tracker-btn:hover { transform: scale(1.06); }
.tracker-btn.light { background: #FFFFFF; color: var(--primary-dark); }
.tracker-btn.red { background: #EF4444; color: #FFFFFF; }

/* Forms, Buttons, Tables, Badges, Alerts, Login */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.form label { display: block; margin: 14px 0 6px; font-weight: 700; font-size: 13px; color: var(--text-soft); }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  font-family: inherit;
  font-size: 14px;
  background: #FBFDFB;
  color: var(--text);
  transition: all 0.18s ease;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 54, 0.12);
}
.form textarea { resize: vertical; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: 'Plus Jakarta Sans', ui-monospace, Menlo, Consolas, monospace; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #114B27 0%, #1D703E 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(21, 94, 54, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0D3C1E 0%, #155E36 100%);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #FFFFFF;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-block { width: 100%; }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
.table th { color: var(--muted); font-weight: 700; font-size: 12px; background: #FAFBFA; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FCFDFC; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid rgba(21, 94, 54, 0.15);
}
.badge.ok { background: var(--success-bg); color: var(--success); border-color: rgba(21, 128, 61, 0.2); }
.badge.warn { background: var(--warning-bg); color: var(--warning-text); border-color: rgba(180, 120, 9, 0.2); }
.badge.no { background: var(--danger-bg); color: var(--danger-text); border-color: rgba(185, 28, 28, 0.2); }

.alert { padding: 13px 18px; border-radius: 14px; margin-bottom: 18px; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #BBF7D0; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #FECACA; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.switch-title { font-weight: 700; color: var(--text); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #CBD5CF; border-radius: 999px; transition: .2s; }
.slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.code {
  background: #102318;
  color: #E2F5EA;
  border: 1px solid #1E462F;
  border-radius: 14px;
  padding: 16px;
  overflow-x: auto;
  font-family: 'Plus Jakarta Sans', ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  direction: ltr;
  text-align: left;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 15%, rgba(82, 183, 136, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(21, 94, 54, 0.35) 0%, transparent 50%),
    linear-gradient(135deg, #092214 0%, #14532D 100%);
  padding: 20px;
}
.login-card {
  background: #FFFFFF;
  border-radius: 26px;
  padding: 38px 34px;
  width: 100%;
  max-width: 410px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.32);
}

@media (max-width: 960px) {
  .app-frame { padding: 0; }
  .layout { border-radius: 0; flex-direction: column; padding: 10px; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav-link.active::before { display: none; }
}

/* Language tabs + Playground */
.lang-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.lang-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.lang-tab:hover { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); }
.lang-tab.active {
  background: linear-gradient(135deg, #114B27 0%, #1D703E 100%);
  color: #fff;
  border-color: transparent;
}

.pg-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 16px 0 20px;
}
.pg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 150px;
}
.pg-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.pg-field input, .pg-field select {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', ui-monospace, monospace;
  font-size: 13.5px;
  background: #FBFDFB;
}
.pg-field input:focus, .pg-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 54, 0.12);
}

.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 900px) { .pg-grid { grid-template-columns: 1fr; } }

.pg-box {
  background: #FBFDFB;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.pg-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.pg-code {
  display: block;
  background: #102318;
  color: #E2F5EA;
  border-radius: 10px;
  padding: 12px;
  font-family: 'Plus Jakarta Sans', ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Custom fields key/value editor */
.kv-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.kv-row input {
  flex: 1;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', ui-monospace, monospace;
  font-size: 13.5px;
  background: #FBFDFB;
  color: var(--text);
}
.kv-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 54, 0.12);
}

/* Tutorial (collapsible guide) */
.tutorial {
  border: 1px solid var(--border);
  border-radius: 14px;
}
.tutorial summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text);
  list-style: none;
}
.tutorial summary::-webkit-details-marker { display: none; }
.tutorial summary:before {
  content: "▸";
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.2s ease;
}
.tutorial[open] summary:before { transform: rotate(90deg); }
.tutorial-body {
  padding: 6px 18px 18px;
  border-top: 1px solid var(--border);
}
.tutorial-body h3 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: var(--text);
}
.tutorial-body .code { margin: 6px 0 10px; }

/* Dynamic ad-units editor */
.form .ad-unit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #FAFCFB;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.form .ad-unit-row input[type="text"] {
  width: auto;
  flex: 1 1 180px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', ui-monospace, monospace;
  font-size: 13.5px;
  background: #FFFFFF;
  color: var(--text);
}
.form .ad-unit-row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 54, 0.12);
}
.form .ad-unit-row input.ad-key {
  flex: 0 0 175px;
  font-weight: 800;
}
.ad-unit-row .ad-toggle {
  flex: 0 0 auto;
  min-width: 84px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 12.5px;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.ad-unit-row .ad-toggle.is-on {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(21, 128, 61, 0.25);
}
.ad-unit-row .ad-toggle.is-off {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: rgba(185, 28, 28, 0.25);
}
.ad-unit-row .ad-unit-remove {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.ad-unit-row .ad-unit-remove:hover {
  background: var(--danger);
  color: #FFFFFF;
}
@media (max-width: 640px) {
  .form .ad-unit-row input.ad-key { flex: 1 1 100%; }
}
