/* =========================================================
   CLASP — پوستهٔ روشن (پس‌زمینهٔ سفید) پنل اپراتور
   (سایدبار آیکونی، نوار بالای سفید، کارت‌های سفید با تأکید آبی)
   این فایل آخر از همه لود می‌شود و استایل‌های روشن قبلی را بازنویسی می‌کند.
   ========================================================= */

:root {
  color-scheme: light;
  --bg0: #f4f7fc;
  --bg1: #ffffff;
  --surface: #ffffff;
  --surface-flat: #f6f9ff;
  --surface-deep: #eef3fb;
  --line: rgba(30, 60, 140, .13);
  --line-2: rgba(30, 60, 140, .24);
  --text: #14213d;
  --text-2: #3b4a6b;
  --muted: #66779a;
  --blue: #2f5bf0;
  --blue-2: #2447c4;
  --blue-soft: rgba(47, 91, 240, .12);
  --green: #10b981;
  --red: #e11d48;
  --amber: #f59e0b;
  --cyan: #0ea5e9;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(30, 60, 140, .09);
  --glow: 0 0 0 1px rgba(47, 91, 240, .18), 0 10px 30px rgba(47, 91, 240, .18);
}

html { background: var(--bg0); }
html, body {
  font-family: "Vazirmatn", system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: #f4f7fc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea, .nav-btn, .btn-primary, .btn-secondary, .smart-field {
  font-family: inherit !important;
}
[data-label]::before {
  font-family: "Vazirmatn", system-ui, sans-serif !important;
  font-weight: 600;
  letter-spacing: 0;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(60, 100, 200, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 100, 200, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
::selection { background: rgba(47, 91, 240, .85); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: rgba(110, 150, 255, .35) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(110, 150, 255, .3); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

.ico { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------------------- چیدمان کلی ---------------------- */
.app-shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px; padding: 14px; min-height: 100vh; align-items: start;
}
.app-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
body main { max-width: none; margin: 0; padding: 8px 6px 40px; }

/* ---------------------- سایدبار آیکونی ---------------------- */
.rail {
  position: sticky; z-index: 100; top: 14px; height: calc(100vh - 28px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 14px 0; border-radius: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  
}
.rail-logo {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(145deg, #f4f8ff, #dbe7ff);
  box-shadow: 0 6px 18px rgba(50, 110, 255, .22), inset 0 -2px 0 rgba(40, 90, 230, .18);
  flex-shrink: 0;
}
.rail-logo img { width: 30px; height: auto; display: block; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; width: 100%; padding: 4px 0; }
@media (max-height: 640px) and (min-width: 861px) { .rail-nav { overflow-y: auto; scrollbar-width: none; } [data-label]::before { display: none; } }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-sep { width: 26px; height: 1px; background: var(--line-2); opacity: .7; margin: 6px 0; flex-shrink: 0; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; }

body .nav-btn.rail-btn {
  position: relative; width: 46px; height: 46px; padding: 0; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
}
body .nav-btn.rail-btn .ico { width: 21px; height: 21px; }
body .nav-btn.rail-btn:hover { background: rgba(47, 91, 240, .10); color: var(--blue-2); border-color: var(--line); }
body .nav-btn.rail-btn.active {
  background: linear-gradient(180deg, #5b86ff, #2f5bf0);
  color: #fff; border-color: rgba(130, 170, 255, .42);
  box-shadow: 0 8px 20px rgba(47, 91, 240, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
body .nav-btn.rail-btn.active::after {
  content: ""; position: absolute; right: -15px; top: 11px; bottom: 11px; width: 4px;
  border-radius: 4px 0 0 4px; background: linear-gradient(180deg, #7fa6ff, var(--blue));
  box-shadow: 0 0 10px rgba(47, 91, 240, .5);
}
body .nav-btn.rail-exit:hover { background: rgba(251, 113, 133, .16); color: #be123c; border-color: rgba(251, 113, 133, .35); }

/* راهنمای کنار آیکون (tooltip) */
[data-label]::before {
  content: attr(data-label);
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translate(6px, -50%);
  padding: 6px 11px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  background: #1b2a4e; color: #fff; border: 1px solid var(--line-2);
  font-size: 12.5px; font-weight: 600; opacity: 0; z-index: 200;
  box-shadow: 0 10px 26px rgba(30, 50, 100, .18); transition: opacity .15s, transform .15s;
}
[data-label]:hover::before, [data-label]:focus-visible::before { opacity: 1; transform: translate(0, -50%); }
.icon-btn[data-label]::before { right: auto; left: 50%; top: calc(100% + 10px); transform: translate(-50%, -4px); }
.icon-btn[data-label]:hover::before { transform: translate(-50%, 0); }

.avatar {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #f4f8ff, #c9dcff); color: #1d3a9a; font-weight: 800; font-size: 13px;
  box-shadow: 0 0 0 2px rgba(130, 170, 255, .35);
}
.avatar-dot { position: absolute; bottom: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid #ffffff; }

/* ---------------------- نوار بالا ---------------------- */
body .topbar {
  position: sticky; top: 14px; z-index: 40;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 14px; border-radius: 20px; color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.crumbs b { color: var(--text); font-weight: 700; }
.crumb-sep { width: 15px; height: 15px; opacity: .7; }

.topsearch {
  flex: 1; max-width: 420px; min-width: 150px; display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 12px; border-radius: 13px; color: var(--muted);
  background: #f1f5fb; border: 1px solid var(--line);
  transition: border-color .18s, box-shadow .18s;
}
.topsearch:focus-within { border-color: rgba(130, 170, 255, .6); box-shadow: 0 0 0 3px rgba(63, 109, 255, .22); color: var(--text); }
body .topsearch input {
  flex: 1; min-width: 0; width: auto !important; min-height: 0 !important; height: 100%;
  padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important;
  color: var(--text) !important; font-size: 13.5px !important; outline: none !important;
}
.topsearch kbd {
  font-family: inherit; font-size: 11px; color: var(--muted); padding: 2px 7px; border-radius: 7px;
  border: 1px solid var(--line-2); background: rgba(30, 60, 140, .05); direction: ltr; white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; color: #047857; white-space: nowrap;
  background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .35);
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  border-radius: 13px; color: var(--text-2); background: #f1f5fb; border: 1px solid var(--line);
  transition: .18s;
}
.icon-btn:hover { color: var(--blue-2); border-color: var(--line-2); background: rgba(70, 120, 255, .18); }
.bell-count {
  position: absolute; top: -6px; left: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #ffffff; box-shadow: 0 4px 12px rgba(63, 109, 255, .6);
}
.btn-new {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border: 0; cursor: pointer;
  border-radius: 13px; color: #fff; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  background: linear-gradient(180deg, #5b86ff, #2f5bf0);
  box-shadow: 0 10px 26px rgba(47, 91, 240, .5), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-new:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 14px 32px rgba(47, 91, 240, .6), inset 0 1px 0 rgba(255, 255, 255, .3); }

/* ---------------------- بخش‌ها و عنوان صفحه ---------------------- */
body .section { background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
body .section.active { display: block; animation: secIn .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes secIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section > h2 {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 6px;
  font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.2px; color: var(--text);
}
.page-ico {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; color: #2f5bf0;
  background: linear-gradient(145deg, rgba(70, 120, 255, .32), rgba(30, 60, 180, .2));
  border: 1px solid rgba(130, 170, 255, .34); box-shadow: 0 8px 22px rgba(40, 90, 255, .25), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.page-ico .ico { width: 23px; height: 23px; }
.section > p { color: var(--muted); margin: 2px 0 22px; font-size: 14px; line-height: 1.9; max-width: 820px; }
.section h3 { color: var(--text); }
.schedule-heading h3, .dio-h3 { color: var(--text); font-size: 18px; margin: 28px 0 12px; }

/* ---------------------- کارت‌ها (KPI) ---------------------- */
.cards { gap: 14px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
body .card {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-right-width: 1px;
  border-radius: var(--radius); padding: 18px 20px; gap: 8px;
  background: var(--surface); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
  
  transition: transform .2s, border-color .2s;
}
body .card:hover { transform: translateY(-3px); border-color: var(--line-2); }
body .card::before {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; height: 90%; pointer-events: none;
  background: radial-gradient(closest-side, var(--tone, rgba(63, 109, 255, .35)), transparent); opacity: .35;
}
body .card strong { font-size: 36px; line-height: 1.1; color: var(--text); font-weight: 800; position: relative; }
body .card .card-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); position: relative; }
body .card .card-title .ico { color: var(--tone-ico, #2f5bf0); }
.kpi-cap { font-size: 12.5px; color: var(--muted); position: relative; }
.kpi-green { --tone: rgba(52, 211, 153, .30); --tone-ico: var(--green); }
.kpi-red { --tone: rgba(251, 113, 133, .30); --tone-ico: var(--red); }
.kpi-amber { --tone: rgba(251, 191, 36, .28); --tone-ico: var(--amber); }
.kpi-blue { --tone: rgba(63, 109, 255, .42); --tone-ico: #2f5bf0; }
body .card.busy { --tone: rgba(251, 113, 133, .30); box-shadow: var(--shadow), inset -3px 0 0 var(--red), inset 0 1px 0 rgba(255, 255, 255, .07); }
body .card.free { --tone: rgba(52, 211, 153, .26); box-shadow: var(--shadow), inset -3px 0 0 var(--green), inset 0 1px 0 rgba(255, 255, 255, .07); }
body .card.busy strong { color: #be123c; }
body .card.free strong { color: #047857; }
body .card > span:not(.card-title):not(.kpi-cap) { color: var(--text-2); font-size: 13.5px; line-height: 1.9; position: relative; }

/* ---------------------- داشبورد ---------------------- */
.dash-grid { gap: 14px; margin-top: 14px; }
body .dash-panel, body .rr-panel, body .dio-card, body .base-panel {
  background: var(--surface); border: 1px solid var(--line); border-top: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  
}
body .dash-panel { padding: 20px 22px; }
body .dash-panel h3, body .rr-head h3, body .dio-card h3 { color: var(--text); font-size: 16.5px; }
.bar-label { color: var(--text-2); }
.bar-track { background: #f1f5fb; height: 10px; }
.bar-fill.active { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 8px rgba(16, 185, 129, .35); }
.bar-fill.cancelled { background: linear-gradient(90deg, #e11d48, #fb7185); box-shadow: 0 0 8px rgba(225, 29, 72, .3); }
.bar-fill.moved { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 8px rgba(245, 158, 11, .35); }
.bar-val { color: var(--text); }
.week-stats { border-top: 1px solid var(--line); }
.week-item strong { color: #2f5bf0; }
.week-item span { color: var(--muted); }
.items li, .log li { border-bottom: 1px solid var(--line); color: var(--text); }
.items small, .log small, .log li small { color: var(--muted); }
.muted, .log li.muted { color: var(--muted); }

/* ---------------------- فرم‌ها ---------------------- */
body .form-grid {
  padding: 20px; border-radius: var(--radius); gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.form-grid label, .att-toolbar label, .rr-controls label, .notify-body label { color: var(--text-2); font-size: 13px; font-weight: 600; }

body main input[type="text"], body main input[type="number"], body main input[type="search"],
body main input.smart-field, body main input[type="time"], body main input[type="url"], body main input[type="password"],
body main select, body main textarea,
body .att-dialog input, body .att-dialog select, body .att-dialog textarea,
body .notify-body textarea, body .notify-ch input,
body .att-toolbar input, body .att-toolbar select, body .att-accounts input,
body .base-modal-dialog input, body .base-modal-dialog select {
  min-height: 44px !important; padding: 9px 14px !important;
  border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important;
  background-color: #ffffff !important; color: var(--text) !important;
  font-size: 14px !important; box-shadow: none !important; color-scheme: dark;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
body main input::placeholder, body main textarea::placeholder, body .att-dialog textarea::placeholder, body .notify-body textarea::placeholder, body .base-modal-dialog input::placeholder, body .att-dialog input::placeholder { color: #8a98b8 !important; opacity: 1; }
body main input:hover, body main select:hover, body main textarea:hover { border-color: var(--line-2) !important; }
body main input:focus, body main select:focus, body main textarea:focus,
body .att-dialog input:focus, body .att-dialog select:focus, body .att-dialog textarea:focus,
body .notify-body textarea:focus, body .base-modal-dialog input:focus, body .base-modal-dialog select:focus {
  outline: none !important; border-color: rgba(130, 170, 255, .75) !important;
  box-shadow: 0 0 0 3px rgba(63, 109, 255, .28) !important; background-color: #ffffff !important;
}
body main input:disabled { background-color: #eef2f9 !important; color: #8a98b8 !important; }
select option { background: #ffffff; color: var(--text); }
input[type="time"]::-webkit-calendar-picker-indicator, input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
body main input[type="checkbox"], body main input[type="radio"] { accent-color: var(--blue); width: 17px; min-height: 0 !important; height: 17px; }
body main input[type="file"] { color: var(--text-2); padding: 8px !important; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #7fa6ff; outline-offset: 2px; }

/* کومبوباکس */
.combo-arrow { filter: none; }
.combo-menu { background: #ffffff; border: 1px solid var(--line-2); box-shadow: 0 14px 36px rgba(30, 50, 100, .16); }
.combo-item { color: var(--text); }
.combo-item:hover, .combo-item.active { background: rgba(63, 109, 255, .25); }
.combo-item.selected { background: linear-gradient(180deg, #5b86ff, #2f5bf0); color: #fff; }
.combo-empty { color: var(--muted); }

/* ---------------------- دکمه‌ها ---------------------- */
body .btn-primary {
  background: linear-gradient(180deg, #5b86ff, #2f5bf0); color: #fff; border: 0; font-weight: 700;
  padding: 10px 22px; border-radius: 12px; min-height: 42px;
  box-shadow: 0 10px 24px rgba(47, 91, 240, .42), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .15s, filter .15s, box-shadow .15s;
}
body .btn-primary:hover { background: linear-gradient(180deg, #6b93ff, #3a66f5); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(47, 91, 240, .55), inset 0 1px 0 rgba(255, 255, 255, .28); }
body .btn-primary:active { transform: none; }
body .btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
body .btn-secondary {
  background: rgba(70, 110, 240, .12); color: #2447c4; border: 1px solid var(--line-2); font-weight: 600;
  padding: 9px 16px; border-radius: 12px; min-height: 42px; transition: .15s;
}
body .btn-secondary:hover { background: rgba(70, 110, 240, .26); color: #1d3fbf; border-color: rgba(150, 185, 255, .55); }
body .view-toggle .btn-secondary.active, body .rr-filter .btn-secondary.active {
  background: linear-gradient(180deg, #5b86ff, #2f5bf0); color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px rgba(47, 91, 240, .4);
}
body .btn-small { background: rgba(251, 113, 133, .16); color: #be123c; border: 1px solid rgba(251, 113, 133, .35); padding: 5px 12px; border-radius: 9px; transition: .15s; }
body .btn-small:hover { background: rgba(225, 29, 72, .16); color: #9f1239; }
body .btn-small.edit { background: rgba(63, 109, 255, .18); color: #2447c4; border-color: rgba(130, 170, 255, .4); }
body .btn-small.edit:hover { background: rgba(47, 91, 240, .2); color: #1d3fbf; }
body .note-icon-btn { background: rgba(63, 109, 255, .14); border: 1px solid var(--line-2); color: #2447c4; border-radius: 9px; }
body .note-icon-btn:hover { background: rgba(63, 109, 255, .3); border-color: rgba(150, 185, 255, .55); }
.error { color: #be123c; }
body .day-tab {
  background: rgba(70, 110, 240, .10); color: var(--text-2); border: 1px solid var(--line); border-radius: 11px; padding: 8px 15px; transition: .15s;
}
body .day-tab:hover { border-color: var(--line-2); color: var(--blue-2); }
body .day-tab.active { background: linear-gradient(180deg, #5b86ff, #2f5bf0); color: #fff; border-color: rgba(150, 185, 255, .5); box-shadow: 0 8px 20px rgba(47, 91, 240, .3); }
.day-tab small { opacity: .8; }
.search { margin-bottom: 14px; }

/* ---------------------- جدول‌ها ---------------------- */
body .table-wrap {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: auto;
  background: #ffffff;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
}
table { color: var(--text); }
th { background: rgba(80, 125, 255, .10); color: var(--muted); font-weight: 700; font-size: 12.5px; border-bottom: 1px solid var(--line); padding: 12px 14px; }
td { border-bottom: 1px solid rgba(110, 150, 255, .09); padding: 12px 14px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(70, 120, 255, .09); }
tbody tr:last-child td { border-bottom: 0; }
body .dio-table td { white-space: normal; }

/* نشان وضعیت */
body .badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff;
  border: 1px solid transparent;
}
body .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
body .badge.active { background: rgba(52, 211, 153, .14); color: #047857; border-color: rgba(52, 211, 153, .35); }
body .badge.cancelled { background: rgba(251, 113, 133, .14); color: #be123c; border-color: rgba(251, 113, 133, .35); }
body .badge.moved { background: rgba(251, 191, 36, .14); color: #92580a; border-color: rgba(251, 191, 36, .35); }

/* کارت‌های برنامه (نمای کارت) */
.schedule-cards { gap: 14px; }
body .class-card {
  background: var(--surface); border: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06), inset -3px 0 0 var(--green); transition: transform .2s, border-color .2s;
}
body .class-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
body .class-card.status-moved { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06), inset -3px 0 0 var(--amber); }
body .class-card.status-cancelled { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06), inset -3px 0 0 var(--red); opacity: .8; }
.course-name { color: var(--text); font-size: 15.5px; }
.info-row { color: var(--text-2); }
.card-actions { border-top: 1px solid var(--line); }

/* ---------------------- اطلاعات پایه ---------------------- */
.base-panel-title { background: transparent; color: var(--text); font-size: 16px; padding: 18px 20px 4px; }
.base-panel-content { padding: 14px 20px 20px; }
.base-summary-count { color: var(--muted); }
.base-summary-count strong { color: #2f5bf0; font-size: 17px; }
.items-collapse { border-color: var(--line); }
.items-collapse summary { background: rgba(80, 125, 255, .1); color: #2447c4; }

/* ---------------------- ورود/خروج داده و گزارش کلاس‌ها ---------------------- */
body .dio-card { padding: 20px; }
.dio-hint { color: var(--muted); }
.dio-info { background: rgba(63, 109, 255, .12); color: var(--text-2); border: 1px solid var(--line); }
.dio-info.warn { background: rgba(251, 191, 36, .1); color: #92580a; border-color: rgba(251, 191, 36, .3); }
.dio-drop { background: rgba(63, 109, 255, .08); border: 2px dashed rgba(130, 170, 255, .38); color: #2447c4; border-radius: var(--radius); }
.dio-drop:hover, .dio-drop.drag { background: rgba(63, 109, 255, .2); border-color: rgba(160, 195, 255, .8); }
.dio-drop small { color: var(--muted); }
.dio-chip, .rr-chip { background: rgba(63, 109, 255, .16); color: #2447c4; border: 1px solid var(--line); }
.dio-chip.ok, .rr-chip.free { background: rgba(52, 211, 153, .14); color: #047857; border-color: rgba(52, 211, 153, .3); }
.dio-chip.err, .rr-chip.busy { background: rgba(251, 113, 133, .14); color: #be123c; border-color: rgba(251, 113, 133, .3); }
.dio-chip.warn { background: rgba(251, 191, 36, .13); color: #92580a; border-color: rgba(251, 191, 36, .3); }
.dio-table { border-color: var(--line); }
.dio-table tr.dio-error td { background: rgba(251, 113, 133, .1); color: #be123c; }
.dio-table tr.dio-warn td { background: rgba(251, 191, 36, .08); color: #92580a; }
.dio-table tr.dio-ok td:nth-child(2) { color: #047857; }
.dio-restore { background: #f1f5fb; border-color: var(--line); }
.dio-h4 { color: #2447c4; }
.dio-modes { color: var(--text-2); }
body .rr-panel { padding: 20px; }
.rr-live { background: rgba(251, 191, 36, .13); color: #92580a; }
.rr-live.on { background: rgba(52, 211, 153, .14); color: #047857; }
.rr-badge.busy { background: rgba(251, 113, 133, .16); color: #be123c; }
.rr-badge.free { background: rgba(52, 211, 153, .16); color: #047857; }
tr.rr-busy td:first-child { box-shadow: inset -3px 0 0 var(--red); }
tr.rr-free td:first-child { box-shadow: inset -3px 0 0 var(--green); }

/* ---------------------- جلسات و حضور اساتید ---------------------- */
.att-hint { color: var(--muted); }
.att-info { color: #2f5bf0; }
body .att-pending { background: rgba(251, 113, 133, .08); border: 1px solid rgba(251, 113, 133, .3); border-radius: var(--radius); padding: 14px 18px; }
.att-pending h3 { color: #be123c; }
.att-pend-row { border-top: 1px dashed rgba(251, 113, 133, .25); color: var(--text); }
.att-ok { color: #047857; }
body .att-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.att-card span { color: var(--muted); }
.att-card strong { color: var(--text); }
.att-card.warn strong { color: var(--amber); }
.att-card.bad strong { color: var(--red); }
.att-table td small { color: var(--muted); }
.att-row-abs { background: rgba(251, 113, 133, .07); }
.att-held { background: rgba(52, 211, 153, .15); color: #047857; }
.att-today { background: rgba(56, 189, 248, .15); color: #0369a1; }
.att-up { background: rgba(30, 60, 140, .07); color: var(--text-2); }
.att-need { background: rgba(251, 113, 133, .16); color: #be123c; }
.att-mk { background: rgba(251, 191, 36, .15); color: #92580a; }
.att-mkdone { background: rgba(45, 212, 191, .15); color: #0f766e; }
.att-accounts { border-top: 1px solid var(--line); }
.att-accounts summary { color: #2447c4; }

/* ---------------------- پنجره‌های مودال ---------------------- */
.note-backdrop, .base-modal-backdrop { background: rgba(20, 33, 61, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body .att-modal { background: rgba(20, 33, 61, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body .note-dialog, body .base-modal-dialog, body .att-dialog {
  background: #ffffff; color: var(--text);
  border: 1px solid var(--line-2); border-top: 1px solid rgba(150, 185, 255, .4); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(30, 50, 100, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: modalIn .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.note-dialog-head h3, .base-modal-head h3, .att-dialog h3 { color: var(--text); }
.note-close { color: var(--muted); border-radius: 9px; width: 34px; height: 34px; transition: .15s; }
.note-close:hover { color: var(--text); background: rgba(30, 60, 140, .08); }
.note-dialog-content { background: #f1f5fb; color: var(--text); border: 1px solid var(--line); }
.base-modal-content h4 { color: #2447c4; }
.base-register-form { background: #f1f5fb; border-color: var(--line); }
.base-list-title { border-bottom: 1px solid var(--line); }
.base-modal-actions { border-top: 1px solid var(--line); }
.att-dialog label { color: var(--text-2); }
.att-err { color: #be123c; }
.notify-class { background: rgba(63, 109, 255, .14); color: var(--text-2); border: 1px solid var(--line); }
.notify-meta, .notify-ch summary { color: var(--muted); }
.notify-ch summary { color: #2f5bf0; }
.notify-preview { background: #f1f5fb; border: 1px solid var(--line); }
.notify-preview-title { color: var(--muted); }
.notify-avatar { background: #eaf1ff; }
.notify-bubble { background: #eaf1ff; border: 1px solid var(--line-2); box-shadow: none; }
.notify-bubble b { color: #2f5bf0; }
.notify-bubble p { color: var(--text); }
.notify-bubble p.empty, .notify-bubble small { color: var(--muted); }
.notify-share > span { color: var(--text-2); }
.notify-check.small { color: var(--muted); }
body .announce-list li { align-items: flex-start; }

/* ---------------------- اعلان (toast) ---------------------- */
body .toast {
  left: 24px; bottom: 24px; padding: 13px 20px; border-radius: 14px; color: var(--text); font-weight: 600; font-size: 14px;
  background: #ffffff; border: 1px solid var(--line-2); box-shadow: 0 14px 36px rgba(30, 50, 100, .16);
   transform: translateY(10px); transition: opacity .3s, transform .3s;
}
body .toast.show { transform: none; }
body .toast.success { background: #ecfdf5; border-color: rgba(16, 185, 129, .5); color: #065f46; }
body .toast.error { background: #fff1f2; border-color: rgba(225, 29, 72, .4); color: #9f1239; }

/* ---------------------- واکنش‌گرا ---------------------- */
@media (max-width: 1100px) {
  .topsearch kbd { display: none; }
  .btn-new span { display: none; }
  .btn-new { padding: 0 12px; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; padding: 10px 10px 84px; gap: 10px; }
  .rail {
    position: fixed; z-index: 90; top: auto; bottom: 10px; right: 10px; left: 10px; height: 64px;
    flex-direction: row; justify-content: space-between; padding: 8px 12px; border-radius: 22px;
  }
  .rail-logo { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; overflow-x: auto; padding: 0; }
  .rail-sep { width: 1px; height: 24px; margin: 0 2px; }
  .rail-bottom { flex-direction: row; gap: 8px; }
  .avatar { display: none; }
  body .nav-btn.rail-btn.active::after { right: 11px; left: 11px; top: auto; bottom: -9px; width: auto; height: 4px; border-radius: 4px 4px 0 0; }
  [data-label]::before { display: none; }
  body .topbar { position: static; flex-wrap: wrap; gap: 10px; }
  .crumbs { order: 1; }
  .top-actions { order: 2; margin-right: auto; }
  .topsearch { order: 3; max-width: none; flex-basis: 100%; }
  .live-pill { display: none; }
  body main { padding: 4px 0 24px; }
  body .toast { bottom: 90px; left: 12px; }
}
@media (max-width: 600px) {
  .page-ico { width: 40px; height: 40px; border-radius: 13px; }
  body .form-grid { padding: 14px; }
  body .card strong { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* نوار ابزار حضور: کنترل‌ها کنار هم، نه تمام‌عرض */
body main .att-toolbar input, body main .att-toolbar select {
  width: auto !important; flex: 0 1 260px; min-width: 170px;
}
body main .att-toolbar #attTermStart { flex: 0 1 190px; }
body main .att-toolbar { gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
body main .att-toolbar .att-info { flex: 1 1 260px; }

/* دکمهٔ انتخاب فایل */
input[type="file"]::file-selector-button {
  margin-left: 12px; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer;
  background: rgba(70, 110, 240, .2); color: #2447c4; font: inherit; font-weight: 600; transition: .15s;
}
input[type="file"]::file-selector-button:hover { background: rgba(70, 110, 240, .38); }

/* اصلاحات موبایل */
@media (max-width: 860px) {
  body .topbar .topsearch { order: 3; flex: 1 1 100%; width: 100%; max-width: none; min-width: 0; }
  body .nav-btn.rail-btn { width: 40px; height: 40px; border-radius: 12px; }
  body .nav-btn.rail-btn .ico { width: 20px; height: 20px; }
  .rail { padding: 8px 8px; }
  .rail-nav { gap: 2px; overflow: visible; }
  .rail-sep { display: none; }
}
@media (max-width: 860px) {
  body .topbar .topsearch { height: 42px; min-height: 42px; flex-shrink: 0; align-self: stretch; }
  body .topbar .topsearch input { height: 100%; }
}

/* ========== داشبورد پیشرفته: دونات، جدول، اشغال ========== */
.kpi-purple { --tone: rgba(168, 85, 247, .28); --tone-ico: #9333ea; }
.kpi-teal { --tone: rgba(45, 212, 191, .28); --tone-ico: #0d9488; }

.donut-wrap {
  display: flex; align-items: center; gap: 22px; margin: 12px 0 18px; flex-wrap: wrap;
}
.donut {
  --size: 120px;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: conic-gradient(
    #34d399 0 calc(var(--p-active) * 1%),
    #fb7185 calc(var(--p-active) * 1%) calc((var(--p-active) + var(--p-cancelled)) * 1%),
    #fbbf24 calc((var(--p-active) + var(--p-cancelled)) * 1%) 100%
  );
  display: grid; place-items: center; position: relative;
  box-shadow: 0 8px 24px rgba(47, 91, 240, .12);
  transition: background .5s ease;
}
.donut-hole {
  width: 68%; height: 68%; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.donut-hole span { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.donut-hole small { font-size: 11px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend .leg { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.donut-legend .leg i { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.leg-active i { background: #34d399; }
.leg-cancelled i { background: #fb7185; }
.leg-moved i { background: #fbbf24; }
.donut-legend b { margin-right: auto; font-weight: 700; color: var(--text); }

.bar-fill { transition: width .55s cubic-bezier(.2, .8, .2, 1); }
.bar-fill.bar-pulse { animation: barPulse .45s ease; }
@keyframes barPulse {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}

.kpi-moved.has-moved {
  animation: movedSlide 1.2s ease;
}
@keyframes movedSlide {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.bar-moved-row .bar-fill.moved {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.dash-grid-2 { margin-top: 16px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.stat-table th, .stat-table td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.stat-table th { color: var(--text-2); font-weight: 600; background: rgba(70, 110, 240, .06); }
.stat-table td.td-moved { color: #b45309; font-weight: 700; background: rgba(251, 191, 36, .12); }
.stat-table tr:hover td { background: rgba(70, 110, 240, .04); }

.occ-meter { margin: 10px 0 16px; }
.occ-bar {
  height: 14px; border-radius: 99px; background: rgba(70, 110, 240, .1);
  overflow: hidden; border: 1px solid var(--line);
}
.occ-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #34d399, #2f5bf0);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.occ-meta { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.occ-meta strong { font-size: 22px; font-weight: 800; color: var(--text); }
.occ-meta span { font-size: 13px; color: var(--muted); }

.mini-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px;
}
.ms-item {
  text-align: center; padding: 12px 8px; border-radius: 12px;
  background: rgba(70, 110, 240, .06); border: 1px solid var(--line);
}
.ms-item b { display: block; font-size: 20px; font-weight: 800; color: var(--text); }
.ms-item span { font-size: 11.5px; color: var(--muted); }

/* ========== تقویم شمسی جلسه جبرانی ========== */
.date-picker-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.date-picker-wrap input { flex: 1; }
.date-cal-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(70, 110, 240, .1); color: #2f5bf0; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
  transition: .15s;
}
.date-cal-btn:hover { background: rgba(70, 110, 240, .22); }
.date-cal-btn .ico { width: 20px; height: 20px; }

.jalali-cal {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 80;
  width: 280px; padding: 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px rgba(30, 50, 100, .2);
  animation: calIn .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes calIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.jcal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.jcal-title { font-weight: 700; font-size: 14.5px; color: var(--text); }
.jcal-nav {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(70, 110, 240, .08); color: var(--text); cursor: pointer; font-size: 18px;
  display: grid; place-items: center; transition: .15s;
}
.jcal-nav:hover { background: rgba(70, 110, 240, .2); }
.jcal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px;
}
.jcal-weekdays span {
  text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0;
}
.jcal-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.jcal-day {
  aspect-ratio: 1; border: none; border-radius: 10px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: .12s;
}
.jcal-day:hover { background: rgba(70, 110, 240, .15); }
.jcal-day.other { color: var(--muted); opacity: .45; }
.jcal-day.today { box-shadow: inset 0 0 0 1.5px #2f5bf0; }
.jcal-day.selected {
  background: linear-gradient(145deg, #5b86ff, #2f5bf0); color: #fff;
  box-shadow: 0 4px 12px rgba(47, 91, 240, .4);
}
.jcal-day:disabled { opacity: .3; cursor: default; }

/* انیمیشن جابه‌جایی بخش‌ها (موشن با کلیک) */
body .section.active {
  animation: secSlideIn .4s cubic-bezier(.2, .8, .2, 1);
}
@keyframes secSlideIn {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-moved.has-moved, .bar-fill.bar-pulse, body .section.active, .jalali-cal {
    animation: none !important;
  }
}

/* اعلان‌ها همیشه بالاتر از همه پنجره‌ها و پس‌زمینه‌ها */
#toast, body .toast { position: fixed !important; z-index: 2147483647 !important; background: #ffffff; opacity: 0; isolation: isolate; box-shadow: 0 18px 48px rgba(15, 30, 60, .35); }
#toast.show, body .toast.show { opacity: 1 !important; }
body .toast.success { background: #ecfdf5 !important; }
body .toast.error { background: #fff1f2 !important; }
