/* ═════════ فونت و پایه ═════════ */
body{font-family:Vazir,Tahoma,sans-serif}
.is-hidden{display:none!important}

/* ═════════ چیدمان کلی ═════════ */
.app-shell{min-height:100vh;display:flex;flex-direction:column}
@media(min-width:1024px){.app-shell{padding-left:16rem}}

.sidebar{position:fixed;top:0;bottom:0;left:0;width:16rem;z-index:40;background:#fff;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;transform:translateX(-100%);transition:transform .25s}
.sidebar.open{transform:none}
@media(min-width:1024px){.sidebar{transform:none}}
.dark .sidebar{background:#1e293b;border-left-color:#334155}

.sidebar-backdrop{position:fixed;inset:0;background:rgba(2,6,23,.45);z-index:30;opacity:0;pointer-events:none;transition:opacity .2s}
.sidebar-backdrop.show{opacity:1;pointer-events:auto}
@media(min-width:1024px){.sidebar-backdrop{display:none}}

.sidebar-logo{display:flex;align-items:center;gap:.75rem;padding:1.2rem 1rem;border-bottom:1px solid #e2e8f0;font-weight:700;color:#0f766e}
.dark .sidebar-logo{border-bottom-color:#334155;color:#5eead4}
.logo-badge{width:2.5rem;height:2.5rem;border-radius:.75rem;background:#0d9488;color:#fff;display:flex;align-items:center;justify-content:center;font-size:1.05rem;flex-shrink:0}

.sidebar-nav{flex:1;overflow-y:auto;padding:.75rem .6rem;display:flex;flex-direction:column;gap:.15rem}
.nav-link{display:flex;align-items:center;gap:.75rem;padding:.6rem .8rem;border-radius:.7rem;color:#475569;font-size:.9rem;font-weight:500;transition:.15s}
.nav-link i{width:1.25rem;text-align:center;font-size:1rem}
.nav-link:hover{background:#f1f5f9;color:#0f766e}
.dark .nav-link{color:#cbd5e1}
.dark .nav-link:hover{background:#334155;color:#5eead4}
.nav-link.active{background:#0d9488;color:#fff}
.nav-link.active:hover{background:#0f766e;color:#fff}
.sidebar-footer{padding:.6rem;border-top:1px solid #e2e8f0}
.dark .sidebar-footer{border-top-color:#334155}

.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:.4rem;height:4rem;padding:0 1rem;background:rgba(255,255,255,.85);backdrop-filter:blur(8px);border-bottom:1px solid #e2e8f0}
.dark .topbar{background:rgba(30,41,59,.85);border-bottom-color:#334155}
.main-content{flex:1;padding:1.25rem;width:100%}

/* ═════════ دکمه‌ها و فرم ═════════ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;padding:.5rem 1rem;border:none;border-radius:.7rem;font-family:inherit;font-size:.85rem;font-weight:600;cursor:pointer;transition:.15s;white-space:nowrap}
.btn-primary{background:#0d9488;color:#fff}.btn-primary:hover{background:#0f766e}
.btn-ghost{background:transparent;color:#475569;border:1px solid #cbd5e1}.btn-ghost:hover{background:#f8fafc}
.dark .btn-ghost{color:#cbd5e1;border-color:#475569}.dark .btn-ghost:hover{background:#334155}
.btn-danger{background:#e11d48;color:#fff}.btn-danger:hover{background:#be123c}
.btn-light{background:#f1f5f9;color:#334155}.dark .btn-light{background:#334155;color:#e2e8f0}
.btn-icon{display:inline-flex;align-items:center;justify-content:center;width:2.4rem;height:2.4rem;border:none;background:transparent;border-radius:.7rem;color:#475569;cursor:pointer;transition:.15s;position:relative}
.btn-icon:hover{background:#f1f5f9;color:#0d9488}
.dark .btn-icon{color:#cbd5e1}.dark .btn-icon:hover{background:#334155;color:#5eead4}

.input{width:100%;padding:.55rem .85rem;border:1px solid #cbd5e1;border-radius:.7rem;background:#fff;color:inherit;font-family:inherit;font-size:.85rem;outline:none;transition:.15s}
.input:focus{border-color:#0d9488;box-shadow:0 0 0 3px rgba(13,148,136,.15)}
.dark .input{background:#0f172a;border-color:#334155;color:#e2e8f0}
.label{display:block;margin-bottom:.3rem;font-size:.78rem;font-weight:600;color:#475569}
.dark .label{color:#94a3b8}

.card{background:#fff;border:1px solid #e2e8f0;border-radius:1rem;box-shadow:0 1px 2px rgba(2,6,23,.05)}
.dark .card{background:#1e293b;border-color:#334155}

.stat-icon{width:3rem;height:3rem;border-radius:.9rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0}
.alert{padding:.7rem 1rem;border-radius:.7rem;font-size:.83rem;margin-bottom:1rem;display:flex;gap:.5rem;align-items:flex-start}
.alert-error{background:#ffe4e6;color:#9f1239}.dark .alert-error{background:rgba(225,29,72,.15);color:#fda4af}
.alert-success{background:#dcfce7;color:#166534}.dark .alert-success{background:rgba(22,163,74,.15);color:#86efac}

/* ═════════ دراپ‌داون ═════════ */
.dd{position:relative}
.dd-panel{position:absolute;top:calc(100% + 10px);left:0;min-width:14rem;background:#fff;border:1px solid #e2e8f0;border-radius:.9rem;box-shadow:0 10px 25px rgba(2,6,23,.15);display:none;z-index:50}
.dd.open .dd-panel{display:block}
.dark .dd-panel{background:#1e293b;border-color:#334155}
.dd-item{display:flex;align-items:center;gap:.6rem;padding:.6rem 1rem;font-size:.85rem;color:inherit;width:100%;text-align:right}
.dd-item:hover{background:#f8fafc}.dark .dd-item:hover{background:#334155}
.weather-panel{width:20rem;padding:1rem}
.notif-panel{width:20rem}
.notif-head{display:flex;justify-content:space-between;align-items:center;padding:.7rem 1rem;border-bottom:1px solid #e2e8f0}
.dark .notif-head{border-bottom-color:#334155}
.notif-list{max-height:20rem;overflow-y:auto}
.notif-item{padding:.7rem 1rem;border-bottom:1px solid #f1f5f9;font-size:.8rem}
.dark .notif-item{border-bottom-color:#1e293b}
.notif-item.unread{background:#f0fdfa}.dark .notif-item.unread{background:rgba(13,148,136,.08)}
.notif-badge{position:absolute;top:2px;left:-2px;background:#e11d48;color:#fff;font-size:.6rem;min-width:1.1rem;height:1.1rem;border-radius:999px;display:flex;align-items:center;justify-content:center;padding:0 3px}
.avatar-initial{width:2.25rem;height:2.25rem;border-radius:9999px;background:#0d9488;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}
.profile-btn{display:flex;align-items:center}
.profile-panel{min-width:13rem}

/* ═════════ توست ═════════ */
#toast-container{position:fixed;bottom:1rem;right:1rem;z-index:80;display:flex;flex-direction:column;gap:.5rem;max-width:22rem}
.toast{display:flex;align-items:center;gap:.6rem;padding:.7rem 1rem;background:#fff;border:1px solid #e2e8f0;border-radius:.8rem;box-shadow:0 8px 20px rgba(2,6,23,.15);font-size:.85rem;animation:toastIn .25s ease}
.dark .toast{background:#1e293b;border-color:#334155}
.toast.success i{color:#16a34a}.toast.error i{color:#e11d48}.toast.info i{color:#0d9488}
.toast.hide{opacity:0;transform:translateY(8px);transition:.3s}
@keyframes toastIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ═════════ مودال ═════════ */
.modal-backdrop{position:fixed;inset:0;z-index:60;background:rgba(2,6,23,.55);display:none;align-items:center;justify-content:center;padding:1rem}
.modal-backdrop.open{display:flex}
.modal-box{background:#fff;border-radius:1.1rem;width:100%;max-width:32rem;max-height:92vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(2,6,23,.3);animation:modalIn .2s ease}
.dark .modal-box{background:#1e293b}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.25rem;border-bottom:1px solid #e2e8f0}
.dark .modal-header{border-bottom-color:#334155}
#modal-body{padding:1.25rem;overflow-y:auto}
.modal-foot{display:flex;justify-content:flex-end;gap:.6rem;padding:0 1.25rem 1.25rem}
@keyframes modalIn{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}

/* ═════════ تقویم جلالی ═════════ */
.jc-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:#e2e8f0;border:1px solid #e2e8f0;border-radius:.75rem;overflow:hidden}
.dark .jc-grid{background:#334155;border-color:#334155}
.jc-weekday,.jc-day{background:#fff}
.dark .jc-weekday,.dark .jc-day{background:#1e293b}
.jc-weekday{text-align:center;font-size:.72rem;font-weight:700;padding:.5rem .2rem;background:#f1f5f9;color:#475569}
.dark .jc-weekday{background:#0f172a;color:#94a3b8}
.jc-day{min-height:5.5rem;padding:.3rem;cursor:pointer}
.jc-day:hover{background:#f8fafc}.dark .jc-day:hover{background:#0f172a}
.jc-weekend{background:#fbfaf7}.dark .jc-weekend{background:#19222f}
.jc-num{font-weight:600;font-size:.75rem}
.jc-today{background:#f0fdfa}.dark .jc-today{background:rgba(13,148,136,.14)}
.jc-today .jc-num{color:#0d9488;font-weight:800}
.jc-out .jc-num{opacity:.25}
.jc-dragover{outline:2px dashed #0d9488;outline-offset:-2px}
.jc-ev{display:flex;align-items:center;gap:.25rem;font-size:.68rem;padding:.15rem .3rem;border-radius:.375rem;margin-top:.15rem;cursor:pointer;overflow:hidden;background:color-mix(in srgb,var(--ev,#0d9488) 16%,transparent)}
.jc-ev-dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--ev,#0d9488);flex-shrink:0}
.jc-ev-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jc-more{font-size:.62rem;color:#64748b;padding:.1rem .3rem}

/* ═════════ کانبان ═════════ */
.kanban-col{background:#f8fafc;border:1px solid #e2e8f0;border-radius:.9rem;padding:.6rem;min-height:8rem}
.dark .kanban-col{background:#0f172a;border-color:#334155}
.kanban-col.drag-over{border-color:#0d9488;background:#f0fdfa}
.kanban-head{display:flex;justify-content:space-between;align-items:center;padding:.25rem .4rem .6rem;font-size:.85rem;font-weight:700}
.kanban-card{background:#fff;border:1px solid #e2e8f0;border-radius:.7rem;padding:.6rem .7rem;margin-bottom:.5rem;cursor:grab;font-size:.8rem}
.dark .kanban-card{background:#1e293b;border-color:#334155}
.kanban-card.dragging{opacity:.5}

/* ═════════ لیست کارها ═════════ */
.task-row{display:flex;align-items:center;gap:.5rem;padding:.6rem .75rem;background:#fff;border:1px solid #e2e8f0;border-radius:.7rem}
.dark .task-row{background:#1e293b;border-color:#334155}
.task-row:hover{border-color:#94a3b8}
.task-children{margin-right:1.75rem;margin-top:.35rem;display:flex;flex-direction:column;gap:.35rem;border-right:2px dashed #cbd5e1;padding-right:.75rem}
.dark .task-children{border-right-color:#475569}
.task-check,.habit-check{background:none;border:none;cursor:pointer;font-size:1.1rem;color:#94a3b8}
.task-check:hover,.habit-check:hover{color:#16a34a}
.habit-check.done{color:#16a34a}

/* ═════════ نشان‌ها ═════════ */
.badge{display:inline-flex;align-items:center;gap:.25rem;padding:.15rem .55rem;border-radius:999px;font-size:.68rem;font-weight:600;white-space:nowrap}
.b-low,.b-pending{background:#f1f5f9;color:#475569}.dark .b-low,.dark .b-pending{background:#334155;color:#cbd5e1}
.b-medium,.b-in_progress{background:#e0f2fe;color:#0369a1}.dark .b-medium,.dark .b-in_progress{background:rgba(2,132,199,.25);color:#7dd3fc}
.b-high{background:#fef3c7;color:#b45309}.dark .b-high{background:rgba(217,119,6,.25);color:#fcd34d}
.b-critical,.b-cancelled{background:#ffe4e6;color:#be123c}.dark .b-critical,.dark .b-cancelled{background:rgba(225,29,72,.25);color:#fda4af}
.b-done{background:#dcfce7;color:#15803d}.dark .b-done{background:rgba(22,163,74,.25);color:#86efac}

.progress{height:.5rem;background:#e2e8f0;border-radius:999px;overflow:hidden}
.dark .progress{background:#334155}
.progress>div{height:100%;border-radius:999px;transition:width .4s}

/* ═════════ یادداشت‌ها ═════════ */
.note-card{border-radius:1rem;padding:1rem;min-height:9rem;color:#374151;box-shadow:0 2px 6px rgba(2,6,23,.1);display:flex;flex-direction:column}
.note-preview{overflow:hidden;flex:1;line-height:1.7;color:#4b5563;font-size:.8rem;margin-top:.25rem}
.note-pin{background:none;border:none;cursor:pointer;color:#9ca3af;font-size:.8rem}
.note-pin.pinned{color:#b45309}
.color-sw{width:1.75rem;height:1.75rem;border-radius:.5rem;border:2px solid #cbd5e1;cursor:pointer;transition:.15s}
.color-sw.sel{border-color:#0d9488;box-shadow:0 0 0 3px rgba(13,148,136,.25)}

/* ═════════ سوئیچ نما ═════════ */
.view-switch{display:inline-flex;background:#f1f5f9;border-radius:.7rem;padding:.2rem;gap:.15rem}
.dark .view-switch{background:#0f172a}
.btn-view{display:inline-flex;align-items:center;gap:.35rem;padding:.4rem .75rem;border:none;background:transparent;border-radius:.55rem;font-size:.8rem;font-weight:600;color:#64748b;cursor:pointer}
.btn-view.active{background:#fff;color:#0d9488;box-shadow:0 1px 3px rgba(2,6,23,.1)}
.dark .btn-view.active{background:#1e293b;color:#5eead4}

.jdate-hint{display:block;font-size:.68rem;color:#94a3b8;margin-top:.2rem}

::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}

/* ═════════ چاپ گزارش (PDF) ═════════ */
@media print{
  .sidebar,.topbar,.no-print,#toast-container,.modal-backdrop{display:none!important}
  .app-shell{padding-left:0!important}
  body{background:#fff!important;color:#000!important}
  .card{box-shadow:none}
}

.habit-toggle{color:#475569;border:2px dashed #cbd5e1;border-radius:.75rem;padding:.6rem;width:100%;font-family:inherit;font-weight:700;font-size:.83rem;cursor:pointer;transition:.15s;background:transparent}
.habit-toggle:hover{border-color:#0d9488;color:#0d9488}
.habit-toggle.done{background:#f0fdfa;border:2px solid #16a34a;color:#15803d}
.dark .habit-toggle{color:#cbd5e1;border-color:#475569}
.dark .habit-toggle.done{background:rgba(22,163,74,.15);color:#86efac}

/* یادداشت سنجاق‌شده */
.note-card.pinned{box-shadow:0 6px 14px rgba(2,6,23,.18)}

/* فاصله منوهای small */
.h-2\.5{height:.625rem}
.w-2\.5{width:.625rem}
.w-2\.5.h-2\.5{width:.625rem;height:.625rem}

/* متن چندخطی محدود (بوکمارک) */
.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ═════════════════════════════════════════════════ */
/* ✨ لایه‌ی پولیش حالت تاریک — انتهای فایل اضافه شود */
/* ═════════════════════════════════════════════════ */

/* ── ۱) پس‌زمینه اصلی: عمق تیره + هاله‌های محو فیروزه‌ای ── */
html.dark body{
  background-color:#0b1220 !important; /* بی‌خیال slate-950 خالی */
  background-image:
    radial-gradient(1100px 480px at 88% -12%, rgba(13,148,136,.16), transparent 60%),
    radial-gradient(850px 400px at -12% 108%, rgba(56,189,168,.07), transparent 60%);
  background-attachment:fixed;
}

/* ── ۲) نوار کناری: گرادیان عمودی + لوگوی درخشان ── */
html.dark .sidebar{
  background:linear-gradient(180deg,#101b2f 0%,#0c1526 100%);
  border-left:1px solid rgba(148,163,184,.14);
}
html.dark .logo-badge{
  background:linear-gradient(135deg,#14b8a6,#0d9488);
  box-shadow:0 0 16px rgba(20,184,166,.45);
}
html.dark .nav-link:hover{background:rgba(148,163,184,.08);color:#99f6e4}
html.dark .nav-link.active{
  background:linear-gradient(90deg,rgba(13,148,136,.28),rgba(13,148,136,.10));
  color:#5eead4;
  box-shadow:inset -3px 0 0 #14b8a6; /* نوار فیروزه‌ای لبه‌ی راست */
}
html.dark .nav-link.active:hover{background:linear-gradient(90deg,rgba(20,184,166,.34),rgba(13,148,136,.14));color:#5eead4}

/* ── ۳) هدر: شیشه‌ای واقعی ── */
html.dark .topbar{
  background:rgba(11,18,32,.72);
  backdrop-filter:blur(14px) saturate(1.5);
  border-bottom:1px solid rgba(148,163,184,.14);
}
html.dark #clock-time{color:#5eead4;text-shadow:0 0 14px rgba(94,234,212,.4)}
html.dark .avatar-initial{
  background:linear-gradient(135deg,#14b8a6,#0f766e);
  box-shadow:0 0 0 2px rgba(20,184,166,.25);
}
html.dark .profile-btn img{box-shadow:0 0 0 2px rgba(45,212,191,.45)}

/* ── ۴) کارت‌ها: گرادیان ظریف + سایه‌ی لطیف ── */
html.dark .card{
  background:linear-gradient(180deg,#151f36 0%,#111a2d 100%);
  border-color:rgba(148,163,184,.14);
  box-shadow:inset 0 1px 0 rgba(148,163,184,.06), 0 8px 24px -12px rgba(2,6,23,.7);
}

/* ── ۵) دکمه اصلی: گرادیان + هاله ── */
html.dark .btn-primary{
  background:linear-gradient(135deg,#0d9488,#0f766e);
  box-shadow:0 4px 14px -4px rgba(13,148,136,.55);
}
html.dark .btn-primary:hover{
  background:linear-gradient(135deg,#14b8a6,#0d9488);
  box-shadow:0 6px 20px -4px rgba(20,184,166,.6);
}

/* ── ۶) فرم‌ها: فوکوس نئونی ── */
html.dark .input{background:#0d1526;border-color:rgba(148,163,184,.2)}
html.dark .input:focus{
  border-color:#2dd4bf;background:#0f1a30;
  box-shadow:0 0 0 3px rgba(45,212,191,.18);
}
html.dark .input::placeholder{color:#5b6b8c}
html.dark .label{color:#93a5c7}

/* ── ۷) آمار داشبورد: هاله‌ی هم‌رنگ آیکون ── */
html.dark .stat-icon{box-shadow:0 0 20px -6px currentColor;border-radius:.9rem}

/* ── ۸) ردیف کارها و کانبان ── */
html.dark .task-row{background:#111a2d;border-color:rgba(148,163,184,.14)}
html.dark .task-row:hover{border-color:rgba(45,212,191,.4)}
html.dark .kanban-col{background:rgba(13,21,38,.55);border-color:rgba(148,163,184,.14)}
html.dark .kanban-col.drag-over{border-color:#2dd4bf;background:rgba(13,148,136,.08)}
html.dark .kanban-card{background:#151f36;border-color:rgba(148,163,184,.16)}
html.dark .kanban-card:hover{border-color:rgba(45,212,191,.35)}

/* ── ۹) تقویم جلالی ── */
html.dark .jc-grid{background:rgba(148,163,184,.15);border-color:rgba(148,163,184,.15)}
html.dark .jc-weekday{background:#0d1526;color:#7d8db0}
html.dark .jc-day{background:#111a2d}
html.dark .jc-day:hover{background:#17223a}
html.dark .jc-weekend{background:#0f1829}
html.dark .jc-today{background:rgba(13,148,136,.10)}
html.dark .jc-today .jc-num{color:#2dd4bf;text-shadow:0 0 12px rgba(45,212,191,.55)}
html.dark .jc-ev{background:color-mix(in srgb,var(--ev,#0d9488) 22%,#0b1220)}
html.dark .jc-more{color:#7d8db0}

/* ── ۱۰) یادداشت‌ها: رنگی می‌مانند ولی با قاب ── */
html.dark .note-card{
  filter:saturate(.92) brightness(.97);
  box-shadow:0 6px 16px rgba(2,6,23,.55);
  border:1px solid rgba(255,255,255,.14);
}

/* ── ۱۱) مودال / دراپ‌داون / توست ── */
html.dark .modal-box{
  background:#131d33;border:1px solid rgba(148,163,184,.16);
  box-shadow:0 24px 60px rgba(2,6,23,.65);
}
html.dark .modal-header{border-bottom-color:rgba(148,163,184,.14)}
html.dark .dd-panel{
  background:#131d33;border-color:rgba(148,163,184,.16);
  box-shadow:0 16px 40px rgba(2,6,23,.6);
}
html.dark .toast{background:#131d33;border-color:rgba(148,163,184,.16)}
html.dark .notif-item{border-bottom-color:rgba(148,163,184,.1)}
html.dark .notif-item.unread{background:rgba(13,148,136,.09)}

/* ── ۱۲) هشدارها و سوئیچ نما ── */
html.dark .alert-success{background:rgba(22,163,74,.12);color:#86efac;border:1px solid rgba(22,163,74,.25)}
html.dark .alert-error{background:rgba(225,29,72,.12);color:#fda4af;border:1px solid rgba(225,29,72,.25)}
html.dark .view-switch{background:#0d1526;border:1px solid rgba(148,163,184,.15)}
html.dark .btn-view{color:#7d8db0}
html.dark .btn-view.active{background:#17223a;color:#5eead4}

/* ── ۱۳) جزئیات: اسکرول‌بار و انتخاب متن ── */
html.dark ::-webkit-scrollbar-thumb{background:#2a3a55}
html.dark ::-webkit-scrollbar-thumb:hover{background:#3b4d6b}
html.dark ::selection{background:rgba(20,184,166,.35)}

/* ── ۱۴) انیمیشن نرم تعویض تم ── */
html.theme-anim body,html.theme-anim .card,html.theme-anim .sidebar,html.theme-anim .topbar,
html.theme-anim .input,html.theme-anim .btn,html.theme-anim .task-row,html.theme-anim .kanban-col{
  transition:background-color .3s ease,border-color .3s ease,color .3s ease,box-shadow .3s ease;
}