/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #58CC02;
  --green-dark: #46A302;
  --blue:       #1CB0F6;
  --purple:     #CE82FF;
  --orange:     #FF9600;
  --gray-50:    #F7F7F7;
  --gray-100:   #F0F0F0;
  --gray-200:   #E5E5E5;
  --gray-400:   #9CA3AF;
  --gray-500:   #6B7280;
  --gray-600:   #4B5563;
  --gray-700:   #374151;
  --gray-800:   #1F2937;
  --gray-900:   #111827;
  --white:      #FFFFFF;
  --radius-sm:  0.75rem;
  --radius-md:  1.25rem;
  --radius-lg:  2rem;
  --radius-xl:  2.5rem;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14);
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ===== Utilities ===== */
.container { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }
.text-green  { color: var(--green); }
.text-blue   { color: var(--blue); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-white  { color: var(--white); }
.text-gray   { color: var(--gray-500); }
.text-center { text-align: center; }
.font-black  { font-weight: 900; }
.font-bold   { font-weight: 700; }
.hidden-md   { display: none; }

@media (min-width: 768px) { .hidden-md { display: flex; } }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-img {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  background: var(--green);
  object-fit: cover;
}
.logo-title  { font-size: 1.15rem; font-weight: 900; color: var(--green); }
.logo-sub    { font-size: .65rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav a {
  font-size: .9rem; font-weight: 700; color: var(--gray-600);
  transition: color .2s;
}
.site-nav a:hover  { color: var(--green); }
.site-nav a.active { color: var(--blue); }

.nav-auth {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.btn-nav-login {
  padding: .5rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  font-weight: 700;
  font-size: .875rem;
  color: var(--gray-700);
  background: transparent;
  transition: border-color .2s, color .2s;
}
.btn-nav-login:hover { border-color: var(--green); color: var(--green); }

.btn-nav-register {
  padding: .5rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: .875rem;
  border: none;
  transition: background .2s;
}
.btn-nav-register:hover { background: var(--green-dark); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 900;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }

.btn-primary   { background: var(--green); color: var(--white); box-shadow: 0 4px 18px rgba(88,204,2,.3); }
.btn-primary:hover { background: var(--green-dark); }

.btn-outline {
  background: var(--white);
  border: 2px solid var(--gray-200);
  color: var(--green);
}
.btn-outline:hover { border-color: var(--green); }

.btn-blue   { background: var(--blue);   color: var(--white); }
.btn-purple { background: var(--purple); color: var(--white); }
.btn-full   { width: 100%; }

/* ===== Hero ===== */
.hero {
  background: var(--white);
  padding: 4.5rem 1.25rem;
}
.hero-badge {
  display: inline-block;
  background: #EFF6FF;
  color: #2563EB;
  padding: .4rem 1rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
}
.hero p {
  font-size: 1.15rem;
  color: var(--gray-600);
  max-width: 38rem;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ===== Section headings ===== */
.sec-icon {
  display: inline-flex;
  padding: 1rem;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.sec-title {
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--gray-800);
  margin-bottom: .375rem;
}

/* ===== Course card ===== */
.course-wrap {
  background: linear-gradient(135deg, #111827, #1F2937);
  border-radius: var(--radius-xl);
  padding: .25rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 2.5rem 0;
}
.course-inner {
  background: rgba(17,24,39,.5);
  border-radius: calc(var(--radius-xl) - .3rem);
  padding: 2.5rem;
}
.course-body {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .course-body { flex-direction: row; }
}
.course-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(239,68,68,.15);
  color: #F87171;
  padding: .4rem 1rem;
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.25rem;
}
.course-text h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.course-text p { color: #9CA3AF; font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.5rem; }
.course-yt-note {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: #D1D5DB;
  font-size: .9rem;
}
.course-video {
  flex: 1;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.05);
  box-shadow: var(--shadow-lg);
}
.course-video iframe { width: 100%; height: 100%; display: block; border: none; }

/* ===== Video grid ===== */
.videos-section { padding: 5rem 0; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}
.video-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gray-100);
}
.video-card iframe { width: 100%; aspect-ratio: 16/9; display: block; border: none; }
.video-card-body { padding: 1.5rem; }
.video-card-body h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: .375rem; color: var(--gray-800); }
.video-card-body p  { font-size: .875rem; color: var(--gray-600); line-height: 1.6; }

/* ===== Rules section ===== */
.rules-section { background: var(--white); padding: 5rem 0; }
.rules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
}
@media (min-width: 1024px) { .rules-grid { grid-template-columns: 1fr 1fr; } }

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.rule-item:hover { background: var(--gray-50); border-color: var(--gray-100); }
.rule-icon { color: var(--green); flex-shrink: 0; margin-top: .2rem; }
.rule-icon-blue { color: var(--blue); flex-shrink: 0; margin-top: .2rem; }
.rule-item p { font-weight: 700; font-size: 1rem; color: var(--gray-800); }

.subsec-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}
.subsec-bar { width: .35rem; height: 2rem; border-radius: 9999px; }
.bar-green  { background: var(--green); }
.bar-blue   { background: var(--blue); }

.rules-col-left { display: flex; flex-direction: column; gap: 1.5rem; }
.blue-box {
  background: #EFF6FF;
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.orange-box {
  background: #FFF7ED;
  border: 2px solid #FED7AA;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.orange-box h4 { font-weight: 900; color: #C2410C; margin-bottom: .5rem; }
.orange-box p  { color: var(--gray-700); line-height: 1.7; }

/* ===== Setup cards ===== */
.setup-section { padding: 5rem 0; }
.setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}
@media (min-width: 768px) { .setup-grid { grid-template-columns: 1fr 1fr; } }

.setup-card {
  border-radius: var(--radius-lg);
  padding: 2rem;
  border-bottom: .5rem solid;
  box-shadow: var(--shadow-lg);
  color: var(--white);
}
.setup-card.blue   { background: var(--blue);  border-color: #0284C7; }
.setup-card.green  { background: var(--green); border-color: var(--green-dark); }
.setup-card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.setup-card-head h3 { font-size: 1.35rem; font-weight: 900; }
.setup-card p { opacity: .9; margin-bottom: 1.5rem; line-height: 1.7; }
.setup-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: opacity .2s;
}
.setup-link.blue-text  { color: var(--blue); }
.setup-link.green-text { color: var(--green); }
.setup-link:hover { opacity: .9; }
.setup-items { list-style: none; margin-bottom: 1.25rem; opacity: .9; }
.setup-items li { display: flex; gap: .5rem; padding: .3rem 0; }
.setup-items li::before { content: "•"; }

/* ===== Practice hub ===== */
.practice-section { padding: 3rem 0; }
.practice-gradient {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 2.5rem;
  padding: .25rem;
  box-shadow: var(--shadow-lg);
}
.practice-inner {
  background: var(--white);
  border-radius: 2.25rem;
  padding: 4rem 2rem;
  text-align: center;
}
.practice-icon {
  display: inline-flex;
  background: #FACC15;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  animation: bounce 1s infinite;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.practice-inner h2 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
}
.practice-inner > p {
  font-size: 1.1rem;
  color: var(--gray-600);
  max-width: 44rem;
  margin: 0 auto 3rem;
  line-height: 1.7;
}
.practice-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 50rem;
  margin: 0 auto;
}
@media (min-width: 640px) { .practice-cards { grid-template-columns: 1fr 1fr; } }

.pcard {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: right;
  color: var(--white);
  transition: transform .2s;
  box-shadow: var(--shadow-lg);
}
.pcard:hover { transform: scale(1.04); }
.pcard.blue   { background: var(--blue); }
.pcard.purple { background: var(--purple); }
.pcard h4 { font-size: 1.35rem; font-weight: 900; margin-bottom: .375rem; position: relative; z-index: 1; }
.pcard p  { opacity: .9; font-size: .95rem; position: relative; z-index: 1; }
.pcard .pcard-bg-icon {
  position: absolute;
  bottom: -1.25rem;
  left: -1.25rem;
  opacity: .15;
  transition: transform .2s;
}
.pcard:hover .pcard-bg-icon { transform: scale(1.1); }
.practice-note { margin-top: 2rem; font-size: .875rem; color: var(--gray-400); font-style: italic; }

/* ===== FAQ / Support ===== */
.support-section { padding: 5rem 0; }
.support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}
@media (min-width: 1024px) { .support-grid { grid-template-columns: 2fr 1fr; } }

.support-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 2px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}
.support-card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.support-card-head h2 { font-size: 1.35rem; font-weight: 900; }
.support-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 479px) { .support-links { grid-template-columns: 1fr; } }
.slink {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  transition: background .2s;
}
.slink:hover { background: var(--gray-100); }
.slink h5 { font-weight: 700; font-size: .95rem; }
.slink p  { font-size: .75rem; color: var(--gray-500); margin-top: .1rem; }

.help-card {
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.help-card h4 { font-size: 1.35rem; font-weight: 900; margin-bottom: 1rem; }
.help-card p  { color: var(--gray-400); font-size: .9rem; line-height: 1.7; margin-bottom: 1.5rem; }
.help-email   { display: flex; align-items: center; gap: .75rem; font-weight: 700; font-size: .875rem; margin-bottom: 1.5rem; }
.help-email svg { color: var(--green); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--gray-200);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--gray-400);
  font-weight: 700;
}

/* ===== Auth – Split dark layout ===== */
.auth-split {
  min-height: 100vh;
  display: flex;
  background: #12121E;
}

/* Brand side */
.auth-brand {
  display: none;
  flex: 0 0 42%;
  background: linear-gradient(160deg, #0E0E1C 0%, #1A0838 40%, #0A1830 100%);
  position: relative;
  overflow: hidden;
  padding: 2.5rem;
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 900px) { .auth-brand { display: flex; } }

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 20%, rgba(88,204,2,.22) 0%, transparent 45%),
    radial-gradient(circle at 25% 80%, rgba(124,58,237,.25) 0%, transparent 45%);
  pointer-events: none;
}
.auth-brand-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}
.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.auth-brand-logo img  { width: 2rem; height: 2rem; border-radius: .4rem; object-fit: cover; }
.auth-brand-logo span { font-weight: 900; color: #fff; font-size: .95rem; }

.auth-brand-body {
  position: relative;
  z-index: 1;
}
.auth-brand-body h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
  margin-bottom: .85rem;
}
.auth-brand-body p {
  color: rgba(255,255,255,.55);
  font-size: .95rem;
  line-height: 1.7;
}
.auth-brand-footer {
  display: flex;
  gap: .4rem;
  position: relative;
  z-index: 1;
}
.auth-brand-footer span {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
}
.auth-brand-footer span.dot-active {
  width: 1.2rem;
  border-radius: 9999px;
  background: var(--green);
}

/* Form side */
.auth-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #13131F;
  min-height: 100vh;
}
.auth-form-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem 2rem;
}
.auth-form-topbar a {
  font-size: .8rem;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  border: 1px solid rgba(255,255,255,.12);
  padding: .4rem .85rem;
  border-radius: .45rem;
  transition: color .2s, border-color .2s;
}
.auth-form-topbar a:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.auth-form-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-form-wrap { width: 100%; max-width: 24rem; }
.auth-form-wrap h2 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: .4rem;
}
.auth-form-sub { font-size: .875rem; color: #666; margin-bottom: 1.75rem; }
.auth-form-sub a { color: var(--green); font-weight: 700; }
.auth-form-sub a:hover { text-decoration: underline; }

/* Dark input group */
.df-group { margin-bottom: .9rem; }
.df-group input {
  width: 100%;
  padding: .8rem 1rem;
  background: #1C1C2E;
  border: 1.5px solid #2A2A40;
  border-radius: .55rem;
  font-size: .9rem;
  font-family: inherit;
  color: #fff;
  transition: border-color .2s, box-shadow .2s;
  direction: ltr;
}
.df-group input::placeholder { color: #444; }
.df-group input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(88,204,2,.1);
}
.df-group input.error { border-color: #EF4444; }

.df-field-error { font-size: .78rem; color: #EF4444; margin-top: .3rem; display: none; }
.df-field-error.visible { display: block; }

.df-alert { padding: .8rem 1rem; border-radius: .55rem; font-size: .875rem; font-weight: 700; margin-bottom: 1.25rem; display: none; }
.df-alert.visible     { display: block; }
.df-alert-success { background: rgba(88,204,2,.12);    color: #8ACF44; border: 1px solid rgba(88,204,2,.3); }
.df-alert-error   { background: rgba(239,68,68,.12);   color: #F87171; border: 1px solid rgba(239,68,68,.3); }

.btn-auth {
  width: 100%;
  margin-top: 1.25rem;
  padding: .875rem;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  border: none;
  border-radius: .55rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: inherit;
}
.btn-auth:hover         { background: var(--green-dark); }
.btn-auth:active        { transform: scale(.98); }
.btn-auth:disabled      { opacity: .65; cursor: not-allowed; transform: none; }

.auth-footer-link { text-align: center; color: #555; font-size: .875rem; margin-top: 1rem; }
.auth-footer-link a { color: var(--green); font-weight: 700; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ===== Spinner ===== */
.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.spinner.visible { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 767px) {
  .site-nav { display: none; }
  .nav-auth .btn-nav-login { display: none; }
}

/* ===== Dashboard Shell ===== */
.db-shell {
  display: flex;
  min-height: 100vh;
  background: #F4F6FB;
}

/* Sidebar */
.db-sidebar {
  width: 245px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #EAECF0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.db-sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid #F2F4F7;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.db-sidebar-logo-img  { width: 2.25rem; height: 2.25rem; border-radius: .5rem; object-fit: cover; }
.db-sidebar-brand     { font-size: .875rem; font-weight: 900; color: #111827; line-height: 1.2; margin: 0; }
.db-sidebar-brand-sub { font-size: .625rem; color: #9CA3AF; font-weight: 700; }

.db-nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  overflow-y: auto;
}
.db-nav-label {
  font-size: .68rem;
  font-weight: 900;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .85rem 1rem .3rem;
}
/* .db-nav-item also carries .db-tab for JS tab switching */
.db-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  border-radius: .65rem;
  font-size: .875rem;
  font-weight: 700;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: right;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.db-nav-item:hover  { background: #F9FAFB; color: #374151; }
.db-nav-item.active { background: #F0FDE4; color: #3A8C00; }
.db-nav-item .nav-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .95rem;
  background: #F3F4F6;
  transition: background .15s;
}
.db-nav-item.active .nav-icon { background: rgba(88,204,2,.15); }
.db-nav-item:hover  .nav-icon { background: #E5E7EB; }

.db-sidebar-bottom {
  padding: 1rem .75rem;
  border-top: 1px solid #F2F4F7;
  flex-shrink: 0;
}
.db-user-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: .65rem;
  background: #F9FAFB;
  border: 1px solid #F2F4F7;
  margin-bottom: .5rem;
}
.db-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.db-user-info  { flex: 1; min-width: 0; }
.db-user-name  { font-size: .78rem; font-weight: 700; color: #1F2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-user-email { font-size: .68rem; color: #9CA3AF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  width: 100%;
  padding: .6rem;
  border: 1.5px solid #E5E7EB;
  border-radius: .65rem;
  background: transparent;
  font-size: .8rem;
  font-weight: 700;
  color: #6B7280;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-logout:hover { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

/* Content area */
.db-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.db-topbar {
  background: #fff;
  border-bottom: 1px solid #EAECF0;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.db-topbar h1 { font-size: 1.1rem; font-weight: 900; color: #111827; margin: 0; }
.db-topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.db-topbar-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-topbar-name { font-size: .875rem; font-weight: 700; color: #374151; }
.db-body { flex: 1; padding: 1.75rem 2rem; overflow-y: auto; }

/* Panels */
.db-panel        { display: none; }
.db-panel.active { display: block; }

/* Cards */
.db-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  padding: 1.75rem;
  max-width: 36rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.db-card-full  { max-width: 100%; }
.db-card-title {
  font-size: 1rem;
  font-weight: 900;
  color: #111827;
  margin-bottom: 1.5rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid #F2F4F7;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.db-card-title-icon {
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  background: #F0FDE4;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  flex-shrink: 0;
}

/* Form elements inside dashboard */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid #E5E7EB;
  border-radius: .55rem;
  font-size: .9rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(88,204,2,.1);
}
.form-group input.error    { border-color: #EF4444; }
.form-group input:disabled { background: #F9FAFB; color: #9CA3AF; cursor: not-allowed; }

.field-hint  { display: block; font-size: .75rem; color: #9CA3AF; margin-top: .3rem; }
.field-error { font-size: .75rem; color: #EF4444; margin-top: .3rem; display: none; }
.field-error.visible { display: block; }

.alert         { padding: .8rem 1rem; border-radius: .55rem; font-size: .85rem; font-weight: 700; margin-bottom: 1.25rem; display: none; }
.alert.visible { display: block; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #86EFAC; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* Mobile sidebar */
.db-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90; }
.db-overlay.visible { display: block; }
.db-menu-toggle {
  display: none;
  position: fixed;
  top: .75rem;
  right: .75rem;
  z-index: 200;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: .5rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.15rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .db-menu-toggle { display: flex; }
  .db-sidebar {
    position: fixed;
    right: 0; top: 0;
    transform: translateX(100%);
    transition: transform .28s;
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
  }
  .db-sidebar.open { transform: translateX(0); }
  .db-topbar { padding: .875rem 1.25rem; padding-right: 4rem; }
  .db-body   { padding: 1.25rem; }
}

/* ===== Custom Form (cf-*) ===== */
.cf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
  color: #9CA3AF;
}
.cf-loading-spin {
  width: 2rem;
  height: 2rem;
  border: 3px solid #E5E7EB;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.cf-form-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1.5px solid #F2F4F7;
}
.cf-form-title { font-size: 1.75rem; font-weight: 900; color: #111827; margin-bottom: .5rem; }
.cf-form-desc  { color: #6B7280; font-size: .9rem; line-height: 1.7; }

.cf-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem 2rem;
}
.cf-field[data-type="textarea"],
.cf-field[data-type="checkbox"],
.cf-field[data-type="scale"],
.cf-field[data-type="radio"] { grid-column: 1 / -1; }
.cf-field { display: flex; flex-direction: column; }

.cf-label    { display: block; font-weight: 700; font-size: .875rem; color: #1F2937; margin-bottom: .4rem; }
.cf-required { color: #EF4444; margin-right: .15rem; }
.cf-desc     { font-size: .78rem; color: #9CA3AF; margin-bottom: .5rem; line-height: 1.6; }

.cf-input, .cf-textarea, .cf-select {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid #E5E7EB;
  border-radius: .55rem;
  font-size: .875rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  direction: auto;
}
.cf-input:focus, .cf-textarea:focus, .cf-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(88,204,2,.1);
}
.cf-input.error, .cf-textarea.error, .cf-select.error { border-color: #EF4444; }
.cf-textarea { resize: vertical; min-height: 6rem; }

.cf-options { display: flex; flex-direction: column; gap: .45rem; margin-top: .25rem; }
.cf-option {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .85rem;
  background: #FAFAFA;
  border: 1.5px solid #E5E7EB;
  border-radius: .5rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.cf-option:hover    { border-color: var(--green); background: #F0FDE4; }
.cf-option.selected { border-color: var(--green); background: #F0FDE4; }
.cf-option input[type="radio"],
.cf-option input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--green); flex-shrink: 0; }
.cf-option-text { font-size: .875rem; color: #374151; }
.cf-option.selected .cf-option-text { color: #3A8C00; font-weight: 700; }

.cf-scale-wrap { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.cf-scale-btn {
  flex: 1;
  min-width: 2.25rem;
  padding: .55rem .4rem;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: .5rem;
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  text-align: center;
  transition: all .12s;
  font-family: inherit;
  color: #374151;
}
.cf-scale-btn:hover  { border-color: var(--green); color: var(--green); }
.cf-scale-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

.cf-submit-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid #F2F4F7;
}
.cf-submit-note { font-size: .78rem; color: #9CA3AF; }
.cf-submit-bar .btn { min-width: 12rem; }

.cf-success { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; gap: 1rem; }
.cf-success.visible  { display: flex; }
.cf-success-icon { width: 5rem; height: 5rem; background: #F0FDE4; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.cf-success h3 { font-size: 1.5rem; font-weight: 900; color: #111827; }
.cf-success p  { color: #6B7280; max-width: 24rem; line-height: 1.7; font-size: .95rem; }

.cf-error-box {
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: .75rem;
  padding: 1.25rem;
  text-align: center;
  color: #B91C1C;
  font-size: .875rem;
}

@media (max-width: 600px) {
  .cf-fields { grid-template-columns: 1fr; }
  .cf-field[data-type="textarea"],
  .cf-field[data-type="checkbox"],
  .cf-field[data-type="scale"],
  .cf-field[data-type="radio"] { grid-column: auto; }
  .cf-scale-btn { min-width: 2rem; font-size: .8rem; }
}
