@font-face {
  font-family: "Vazir";
  src: url("asset/Vazir-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir";
  src: url("asset/Vazir-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir";
  src: url("asset/Vazir-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sidebar-width: 355px;
  --sidebar-collapsed-width: 84px;
  --sidebar-transition: 300ms cubic-bezier(0.22, 1, 0.36, 1);

  --text: #2f332d;
  --muted: #747a70;
  --panel: #fffdf8;
  --panel-2: #f7f2e8;
  --card: #ffffff;
  --card-2: #fbf6ed;
  --line: rgba(47,51,45,.09);
  --line-2: rgba(47,51,45,.16);
  --accent: #b7791f;
  --accent-2: #975a16;
  --accent-3: rgba(183,121,31,.13);
  --danger: #dc2626;
  --warning: #d97706;
  --input-bg: #f5efe4;
  --btn-text: #ffffff;

  --page-grad: radial-gradient(circle at 12% 8%, rgba(183,121,31,.08), transparent 22%),
               linear-gradient(180deg, #fbf7ef 0%, #f1eadf 100%);
  --texture: none;

  --radius-shell: 24px;
  --radius-panel: 22px;
  --radius-card: 18px;
  --radius-input: 14px;
  --radius-chip: 999px;

  --panel-border: 1px solid rgba(47,51,45,.07);
  --card-border: 1px solid rgba(47,51,45,.075);

  --shadow-shell: 0 18px 38px rgba(64,54,38,.08);
  --shadow-panel: 0 12px 26px rgba(64,54,38,.065);
  --shadow-card: 0 8px 18px rgba(64,54,38,.055);

  --panel-blur: none;
  --card-blur: none;

  --header-bg: rgba(255,253,248,.92);
  --button-style-bg: #f6efe4;
  --button-style-border: 1px solid rgba(47,51,45,.09);
  --input-border: 1px solid rgba(47,51,45,.10);
  --input-shadow: none;

  --card-highlight: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.92));
  --panel-highlight: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88));
  --grid-overlay-opacity: 0;

  --font-main: "Vazir", Tahoma, Arial, sans-serif;
  --title-spacing: 0;

  --surface: var(--panel);
  --surface-2: var(--panel-2);
  --surface-3: var(--card);
  --surface-4: var(--card-2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.app-loading {
  visibility: hidden;
}

body.app-ready {
  visibility: visible;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 500;
  color: var(--text);
  background: var(--page-grad);
  background-attachment: fixed;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--texture);
  background-size: 18px 18px;
  opacity: var(--grid-overlay-opacity);
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

input,
select,
textarea {
  color: var(--text);
  font-weight: 500;
}

::selection {
  background: var(--accent);
  color: var(--btn-text);
}

/* =========================
   Layout
========================= */

.layout {
  height: 100vh;
  display: grid;
  grid-template-rows: 60px 1fr;
  gap: 10px;
  padding: 10px;
}

/* =========================
   Topbar
========================= */

.topbar {
  background: var(--header-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  min-height: 60px;
}

.app-title {
  min-width: 0;
}

.app-title h1 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: var(--title-spacing);
  color: var(--text);
}

.app-title p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}

.end-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-control,
.student-control {
  display: flex;
  margin-left: 30px;
  align-items: center;
  gap: 8px;
}

.theme-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 700;
}

.theme-select,
.student-name-input {
  height: 36px;
  min-width: 180px;
  padding: 0 12px;
  border-radius: var(--radius-input);
  border: var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  box-shadow: var(--input-shadow);
  transition: 0.15s ease;
  font-size: 14px;
  font-weight: 500;
}

/* theme select custom arrow */
.theme-control {
  position: relative;
}

.theme-control::after {
  content: "⌄";
  position: absolute;
  left: 14px;
  bottom: 11px;
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

.theme-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.theme-select:hover,
.student-name-input:hover,
.search-wrap input:hover,
.field input:hover {
  border-color: var(--line-2);
}

.theme-select:focus,
.student-name-input:focus,
.search-wrap input:focus,
.field input:focus {
  border-color: var(--accent);
  outline: none;
}

/* keep these (used for some browsers/menus) */
.theme-select:focus {
  box-shadow: 0 0 0 4px var(--accent-3);
}

.theme-select option {
  background-color: var(--panel);
  color: var(--text);
  font-weight: 500;
}

.theme-select option:checked {
  background-color: var(--accent);
  color: var(--btn-text);
}

/* =========================
   Workspace
========================= */

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 10px;
  min-height: 0;
  direction: ltr;
}

.sidebar,
.main {
  direction: rtl;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: var(--panel-highlight), var(--surface);
  box-shadow: var(--shadow-panel);
}

/* =========================
   Sidebar
========================= */

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}

.search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 12px;
  border-radius: var(--radius-input);
  border: var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font-weight: 500;
}

.search-wrap input::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
}

.categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.category-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s ease;
}

.category-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.category-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--btn-text);
  border-color: transparent;
}

.exercise-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.section-title span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}

.exercise-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-left: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.exercise-card {
  background: var(--card-highlight), var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 10px 11px;
  margin: 4px 0 8px;
  cursor: grab;
  user-select: none;
  transition: 0.14s ease;
}

.exercise-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.exercise-card:active {
  cursor: grabbing;
}

.exercise-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.exercise-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.exercise-tag {
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-3);
  padding: 3px 7px;
  border-radius: var(--radius-chip);
  white-space: nowrap;
  border: 1px solid rgba(123, 227, 161, 0.12);
  font-weight: 500;
}

.exercise-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}

.footer-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding-top: 8px;
  font-weight: 300;
}

/* =========================
   Main
========================= */

.main {
  display: flex;
  flex-direction: column;
  background: var(--panel-highlight),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.005)),
    var(--surface);
}

.main-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
}

.page-title h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: var(--title-spacing);
  color: var(--text);
}

.page-title p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}

.days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.day-btn,
.add-day-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s ease;
}

.day-btn:hover,
.add-day-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.day-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--btn-text);
  border-color: transparent;
}

.add-day-btn {
  color: var(--accent);
}

/* =========================
   Workout Area
========================= */

.workout-area {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
}

.dropzone {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.004)), var(--surface-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropzone-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.dropzone-title h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.dropzone-title p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}

.dropzone-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-pill {
  padding: 7px 10px;
  border-radius: var(--radius-chip);
  background: var(--accent-3);
  color: var(--accent);
  border: 1px solid rgba(123, 227, 161, 0.12);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.paste-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s ease;
}

.paste-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.paste-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.workout-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.empty-state {
  min-height: 220px;
  height: 100%;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-card);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  padding: 20px;
  font-weight: 300;
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 6px;
  font-weight: 700;
}

.empty-state span {
  color: var(--accent);
  font-weight: 700;
}

/* =========================
   Workout Item
========================= */

.workout-item {
  border: 1px solid var(--line);
  background: var(--card-highlight), var(--surface-3);
  border-radius: var(--radius-card);
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  cursor: grab;
  transition: 0.14s ease;
}

.workout-item:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.workout-item:active {
  cursor: grabbing;
}

.workout-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.drag-handle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--muted);
  font-weight: 700;
}

.workout-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.workout-category {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-chip);
  color: var(--accent);
  background: var(--accent-3);
  border: 1px solid rgba(123, 227, 161, 0.12);
}

.workout-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.field {
  border: 1px solid var(--line);
  background: var(--surface-4);
  border-radius: 12px;
  padding: 8px;
}

.field label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.field-control {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  gap: 6px;
  align-items: center;
}

.field input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  text-align: center;
  font-weight: 700;
  color: var(--text);
}

.field input::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.mini-step {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-style-bg);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  transition: 0.15s ease;
}

.mini-step:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--btn-text);
  border-color: transparent;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.item-actions {
  display: flex;
}

.export-btn {
  margin-left: 10px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  background-color: var(--accent);
  color: var(--btn-text);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
      background-color 0.2s ease,
      color 0.2s ease,
      border-color 0.2s ease,
      box-shadow 0.2s ease,
      transform 0.15s ease;
}

.export-btn:hover {
  filter: brightness(1.05);
}

.export-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.export-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* منوی خروجی شبیه منوهای ویندوز */
.export-menu {
  position: absolute;
  background: #f9f9f9;
  border-radius: 3px;
  padding: 4px 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.25);
  z-index: 999;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  border: 1px solid #cccccc;
}

/* آیتم‌های منو */
.export-menu button {
  background: transparent;
  border: none;
  width: 100%;
  text-align: right;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* هاور مثل منوی ویندوز */
.export-menu button:hover {
  background-color: #e5f1fb;
}

/* جداکننده */
.export-menu button:first-child {
  border-bottom: 1px solid #dddddd;
}

/* کلاس مخفی‌کننده */
.hidden {
  display: none !important;
}

.action-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--text);
  cursor: pointer;
  transition: 0.15s ease;
  font-weight: 500;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.action-btn.delete {
  color: var(--danger);
}

.action-btn.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.action-btn.copy {
  color: var(--accent);
}

.action-btn.subset-btn {
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
}

/* =========================
   Subsets
========================= */

.subsets-wrap {
  width: 100%;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subset-item {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-4);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.subset-remove {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 125, 0.22);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
}

.subset-remove:hover {
  border-color: var(--danger);
}

/* =========================
   Drag States
========================= */

.ghost-line {
  height: 72px;
  border-radius: 14px;
  border: 1px dashed var(--accent);
  background: var(--accent-3);
  margin-bottom: 8px;
  pointer-events: none;
}

.drag-over,
.dropzone.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(123, 227, 161, 0.12);
}

.dragging {
  opacity: 0.55;
}

/* =========================
   Scrollbar
========================= */

.exercise-list::-webkit-scrollbar,
.workout-list::-webkit-scrollbar {
  width: 8px;
}

.exercise-list::-webkit-scrollbar-track,
.workout-list::-webkit-scrollbar-track {
  background: transparent;
}

.exercise-list::-webkit-scrollbar-thumb,
.workout-list::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 999px;
}

.exercise-list::-webkit-scrollbar-thumb:hover,
.workout-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* =========================
   Responsive
========================= */

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .layout {
    height: auto;
    min-height: 100vh;
  }

  .workspace {
    grid-template-columns: 1fr;
    direction: rtl;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .end-box {
    width: 100%;
    justify-content: flex-start;
  }

  .theme-control,
  .student-control {
    width: 100%;
  }

  .theme-select,
  .student-name-input {
    min-width: 0;
    width: 100%;
  }

  .sidebar,
  .main {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .layout {
    padding: 8px;
    gap: 8px;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .days {
    justify-content: flex-start;
  }

  .dropzone-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .workout-item {
    grid-template-columns: 1fr;
  }

  .workout-fields {
    grid-template-columns: 1fr;
  }

  .subset-item {
    grid-template-columns: 1fr;
  }

  .item-actions {
    width: 100%;
  }

  .action-btn {
    flex: 1;
  }
}

/* =========================
   App Drawer / Right Sidebar
========================= */

.app-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.drawer-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 9px;
  flex: 0 0 auto;
  transition: 0.15s ease;
}

.drawer-toggle-btn span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.drawer-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.drawer-toggle-btn:active {
  transform: translateY(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.36);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 90;
  transition: 220ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-drawer {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(355px, calc(100vw - 20px));
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: var(--panel-highlight), var(--surface);
  box-shadow: 
    var(--shadow-shell),
    0 24px 70px rgba(0, 0, 0, 0.18);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 18px));
  opacity: 0;
  visibility: hidden;
  transition: var(--sidebar-transition);
  direction: rtl;
}

.app-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.app-drawer-header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.app-drawer-header h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.app-drawer-header p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: 0.15s ease;
}

.drawer-close-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  transform: translateY(-1px);
}

.app-drawer-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

/* placeholder اختیاری برای زمانی که خالی است */
.app-drawer-body:empty::before {
  content: "فعلاً آیتمی داخل این منو نیست";
  min-height: 160px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-card);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 300;
}

/* وقتی دراور باز است، اسکرول پشت صفحه کنترل شود */
body.drawer-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .app-title-wrap {
    width: 100%;
  }

  .drawer-toggle-btn {
    width: 38px;
    height: 38px;
  }

  .app-drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    border-radius: 20px;
  }
}

/* =========================
   Drawer Students / Programs
========================= */

.add-student-btn {
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius-input);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--btn-text);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
  margin-bottom: 12px;
}

.add-student-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.drawer-students-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-student-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card-highlight), var(--surface-3);
  overflow: visible;
}

.drawer-student-head {
  width: 100%;
  min-height: 48px;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: right;
}

.drawer-student-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-student-arrow {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--button-style-bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: 0.18s ease;
}

.drawer-student-arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  transition: 0.18s ease;
}

.drawer-student-head:hover .drawer-student-arrow {
  border-color: var(--accent);
  color: var(--accent);
}

.drawer-student-item.is-open .drawer-student-arrow svg {
  transform: rotate(180deg);
}

.drawer-student-body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 10px;
  background: rgba(255, 255, 255, 0.015);
  overflow: visible;
}

.drawer-student-item.is-open .drawer-student-body {
  display: block;
}

.add-program-btn {
  width: 100%;
  min-height: 36px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  transition: 0.15s ease;
}

.add-program-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.drawer-programs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-program-item {
  position: relative;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-4);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
}

.drawer-program-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.drawer-program-name:hover {
  color: var(--accent);
}

.program-more-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: 0.15s ease;
}

.program-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.program-menu {
  position: absolute;
  left: 8px;
  top: 38px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  padding: 5px;
  z-index: 999;
  display: none;
}

.drawer-program-item.menu-open .program-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.program-menu button {
  width: 100%;
  min-height: 32px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  padding: 0 9px;
  transition: 0.15s ease;
}

.program-menu button:hover {
  background: var(--accent-3);
  color: var(--accent);
}

.program-menu button.delete-program-action {
  color: var(--danger);
}

.program-menu button.delete-program-action:hover {
  background: rgba(220, 38, 38, 0.09);
  color: var(--danger);
}

.drawer-empty-text {
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-2);
  font-weight: 300;
}

.drawer-program-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-3) inset;
}

.drawer-program-item.is-active .drawer-program-name {
  color: var(--accent);
}

.drawer-student-head-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
}

.drawer-student-head {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.student-more-btn {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer-student-item,
.drawer-program-item {
  position: relative;
}

.program-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 160px;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 6px;
  display: none;
}

.drawer-student-item.menu-open > .drawer-student-head-wrap .student-menu,
.drawer-program-item.menu-open > .program-menu {
  display: block;
}

.program-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.program-menu button:hover {
  background: rgba(0,0,0,0.06);
}

.icon-more-btn {
  margin-left: 10px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: currentColor;
  opacity: 0.65;
  flex: 0 0 auto;
}

.icon-more-btn:hover {
  opacity: 1;
}

.icon-more-btn:focus,
.icon-more-btn:active {
  outline: none;
  background: transparent;
  box-shadow: none;
}

.more-dots-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}