/* =========================================================
   FormYar — Design System (base.css)
   Persian-first, RTL, mobile-first form builder demo
   ========================================================= */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #047857;
  --brand-deep: #065f46;
  --brand-soft: #ecfdf5;
  --brand-contrast: #ffffff;
  --violet: #0d9488;
  --mint: #10b981;
  --mint-soft: #e7faf2;
  --coral: #fb7185;
  --coral-soft: #fff0f3;
  --amber: #f59e0b;
  --amber-soft: #fff7e6;
  --sky: #0ea5e9;

  --ink: #0c1f19;
  --ink-2: #203a32;
  --muted: #5b746d;
  --muted-2: #829a92;
  --bg: #f4faf7;
  --bg-2: #eaf5f0;
  --card: #ffffff;
  --card-2: #f8fcfa;
  --line: #dfeee8;
  --line-2: #cfe4db;
  /* aliases shared by the reports / publishing components */
  --surface: var(--card);
  --surface-2: var(--bg-2);
  --surface-3: var(--card-2);
  --text: var(--ink);
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
  --accent-line: color-mix(in srgb, var(--brand) 28%, transparent);
  --shadow-xs: 0 1px 2px rgba(14, 19, 48, 0.04);
  --shadow-sm: 0 2px 10px rgba(14, 19, 48, 0.05);
  --shadow-md: 0 10px 35px rgba(14, 19, 48, 0.08);
  --shadow-lg: 0 24px 70px rgba(14, 19, 48, 0.13);
  --shadow-brand: 0 14px 34px rgba(4, 120, 87, 0.28);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-full: 999px;

  --container: 1200px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --sidebar-w: 254px;

  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #34d399;
  --brand-deep: #10b981;
  --brand-soft: #112c26;
  --brand-contrast: #052e22;
  --violet: #2dd4bf;
  --mint: #34d399;
  --mint-soft: #112c26;
  --coral: #fb8ca0;
  --coral-soft: #331a22;
  --amber: #fbbf24;
  --amber-soft: #302413;
  --sky: #38bdf8;

  --ink: #eefdf7;
  --ink-2: #cfeee3;
  --muted: #9bb9b0;
  --muted-2: #78948b;
  --bg: #06110f;
  --bg-2: #0a1a16;
  --card: #0e211d;
  --card-2: #122a24;
  --line: #1d3a32;
  --line-2: #294c42;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 38px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.5);
  --shadow-brand: 0 14px 34px rgba(16, 185, 129, 0.32);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color 0.25s, color 0.25s;
}

body.no-scroll {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--brand);
  color: var(--brand-contrast);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 20px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.tiny {
  font-size: 11.5px;
}
.strong {
  font-weight: 700;
}
.center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}
.hidden {
  display: none !important;
}
.gradient-text {
  background: linear-gradient(100deg, var(--brand) 10%, var(--violet) 45%, var(--mint) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-sm {
  width: 16px;
  height: 16px;
}
.icon-lg {
  width: 26px;
  height: 26px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.stack {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
}
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: var(--brand-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.4;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.985);
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #0d9488 55%, #10b981 100%);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  box-shadow: 0 18px 40px rgba(4, 120, 87, 0.36);
}
.btn-dark {
  background: var(--ink);
  color: var(--bg);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.btn-soft {
  background: var(--brand-soft);
  color: var(--brand);
}
.btn-soft:hover {
  background: color-mix(in srgb, var(--brand-soft) 75%, var(--brand));
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.btn-mint {
  background: var(--mint);
  color: #04382a;
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.25);
}
.btn-white {
  background: #fff;
  color: #0c1f19;
}
.btn-white:hover {
  background: #f0fdfa;
}
.btn-sm {
  min-height: 36px;
  padding: 6px 13px;
  font-size: 13px;
  border-radius: 10px;
  gap: 6px;
}
.btn-lg {
  min-height: 54px;
  padding: 14px 30px;
  font-size: 16px;
  border-radius: 14px;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.btn-icon:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.btn .icon {
  width: 18px;
  height: 18px;
}

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  line-height: 1.6;
  white-space: nowrap;
}
.badge .icon {
  width: 14px;
  height: 14px;
}
.badge-mint {
  background: var(--mint-soft);
  color: color-mix(in srgb, var(--mint) 75%, #054d38);
}
[data-theme="dark"] .badge-mint { color: var(--mint); }
.badge-coral {
  background: var(--coral-soft);
  color: #d94260;
}
[data-theme="dark"] .badge-coral { color: var(--coral); }
.badge-amber {
  background: var(--amber-soft);
  color: #a16207;
}
[data-theme="dark"] .badge-amber { color: var(--amber); }
.badge-gray {
  background: var(--bg-2);
  color: var(--muted);
}
.badge-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: 0.18s;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--line-2);
  color: var(--ink);
}
.chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="dark"] .chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

/* ---------- forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field > input:not([type="checkbox"]):not([type="radio"]),
.field > select,
.field > textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field > input:not([type="checkbox"]):not([type="radio"]):focus,
.field > select:focus,
.field > textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}
.field > textarea {
  resize: vertical;
  line-height: 1.8;
}
.label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.label .req {
  color: var(--coral);
  font-size: 15px;
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
  font-size: 13px;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-2);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent);
}
.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.8;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23626a87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
  cursor: pointer;
}
.input-group {
  position: relative;
}
.input-group .icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--muted-2);
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.input-group .input {
  padding-right: 42px;
}
.help {
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.6;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 20px;
  background: var(--line-2);
  transition: 0.2s;
  flex: none;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: 0.2s var(--ease);
}
.switch.on {
  background: var(--mint);
}
.switch.on::after {
  right: 21px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-2);
}
.check input {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  display: grid;
  place-items: center;
  transition: 0.15s;
  margin: 0;
  flex: none;
  cursor: pointer;
}
.check input:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.check input:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translateY(-1px);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  transition: box-shadow 0.2s, background 0.2s;
}
.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand) 10%, #14b8a6 60%, var(--mint) 130%);
  display: grid;
  place-items: center;
  color: var(--brand-contrast);
  box-shadow: 0 7px 18px rgba(4, 120, 87, 0.3);
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 10%, rgba(255, 255, 255, 0.5), transparent 55%);
}
.brand-mark svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  line-height: 1;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 9px 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 9px;
  transition: 0.16s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--bg-2);
}
.header-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions .divider {
  width: 1px;
  height: 26px;
  background: var(--line);
  margin-inline: 4px;
}
.theme-toggle {
  color: var(--muted);
}
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }
.hamburger {
  display: none;
}

/* mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.mobile-drawer.open {
  display: block;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 28, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.drawer-panel {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(340px, 88vw);
  background: var(--card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideIn 0.32s var(--ease);
  overflow-y: auto;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-links a {
  padding: 13px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-links a:hover {
  background: var(--bg-2);
  color: var(--brand);
}
.drawer-links a .icon {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}
.drawer-cta {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}
.drawer-foot {
  margin-top: auto;
  padding-top: 24px;
  font-size: 12px;
  color: var(--muted-2);
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
[dir="rtl"] .drawer-panel { animation-name: slideInRtl; }
@keyframes slideInRtl {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- sections ---------- */
.section {
  padding: clamp(58px, 8vw, 104px) 0;
  position: relative;
}
.section-tight {
  padding: clamp(40px, 6vw, 70px) 0;
}
.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto clamp(32px, 5vw, 54px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.section-title {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.35;
}
.section-sub {
  font-size: clamp(14.5px, 1.6vw, 17px);
  color: var(--muted);
  max-width: 620px;
  line-height: 1.9;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  padding: 5px 13px;
  border-radius: var(--r-full);
}
.eyebrow .icon {
  width: 14px;
  height: 14px;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad {
  padding: clamp(18px, 2.6vw, 28px);
}
.hover-lift {
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
}
.icon-tile {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: none;
}
.icon-tile.mint { background: var(--mint-soft); color: var(--mint); }
.icon-tile.coral { background: var(--coral-soft); color: var(--coral); }
.icon-tile.amber { background: var(--amber-soft); color: var(--amber); }
.icon-tile svg { width: 23px; height: 23px; }

/* ---------- footer ---------- */
.site-footer {
  background: #071713;
  color: #b7e8d8;
  padding: 60px 0 24px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4, 120, 87, 0.28), transparent 70%);
  top: -220px;
  inset-inline-start: -100px;
  pointer-events: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr) 1.4fr;
  gap: 36px;
  position: relative;
}
.footer-brand .brand {
  color: #fff;
  margin-bottom: 14px;
}
.footer-about {
  font-size: 13.5px;
  line-height: 2;
  color: #8fb8a9;
  max-width: 290px;
}
.footer-socials {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}
.footer-socials a {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  color: #d1fae5;
  transition: 0.2s;
}
.footer-socials a:hover {
  background: var(--brand);
  color: var(--brand-contrast);
  transform: translateY(-2px);
}
.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}
.footer-col a,
.footer-col p {
  display: block;
  font-size: 13px;
  color: #8fb8a9;
  padding: 5px 0;
  transition: 0.16s;
}
.footer-col a:hover {
  color: #fff;
  transform: translateX(-3px);
}
.footer-news p {
  margin-bottom: 12px;
  line-height: 1.9;
}
.newsletter {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px;
  border-radius: 12px;
}
.newsletter input {
  background: transparent;
  border: 0;
  outline: 0;
  padding: 8px 10px;
  color: #fff;
  width: 100%;
  font-size: 12.5px;
  min-width: 0;
}
.newsletter input::placeholder { color: #7d9b90; }
.newsletter button {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-contrast);
  display: grid;
  place-items: center;
  flex: none;
}
.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #7d9b90;
  position: relative;
}
.footer-bottom .row { gap: 18px; flex-wrap: wrap; }
.footer-bottom a:hover { color: #fff; }
.footer-badges {
  display: flex;
  gap: 10px;
  align-items: center;
}
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  color: #b7e8d8;
}
.footer-badge svg { width: 15px; height: 15px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 28, 0.6);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s;
}
.modal-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalIn 0.32s var(--ease);
}
.modal-panel.wide { width: min(900px, 100%); }
.modal-panel.slim { width: min(430px, 100%); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 2;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-head h3 {
  font-size: 17px;
  flex: 1;
}
.modal-body {
  padding: 24px;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.modal-foot .spacer { flex: 1; }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 26px;
  inset-inline-start: 26px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  animation: toastIn 0.35s var(--ease);
  max-width: 340px;
  pointer-events: auto;
}
[data-theme="dark"] .toast {
  background: #f0fdfa;
  color: #0c1f19;
}
.toast .icon {
  width: 18px;
  height: 18px;
  color: var(--mint);
  flex: none;
}
.toast.error .icon { color: var(--coral); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.out {
  animation: toastOut 0.25s forwards;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ---------- app shell ---------- */
.app-layout {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--card);
  border-inline-start: 1px solid var(--line);
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s var(--ease);
}
.sidebar-head {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
  gap: 8px;
}
.sidebar-head .brand { flex: 1; }
.sidebar-close { display: none; }
.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
}
.topbar-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.topbar-brand .brand-mark svg { width: 17px; height: 17px; }
.sidebar-body {
  padding: 18px 14px;
  overflow-y: auto;
  flex: 1;
}
.side-group {
  margin-bottom: 22px;
}
.side-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  padding: 0 12px 8px;
  text-transform: uppercase;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.16s;
  margin-bottom: 3px;
}
.side-link .icon {
  width: 19px;
  height: 19px;
}
.side-link:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.side-link.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}
.side-link .count {
  margin-inline-start: auto;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}
.side-link.active .count {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
}
.side-cta {
  margin: 8px 8px 18px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(150deg, #047857, #10b981 55%, #10b981 160%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.side-cta::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  top: -45px;
  left: -30px;
}
.side-cta h4 {
  font-size: 13.5px;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.side-cta p {
  font-size: 11.5px;
  opacity: 0.88;
  line-height: 1.7;
  margin-bottom: 11px;
  position: relative;
  z-index: 1;
}
.side-cta .btn {
  position: relative;
  z-index: 1;
  min-height: 32px;
  font-size: 11.5px;
  padding: 5px 12px;
  background: #fff;
  color: #065f46;
  box-shadow: none;
}
.side-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  flex: none;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 12px;
  transition: 0.16s;
}
.side-user:hover { background: var(--bg-2); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--brand-soft);
}
.avatar-lg { width: 44px; height: 44px; }
.side-user .name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}
.side-user .mail {
  font-size: 10.5px;
  color: var(--muted-2);
  direction: ltr;
  text-align: right;
}
.app-main {
  flex: 1;
  min-width: 0;
  margin-inline-start: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(16px, 3vw, 30px);
}
.topbar-title {
  font-size: 15px;
  font-weight: 800;
}
.topbar-title span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-2);
  line-height: 1.4;
}
.topbar-search {
  position: relative;
  width: min(320px, 32vw);
  margin-inline-start: 8px;
}
.topbar-search .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}
.topbar-search input {
  width: 100%;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 38px 0 14px;
  font-size: 12.5px;
  outline: 0;
}
.topbar-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.topbar-search kbd {
  position: absolute;
  inset-inline-end: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--muted-2);
  background: var(--bg-2);
}
.topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-dot {
  position: relative;
}
.notif-dot::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--bg);
}
.content {
  padding: clamp(20px, 3vw, 32px);
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.4;
}
.page-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 5px;
}
.page-head-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

/* mobile bottom tabbar */
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  align-items: flex-end;
  justify-content: space-around;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-2);
  padding: 3px 8px;
  min-width: 52px;
  border-radius: 10px;
  transition: 0.16s;
}
.tab-item .icon {
  width: 21px;
  height: 21px;
}
.tab-item.active {
  color: var(--brand);
}
.tab-item-create {
  margin-top: -22px;
}
.tab-item-create .tab-fab {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--brand), #10b981);
  color: var(--brand-contrast);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(4, 120, 87, 0.4);
  border: 4px solid var(--bg);
}
.tab-item-create .tab-fab .icon {
  width: 23px;
  height: 23px;
}
.tab-item-create span:last-child {
  font-size: 9.5px;
  margin-top: 1px;
}

/* sidebar mobile overlay */
.sidebar-backdrop {
  display: none;
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .footer-news { grid-column: 1 / -1; max-width: 420px; }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .sidebar {
    transform: translateX(105%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 28, 0.5);
    backdrop-filter: blur(3px);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
  .app-main {
    margin-inline-start: 0;
  }
  .mobile-tabbar {
    display: flex;
  }
  .app-layout.has-tabbar .content {
    padding-bottom: 96px;
  }
  .topbar { padding-inline: 16px; }
  .topbar-title { display: none; }
  .topbar-brand { display: inline-flex; }
  .topbar-search { width: auto; flex: 1; max-width: 300px; margin-inline-start: 4px; }
  .topbar-search kbd { display: none; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-close { display: inline-flex; }
  .sidebar-toggle, .topbar-brand, .topbar-actions { flex: none; }
}

@media (max-width: 700px) {
  .topbar { padding-inline: 13px; gap: 7px; }
  .topbar-search { display: none; }
  .topbar-actions > .btn:first-child { display: none; }
  .topbar-actions { gap: 2px; }
  .topbar-brand { font-size: 15px; }
  .topbar-brand .brand-mark { width: 28px; height: 28px; }
}
@media (min-width: 901px) {
  .sidebar-toggle { display: none; }
}

@media (max-width: 700px) {
  body { font-size: 15px; }
  .container { padding-inline: 18px; }
  .header-actions .login-btn { display: none; }
  .header-actions .divider { display: none; }
  .brand { font-size: 19px; }
  .brand small { display: none; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-news { grid-column: 1 / -1; }
  .footer-bottom { justify-content: center; text-align: center; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px;
  }
  .modal-panel.wide { width: 100%; }
  .toast-wrap {
    inset-inline: 12px;
    bottom: 84px;
    align-items: center;
  }
  .toast { max-width: 100%; width: 100%; }
  .page-head { align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
}

@media (max-width: 430px) {
  .container { padding-inline: 15px; }
  .btn-lg { min-height: 50px; padding: 12px 22px; font-size: 15px; }
  .header-actions .btn-primary { padding: 8px 14px; font-size: 12.5px; min-height: 38px; }
  .footer-grid { grid-template-columns: 1fr; }
}
