    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      --c-bg: #F7F4EE;
      --c-surface: #FCFBF8;
      --c-surface2: #F0EDE6;
      --c-border: #E7E2D8;
      --c-border2: #DDD8CE;
      --c-text: #24352F;
      --c-text2: #4A5550;
      --c-text3: #6A736E;
      --c-text4: #9AA39E;
      --c-topbar: #FCFBF8;
      --c-primary: #1E3932;
      --c-accent: #2D6A4F;
      --c-success: #4F8A68;
      --c-sage: #DCE8E1;
      --c-warn: #B85C4A;
      --c-warn-bg: #F7ECE8;
      --shadow-card: 0 1px 4px rgba(30, 57, 50, .06), 0 0 0 1px rgba(30, 57, 50, .05);
      --shadow-hover: 0 6px 20px rgba(30, 57, 50, .1), 0 0 0 1px rgba(30, 57, 50, .06);
    }

    [data-theme='dark'] {
      --c-bg: #111827;
      --c-surface: #1f2937;
      --c-surface2: #374151;
      --c-border: #374151;
      --c-border2: #4b5563;
      --c-text: #f3f4f6;
      --c-text2: #d1d5db;
      --c-text3: #9ca3af;
      --c-text4: #6b7280;
      --c-topbar: #1f2937;
      --c-primary: #1E3932;
      --c-accent: #2D6A4F;
      --c-success: #4F8A68;
      --c-sage: #2d4a40;
      --c-warn: #B85C4A;
      --c-warn-bg: #3a2420;
      --shadow-card: 0 2px 8px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .04);
      --shadow-hover: 0 6px 20px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .07);
    }

    @media(prefers-color-scheme:dark) {
      :root:not([data-theme='light']) {
        --c-bg: #111827;
        --c-surface: #1f2937;
        --c-surface2: #374151;
        --c-border: #374151;
        --c-border2: #4b5563;
        --c-text: #f3f4f6;
        --c-text2: #d1d5db;
        --c-text3: #9ca3af;
        --c-text4: #6b7280;
        --c-topbar: #1f2937;
        --c-primary: #1E3932;
        --c-accent: #2D6A4F;
        --c-success: #4F8A68;
        --c-sage: #2d4a40;
        --c-warn: #B85C4A;
        --c-warn-bg: #3a2420;
        --shadow-card: 0 2px 8px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .04);
        --shadow-hover: 0 6px 20px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .07);
      }
    }

    body {
      font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
      background: var(--c-bg);
      color: var(--c-text);
      display: flex;
      height: 100vh;
      overflow: hidden;
      line-height: 1.5;
    }

    /* ── SIDEBAR ── */
    #sidebar {
      width: 220px;
      min-width: 220px;
      background: #1E3932;
      display: flex;
      flex-direction: column;
      height: 100vh;
      overflow-y: auto;
    }

    #sidebar-logo {
      padding: 22px 16px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    #sidebar-logo .sys-name {
      color: #fff;
      font-size: 15px;
      font-weight: 700;
      line-height: 1.4;
      letter-spacing: -.1px;
    }

    #sidebar-logo .sys-unit {
      color: rgba(255, 255, 255, .45);
      font-size: 11px;
      margin-top: 3px;
      letter-spacing: .2px;
    }

    #sidebar nav {
      flex: 1;
      padding: 10px 8px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      margin: 1px 0;
      border-radius: 10px;
      color: rgba(255, 255, 255, .62);
      cursor: pointer;
      transition: background .18s, color .18s;
      font-size: 13.5px;
      letter-spacing: -.1px;
      font-weight: 500;
    }

    .nav-item:hover {
      background: rgba(255, 255, 255, .08);
      color: rgba(255, 255, 255, .9);
    }

    .nav-item.active {
      background: rgba(255, 255, 255, .14);
      color: #fff;
      font-weight: 600;
    }

    .nav-item svg {
      opacity: .6;
      flex-shrink: 0;
    }

    .nav-item.active svg {
      opacity: 1;
    }

    #sidebar-footer {
      padding: 14px 16px;
      border-top: 1px solid rgba(255, 255, 255, .08);
    }

    .user-card-sb {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .user-avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: #e8e3dc;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      color: #555;
      font-size: 14px;
      flex-shrink: 0;
      overflow: hidden;
      background-size: cover;
      background-position: center;
    }

    .user-name-sb {
      color: #fff;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .user-role-sb {
      color: rgba(255, 255, 255, .5);
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

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

    #topbar {
      background: var(--c-topbar);
      border-bottom: 1px solid var(--c-border);
      padding: 0 24px;
      height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
    }

    #topbar-title {
      font-size: 17px;
      font-weight: 600;
      color: var(--c-primary);
      letter-spacing: -.2px;
    }

    .topbar-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    #content {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
    }

    /* ── STAT CARDS ── */
    .stat-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
      margin-bottom: 24px;
    }

    .stat-card {
      background: var(--c-surface);
      border: 1px solid var(--c-border);
      border-radius: 12px;
      padding: 16px 18px;
      box-shadow: var(--shadow-card);
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .stat-ico {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      border-radius: 9px;
      background: var(--c-surface2);
      color: var(--c-text2);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .stat-ico svg {
      width: 19px;
      height: 19px;
    }

    .stat-num {
      font-size: 24px;
      font-weight: 700;
      line-height: 1;
      letter-spacing: -.3px;
      color: var(--c-text);
    }

    .stat-lbl {
      font-size: 11px;
      color: var(--c-text3);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .6px;
      margin-top: 5px;
    }

    .stat-card-neutral .stat-ico {
      background: var(--c-surface2);
      color: var(--c-text2);
    }

    .stat-card-green .stat-ico {
      background: #DCE8E1;
      color: #2D6A4F;
    }

    .stat-card-green .stat-num {
      color: #2D6A4F;
    }

    .stat-card-blue .stat-ico {
      background: #e4edf9;
      color: #2a609e;
    }

    .stat-card-blue .stat-num {
      color: #2a609e;
    }

    .stat-card-red .stat-ico {
      background: #F7ECE8;
      color: #B85C4A;
    }

    .stat-card-red .stat-num {
      color: #B85C4A;
    }

    /* ── CARDS ── */
    .section-card {
      background: var(--c-surface);
      border-radius: 18px;
      padding: 22px;
      box-shadow: var(--shadow-card);
      margin-bottom: 20px;
    }

    .section-card h3 {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--c-primary);
      margin-bottom: 16px;
      letter-spacing: -.1px;
    }

    .btn-compact {
      min-height: 28px;
      padding: 5px 12px;
      font-size: 12px;
      line-height: 1.35;
      white-space: nowrap;
    }

    .class-card {
      padding: 0;
      overflow: hidden;
    }

    .class-card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 18px 22px;
      border-bottom: 1px solid var(--c-border);
    }

    .class-title-wrap {
      min-width: 0;
    }

    .class-title {
      color: var(--c-primary);
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0;
      line-height: 1.35;
    }

    .class-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 12px;
      margin-top: 4px;
      color: var(--c-text3);
      font-size: 12.5px;
      font-weight: 500;
    }

    .class-meta span {
      position: relative;
    }

    .class-meta span + span::before {
      content: '';
      position: absolute;
      left: -7px;
      top: 50%;
      width: 3px;
      height: 3px;
      border-radius: 50%;
      background: var(--c-text4);
      transform: translateY(-50%);
    }

    .class-head-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .class-count {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 5px 10px;
      border-radius: 999px;
      background: var(--c-sage);
      color: var(--c-accent);
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .class-empty {
      display: flex;
      align-items: center;
      gap: 14px;
      margin: 16px 22px 20px;
      padding: 16px;
      border: 1px dashed var(--c-border2);
      border-radius: 14px;
      background: var(--c-surface2);
    }

    .class-empty-icon {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      background: var(--c-sage);
      color: var(--c-accent);
    }

    .class-empty-icon svg {
      width: 21px;
      height: 21px;
    }

    .class-empty-copy {
      flex: 1;
      min-width: 0;
    }

    .class-empty-title {
      color: var(--c-text);
      font-size: 13.5px;
      font-weight: 700;
      line-height: 1.35;
    }

    .class-empty-sub {
      color: var(--c-text3);
      font-size: 12.5px;
      margin-top: 2px;
    }

    .class-card .tbl-wrap {
      padding: 0 22px 20px;
    }

    .staff-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 14px;
    }

    .staff-card {
      background: var(--c-surface2);
      border: 1px solid var(--c-border);
      border-radius: 14px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      transition: box-shadow .2s, transform .2s;
    }

    .staff-card:hover {
      box-shadow: var(--shadow-hover);
      transform: translateY(-1px);
    }

    .staff-card-admin {
      border: 1.5px solid #e0b563;
      background: linear-gradient(165deg, #fbf1da, var(--c-surface2) 60%);
    }

    .staff-card-hd {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .staff-avatar {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 700;
      font-size: 16px;
    }

    .staff-card-id {
      min-width: 0;
    }

    .staff-card-name {
      font-weight: 700;
      font-size: 14px;
      color: var(--c-text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .staff-card-email {
      font-size: 12px;
      color: var(--c-text3);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .staff-card-badges {
      display: flex;
      gap: 6px;
    }

    .staff-card-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .two-col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-bottom: 20px;
    }

    /* ── BUTTONS ── */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 18px;
      border-radius: 50px;
      border: none;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      transition: all .2s;
      letter-spacing: -.05px;
    }

    .btn-primary {
      background: var(--c-primary);
      color: #fff;
      box-shadow: 0 1px 4px rgba(30, 57, 50, .2);
    }

    .btn-primary:hover {
      background: #2D6A4F;
      box-shadow: 0 3px 10px rgba(30, 57, 50, .28);
    }

    .btn-outline {
      background: var(--c-surface);
      color: #1E3932;
      border: 1.5px solid var(--c-border);
    }

    .btn-outline:hover {
      background: var(--c-surface2);
      border-color: var(--c-border2);
    }

    .btn-sm {
      padding: 5px 14px;
      font-size: 12.5px;
    }

    /* Table action button */
    .btn-action {
      display: inline-flex;
      align-items: center;
      padding: 4px 12px;
      border-radius: 8px;
      border: 1.5px solid var(--c-border2);
      background: var(--c-surface);
      color: #1E3932;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: all .2s;
    }

    .btn-action:hover {
      background: #1E3932;
      color: #fff;
      border-color: #1E3932;
    }

    /* ── BADGES ── */
    .badge {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 6px;
      font-size: 11.5px;
      font-weight: 600;
      white-space: nowrap;
    }

    .bg-green {
      background: #DCE8E1;
      color: #2D6A4F;
    }

    .bg-blue {
      background: #e4edf9;
      color: #2a609e;
    }

    .bg-gray {
      background: var(--c-border);
      color: var(--c-text2);
    }

    .bg-red {
      background: #F7ECE8;
      color: #B85C4A;
    }

    .bg-gold {
      background: #f5ecd6;
      color: #8a6520;
    }

    /* Role badges — pill style for sidebar footer */
    .badge-pill {
      border-radius: 50px;
    }

    /* ── TABLE ── */
    .tbl-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13.5px;
    }

    .tbl-fixed {
      table-layout: fixed;
    }

    th {
      background: transparent;
      color: var(--c-text3);
      font-weight: 600;
      padding: 9px 12px 8px;
      text-align: left;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .7px;
      border-bottom: 1.5px solid var(--c-border);
    }

    td {
      padding: 11px 12px;
      border-bottom: 1px solid var(--c-border);
      vertical-align: middle;
      line-height: 1.45;
    }

    tr:hover td {
      background: #faf8f6;
    }

    tr:last-child td {
      border-bottom: none;
    }

    /* ── PROGRESS ── */
    .pbar {
      background: var(--c-sage);
      border-radius: 50px;
      height: 7px;
      overflow: hidden;
    }

    .pbar-fill {
      height: 100%;
      border-radius: 50px;
      transition: width .4s;
    }

    .pf-green {
      background: #2D6A4F;
    }

    .pf-gold {
      background: #c8973a;
    }

    .pf-red {
      background: #B85C4A;
    }

    .pf-gray {
      background: #b8b2a8;
    }

    /* ── FILTERS ── */
    .filter-bar {
      display: flex;
      gap: 10px;
      margin-bottom: 16px;
      flex-wrap: wrap;
      align-items: center;
    }

    .sel-wrap {
      position: relative;
      display: inline-block;
    }

    .sel-wrap select {
      appearance: none;
      -webkit-appearance: none;
      background: var(--c-surface);
      border: 1.5px solid var(--c-border2);
      border-radius: 50px;
      padding: 8px 34px 8px 16px;
      font-family: inherit;
      font-size: 13px;
      font-weight: 600;
      color: var(--c-text);
      cursor: pointer;
      width: auto;
      box-shadow: 0 1px 2px rgba(0,0,0,.04);
      transition: border-color .15s, box-shadow .15s;
    }

    .sel-wrap select:hover {
      border-color: #00754A;
    }

    .sel-wrap select:focus {
      outline: none;
      border-color: #00754A;
      box-shadow: 0 0 0 3px rgba(0,117,74,.12);
    }

    .sel-wrap::after {
      content: '▾';
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      pointer-events: none;
      color: #00754A;
      font-size: 12px;
      font-weight: 700;
    }

    /* ── CUSTOM SELECT (_csel) ── */
    .csel {
      position: relative;
      display: inline-block;
      user-select: none;
    }

    .csel-val {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 32px 7px 14px;
      background: var(--c-surface);
      border: 1.5px solid var(--c-border);
      border-radius: 50px;
      font-size: 13px;
      color: var(--c-text);
      cursor: pointer;
      min-width: 140px;
      white-space: nowrap;
      transition: border-color .18s, background .18s, box-shadow .18s;
    }

    .csel-val:hover,
    .csel.open .csel-val {
      border-color: #2D6A4F;
      box-shadow: 0 0 0 3px rgba(45, 106, 79, .1);
    }

    .csel-val::after {
      content: '▾';
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%) rotate(0deg);
      color: var(--c-text3);
      font-size: 12px;
      transition: transform .2s;
    }

    .csel.open .csel-val::after {
      transform: translateY(-50%) rotate(180deg);
    }

    .csel-opts {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      min-width: 100%;
      background: var(--c-surface);
      border: 1px solid var(--c-border);
      border-radius: 14px;
      box-shadow: 0 8px 28px rgba(0, 0, 0, .1), 0 0 0 1px rgba(0, 0, 0, .04);
      z-index: 500;
      overflow: hidden;
      padding: 5px 0;
    }

    .csel.open .csel-opts {
      display: block;
    }

    .csel-opt {
      padding: 10px 16px;
      font-size: 13px;
      cursor: pointer;
      color: var(--c-text);
      transition: background .12s;
      white-space: nowrap;
    }

    .csel-opt:hover {
      background: var(--c-surface2);
    }

    .csel-opt.selected {
      font-weight: 600;
      color: #2D6A4F;
      background: #edf4f0;
    }

    /* ── MODAL ── */
    .modal-ov {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .45);
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
    }

    .modal-ov.open {
      display: flex;
    }

    /* m-confirm phải nổi trên cả #onboarding-screen (z-index 10000) vì declineOnboarding()
       gọi customConfirm() ngay trong lúc màn onboarding đang mở. */
    #m-confirm {
      z-index: 10001;
    }

    .modal {
      background: var(--c-surface);
      border-radius: 22px;
      padding: 28px;
      width: 100%;
      max-width: 480px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 24px 64px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .04);
    }

    .modal h2 {
      font-size: 18px;
      font-weight: 700;
      color: #1E3932;
      margin-bottom: 22px;
      letter-spacing: -.2px;
    }

    .fg {
      margin-bottom: 16px;
    }

    .fg label {
      display: block;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--c-text3);
      margin-bottom: 6px;
      letter-spacing: .2px;
    }

    .fg input,
    .fg select,
    .fg textarea {
      width: 100%;
      border: 1.5px solid var(--c-border);
      background: var(--c-surface2);
      color: var(--c-text);
      border-radius: 10px;
      padding: 10px 13px;
      font-size: 13.5px;
      outline: none;
      font-family: inherit;
      transition: border-color .15s, background .15s;
    }

    .fg input:focus,
    .fg select:focus,
    .fg textarea:focus {
      border-color: #2D6A4F;
      background: #fff;
    }

    .fg select {
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%236A736E'/></svg>");
      background-repeat: no-repeat;
      background-position: right 14px center;
      padding-right: 36px;
      cursor: pointer;
    }

    .fg textarea {
      min-height: 80px;
      resize: vertical;
    }

    .fg input[type="date"],
    .fg input[type="time"] {
      min-width: 0;
      padding: 10px 8px;
    }

    .modal-footer {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 22px;
    }

    .reminder-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 8px;
      border-radius: 8px;
      cursor: pointer;
    }

    .reminder-row:hover {
      background: var(--c-surface2);
    }

    .reminder-row input[type="checkbox"] {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
    }

    .reminder-row-name {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--c-text);
    }

    .reminder-row-meta {
      font-size: 11.5px;
      color: var(--c-text3);
      margin-top: 1px;
    }

    /* ── BAR CHART ── */
    .bar-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }

    .bar-lbl {
      font-size: 12.5px;
      color: #444;
      width: 180px;
      flex-shrink: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .bar-track {
      flex: 1;
      background: #e8e3dc;
      border-radius: 50px;
      height: 10px;
      overflow: hidden;
    }

    .bar-fill {
      height: 100%;
      border-radius: 50px;
      transition: width .5s;
    }

    .bar-cnt {
      font-size: 12px;
      color: #767676;
      width: 24px;
      text-align: right;
      flex-shrink: 0;
    }

    /* ── TASK ITEMS ── */
    .task-item {
      padding: 11px 0;
      border-bottom: 1px solid var(--c-border);
      display: flex;
      align-items: flex-start;
      gap: 10px;
    }

    .task-item:last-child {
      border-bottom: none;
    }

    .tdot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-top: 6px;
      flex-shrink: 0;
    }

    .ti-name {
      font-size: 13.5px;
      font-weight: 500;
      line-height: 1.4;
    }

    .ti-sub {
      font-size: 12px;
      color: var(--c-text3);
      margin-top: 2px;
      line-height: 1.4;
    }

    /* ── AI ── */
    .ai-card {
      padding: 22px 24px;
    }

    .ai-chat-log {
      max-height: 320px;
      overflow-y: auto;
      padding: 4px 2px;
      margin-bottom: 14px;
    }

    .msg {
      margin-bottom: 12px;
    }

    .msg-bubble {
      display: inline-block;
      padding: 9px 13px;
      border-radius: 12px;
      font-size: 13.5px;
      max-width: 85%;
      text-align: left;
      line-height: 1.6;
      white-space: pre-wrap;
      border: 1px solid var(--c-border);
    }

    .msg-user {
      text-align: right;
    }

    .msg-bubble.msg-user {
      background: var(--c-primary);
      border-color: var(--c-primary);
      color: #fff;
    }

    .msg-bubble.msg-ai {
      background: var(--c-surface2);
      color: var(--c-text);
    }

    .chat-row {
      display: flex;
      gap: 10px;
      align-items: center;
      max-width: 620px;
    }

    .chat-row input {
      flex: 1;
      min-width: 0;
      border: 1.5px solid var(--c-border2);
      border-radius: 999px;
      padding: 10px 16px;
      font-size: 13.5px;
      outline: none;
      background: var(--c-surface);
      color: var(--c-text);
      transition: border-color .18s, box-shadow .18s;
    }

    .chat-row input:focus {
      border-color: var(--c-accent);
      box-shadow: 0 0 0 3px rgba(45, 106, 79, .12);
    }

    .chat-send-btn {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      border: none;
      border-radius: 50%;
      background: var(--c-primary);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform .15s, box-shadow .15s, background .15s;
      box-shadow: 0 4px 12px rgba(30, 57, 50, .18);
    }

    .chat-send-btn svg {
      width: 18px;
      height: 18px;
    }

    .chat-send-btn:hover {
      transform: translateY(-1px);
      background: var(--c-accent);
      box-shadow: 0 6px 16px rgba(30, 57, 50, .22);
    }

    .ai-out {
      background: var(--c-surface2);
      border: 1px solid var(--c-border);
      border-radius: 14px;
      padding: 16px;
      font-size: 13.5px;
      line-height: 1.7;
      white-space: pre-wrap;
      min-height: 58px;
      margin-top: 14px;
      color: var(--c-text2);
    }

    .ai-empty-hint {
      color: var(--c-text4);
      font-style: normal;
    }

    .ai-section-hd {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
    }

    .ai-section-icon {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      border-radius: 12px;
      background: var(--c-surface2);
      border: 1px solid var(--c-border);
      color: var(--c-primary);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .ai-section-icon svg {
      width: 20px;
      height: 20px;
    }

    .ai-icon-chat {
      background: var(--c-surface2);
    }

    .ai-icon-report {
      background: var(--c-surface2);
    }

    .ai-icon-analysis {
      background: var(--c-surface2);
    }

    .ai-section-title {
      font-size: 15.5px;
      font-weight: 700;
      color: var(--c-primary);
      letter-spacing: 0;
    }

    .ai-section-sub {
      font-size: 12.5px;
      color: var(--c-text3);
      margin-top: 2px;
    }

    .ai-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
    }

    .ai-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      max-width: 680px;
      margin-bottom: 12px;
    }

    .ai-field {
      min-height: 36px;
      border: 1.5px solid var(--c-border2);
      border-radius: 10px;
      padding: 7px 10px;
      background: var(--c-surface);
      color: var(--c-text);
      font-size: 13px;
      outline: none;
      transition: border-color .18s, box-shadow .18s;
    }

    .ai-field:focus {
      border-color: var(--c-accent);
      box-shadow: 0 0 0 3px rgba(45, 106, 79, .12);
    }

    .ai-field-wide {
      flex: 1;
      min-width: 220px;
    }

    .ai-field-year {
      width: 92px;
    }

    @media(max-width:768px) {
      .ai-card {
        padding: 18px;
      }

      .chat-row {
        max-width: none;
      }

      .ai-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
      }

      .ai-field-wide {
        grid-column: 1 / -1;
        min-width: 0;
      }
    }

    .chart-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-top: 18px;
      margin-bottom: 20px;
    }

    @media(max-width:900px) {
      .chart-grid {
        grid-template-columns: 1fr;
      }
    }

    .chart-wrap {
      position: relative;
      height: 240px;
      background: var(--c-surface);
      border-radius: 16px;
      padding: 16px;
      box-shadow: var(--shadow-card);
    }

    /* ── BACK BUTTON ── */
    .btn-back {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px 6px 10px;
      border-radius: 50px;
      border: 1.5px solid var(--c-border);
      background: var(--c-surface);
      color: var(--c-text2);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      margin-bottom: 16px;
      transition: all .2s;
    }

    .btn-back:hover {
      background: #1E3932;
      color: #fff;
      border-color: #1E3932;
    }

    .btn-back svg {
      transition: transform .18s;
    }

    .btn-back:hover svg {
      transform: translateX(-2px);
    }

    /* ── MISC ── */
    .empty {
      text-align: center;
      padding: 36px;
      color: #aaa;
      font-size: 14px;
    }

    .tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 11.5px;
      font-weight: 600;
      background: #DCE8E1;
      color: #2D6A4F;
    }

    .overdue {
      color: #B85C4A;
      font-size: 11.5px;
      font-weight: 600;
    }

    .spinner {
      display: inline-block;
      width: 14px;
      height: 14px;
      border: 2px solid rgba(0, 0, 0, .1);
      border-top-color: #2D6A4F;
      border-radius: 50%;
      animation: spin .8s linear infinite;
      vertical-align: middle;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg)
      }
    }

    /* ── DROPZONE (chọn / kéo-thả file) ── */
    .dropzone {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 100%;
      padding: 22px 16px;
      border: 2px dashed var(--c-border2);
      border-radius: 12px;
      background: var(--c-surface2);
      cursor: pointer;
      text-align: center;
      transition: border-color .15s, background .15s;
    }

    .dropzone:hover, .dropzone:focus-visible {
      border-color: #00754A;
      background: var(--c-sage);
    }

    .dropzone.dragover {
      border-color: #00754A;
      background: var(--c-sage);
    }

    .dropzone-icon {
      width: 30px;
      height: 30px;
      color: var(--c-accent);
    }

    .dropzone-title {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--c-text);
    }

    .dropzone-sub {
      font-size: 11.5px;
      color: var(--c-text3);
    }

    .file-chip {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      padding: 10px 12px;
      border: 1px solid var(--c-border2);
      border-radius: 10px;
      background: var(--c-surface);
    }

    .file-chip-icon {
      width: 30px;
      height: 30px;
      flex-shrink: 0;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--c-sage);
      color: var(--c-accent);
    }

    .file-chip-icon svg {
      width: 16px;
      height: 16px;
    }

    .file-chip-name {
      flex: 1;
      min-width: 0;
      font-size: 13px;
      font-weight: 600;
      color: var(--c-text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .file-chip-remove {
      flex-shrink: 0;
      width: 22px;
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      border: none;
      background: transparent;
      color: var(--c-text3);
      cursor: pointer;
      font-size: 15px;
      line-height: 1;
    }

    .file-chip-remove:hover {
      background: var(--c-surface2);
      color: #B85C4A;
    }

    /* ── HÌNH ẢNH MINH HỌA BÀI TẬP ── */
    .bt-img-list {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 10px;
    }

    .bt-img-thumb-wrap {
      position: relative;
      width: 84px;
      height: 84px;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--c-border2);
      background: var(--c-surface2);
    }

    .bt-img-thumb-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .bt-img-thumb-remove {
      position: absolute;
      top: 3px;
      right: 3px;
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      border: none;
      background: rgba(0, 0, 0, .55);
      color: #fff;
      cursor: pointer;
      font-size: 13px;
      line-height: 1;
    }

    .bt-img-thumb-remove:hover {
      background: #B85C4A;
    }

    .bt-img-gallery {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 10px;
      margin-top: 8px;
    }

    .bt-img-gallery a {
      display: block;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--c-border2);
      background: var(--c-surface2);
    }

    .bt-img-gallery img {
      width: 100%;
      height: 120px;
      object-fit: cover;
      display: block;
    }

    /* ── PHÒNG CARDS ── */
    .phong-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 12px;
      margin-bottom: 20px;
    }

    .phong-card {
      background: var(--c-surface);
      border-radius: 16px;
      padding: 18px;
      box-shadow: var(--shadow-card);
      border-left: 3px solid #2D6A4F;
      cursor: pointer;
      transition: box-shadow .2s, transform .2s;
    }

    .phong-card:hover {
      box-shadow: var(--shadow-hover);
      transform: translateY(-1px);
    }

    .phong-card .pc-name {
      font-size: 13.5px;
      font-weight: 700;
      color: #1E3932;
      margin-bottom: 12px;
      line-height: 1.35;
      letter-spacing: -.1px;
    }

    .phong-card .pc-nums {
      display: flex;
      gap: 14px;
    }

    .phong-card .pc-num {
      text-align: center;
    }

    .phong-card .pc-num .pn {
      font-size: 22px;
      font-weight: 800;
      line-height: 1;
      letter-spacing: -.5px;
    }

    .phong-card .pc-num .pl {
      font-size: 10px;
      color: var(--c-text4);
      text-transform: uppercase;
      margin-top: 3px;
      letter-spacing: .4px;
    }

    /* ── KHÓ KHĂN NOTE ── */
    .kk-note {
      border-radius: 0 6px 6px 0;
      padding: 7px 11px;
      font-size: 12px;
      margin-top: 7px;
      line-height: 1.5;
    }

    .kk-note-red {
      background: #fdf0ee;
      border-left: 3px solid #c82014;
      color: #9a2218;
    }

    .kk-note-amber {
      background: #fdf5ee;
      border-left: 3px solid #cba258;
      color: #8a5e28;
    }

    .db-section-hd-warn {
      color: #c82014;
    }

    .db-section-hd-soon {
      color: #b07a2e;
    }

    /* ── NHIỆM VỤ CON ROWS ── */
    .nvct-list {
      padding: 2px 0;
    }

    .nvct-row {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      padding: 16px 8px;
      border-bottom: 1px solid var(--c-border);
      transition: background .18s;
      border-radius: 8px;
      border-left: 3px solid transparent;
    }

    .nvct-row:last-child {
      border-bottom: none;
    }

    .nvct-row:hover {
      background: #faf8f5;
    }

    .nvct-row.nvct-done {
      opacity: .68;
    }

    .nvct-row.nvct-overdue-row {
      border-left-color: #d9a898;
    }

    .nvct-cb {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 2px solid #d1d5db;
      flex-shrink: 0;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border-color .18s, background .18s;
      position: relative;
    }

    .nvct-cb:hover {
      border-color: #2D6A4F;
    }

    .nvct-cb.done {
      background: #2D6A4F;
      border-color: #2D6A4F;
    }

    .nvct-cb.done::after {
      content: '✓';
      color: #fff;
      font-size: 12px;
      font-weight: 800;
      line-height: 1;
      position: absolute;
    }

    .nvct-cb.overdue {
      border-color: #B85C4A;
    }

    .nvct-info {
      flex: 1;
      min-width: 0;
    }

    .nvct-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--c-text1);
      line-height: 1.35;
      transition: color .18s;
    }

    .nvct-row.nvct-done .nvct-name {
      text-decoration: line-through;
      color: var(--c-text3);
    }

    .nvct-meta-row {
      font-size: 12px;
      color: var(--c-text3);
      margin-top: 3px;
    }

    .nvct-dl {
      font-size: 12.5px;
      flex-shrink: 0;
      text-align: right;
      color: var(--c-text3);
    }

    .nvct-dl.overdue {
      color: #B85C4A;
      font-weight: 600;
    }

    .nvct-dl.soon {
      color: #9a7020;
      font-weight: 600;
    }

    .nvct-dl.done-dl {
      color: #2D6A4F;
    }

    /* progress bar */
    .nvct-prog {
      margin-bottom: 20px;
    }

    .prog-bar-wrap {
      height: 7px;
      border-radius: 6px;
      background: var(--c-sage);
      overflow: hidden;
      display: flex;
      margin-bottom: 8px;
    }

    .prog-bar-done {
      background: #2D6A4F;
      transition: width .45s cubic-bezier(.4, 0, .2, 1);
      min-width: 0;
    }

    .prog-bar-ov {
      background: #B85C4A;
      transition: width .45s cubic-bezier(.4, 0, .2, 1);
      min-width: 0;
    }

    .nvct-prog-label {
      font-size: 12.5px;
      color: var(--c-text3);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    /* ── GANTT MINI ── */
    .gantt-wrap {
      overflow-x: auto;
      padding-bottom: 4px;
    }

    .gantt-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 9px;
      min-width: 380px;
    }

    .gantt-lbl {
      font-size: 12px;
      color: #444;
      width: 190px;
      min-width: 190px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-shrink: 0;
    }

    .gantt-track {
      flex: 1;
      height: 26px;
      background: #f2f0eb;
      border-radius: 6px;
      position: relative;
      overflow: hidden;
      cursor: pointer;
    }

    .gantt-track:hover {
      background: #eae6e0;
    }

    .gantt-bar {
      position: absolute;
      height: 100%;
      border-radius: 6px;
      overflow: hidden;
      transition: opacity .15s;
    }

    .gantt-bar:hover {
      opacity: .8;
    }

    .gantt-pct {
      width: 36px;
      text-align: right;
      font-size: 11.5px;
      font-weight: 700;
      flex-shrink: 0;
    }

    /* ── KANBAN ── */
    .kanban-board {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      align-items: start;
    }

    .kanban-col {
      background: var(--c-surface2);
      border-radius: 14px;
      padding: 12px;
    }

    .kanban-col-hd {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--c-border);
    }

    .kanban-col-hd .badge {
      font-size: 12px;
    }

    .kanban-cnt {
      font-size: 12px;
      font-weight: 700;
      color: var(--c-text4);
    }

    .kanban-cards {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }

    .kanban-card {
      background: var(--c-surface);
      border-radius: 10px;
      padding: 11px 12px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, .04), 0 0 0 1px rgba(0, 0, 0, .03);
      border-left: 3px solid var(--c-border);
    }

    .kanban-card.kc-ov {
      border-left-color: #B85C4A;
      background: #fbf6f4;
    }

    .kanban-card.kc-soon {
      border-left-color: #c8973a;
    }

    .kc-name {
      font-size: 13px;
      font-weight: 700;
      color: #1c1c1c;
      line-height: 1.4;
      margin-bottom: 5px;
    }

    .kc-sub {
      font-size: 12px;
      color: #767676;
      margin-bottom: 7px;
    }

    .kc-ft {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
    }

    /* ── INTERVENTION ITEMS ── */
    .intervention-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      border: 1px solid #ead5d0;
      border-radius: 12px;
      padding: 13px 14px;
      margin-bottom: 8px;
      cursor: pointer;
      transition: background .18s;
      background: var(--c-surface);
    }

    .intervention-item:hover {
      background: var(--c-warn-bg);
    }

    .intervention-item:last-child {
      margin-bottom: 0;
    }

    .ii-icon {
      font-size: 20px;
      margin-top: 1px;
      flex-shrink: 0;
    }

    .ii-body {
      flex: 1;
      min-width: 0;
    }

    .ii-title {
      font-size: 13.5px;
      font-weight: 700;
      color: #1c1c1c;
      margin-bottom: 3px;
      line-height: 1.3;
    }

    .ii-detail {
      font-size: 13px;
      color: #555;
      margin-bottom: 2px;
    }

    .ii-meta {
      font-size: 12px;
      color: #aaa;
    }

    .ii-arrow {
      color: #ddd;
      font-size: 18px;
      align-self: center;
      flex-shrink: 0;
    }

    /* ── PHÒNG BAN BAR LIST ── */
    .phong-bar-list {
      display: flex;
      flex-direction: column;
      background: var(--c-surface);
      border-radius: 18px;
      box-shadow: var(--shadow-card);
      overflow: hidden;
      margin-bottom: 24px;
    }

    .phong-bar-row {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px 20px;
      cursor: pointer;
      transition: background .18s;
      border-bottom: 1px solid var(--c-border);
      position: relative;
    }

    .phong-bar-row:last-child {
      border-bottom: none;
    }

    .phong-bar-row::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 3px;
      background: transparent;
      transition: background .15s;
    }

    .phong-bar-row:hover {
      background: var(--c-surface2);
    }

    .phong-bar-row:hover::before {
      background: #2D6A4F;
    }

    .phong-bar-row.pb-empty {
      opacity: 0.45;
      cursor: default;
    }

    .phong-bar-row.pb-empty:hover {
      background: transparent;
    }

    .phong-bar-row.pb-empty::before {
      display: none;
    }

    .pb-info {
      width: 220px;
      flex-shrink: 0;
    }

    .pb-name {
      font-size: 14px;
      font-weight: 800;
      color: var(--c-text);
      line-height: 1.2;
    }

    .pb-meta {
      font-size: 11.5px;
      color: var(--c-text3);
      margin-top: 3px;
      line-height: 1.4;
    }

    .pb-track {
      flex: 1;
      height: 7px;
      background: var(--c-border);
      border-radius: 4px;
      overflow: hidden;
      min-width: 60px;
    }

    .pb-fill {
      height: 100%;
      border-radius: 4px;
      background: #2D6A4F;
      transition: width .45s cubic-bezier(.4, 0, .2, 1);
    }

    .pb-pct {
      width: 44px;
      text-align: right;
      font-size: 14px;
      font-weight: 800;
      color: var(--c-text);
      flex-shrink: 0;
    }

    .pb-badge {
      flex-shrink: 0;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 700;
      min-width: 78px;
      text-align: center;
    }

    .pb-badge.pb-red {
      background: rgba(184, 92, 74, .1);
      color: #B85C4A;
    }

    .pb-badge.pb-gold {
      background: rgba(154, 112, 32, .12);
      color: #8a6520;
    }

    .pb-badge.pb-green {
      background: rgba(45, 106, 79, .1);
      color: #2D6A4F;
    }

    .pb-badge.pb-gray {
      background: var(--c-border);
      color: var(--c-text4);
    }

    .pb-chevron {
      color: var(--c-text4);
      font-size: 20px;
      flex-shrink: 0;
      line-height: 1;
      transition: transform .15s, color .15s;
    }

    .phong-bar-row:hover .pb-chevron {
      color: #2D6A4F;
      transform: translateX(3px);
    }

    /* keep for renderDBPhong mini-donut */
    .donut-chart-wrap {
      width: 104px;
      height: 104px;
      margin: 0 auto 14px;
      position: relative;
    }

    .db-section-hd {
      font-size: 15px;
      font-weight: 600;
      color: var(--c-primary);
      margin-bottom: 18px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--c-border);
      display: flex;
      align-items: center;
      gap: 8px;
      letter-spacing: -.15px;
    }

    .tbl-row-click {
      cursor: pointer;
    }

    .tbl-row-click:hover td {
      background: var(--c-surface2) !important;
    }

    /* ── HERO INTERVENTION ── */
    .hero-intervention {
      background: var(--c-warn-bg);
      border: 1px solid #ead5d0;
      border-left: 4px solid #B85C4A;
      border-radius: 18px;
      padding: 18px 22px;
      margin-bottom: 20px;
    }

    .hi-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }

    .hi-icon {
      font-size: 20px;
      flex-shrink: 0;
    }

    .hi-title {
      font-size: 15px;
      font-weight: 800;
      flex: 1;
    }

    .hi-count {
      font-size: 12.5px;
      color: #aaa;
      font-weight: 600;
      flex-shrink: 0;
    }

    .hi-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 9px 8px;
      margin: 0 -8px;
      border-top: 1px solid rgba(184, 92, 74, .1);
      cursor: pointer;
      border-radius: 6px;
      transition: background .12s;
    }

    .hi-item:hover {
      background: rgba(184, 92, 74, .06);
    }

    .hi-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .hi-body {
      flex: 1;
      min-width: 0;
    }

    .hi-nvc {
      font-size: 13.5px;
      font-weight: 700;
      color: #1c1c1c;
      line-height: 1.3;
      margin-bottom: 2px;
    }

    .hi-detail {
      font-size: 12.5px;
      color: #555;
      line-height: 1.4;
    }

    .hi-arrow {
      font-size: 18px;
      color: #d9a898;
      flex-shrink: 0;
    }

    /* ── STUCK STAFF LIST ── */
    .stuck-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid #f5f2ee;
    }

    .stuck-row:last-child {
      border-bottom: none;
    }

    .stuck-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .stuck-person {
      font-size: 13px;
      font-weight: 700;
      color: #1c1c1c;
      width: 140px;
      min-width: 140px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .stuck-task {
      flex: 1;
      min-width: 0;
    }

    .stuck-deadline {
      font-size: 12.5px;
      font-weight: 700;
      flex-shrink: 0;
      white-space: nowrap;
      min-width: 90px;
      text-align: right;
    }

    /* ── VIEW TOGGLE (NVCT) ── */
    .view-toggle {
      display: flex;
      background: var(--c-border);
      border-radius: 10px;
      padding: 3px;
      gap: 2px;
    }

    .vt-btn {
      padding: 5px 14px;
      border-radius: 8px;
      border: none;
      background: none;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--c-text3);
      cursor: pointer;
      transition: all .18s;
    }

    .vt-btn.active {
      background: #fff;
      color: #1E3932;
      box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    }

    /* ── MOBILE RESPONSIVE ── */
    #sb-toggle {
      display: none;
      position: fixed;
      top: 12px;
      left: 12px;
      z-index: 10000;
      background: #1E3932;
      border: none;
      border-radius: 8px;
      padding: 8px 10px;
      cursor: pointer;
      line-height: 0;
    }

    #sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .4);
      z-index: 998;
    }

    @media(max-width:768px) {
      body {
        flex-direction: column;
      }

      #sb-toggle {
        display: block;
      }

      #sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        z-index: 999;
        transition: left .25s;
        height: 100vh;
      }

      #sidebar.open {
        left: 0;
      }

      #sidebar-overlay.open {
        display: block;
      }

      #main {
        width: 100%;
        min-height: 100vh;
      }

      #topbar {
        padding: 0 12px 0 52px;
      }

      #content {
        padding: 12px;
      }

      .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      .two-col {
        grid-template-columns: 1fr !important;
      }

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

      .class-card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
      }

      .class-head-actions {
        width: 100%;
        justify-content: space-between;
      }

      .class-empty {
        align-items: flex-start;
        flex-direction: column;
        margin: 14px 16px 16px;
      }

      .class-empty .btn {
        width: 100%;
      }

      .class-card .tbl-wrap {
        padding: 0 16px 16px;
      }

      .kanban-board {
        grid-template-columns: 1fr 1fr;
      }

      .gantt-lbl {
        width: 90px;
        min-width: 90px;
      }

      table {
        font-size: 12px;
      }

      th,
      td {
        padding: 7px 8px;
      }

      .lc {
        max-width: 95vw;
      }

      .modal {
        padding: 18px;
      }

      /* Mobile search — show icon only, expand on tap */
      #search-wrap {
        flex: none;
        max-width: none;
        margin: 0;
      }

      #search-inp,
      .search-ico {
        display: none;
      }

      #search-mob-btn {
        display: flex;
      }

      #search-wrap.search-open {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10001;
        background: var(--c-topbar);
        padding: 9px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 2px 16px rgba(0, 0, 0, .14);
        border-bottom: 1px solid var(--c-border);
      }

      #search-wrap.search-open #search-mob-btn {
        display: none;
      }

      #search-wrap.search-open .search-ico {
        display: block;
        position: static;
        transform: none;
        color: var(--c-text4);
      }

      #search-wrap.search-open #search-inp {
        display: block;
        flex: 1;
        border-radius: 10px;
        padding: 9px 12px 9px 36px;
      }

      #search-wrap.search-open #search-mob-close {
        display: flex;
      }

      #search-wrap.search-open #search-drop {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        border-radius: 0 0 16px 16px;
        max-height: 60vh;
      }

      /* Mobile table → card layout */
      .tbl-wrap {
        overflow-x: visible !important;
      }

      .tbl-wrap table {
        display: block;
        min-width: 0;
      }

      .tbl-wrap thead {
        display: none;
      }

      .tbl-wrap tbody,
      .tbl-wrap tr {
        display: block;
      }

      .tbl-wrap tr {
        background: var(--c-surface);
        border-radius: 10px;
        margin-bottom: 8px;
        padding: 2px 0;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
        border: 1px solid var(--c-border);
      }

      .tbl-wrap tr:hover td {
        background: transparent;
      }

      .tbl-wrap td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 12px;
        border: none;
        border-bottom: 1px solid var(--c-border);
        font-size: 13px;
      }

      .tbl-wrap td:last-child {
        border-bottom: none;
      }

      .tbl-wrap td::before {
        content: attr(data-label);
        font-size: 10.5px;
        font-weight: 700;
        color: var(--c-text4);
        text-transform: uppercase;
        letter-spacing: .5px;
        flex-shrink: 0;
        min-width: 70px;
      }
    }

    /* ── STAT CARD TOOLTIP ── */
    #card-tip {
      position: fixed;
      z-index: 2000;
      background: #fff;
      border-radius: 16px;
      width: 360px;
      box-shadow: 0 16px 48px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .07);
      pointer-events: none;
      display: none;
      overflow: hidden;
      font-size: 13px;
      color: #1c1c1c;
    }

    .tip-hd {
      padding: 14px 16px;
      color: #fff;
    }

    .tip-hd-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .7px;
      opacity: .85;
    }

    .tip-hd-nums {
      display: flex;
      gap: 0;
      margin-top: 10px;
    }

    .tip-num-blk {
      flex: 1;
      text-align: center;
      padding: 4px 0;
    }

    .tip-num-blk+.tip-num-blk {
      border-left: 1px solid rgba(255, 255, 255, .15);
    }

    .tip-num-blk .tn {
      font-size: 24px;
      font-weight: 800;
      line-height: 1;
    }

    .tip-num-blk .tl {
      font-size: 10px;
      opacity: .7;
      margin-top: 3px;
      text-transform: uppercase;
      letter-spacing: .4px;
    }

    .tip-rows {
      padding: 6px 0;
      max-height: 280px;
      overflow-y: auto;
    }

    .tip-row2 {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 16px;
      border-bottom: 1px solid #f5f2ee;
    }

    .tip-row2:last-child {
      border-bottom: none;
    }

    .tip-row2:hover {
      background: #faf8f5;
    }

    .tr-icon {
      width: 22px;
      text-align: center;
      flex-shrink: 0;
      font-size: 14px;
    }

    .tr-main {
      flex: 1;
      min-width: 0;
    }

    .tr-name {
      font-size: 13px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #1c1c1c;
    }

    .tr-sub {
      font-size: 11.5px;
      color: #999;
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tr-pbar-wrap {
      height: 3px;
      background: #e8e3dc;
      border-radius: 2px;
      margin-top: 4px;
    }

    .tr-pbar-fill {
      height: 100%;
      border-radius: 2px;
      transition: width .3s;
    }

    .tr-val {
      font-size: 13px;
      font-weight: 800;
      flex-shrink: 0;
      min-width: 44px;
      text-align: right;
    }

    .tip-empty {
      padding: 18px 16px;
      text-align: center;
      color: #bbb;
      font-size: 13px;
    }

    .stat-card[data-tip] {
      cursor: default;
    }

    /* ── LOGIN PAGE V2 ── */
    #login-screen {
      position: fixed;
      inset: 0;
      background: #dde8f0;
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #login-screen.gone {
      display: none;
    }

    .lc {
      background: #fff;
      border-radius: 20px;
      overflow: hidden;
      width: 100%;
      max-width: 420px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
    }

    .lc-head {
      background: linear-gradient(145deg, #1E3932 0%, #2D6A4F 100%);
      padding: 30px 24px 26px;
      text-align: center;
      position: relative;
    }

    .lc-head-icon {
      width: 52px;
      height: 52px;
      background: rgba(255, 255, 255, .18);
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 14px;
    }

    .lc-head-name {
      font-size: 21px;
      font-weight: 800;
      color: #fff;
      line-height: 1.2;
    }

    .lc-head-sub {
      font-size: 12.5px;
      color: rgba(255, 255, 255, .65);
      margin-top: 4px;
    }

    .lc-tabs {
      display: flex;
      border-bottom: 1.5px solid #eee;
    }

    .lc-tab {
      flex: 1;
      padding: 13px;
      font-size: 13.5px;
      font-weight: 600;
      color: #aaa;
      background: none;
      border: none;
      cursor: pointer;
      border-bottom: 2.5px solid transparent;
      margin-bottom: -1.5px;
      transition: all .2s;
    }

    .lc-tab.active {
      color: #1E3932;
      border-bottom-color: #2D6A4F;
    }

    .lc-body {
      padding: 22px 24px;
    }

    .lc-field {
      margin-bottom: 14px;
    }

    .lc-label {
      font-size: 10.5px;
      font-weight: 700;
      color: #aaa;
      letter-spacing: .8px;
      margin-bottom: 6px;
    }

    .lc-iw {
      position: relative;
      display: flex;
      align-items: center;
    }

    .lc-iw .fi {
      position: absolute;
      left: 12px;
      color: #ccc;
      pointer-events: none;
    }

    .lc-inp {
      width: 100%;
      border: 1.5px solid #e8e3dc;
      border-radius: 10px;
      padding: 11px 12px 11px 38px;
      font-size: 13.5px;
      outline: none;
      background: #f9f8f6;
      font-family: inherit;
    }

    .lc-inp:focus {
      border-color: #2D6A4F;
      background: #fff;
    }

    .lc-inp.no-icon {
      padding-left: 12px;
    }

    .lc-eye {
      position: absolute;
      right: 10px;
      background: none;
      border: none;
      cursor: pointer;
      color: #ccc;
      padding: 4px;
      line-height: 0;
    }

    .lc-pw-bar {
      height: 3px;
      border-radius: 2px;
      margin-top: 5px;
      width: 0;
      transition: all .3s;
    }

    .lc-pw-hint {
      font-size: 11px;
      color: #aaa;
      margin-top: 3px;
    }

    .lc-remember {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 14px;
      font-size: 13px;
      color: #555;
      cursor: pointer;
    }

    .lc-submit {
      width: 100%;
      padding: 13px;
      background: #1E3932;
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 14.5px;
      font-weight: 700;
      cursor: pointer;
      transition: background .15s;
      margin-bottom: 12px;
    }

    .lc-submit:hover {
      background: #2D6A4F;
    }

    .lc-or {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #ccc;
      font-size: 12px;
      margin: 4px 0 12px;
    }

    .lc-or::before,
    .lc-or::after {
      content: '';
      flex: 1;
      height: 1px;
      background: #eee;
    }

    .lc-google {
      width: 100%;
      padding: 11px;
      background: #fff;
      color: #3c4043;
      border: 1.5px solid #ddd;
      border-radius: 10px;
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      transition: background .15s;
    }

    .lc-google:hover {
      background: #f7f5f2;
    }

    .lc-terms {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      font-size: 12.5px;
      color: #555;
      margin-bottom: 14px;
      line-height: 1.5;
      cursor: pointer;
    }

    .lc-terms a {
      color: #2D6A4F;
      text-decoration: none;
    }

    .lc-hint-box {
      background: #fff8e1;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 12px;
      color: #7a6000;
      margin-bottom: 14px;
      line-height: 1.5;
    }

    .lc-err {
      background: #fee2e2;
      color: #c82014;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 13px;
      margin: 0 24px 0;
      display: none;
    }

    .lc-ok {
      background: #d6f0e0;
      color: #006241;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 13px;
      margin: 0 24px 0;
      display: none;
    }

    .lc-foot {
      text-align: center;
      font-size: 11.5px;
      color: #ccc;
      padding: 12px 24px;
      border-top: 1px solid #f0ece6;
    }

    /* Demo selector */
    .lc-demo-label {
      font-size: 12px;
      color: #999;
      margin-bottom: 12px;
      text-align: center;
    }

    .lc-demo-btn {
      width: 100%;
      padding: 11px 14px;
      border-radius: 10px;
      border: 1.5px solid #e8e3dc;
      background: #fff;
      cursor: pointer;
      text-align: left;
      transition: all .15s;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .lc-demo-btn:hover {
      border-color: #2D6A4F;
      background: #edf4f0;
    }

    .lc-dav {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      color: #fff;
      font-size: 13px;
      flex-shrink: 0;
    }

    .lc-dname {
      font-weight: 600;
      font-size: 13.5px;
      color: #1c1c1c;
    }

    .lc-drole {
      font-size: 12px;
      color: #767676;
    }

    /* ── ICON BUTTONS (topbar) ── */
    .topbar-icon-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: none;
      background: none;
      border-radius: 8px;
      cursor: pointer;
      color: var(--c-text2);
      transition: background .15s;
      flex-shrink: 0;
    }

    .topbar-icon-btn:hover {
      background: var(--c-surface2);
    }

    #search-mob-btn {
      display: none;
    }

    #search-mob-close {
      display: none;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border: none;
      background: none;
      cursor: pointer;
      color: var(--c-text2);
      font-size: 17px;
      flex-shrink: 0;
      border-radius: 8px;
    }

    #search-mob-close:hover {
      background: var(--c-surface2);
    }

    /* ── DARK MODE TOGGLE ── */
    #dark-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: none;
      background: none;
      border-radius: 8px;
      cursor: pointer;
      color: var(--c-text2);
      transition: background .15s;
    }

    #dark-btn:hover {
      background: var(--c-surface2);
    }

    /* ── NOTIFICATION BELL ── */
    #notif-wrap {
      position: relative;
    }

    #notif-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: none;
      background: none;
      border-radius: 8px;
      cursor: pointer;
      color: var(--c-text2);
      transition: background .15s;
    }

    #notif-btn:hover {
      background: var(--c-surface2);
    }

    #notif-badge {
      position: absolute;
      top: 4px;
      right: 4px;
      min-width: 16px;
      height: 16px;
      border-radius: 8px;
      background: #B85C4A;
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 0 3px;
      line-height: 1;
    }

    #notif-drop {
      position: absolute;
      top: calc(100% + 8px);
      right: -8px;
      width: 340px;
      background: var(--c-surface);
      border-radius: 16px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, .15), 0 0 0 1px var(--c-border);
      z-index: 2000;
      display: none;
      overflow: hidden;
    }

    #notif-drop.open {
      display: block;
    }

    .nd-hd {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px 10px;
      border-bottom: 1px solid var(--c-border);
    }

    .nd-hd span:first-child {
      font-size: 14px;
      font-weight: 700;
      color: var(--c-text);
    }

    .nd-count {
      font-size: 12px;
      color: var(--c-text4);
      font-weight: 600;
    }

    .nd-item {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 11px 16px;
      cursor: pointer;
      border-left: 3px solid transparent;
      transition: background .12s;
    }

    .nd-item:hover {
      background: var(--c-surface2);
    }

    .nd-ico {
      font-size: 16px;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .nd-body {
      flex: 1;
      min-width: 0;
    }

    .nd-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--c-text);
      line-height: 1.35;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .nd-sub {
      font-size: 12px;
      color: var(--c-text3);
      margin-top: 2px;
    }

    .nd-empty {
      padding: 24px 16px;
      text-align: center;
      color: var(--c-text4);
      font-size: 13px;
    }

    /* ── GLOBAL SEARCH ── */
    #search-wrap {
      flex: 1;
      max-width: 380px;
      position: relative;
      margin: 0 20px;
    }

    #search-inp {
      width: 100%;
      border: 1.5px solid var(--c-border);
      border-radius: 50px;
      padding: 8px 14px 8px 38px;
      font-size: 13.5px;
      outline: none;
      background: var(--c-surface2);
      color: var(--c-text);
      font-family: inherit;
      transition: all .2s;
    }

    #search-inp:focus {
      border-color: #2D6A4F;
      background: var(--c-surface);
      box-shadow: 0 0 0 3px rgba(45, 106, 79, .1);
    }

    .search-ico {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: #aaa;
      pointer-events: none;
    }

    #search-drop {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      right: 0;
      background: var(--c-surface);
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, .14), 0 0 0 1px var(--c-border);
      z-index: 2000;
      max-height: 420px;
      overflow-y: auto;
      display: none;
    }

    #search-drop.open {
      display: block;
    }

    .sr-section {
      padding: 4px 0;
    }

    .sr-section+.sr-section {
      border-top: 1px solid var(--c-border);
    }

    .sr-hd {
      padding: 8px 14px 4px;
      font-size: 10.5px;
      font-weight: 700;
      color: var(--c-text4);
      text-transform: uppercase;
      letter-spacing: .7px;
    }

    .sr-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 14px;
      cursor: pointer;
      transition: background .12s;
    }

    .sr-item:hover {
      background: var(--c-surface2);
    }

    .sr-ico {
      width: 28px;
      height: 28px;
      border-radius: 7px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      flex-shrink: 0;
    }

    .sr-body {
      flex: 1;
      min-width: 0;
    }

    .sr-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--c-text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sr-sub {
      font-size: 11.5px;
      color: var(--c-text4);
      margin-top: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sr-empty {
      padding: 20px 14px;
      text-align: center;
      color: var(--c-text4);
      font-size: 13px;
    }

    /* ── Skeleton loader ── */
    #skeleton-loader { padding: 24px; }
    .sk-card, .sk-row {
      background: linear-gradient(90deg, #e8e3dc 25%, #f2ede8 50%, #e8e3dc 75%);
      background-size: 200% 100%;
      animation: sk-shimmer 1.4s infinite;
      border-radius: 12px;
    }
    .sk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
    .sk-card { height: 90px; }
    .sk-row { height: 20px; margin-bottom: 14px; border-radius: 6px; }
    .sk-row-short { width: 60%; }
    @keyframes sk-shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    @media (max-width: 640px) { .sk-stats { grid-template-columns: repeat(2, 1fr); } }
