@font-face {
    font-family: "Yekan";
    src:
        url("../fonts/YekanBakh-VF.woff2") format("woff2"),
        url("../fonts/YekanBakh-VF.woff") format("woff");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}
svg{
  height: 18px;
  width: 18px;
  top:5px;
  margin-left: 5px;
  position: relative
}
.search-breadcrumb svg {
  height: 16px;
  width: 16px;
  top: 0;
  margin-left: 6px;
}
.faq-link svg {
  height: 16px;
  width: 16px;
  top: 0;
  margin-left: 6px;
}
.stat svg {
  height: 16px;
  width: 16px;
  top: 2px;
  margin-left: 6px;
}
.theme-toggle-btn svg{
  height: 22px;
  width: 22px;
  top:5px
}
.badges svg{
  height: 18px;
  width: 18px;
  top:6px;
  margin-left: 4px;
}
.field-header svg{
  height: 18px;
  width: 18px;
  top:6px;
  margin-left: 4px;
}
h2 svg{
  height: 50px;
  width: 50px;
  top:39px;
  margin-left: 10px;
}
.hero-icon svg{
  height: 50px;
  width: 50px;
  top:15px;
  margin:0;
}
.welcome-card h3 svg{
  height: 20px;
  width: 20px;
  top:0;
  margin:0;
}
.welcome-card svg{
  height: 40px;
  width: 40px;
  top:0;
  margin-left:5px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --sidebar-w: 380px;
  --primary: #3b5bdb;
  --primary-dark: #2c4bc3;
  --primary-light: #e7ebff;
  --success: #2859c5;
  --warning: #ad1e61;
  --danger: #c92a2a;
  --bg: #f4f4f4;
  --card-bg: #ffffff;
  --sidebar-bg: #111827;
  --sidebar-text: #8fbffa;
  --sidebar-active: #3b5bdb;
  --border: #e5e7eb;
  --text-dark: #1f2937;
  --text-mid: #4b5563;
  --text-light: #9ca3af;
  --radius: 20px;
  --border: 1px solid #eef2f9;
  --border-bottom: none;
  --border-left: none;
  --border-radius: 15px;
  ---webkit-box-shadow: 0 8px 24px hsla(210,8%,62%,.2);
  ---webkit-box-shadow: 0 6px 10px 0 rgba(178,189,206,.2);
  --box-shadow: 0 6px 10px 0 rgba(178,189,206,.2);
}
:root body.dark-theme {
    --success:#8fbffa
}
/* Dark mode overrides */
body.dark-theme {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --text-dark: #f8fafc;
  --text-mid: #cbd5e1;
  --text-light: #64748b;
  --primary-light: #4d607e87;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

html { scroll-behavior: smooth; }
body {
  font-family:Yekan;
  background: var(--bg);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.7;
  transition: background 0.25s, color 0.25s;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #1f2937;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

.sidebar-brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #1f2937;
}
.sidebar-brand h2 { font-size: 1.9rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.sidebar-brand p { font-size: 1.16rem; color: #8aa2c4; line-height: 0;margin: 7px 67px 30px 0;}
.sidebar-brand .brand-stats {
  display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.sidebar-brand h2{
  color:#cae2ff;
}
.sidebar-brand .stat {
  background: #1e293b; padding: 12px 10px; border-radius: 13px;
  font-size: 0.81rem; color: #60a5fa; font-weight: 600;
  display: grid;
  grid-template-columns: 1fr 2fr;
}

.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid #1f2937;
}
.sidebar-search input {
  width: 100%; background: #1e293b; border: none;
  border-radius: 12px; padding: 8px 12px; color: #fff; font-family: Yekan;
  font-size: 0.8rem; outline: none;
  height: 45px;
}
.sidebar-search input::placeholder { color:#cae2ff }
body.dark-theme .sidebar-search input::placeholder { color: #cae2ff }
.sidebar-search input:focus { border-color: var(--primary); }

.sidebar-nav { padding: 8px 0 80px; }

.nav-group { border-bottom: 1px solid #49628536; }
.nav-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s;
  color: #daeaff;
}
.nav-group-header:hover { background: #1f2937; color: #fff; }
.nav-group-header.active { background: #1e293b; color: #fff; border-right: 3px solid var(--primary); }
.nav-icon { font-size: 1rem; flex-shrink: 0; }
.nav-label { flex: 1; font-size: 0.9rem; font-weight: 500; }
.nav-count { background: #3b445a; padding: 0 10px; border-radius: 10px; font-size: 0.88rem; color: #d9e7ff; }
.nav-chevron {font-size: 22px;color: #8fbffa9e;transition: transform 0.2s;line-height: 0;margin-top: 5px;}
.nav-chevron.open { transform: rotate(180deg); margin: 0;}
body.dark-theme .nav-count {
  color:#ececec;
}
/* TREE-BASED LAYOUT CSS */
.nav-children {
  display: none;
  background: #0b0f19;
  margin-right: 20px;
  border-right: 1.5px dashed #7a8aa3;
  padding-right: 8px;
  position: relative;
}
.nav-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.15s;
  border-right: 2px solid transparent;
  position: relative;
  border-radius: 10px;
  margin: 6px;
}
.nav-child::before {
  content: '';
  position: absolute;
  right: -13px; /* Extends right to meet the dashed vertical border */
  top: 50%;
  width: 10px; /* Horizontal connector line */
  height: 1.5px;
  background: #7a8aa3;
}
.nav-child:hover { background: #1e293b; color: #fff; }
.nav-child.active { background: #1e293b; color: #8fbffa; }
.nav-child.active::before { background: var(--primary); }
.nav-child small { background: #7d848e40; padding: 2px 6px; border-radius: 8px; font-size: 0.75rem; line-height: 1.4;}

.nav-section-divider { height: 1px; background: transparent; margin: 12px 0; }
.sidebar-section-title { padding: 16px; color: #cae2ff; font-size: 01rem; font-weight: 700; text-transform: uppercase; }

/* ===== MAIN CONTENT ===== */
main {
  margin-right: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  padding: 0; overflow-x: hidden;
}

.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 32px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.25s, border-color 0.25s;
}
body.dark-theme .topbar { background: #1e293b; }
.topbar .breadcrumb { font-size: .9rem; color: var(--text-mid); }
.topbar .breadcrumb span { color: var(--primary); font-weight: 700; }
body.dark-theme .topbar .breadcrumb span { color:#8fbffa; }
.topbar-search { margin-right: auto; display: flex; align-items: center; gap: 12px; }
.topbar-search input {
   border-radius: 12px;
   padding: 7px 14px;
   font-family: Yekan;
   font-size: 0.82rem;
   outline: none;
   width: 250px;
   color: var(--text-dark);
   background: #cccccc38;
   height: 45px;
   border: none;
}
body.dark-theme .theme-toggle-btn, 
body.dark-theme .topbar-search input{
  background: #5d7cae30;
  color: #b2d4ff !important;
}
body.dark-theme .topbar-search input::placeholder{
  color: #b2d4ff !important;
}
.topbar-search input:focus { border-color: var(--primary); }
.theme-toggle-btn {
  background: #cccccc38;
  border: none;
  border-radius: 12px;
  width: 45px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  color: var(--text-dark);
}
.theme-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.content-wrapper { padding: 28px 32px 60px; max-width: 100%; }

/* ===== WELCOME ===== */
#welcome-panel { display: flex; flex-direction: column; gap: 24px; }
.welcome-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border-radius: var(--radius); padding: 35px 40px; color: #e8f2ff; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.welcome-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; color: #fff;}
.welcome-hero p { opacity: 0.9;  line-height: 1.8; }
.welcome-hero .badges { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-hero .badge {
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  padding: 8px 15px 11px; border-radius: 11px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
}
.welcome-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; }
.welcome-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 30px 15px;
  border: 1px solid var(--border); cursor: pointer; transition: all 0.2s;
  text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.welcome-cards .welcome-card{
  height: 200px
}
.welcome-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.welcome-card .wc-icon { font-size: 2rem; margin-bottom: 10px; }
.welcome-card .wc-title { font-size: 0.9rem; font-weight: 700; color: #000; margin-bottom: 4px; }
.welcome-card .wc-count { font-size: 0.85rem; color: #2d5dc8; }
body.dark-theme .welcome-card .wc-title {
  color:#fff
}
body.dark-theme .welcome-card .wc-count {
  color:#8fbffa;
}
/* ===== SECTION HERO ===== */
.section-panel { display: none; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.section-hero {
  background: linear-gradient(135deg, #d9e8fa 0%, #e8eeff 100%);
  border-radius: var(--radius); padding: 28px 32px; color: #2859c5;
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
body.dark-theme .section-hero {
  background: #ffffff1c !important;
  color: #8fbffa;
}
.hero-icon { font-size: 2.5rem; }
.hero-text h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.hero-text p { opacity: 0.8; font-size: 0.9rem; }

/* ===== SUBSECTION ===== */
.sub-section { margin-bottom: 28px; }
.sub-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); border-bottom: 2px solid var(--primary);
  margin-bottom: 15px;
  border-radius: 20px 20px 0 0;
}
.sub-section-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-dark); }

.fields-section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-weight: 700; font-size: 1.4rem;
  color: #163374; margin-bottom: 2px;
}
body.dark-theme .fields-section-title {
  color: #d5e8ff;
}
.count-badge {
  font-size: 13px;
  font-weight: 700;
}

/* ===== FIELD CARD ===== */
.fields-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.field-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden; transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.field-card:hover { box-shadow: var(--shadow); border-color: #cbd5e1; }
body.dark-theme .field-card:hover { border-color: #475569; }
.field-card:target { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,0.15); }

.field-header {
  padding: 14px 18px 10px; background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--border);
}
.field-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.field-title { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); flex: 1; line-height: 2.5; }
.field-type-badge {
  background: var(--bg); color: var(--text-mid); padding: 6px 12px 9px;
  border-radius: 11px; font-size: 0.82rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border);
}
.field-id-row { display: flex; align-items: center; gap: 6px; }
.field-id-label { font-size: 0.82rem; color: var(--text-light); }
.field-id { background: var(--bg); color: var(--text-mid); padding: 8px; border-radius: 10px; font-size: 0.72rem; font-family: monospace; border: 1px solid var(--border); }
body.dark-theme .field-id-label {
  color: #a1b1d5;
}
.field-body { padding: 18px; }
.field-description { color: var(--text-mid); font-size: 0.88rem; line-height: 1.8; margin-bottom: 8px; }
.field-options { margin-top: 8px; font-size: 0.82rem; color: var(--text-mid); }
.opt-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; margin: 2px; }
.opt-tag code { background: rgba(0,0,0,0.05); padding: 0 4px; border-radius: 3px; font-size: 0.7rem; color: var(--text-dark); }

.field-tip {
  background: rgb(229, 241, 255); border-right: 3px solid #2859c5; border-radius: 11px 0 0 11px;
  padding: 16px 12px; margin-top: 8px; font-size: 0.82rem; color: #2859c5; line-height: 1.7;
}
body.dark-theme .field-tip {
  background: rgba(229, 241, 255, 0.26);
  color: #b8d8ff;
  border-color: #cae2ff;
}
.field-warning {
  background: rgba(173, 30, 97, 0.1); border-right: 3px solid #ad1e61; border-radius: 11px 0 0 11px;
  padding: 16px 12px; margin-top: 8px; font-size: 0.82rem; color: #ad1e61; line-height: 1.7;
}
body.dark-theme .field-warning { color: #ed60a2; background: #8f114c47;}

.empty-section {
  background: rgba(0,0,0,0.01); border: 1px dashed var(--border); border-radius: 8px;
  padding: 20px; text-align: center; color: var(--text-light); font-size: 0.85rem; margin: 8px 0;
}

/* ===== FAQ SECTION STYLES ===== */
.faq-container { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 15px;
  overflow: hidden; transition: all 0.2s;
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-question {
  display: flex;
  padding: 16px20px;
  tart;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dark);
  transition: background 0.15s;
  user-select: none;
  border-radius: 7px;
}
.faq-question:hover { background: rgba(0,0,0,0.02); }
.faq-q-text { flex: 1; line-height: 1.6; }
.faq-chevron {font-size: 22px;color: var(--text-light);transition: transform 0.2s;margin-top: 3px;line-height: 1;}
.faq-chevron.open { transform: rotate(180deg); }
.faq-answer {
  padding: 18px 20px; color: var(--text-mid); font-size: 0.88rem; line-height: 1.8;
  border-top: 1px solid var(--border); background: rgba(0,0,0,0.01);
}
.faq-answer strong { color: var(--text-dark); font-weight: 700; }
.faq-answer code {
  background: var(--bg); color: var(--text-dark); padding: 6px; border-radius: 9px;
   font-size: .85rem; border: 1px solid var(--border);
  font-family: Yekan;
}
.faq-answer a { color: var(--primary); text-decoration: none; border-bottom: 1px solid #bfdbfe; }
.faq-answer a:hover { color: var(--primary-dark); }

/* Global Search highlight and breadcrumb */
.search-highlight {
  animation: flashHighlight 3s ease-out;
  border-color: var(--primary) !important;
}
@keyframes flashHighlight {
  0% { box-shadow: 0 0 0 4px rgba(59, 91, 219, 0.4); background: var(--primary-light); }
  100% { box-shadow: none; background: var(--card-bg); }
}
.search-breadcrumb {
  background: rgba(0,0,0,0.03);
  padding: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
}

.highlight { background: #fef08a !important; border-radius: 2px; }
body.dark-theme .highlight { background: #854d0e !important; color: #fef08a !important; }
.section-hero,
.topbar-search input,
.theme-toggle-btn,
.sidebar-brand .stat,
.sidebar-search input,
.nav-child,
.nav-count,
.field-id,
.field-type-badge,
.field-card,
.welcome-hero,
.welcome-hero .badge,
.welcome-card,
.faq-item{
    @supports(corner-shape:superellipse(2)) {
        corner-shape: superellipse(2) !important
    }
    @supports(corner-shape:squircle) {
        border-radius: 40px !important;
        corner-shape: squircle !important
    }
}
.sub-section-header{
      @supports(corner-shape:superellipse(2)) {
        corner-shape: superellipse(2) !important
    }
    @supports(corner-shape:squircle) {
        border-radius: 40px 40px 0 0 !important;
        corner-shape: squircle !important
    }
}
.field-warning,
.field-tip {
        @supports(corner-shape:superellipse(2)) {
        corner-shape: superellipse(2) !important
    }
    @supports(corner-shape:squircle) {
        border-radius: 40px 0 0 40px !important;
        corner-shape: squircle !important
    }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  main { margin-right: 0; }
  .content-wrapper { padding: 16px; }
}