/* ==========================================
   GYM PROGRAM - Editor Desktop App Style
   Minimal, Clean, Professional
   ========================================== */

/* ── فونت لوکال ── */
@font-face {
  font-family: "IRANSans";
  src: url("../fonts/IRANSansWeb_Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url("../fonts/IRANSansWeb_Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url("../fonts/IRANSansWeb_Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── CSS Variables ── */
:root {
  --bg: #e8ecf1;
  --app-bg: #ffffff;
  --sidebar-bg: #fafbfc;
  --sidebar-border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-glow: rgba(37,99,235,0.1);
  --titlebar-bg: #f8f9fa;
  --titlebar-border: #e5e7eb;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --card-bg: #fafbfc;
  --input-bg: #fafbfc;
  --input-border: #e5e7eb;
  --danger: #dc2626;
  --success: #22c55e;
}

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

html {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: "IRANSans", Tahoma, Arial, sans-serif;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── APP WINDOW ── */
.layout {
  width: 100%;
  max-width: 1400px;
  height: calc(100vh - 40px);
  background: var(--app-bg);
  border-radius: 12px;
  box-shadow: 0 2px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── TOPBAR ── */
.topbar {
  height: 52px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--titlebar-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
}

.app-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.drawer-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.drawer-toggle-btn span {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.drawer-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-title h1 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.app-title p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.end-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.theme-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.theme-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.export-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ── WORKSPACE ── */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.categories::-webkit-scrollbar {
  height: 4px;
}

.categories::-webkit-scrollbar-track {
  background: transparent;
}

.categories::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.category-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.category-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.exercise-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  min-height: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

.section-title h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.section-title span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.exercise-list {
  flex: 1;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.exercise-list::-webkit-scrollbar {
  width: 4px;
}

.exercise-list::-webkit-scrollbar-track {
  background: transparent;
}

.exercise-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.exercise-card {
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: grab;
  transition: all 0.2s;
}

.exercise-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.exercise-card:active {
  cursor: grabbing;
}

.exercise-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

/* ── MAIN ── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.page-title h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}

.page-title p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.day-btn-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.day-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.day-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.day-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.day-delete-btn {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
  padding: 0;
  z-index: 2;
}

.day-btn-wrapper:hover .day-delete-btn {
  opacity: 1;
}

.day-delete-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.add-day-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.add-day-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.paste-buttons-group {
  display: flex;
  gap: 6px;
}

.paste-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.paste-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.paste-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.paste-btn.day-paste-btn {
  background: var(--card-bg);
}

/* ── WORKOUT AREA ── */
.workout-area {
  flex: 1;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}

.dropzone {
  height: 100%;
  border-radius: 10px;
  border: 2px dashed var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.workout-list {
  flex: 1;
  overflow: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.workout-list::-webkit-scrollbar {
  width: 4px;
}

.workout-list::-webkit-scrollbar-track {
  background: transparent;
}

.workout-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.workout-item {
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  cursor: grab;
  transition: all 0.2s;
}

.workout-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.workout-item:active {
  cursor: grabbing;
}

.workout-item.dragging {
  opacity: 0.5;
}

.workout-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.drag-handle {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: grab;
  overflow: hidden;
  flex-shrink: 0;
}

.drag-handle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drag-handle-icon {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 700;
}

.workout-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.workout-fields {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 8px;
}

.field {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 8px;
  padding: 8px;
}

.field label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.field input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

.field input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.mini-step {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.mini-step:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

/* ── SUBSETS ── */
.subsets-wrap {
  width: 90%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subset-item {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.subset-remove {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.subset-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ── EMPTY STATE ── */
.empty-state {
  min-height: 200px;
  height: 100%;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}

.empty-state strong {
  display: block;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 4px;
  font-weight: 600;
}

.empty-state span {
  color: var(--accent);
  font-weight: 600;
}

/* ── GHOST LINE ── */
.ghost-line {
  height: 60px;
  border-radius: 10px;
  border: 2px dashed var(--accent);
  background: var(--accent-light);
  margin-bottom: 8px;
  pointer-events: none;
}

/* ── DRAWER ── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.app-drawer {
  position: fixed;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: 340px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  box-shadow: 0 24px 70px rgba(0,0,0,0.2);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.app-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.app-drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-drawer-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.app-drawer-header p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.drawer-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.drawer-close-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.app-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
}

.drawer-students-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-student-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--app-bg);
  overflow: hidden;
}

.drawer-student-head-wrap {
  display: flex;
  align-items: center;
}

.drawer-student-head {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}

.drawer-student-name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-student-arrow svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  transition: transform 0.2s;
}

.drawer-student-item.is-open .drawer-student-arrow svg {
  transform: rotate(180deg);
}

.drawer-student-body {
  display: none;
  border-top: 1px solid var(--border);
  padding: 10px;
  background: var(--card-bg);
}

.drawer-student-item.is-open .drawer-student-body {
  display: block;
}

.drawer-program-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--app-bg);
  transition: all 0.2s;
}

.drawer-program-item.is-active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drawer-program-name {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-program-name:hover {
  color: var(--accent);
}

.program-more-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.program-more-btn:hover {
  background: var(--card-bg);
  color: var(--text);
}

.program-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 30;
  display: none;
}

.drawer-student-item.menu-open .program-menu,
.drawer-program-item.menu-open .program-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.program-menu button {
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  font-family: inherit;
  transition: all 0.15s;
}

.program-menu button:hover {
  background: var(--card-bg);
}

.program-menu button.delete-program-action {
  color: var(--danger);
}

.program-menu button.delete-program-action:hover {
  background: rgba(220,38,38,0.08);
}

.drawer-empty-text {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 280px;
  max-width: 400px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.toast-icon.success { background: rgba(34,197,94,0.12); }
.toast-icon.info { background: rgba(37,99,235,0.12); }
.toast-icon.warning { background: rgba(245,158,11,0.12); }
.toast-icon.error { background: rgba(220,38,38,0.12); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 11px;
  color: var(--text-muted);
}

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--card-bg);
  color: var(--text);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 0 10px;
}

/* ── CONTEXT MENU ── */
.day-context-menu {
  position: fixed;
  z-index: 10001;
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.day-context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  border-radius: 6px;
  font-family: inherit;
  transition: all 0.15s;
}

.day-context-menu-item:hover {
  background: var(--card-bg);
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  body {
    padding: 0;
  }

  .layout {
    border-radius: 0;
    height: 100vh;
    max-width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: 40vh;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px;
  }

  .end-box {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .workout-item {
    grid-template-columns: 1fr;
  }
}

/* ── DRAWER SEARCH ── */
.drawer-search-wrap input {
  width: 100%;
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s;
}

.drawer-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* آیکون dots بیشتر */
.icon-more-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  border-radius: 6px;
}

.icon-more-btn:hover {
  background: var(--card-bg);
  color: var(--text);
}

.more-dots-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* پوزیشن relative برای menu */
.drawer-student-item,
.drawer-program-item {
  position: relative;
}

/* دکمه‌های آیکون در topbar */
.title-bar-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  text-decoration: none;
}

.title-bar-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* مخفی کردن export-btn قدیمی */
.export-btn {
  display: none;
}

/* منوی export */
.export-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--app-bg);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  z-index: 999;
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.export-menu button {
  background: transparent;
  border: none;
  width: 100%;
  text-align: right;
  padding: 9px 14px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

.export-menu button:hover {
  background: var(--card-bg);
  color: var(--accent);
}

.export-menu button:first-child {
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* ── EXERCISE CARD ── */
.exercise-top {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.exercise-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.exercise-tag {
  font-size: 11px;
  color: var(--accent);
  font-weight: 400;
}

.exercise-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exercise-meta-separator {
  color: var(--border);
  font-weight: 300;
}

/* ── WORKOUT ITEM ── */
.workout-item {
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: grab;
  transition: all 0.2s;
}

.workout-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.workout-item:active {
  cursor: grabbing;
}

.workout-item.dragging {
  opacity: 0.5;
}

.workout-main {
  flex: 1;
}

.workout-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.drag-handle {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: grab;
  overflow: hidden;
  flex-shrink: 0;
}

.drag-handle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drag-handle-icon {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 700;
}

.workout-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

/* دکمه‌های action افقی هم‌ردیف با نام */
.item-actions {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--app-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
  padding: 0;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.action-btn.copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.subset-btn {
  width: auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.workout-fields {
  width: 86.5%;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 8px;
}