html[data-theme="dark"] .card-controls{
      border-color:#2a3140;
    }

    html[data-theme="dark"] .badge{
      background:#1b2130;
      color:#b1b8c8;
      border-color:#303749;
    }
    html[data-theme="dark"] .badge.selected{
      background:#18342a;
      color:#69d3aa;
      border-color:#285341;
    }
    html[data-theme="dark"] .badge.candidate{
      background:#382b1b;
      color:#e3ac5e;
      border-color:#5a452a;
    }
    html[data-theme="dark"] .badge.priority{
      background:#292844;
      color:#b5b1ff;
      border-color:#454474;
    }

    html[data-theme="dark"] .group-select,
    html[data-theme="dark"] .status-toggle{
      background:#191f2d;
      color:var(--ink);
      border-color:#303749;
    }
    html[data-theme="dark"] .status-toggle.on{
      background:#173329;
      color:#65d0a6;
      border-color:#285442;
    }

    html[data-theme="dark"] .timeline-scroll,
    html[data-theme="dark"] .timeline,
    html[data-theme="dark"] .lane{
      background:#141927;
    }
    html[data-theme="dark"] .axis-row,
    html[data-theme="dark"] .axis-track,
    html[data-theme="dark"] .axis-corner{
      background:#171d2b;
      border-color:#2b3243;
    }
    html[data-theme="dark"] .axis-track{
      background:linear-gradient(180deg,#181e2d,#151b29);
    }
    html[data-theme="dark"] .tick{
      border-color:#30384a;
    }
    html[data-theme="dark"] .tick::after{
      background:#6f7788;
    }
    html[data-theme="dark"] .tick-label{
      color:#9da5b6;
    }
    html[data-theme="dark"] .day-row{
      border-color:#2a3141;
    }
    html[data-theme="dark"] .day-label{
      color:#e4e7ef;
      background:linear-gradient(90deg,#171d2c,#151a28);
      border-color:#2b3243;
      box-shadow:-7px 0 14px rgba(0,0,0,.14);
    }
    html[data-theme="dark"] .lane::before{
      background:#242b3b;
    }
    html[data-theme="dark"] .empty-timeline{
      color:#9fa7b7;
    }

    html[data-theme="dark"] .storage{
      background:#171d2b;
      color:#9fa7b8;
      border-color:#343c4f;
    }
    html[data-theme="dark"] .storage-state{
      background:#173329;
      color:#64d0a5;
    }

    html[data-theme="dark"] .exam-item{
      border-color:#2a3140;
    }
    html[data-theme="dark"] .date-card{
      background:linear-gradient(135deg,#282742,#302b4b);
      color:#bbb8ff;
      border-color:#45446d;
    }

    html[data-theme="dark"] input,
    html[data-theme="dark"] select,
    html[data-theme="dark"] textarea{
      background:#171d2b;
      color:#eef1f7;
      border-color:#343c4e;
    }
    html[data-theme="dark"] input:hover,
    html[data-theme="dark"] select:hover,
    html[data-theme="dark"] textarea:hover{
      border-color:#454e62;
    }
    html[data-theme="dark"] input:focus,
    html[data-theme="dark"] select:focus,
    html[data-theme="dark"] textarea:focus{
      border-color:#817cff;
      box-shadow:0 0 0 3px rgba(129,124,255,.12);
    }
    html[data-theme="dark"] input::placeholder,
    html[data-theme="dark"] textarea::placeholder{
      color:#757d8e;
    }
    html[data-theme="dark"] input.invalid,
    html[data-theme="dark"] select.invalid,
    html[data-theme="dark"] textarea.invalid{
      border-color:#d76872!important;
      background:#27191d!important;
      box-shadow:0 0 0 3px rgba(255,113,125,.08)!important;
    }

    html[data-theme="dark"] .modal,
    html[data-theme="dark"] .modal-head,
    html[data-theme="dark"] .modal-foot,
    html[data-theme="dark"] .app-dialog{
      background:#151a28;
      color:var(--ink);
      border-color:#2d3547;
    }
    html[data-theme="dark"] .modal-head,
    html[data-theme="dark"] .modal-foot{
      background:rgba(21,26,40,.97);
    }
    html[data-theme="dark"] .section,
    html[data-theme="dark"] .group-card,
    html[data-theme="dark"] .group-head,
    html[data-theme="dark"] .session-row{
      background:#181e2d;
      border-color:#2d3547;
    }
    html[data-theme="dark"] .group-head{
      background:#1a2030;
    }

    html[data-theme="dark"] .app-dialog-actions{
      background:linear-gradient(180deg,#151a28,#141927);
      border-color:#2d3547;
    }
    html[data-theme="dark"] .app-dialog-target{
      background:#191f2e;
      color:#e6e9f0;
      border-color:#30384a;
    }
    html[data-theme="dark"] .app-dialog-error{
      background:#3b2026;
      color:#ff9aa3;
      border-color:#5a3038;
    }

    html[data-theme="dark"] .jalali-popover,
    html[data-theme="dark"] .jalali-calendar,
    html[data-theme="dark"] .calendar-popover{
      background:#171d2b!important;
      color:#eef1f7!important;
      border-color:#343c4e!important;
      box-shadow:0 20px 50px rgba(0,0,0,.32)!important;
    }

    html[data-theme="dark"] .empty-icon{
      background:#292844;
      color:#b9b6ff;
    }

    /* Theme toggle */
    .theme-toggle{
      min-width:42px;
      padding:0 12px;
      gap:7px;
    }
    .theme-toggle-icon{
      width:18px;
      height:18px;
      display:grid;
      place-items:center;
      flex:0 0 auto;
    }
    .theme-toggle-icon svg{
      width:18px;
      height:18px;
      display:block;
    }
    .theme-toggle-label{
      font-size:10.5px;
      font-weight:850;
    }

    @media(max-width:760px){
      .theme-toggle-label{display:none}
      .theme-toggle{width:42px;min-width:42px;padding:0}
    }


    /* ===== v6.6 — refined timetable course cards ===== */
    .course-block{
      isolation:isolate;
      border:0!important;
      background:linear-gradient(138deg,var(--course-light-a),var(--course-light-b))!important;
      box-shadow:
        0 10px 24px color-mix(in srgb,var(--course-light-a) 20%,transparent),
        inset 0 0 0 1px rgba(255,255,255,.13),
        inset 0 1px 0 rgba(255,255,255,.18)!important;
      border-radius:16px;
      padding:11px 13px 11px 14px;
      transition:transform .17s ease,box-shadow .18s ease,filter .18s ease;
    }
    .course-block::before{
      content:"";
      position:absolute;
      inset:0;
      z-index:0;
      pointer-events:none;
      border-radius:inherit;
      background:
        linear-gradient(180deg,rgba(255,255,255,.14) 0%,rgba(255,255,255,.035) 36%,transparent 62%);
    }
    .course-block::after{
      content:"";
      position:absolute;
      z-index:0;
      top:13px;
      bottom:13px;
      right:7px;
      width:3px;
      border-radius:999px;
      background:rgba(255,255,255,.58);
      opacity:.72;
      pointer-events:none;
    }
    .course-block > *{
      position:relative;
      z-index:1;
    }
