    .online-dot {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 10px;
      height: 10px;
      background: #10b981;
      border: 2px solid var(--card);
      border-radius: 50%;
      z-index: 2;
    }

    /* VIDEO CALL UI */
    .video-call-container {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 320px;
      background: rgba(15, 23, 42, 0.95);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 24px;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
      z-index: 9999;
      display: none;
      flex-direction: column;
      overflow: hidden;
    }

    .video-call-header {
      padding: 14px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.05);
      cursor: move;
    }

    .video-area {
      position: relative;
      width: 100%;
      aspect-ratio: 4/3;
      background: #000;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #remote-video {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    #vc-avatar-area {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 15px;
      color: #fff;
    }

    .vc-avatar {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: var(--p);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 40px;
      border: 4px solid rgba(255, 255, 255, 0.2);
    }

    #local-video {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 90px;
      aspect-ratio: 4/3;
      border-radius: 12px;
      border: 2px solid rgba(255, 255, 255, 0.2);
      object-fit: cover;
      background: #1e293b;
      z-index: 10;
    }

    .video-controls {
      padding: 20px;
      display: flex;
      justify-content: center;
      gap: 15px;
    }

    .vc-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
    }

    .vc-btn-hangup {
      background: #ef4444;
    }

    .vc-btn-toggle {
      background: rgba(255, 255, 255, 0.1);
    }

    .vc-btn-toggle.off {
      background: #64748b;
    }

    .incoming-call-toast {
      position: fixed;
      top: 30px;
      left: 50%;
      transform: translateX(-50%);
      background: #fff;
      padding: 15px 25px;
      border-radius: 100px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
      display: none;
      align-items: center;
      gap: 15px;
      z-index: 10000;
      border: 1px solid #ddd;
    }

    .ic-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .notif-dropdown {
      position: absolute;
      top: 50px;
      right: 0;
      width: 320px;
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 12px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
      display: none;
      z-index: 1000;
      overflow: hidden;
    }

    .notif-header {
      padding: 12px 15px;
      border-bottom: 1px solid var(--bdr);
      font-weight: 700;
      font-size: 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg);
    }

    .notif-list {
      max-height: 400px;
      overflow-y: auto;
    }

    .notif-item {
      padding: 12px 15px;
      border-bottom: 1px solid var(--bdr);
      cursor: pointer;
      transition: background 0.2s;
      display: flex;
      gap: 12px;
    }

    .notif-item:hover {
      background: var(--bg);
    }

    .notif-item.unread {
      background: rgba(var(--p-rgb, 37, 99, 235), 0.1);
    }

    [data-theme-mode='dark'] .notif-item.unread {
      background: rgba(var(--p-rgb, 37, 99, 235), 0.15);
    }

    .notif-icon {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--pl);
      color: var(--p);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
    }

    .notif-content {
      flex: 1;
    }

    .notif-title {
      font-weight: 600;
      font-size: 13px;
      margin-bottom: 2px;
      color: var(--tx1);
    }

    .notif-desc {
      font-size: 12px;
      color: var(--tx2);
      line-height: 1.4;
    }

    .notif-time {
      font-size: 10px;
      color: var(--tx3);
      margin-top: 4px;
    }

    .notif-empty {
      padding: 40px 20px;
      text-align: center;
      color: var(--tx3);
      font-size: 13px;
    }

    .notif-dropdown {
      position: absolute;
      top: 50px;
      right: 0;
      width: 320px;
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 12px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
      display: none;
      z-index: 1000;
      overflow: hidden;
    }

    .notif-header {
      padding: 12px 15px;
      border-bottom: 1px solid var(--bdr);
      font-weight: 700;
      font-size: 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg);
    }

    .notif-list {
      max-height: 400px;
      overflow-y: auto;
    }

    .notif-item {
      padding: 12px 15px;
      border-bottom: 1px solid var(--bdr);
      cursor: pointer;
      transition: background 0.2s;
      display: flex;
      gap: 12px;
    }

    .notif-item:hover {
      background: var(--card);
    }

    .notif-item.unread {
      background: rgba(var(--p-rgb, 37, 99, 235), 0.1);
    }

    [data-theme-mode='dark'] .notif-item.unread {
      background: rgba(var(--p-rgb, 37, 99, 235), 0.15);
    }

    .notif-icon {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--pl);
      color: var(--p);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
    }

    .notif-content {
      flex: 1;
    }

    .notif-title {
      font-weight: 600;
      font-size: 13px;
      margin-bottom: 2px;
      color: var(--tx1);
    }

    .notif-desc {
      font-size: 12px;
      color: var(--tx2);
      line-height: 1.4;
    }

    .notif-time {
      font-size: 10px;
      color: var(--tx3);
      margin-top: 4px;
    }

    .notif-empty {
      padding: 40px 20px;
      text-align: center;
      color: var(--tx3);
      font-size: 13px;
    }

    :root {
      --bg: #f1f5f9;
      --sb: #064e3b;
      --sh: #065f46;
      --sa: #059669;
      --p: #059669;
      --pl: #ecfdf5;
      --pd: #047857;
      --acc: #10b981;
      --ok: #10b981;
      --warn: #f59e0b;
      --err: #ef4444;
      --pur: #8b5cf6;
      --w: #fff;
      --card: #fff;
      --bdr: #e2e8f0;
      --tx: #1e293b;
      --tx1: #1e293b;
      --tx2: #475569;
      --tx3: #94a3b8;
      --shd: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
      --r: 12px;
      --sw: 208px;
      --app-font: 'Inter', 'Be Vietnam Pro', sans-serif;
      --app-font-sidebar: var(--app-font);
      --app-font-topbar: var(--app-font);
      --app-font-content: var(--app-font);
      --app-font-size: 14px;
      --app-font-style: normal;
      --app-font-weight: normal;
      --app-font-shadow: none;
      --app-font-sidebar-style: normal;
      --app-font-sidebar-weight: normal;
      --app-font-sidebar-size: 14px;
      --app-font-sidebar-shadow: none;
      --app-font-topbar-style: normal;
      --app-font-topbar-weight: normal;
      --app-font-topbar-size: 14px;
      --app-font-topbar-shadow: none;
      --app-font-content-style: normal;
      --app-font-content-weight: normal;
      --app-font-content-size: 14px;
      --app-font-content-shadow: none;
      --module-bar-w: 80px;
      --module-icon-size: 54px;
      --module-gap: 16px;
      --module-bar-bg: #1e293b;
      --module-bar-gradient:
        radial-gradient(circle at 50% 8%, color-mix(in srgb, var(--sa) 70%, #ffffff 30%) 0%, transparent 26%),
        linear-gradient(180deg, color-mix(in srgb, var(--sb) 82%, #020617 18%) 0%, var(--sb) 42%, var(--sh) 68%, var(--sa) 100%);
      --sidebar-gradient: linear-gradient(180deg, color-mix(in srgb, var(--sb) 90%, #020617 10%) 0%, var(--sb) 34%, var(--sh) 68%, var(--sa) 100%);
      --sidebar-hover-gradient: linear-gradient(90deg, color-mix(in srgb, var(--sh) 88%, #ffffff 12%), color-mix(in srgb, var(--sa) 76%, var(--sh) 24%));
      --sidebar-active-gradient: linear-gradient(90deg, color-mix(in srgb, var(--p) 78%, #ffffff 22%), color-mix(in srgb, var(--sa) 78%, var(--p) 22%));
      --module-label-left: 78px;
      --sidebar-content-pad-y: 10px;
      --sidebar-logo-pad: 18px 8px 14px;
      --sidebar-block-gap: 10px 12px;
      --sidebar-section-pad: 12px 12px 2px;
      --sidebar-item-py: 12px;
      --sidebar-item-px: 15px;
      --sidebar-item-radius: 10px;
      --sidebar-footer-pad: 15px;
      --topbar-h: 60px;
      --topbar-pad-x: 24px;
      --content-pad-y: 22px;
      --content-pad-x: 24px;
      --page-gap: 20px;
      --card-pad: 18px;
      --content-max: none;
    }

    /* DARK MODE VARIABLES */
    html[data-theme-mode='dark'],
    [data-theme-mode='dark'] {
      color-scheme: dark;
      --bg: #0f172a;
      --card: #1e293b;
      --bdr: #334155;
      --tx: #f8fafc;
      --tx1: #ffffff;
      --tx2: #cbd5e1;
      --tx3: #94a3b8;
      --pl: #1e293b;
      --w: #1e293b;
      --sb: #0f172a; /* Darker sidebar in dark mode */
      --sh: #1e293b;
      --sa: #334155;
      --shd: 0 10px 25px rgba(0, 0, 0, 0.3);
    }

    html[data-menu-style='contrast'],
    [data-menu-style='contrast'] {
      --module-bar-gradient:
        linear-gradient(180deg, #020617 0%, var(--sb) 34%, var(--p) 72%, color-mix(in srgb, var(--p) 70%, #ffffff 30%) 100%);
      --sidebar-gradient:
        linear-gradient(180deg, #020617 0%, var(--sb) 30%, var(--sh) 62%, var(--p) 100%);
    }

    html[data-menu-style='spotlight'],
    [data-menu-style='spotlight'] {
      --module-bar-gradient:
        radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.18) 15%, transparent 36%),
        linear-gradient(180deg, #020617 0%, var(--sb) 42%, var(--p) 100%);
      --sidebar-gradient:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.22), transparent 28%),
        linear-gradient(180deg, var(--sb) 0%, var(--sh) 52%, var(--p) 100%);
    }

    html[data-menu-style='aurora'],
    [data-menu-style='aurora'] {
      --module-bar-gradient:
        radial-gradient(circle at 50% 8%, color-mix(in srgb, var(--p) 78%, #ffffff 22%) 0%, transparent 30%),
        linear-gradient(160deg, #020617 0%, var(--sb) 34%, var(--p) 68%, var(--sa) 100%);
      --sidebar-gradient:
        radial-gradient(circle at top left, color-mix(in srgb, var(--p) 32%, transparent) 0%, transparent 34%),
        linear-gradient(145deg, var(--sb) 0%, var(--sh) 52%, var(--sa) 100%);
    }

    html[data-theme='workbase-light'],
    [data-theme='workbase-light'] {
      color-scheme: light;
      --bg: #f1f5f9;
      --sb: #064e3b;
      --sh: #065f46;
      --sa: #059669;
      --p: #059669;
      --pl: #ecfdf5;
      --pd: #047857;
      --acc: #10b981;
      --ok: #10b981;
      --warn: #f59e0b;
      --err: #ef4444;
      --pur: #8b5cf6;
      --w: #fff;
      --card: #ffffff;
      --bdr: #e2e8f0;
      --tx: #1e293b;
      --tx1: #1e293b;
      --tx2: #475569;
      --tx3: #94a3b8;
      --shd: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    html[data-theme='workbase-dark'],
    [data-theme='workbase-dark'] {
      color-scheme: dark;
      --bg: #0f172a;
      --card: #1e293b;
      --bdr: #334155;
      --tx: #f8fafc;
      --tx1: #ffffff;
      --tx2: #cbd5e1;
      --tx3: #94a3b8;
      --pl: #1e293b;
      --w: #1e293b;
      --sb: #0f172a;
      --sh: #1e293b;
      --sa: #334155;
      --p: #10b981;
      --pd: #6ee7b7;
      --acc: #34d399;
      --shd: 0 10px 25px rgba(0, 0, 0, 0.3);
    }

    html[data-theme='emerald-light'],
    [data-theme='emerald-light'] {
      color-scheme: light;
      --bg: #f4fbf8;
      --card: #ffffff;
      --bdr: #d8ece3;
      --tx: #17352e;
      --tx1: #17352e;
      --tx2: #527268;
      --tx3: #83a399;
      --sb: #0d6b56;
      --sh: #107d64;
      --sa: #14a37f;
      --p: #0f8a6b;
      --pl: #e7f7f1;
      --pd: #0b6c55;
      --acc: #22c55e;
      --warn: #f59e0b;
      --err: #dc2626;
      --pur: #7c3aed;
      --w: #ffffff;
      --shd: 0 18px 40px rgba(15, 138, 107, 0.12);
    }

    html[data-theme='emerald-dark'],
    [data-theme='emerald-dark'] {
      color-scheme: dark;
      --bg: #081c18;
      --card: #102a25;
      --bdr: #1f4a40;
      --tx: #ecfdf5;
      --tx1: #f0fdf4;
      --tx2: #c4e9dc;
      --tx3: #7fa89a;
      --sb: #061612;
      --sh: #0d241f;
      --sa: #173a33;
      --p: #34d399;
      --pl: #12332d;
      --pd: #a7f3d0;
      --acc: #10b981;
      --warn: #fbbf24;
      --err: #f87171;
      --pur: #a78bfa;
      --w: #102a25;
      --shd: 0 14px 34px rgba(0, 0, 0, 0.38);
    }

    html[data-theme='paper-light'],
    [data-theme='paper-light'] {
      color-scheme: light;
      --bg: #f7f1e7;
      --card: #fffaf2;
      --bdr: #e6d8c5;
      --tx: #3e2d1f;
      --tx1: #3e2d1f;
      --tx2: #7b624f;
      --tx3: #aa917d;
      --sb: #6f4e37;
      --sh: #8a5a36;
      --sa: #b77943;
      --p: #8a5a36;
      --pl: #f2e4d3;
      --pd: #6c4529;
      --acc: #c08457;
      --warn: #d97706;
      --err: #dc2626;
      --pur: #7c3aed;
      --w: #fffaf2;
      --shd: 0 16px 38px rgba(138, 90, 54, 0.12);
    }

    html[data-theme='paper-dark'],
    [data-theme='paper-dark'] {
      color-scheme: dark;
      --bg: #191412;
      --card: #261f1a;
      --bdr: #44352c;
      --tx: #f7efe5;
      --tx1: #fff8ef;
      --tx2: #d2c1af;
      --tx3: #9f8771;
      --sb: #120f0d;
      --sh: #201915;
      --sa: #3b2f27;
      --p: #f2b880;
      --pl: #332720;
      --pd: #f7d5b3;
      --acc: #fb923c;
      --warn: #fbbf24;
      --err: #f87171;
      --pur: #c4b5fd;
      --w: #261f1a;
      --shd: 0 16px 40px rgba(0, 0, 0, 0.42);
    }

    html[data-theme='ocean-light'],
    [data-theme='ocean-light'] {
      color-scheme: light;
      --bg: #eaf7ff;
      --card: #ffffff;
      --bdr: #bfdbfe;
      --tx: #123047;
      --tx1: #082f49;
      --tx2: #45677c;
      --tx3: #7aa0b8;
      --sb: #075985;
      --sh: #0369a1;
      --sa: #0284c7;
      --p: #0284c7;
      --pl: #e0f2fe;
      --pd: #075985;
      --acc: #38bdf8;
      --warn: #f59e0b;
      --err: #dc2626;
      --pur: #7c3aed;
      --w: #ffffff;
      --shd: 0 18px 40px rgba(2, 132, 199, 0.13);
    }

    html[data-theme='ocean-dark'],
    [data-theme='ocean-dark'] {
      color-scheme: dark;
      --bg: #061826;
      --card: #0b2538;
      --bdr: #164863;
      --tx: #e0f2fe;
      --tx1: #f0f9ff;
      --tx2: #b7d7ea;
      --tx3: #76a8c4;
      --sb: #05121d;
      --sh: #082f49;
      --sa: #0f4c75;
      --p: #38bdf8;
      --pl: #0f3148;
      --pd: #bae6fd;
      --acc: #7dd3fc;
      --warn: #fbbf24;
      --err: #f87171;
      --pur: #c4b5fd;
      --w: #0b2538;
      --shd: 0 18px 42px rgba(0, 0, 0, 0.42);
    }

    html[data-layout='standard'],
    [data-layout='standard'] {
      --module-bar-w: 80px;
      --module-icon-size: 54px;
      --module-gap: 16px;
      --sw: 208px;
      --sidebar-content-pad-y: 10px;
      --sidebar-logo-pad: 18px 8px 14px;
      --sidebar-block-gap: 10px 12px;
      --sidebar-section-pad: 12px 12px 2px;
      --sidebar-item-py: 12px;
      --sidebar-item-px: 15px;
      --sidebar-item-radius: 10px;
      --sidebar-footer-pad: 15px;
      --topbar-h: 60px;
      --topbar-pad-x: 24px;
      --content-pad-y: 22px;
      --content-pad-x: 24px;
      --page-gap: 20px;
      --card-pad: 18px;
      --r: 12px;
      --content-max: none;
    }

    html[data-layout='executive'],
    [data-layout='executive'] {
      --module-bar-w: 76px;
      --module-icon-size: 48px;
      --module-gap: 18px;
      --sw: 246px;
      --sidebar-content-pad-y: 14px;
      --sidebar-logo-pad: 22px 14px 18px;
      --sidebar-block-gap: 14px 16px;
      --sidebar-section-pad: 14px 16px 4px;
      --sidebar-item-py: 14px;
      --sidebar-item-px: 18px;
      --sidebar-item-radius: 14px;
      --sidebar-footer-pad: 18px;
      --topbar-h: 72px;
      --topbar-pad-x: 30px;
      --content-pad-y: 28px;
      --content-pad-x: 30px;
      --page-gap: 24px;
      --card-pad: 22px;
      --r: 16px;
      --content-max: 1760px;
    }

    html[data-layout='compact'],
    [data-layout='compact'] {
      --module-bar-w: 60px;
      --module-icon-size: 40px;
      --module-gap: 12px;
      --sw: 190px;
      --sidebar-content-pad-y: 8px;
      --sidebar-logo-pad: 14px 8px 12px;
      --sidebar-block-gap: 8px 10px;
      --sidebar-section-pad: 8px 10px 0;
      --sidebar-item-py: 10px;
      --sidebar-item-px: 12px;
      --sidebar-item-radius: 9px;
      --sidebar-footer-pad: 12px;
      --topbar-h: 56px;
      --topbar-pad-x: 18px;
      --content-pad-y: 16px;
      --content-pad-x: 18px;
      --page-gap: 14px;
      --card-pad: 14px;
      --r: 10px;
      --content-max: none;
    }

    html[data-layout='focus'],
    [data-layout='focus'] {
      --module-bar-w: 58px;
      --module-icon-size: 40px;
      --module-gap: 14px;
      --sw: 176px;
      --sidebar-content-pad-y: 8px;
      --sidebar-logo-pad: 16px 8px 12px;
      --sidebar-block-gap: 8px 10px;
      --sidebar-section-pad: 10px 10px 0;
      --sidebar-item-py: 10px;
      --sidebar-item-px: 12px;
      --sidebar-item-radius: 10px;
      --sidebar-footer-pad: 12px;
      --topbar-h: 58px;
      --topbar-pad-x: 22px;
      --content-pad-y: 24px;
      --content-pad-x: 32px;
      --page-gap: 22px;
      --card-pad: 20px;
      --r: 14px;
      --content-max: 1500px;
    }

    html[data-layout='dock'],
    [data-layout='dock'] {
      --module-bar-w: 86px;
      --module-icon-size: 48px;
      --module-gap: 14px;
      --sw: 220px;
      --sidebar-content-pad-y: 16px;
      --sidebar-logo-pad: 24px 14px 18px;
      --sidebar-block-gap: 14px 14px;
      --sidebar-section-pad: 12px 14px 4px;
      --sidebar-item-py: 13px;
      --sidebar-item-px: 16px;
      --sidebar-item-radius: 18px;
      --sidebar-footer-pad: 18px;
      --topbar-h: 68px;
      --topbar-pad-x: 28px;
      --content-pad-y: 26px;
      --content-pad-x: 30px;
      --page-gap: 24px;
      --card-pad: 20px;
      --r: 20px;
      --content-max: 1680px;
    }

    * {
      transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease;
    }

    [data-theme-mode='dark'] .b-blue {
      background: #1e293b;
      color: #3b82f6;
      border: 1px solid #334155;
    }

    [data-theme-mode='dark'] .b-green {
      background: #064e3b;
      color: #10b981;
      border: 1px solid #065f46;
    }

    [data-theme-mode='dark'] .b-yellow {
      background: #451a03;
      color: #f59e0b;
      border: 1px solid #78350f;
    }

    [data-theme-mode='dark'] .b-red {
      background: #450a0a;
      color: #ef4444;
      border: 1px solid #7f1d1d;
    }

    [data-theme-mode='dark'] .b-purple {
      background: #2e1065;
      color: #a78bfa;
      border: 1px solid #4c1d95;
    }

    [data-theme-mode='dark'] .b-gray {
      background: #0f172a;
      color: #94a3b8;
      border: 1px solid #1e293b;
    }

    [data-theme-mode='dark'] .b-cyan {
      background: #083344;
      color: #22d3ee;
      border: 1px solid #164e63;
    }

    [data-theme-mode='dark'] .b-orange {
      background: #431407;
      color: #fb923c;
      border: 1px solid #7c2d12;
    }

    [data-theme-mode='dark'] .b-teal {
      background: #042f2e;
      color: #2dd4bf;
      border: 1px solid #115e59;
    }

    [data-theme-mode='dark'] .badge-blue {
      background: #1e3a8a;
      color: #bfdbfe;
    }

    [data-theme-mode='dark'] .badge-green {
      background: #064e3b;
      color: #6ee7b7;
    }

    [data-theme-mode='dark'] .badge-orange {
      background: #431407;
      color: #fdba74;
    }

    [data-theme-mode='dark'] .badge-red {
      background: #450a0a;
      color: #fca5a5;
    }

    [data-theme-mode='dark'] .badge-gray {
      background: #1e293b;
      color: #94a3b8;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0
    }

    .theme-preset-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }

    .theme-preset-card {
      border: 1px solid var(--bdr);
      background: var(--card);
      border-radius: 14px;
      padding: 12px;
      cursor: pointer;
      text-align: left;
      transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
      color: var(--tx);
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .theme-preset-card:hover {
      transform: translateY(-2px);
      border-color: var(--p);
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    }

    .theme-preset-card.active {
      border-color: var(--p);
      box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.18), 0 16px 36px rgba(15, 23, 42, 0.14);
    }

    .theme-preset-swatches {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      margin-bottom: 10px;
    }

    .theme-preset-swatches span {
      display: block;
      height: 28px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.22);
    }

    .theme-preset-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 6px;
    }

    .theme-preset-name {
      font-size: 13px;
      font-weight: 800;
      color: var(--tx1);
    }

    .theme-preset-mode {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--p);
      background: var(--pl);
      border-radius: 999px;
      padding: 4px 8px;
    }

    .theme-preset-desc {
      font-size: 11px;
      line-height: 1.45;
      color: var(--tx2);
    }

    .layout-preset-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }

    .layout-preset-card {
      border: 1px solid var(--bdr);
      background: var(--card);
      border-radius: 14px;
      padding: 12px;
      text-align: left;
      cursor: pointer;
      color: var(--tx);
      transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .layout-preset-card:hover {
      transform: translateY(-2px);
      border-color: var(--p);
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    }

    .layout-preset-card.active {
      border-color: var(--p);
      box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.18), 0 16px 36px rgba(15, 23, 42, 0.14);
    }

    .layout-preset-wireframe {
      position: relative;
      height: 88px;
      border-radius: 12px;
      background: linear-gradient(180deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.08));
      border: 1px solid rgba(148, 163, 184, 0.22);
      overflow: hidden;
      margin-bottom: 10px;
    }

    .layout-preset-wireframe span {
      position: absolute;
      display: block;
      border-radius: 8px;
    }

    .layout-wire-module {
      top: 8px;
      left: 8px;
      bottom: 8px;
      width: 10px;
      background: rgba(30, 41, 59, 0.9);
    }

    .layout-wire-sidebar {
      top: 8px;
      left: 22px;
      bottom: 8px;
      width: 42px;
      background: rgba(15, 118, 110, 0.65);
    }

    .layout-wire-topbar {
      top: 8px;
      left: 70px;
      right: 8px;
      height: 14px;
      background: rgba(5, 150, 105, 0.72);
    }

    .layout-wire-content {
      top: 28px;
      left: 70px;
      right: 8px;
      bottom: 8px;
      background: rgba(255, 255, 255, 0.74);
    }

    .layout-wire-card {
      left: 80px;
      right: 18px;
      background: rgba(148, 163, 184, 0.45);
    }

    .wire-card-a {
      top: 38px;
      height: 16px;
    }

    .wire-card-b {
      top: 60px;
      right: 44px;
      height: 10px;
    }

    .layout-executive .layout-wire-sidebar {
      width: 50px;
    }

    .layout-executive .layout-wire-topbar {
      height: 18px;
    }

    .layout-executive .layout-wire-content {
      top: 32px;
    }

    .layout-compact .layout-wire-module {
      width: 8px;
    }

    .layout-compact .layout-wire-sidebar {
      left: 20px;
      width: 34px;
    }

    .layout-compact .layout-wire-topbar {
      left: 60px;
      height: 12px;
    }

    .layout-compact .layout-wire-content {
      left: 60px;
      top: 24px;
    }

    .layout-compact .layout-wire-card {
      left: 68px;
    }

    .layout-focus .layout-wire-sidebar {
      width: 28px;
    }

    .layout-focus .layout-wire-topbar {
      left: 56px;
      right: 18px;
    }

    .layout-focus .layout-wire-content {
      left: 56px;
      right: 18px;
    }

    .layout-focus .layout-wire-card {
      left: 66px;
      right: 28px;
    }

    .layout-preset-name {
      font-size: 13px;
      font-weight: 800;
      color: var(--tx1);
      margin-bottom: 4px;
    }

    .layout-preset-desc {
      font-size: 11px;
      line-height: 1.45;
      color: var(--tx2);
    }

    /* PERMISSIONS TREE */
    .perm-group {
      margin-bottom: 12px;
      border: 1px solid var(--bdr);
      border-radius: 8px;
      background: var(--card);
      overflow: hidden;
    }

    .perm-group-hdr {
      background: var(--bg);
      padding: 8px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 700;
      font-size: 13px;
      color: var(--tx);
      border-bottom: 1px solid var(--bdr);
      cursor: pointer;
    }

    .perm-group-hdr i {
      width: 20px;
      text-align: center;
      color: var(--p);
    }

    .perm-list {
      padding: 10px 12px;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
    }

    .perm-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--tx2);
      cursor: pointer;
    }

    .perm-item input {
      cursor: pointer;
    }

    html,
    body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      background: var(--sb);
      font-family: var(--app-font);
      color: var(--tx);
      display: flex;
      overflow: hidden;
      font-size: var(--app-font-size);
      font-style: var(--app-font-style);
      font-weight: var(--app-font-weight);
      text-shadow: var(--app-font-shadow);
      -webkit-tap-highlight-color: transparent;
    }

    /* MODULE BAR (Base Style) */
    .mod-badge {
      position: absolute;
      top: 4px;
      right: 4px;
      background: #ef4444;
      color: #fff;
      font-size: 9px;
      font-weight: 800;
      min-width: 16px;
      height: 16px;
      border-radius: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid #1e293b;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
      pointer-events: none;
      z-index: 10;
    }

    #module-bar {
      width: var(--module-bar-w);
      background: var(--module-bar-gradient, var(--module-bar-bg));
      font-family: var(--app-font-sidebar);
      font-size: var(--app-font-sidebar-size);
      font-style: var(--app-font-sidebar-style);
      font-weight: var(--app-font-sidebar-weight);
      text-shadow: var(--app-font-sidebar-shadow);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: calc(20px + env(safe-area-inset-top)) 0 calc(20px + env(safe-area-inset-bottom)) 0;
      gap: var(--module-gap);
      z-index: 100;
      border-right: 1px solid rgba(255, 255, 255, 0.05);
      box-shadow: inset -18px 0 28px rgba(255, 255, 255, 0.08), inset 16px 0 28px rgba(2, 6, 23, 0.22);
      flex-shrink: 0;
    }

    .mod-i {
      width: var(--module-icon-size);
      height: var(--module-icon-size);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 26px;
      color: #fff;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
    }

    .mod-i:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      transform: scale(1.05);
    }

    .mod-i.active {
      background: var(--p);
      color: #fff;
      box-shadow: 0 4px 12px rgba(var(--p-rgb), 0.4);
    }

    .mod-i.active::after {
      content: '';
      position: absolute;
      left: -20px;
      top: 12px;
      bottom: 12px;
      width: 4px;
      background: #fff;
      border-radius: 0 4px 4px 0;
    }

    .mod-label {
      position: absolute;
      left: var(--module-label-left);
      background: #334155;
      color: #fff;
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 12px;
      white-space: nowrap;
      pointer-events: none;
      opacity: 0;
      transform: translateX(-10px);
      transition: all 0.2s;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      font-weight: 600;
      z-index: 1000;
    }

    .mod-i:hover .mod-label {
      opacity: 1;
      transform: translateX(0);
    }

    @keyframes slideUp {
      from { transform: translateY(20px); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }

    /* ADMIN DASHBOARD */
    .admin-nav-item {
      padding: 14px 20px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 14px;
      color: rgba(255,255,255,0.5);
      transition: all 0.2s;
      white-space: nowrap;
      overflow: hidden;
    }
    .admin-nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
    .admin-nav-item.active { background: var(--p); color: #fff; font-weight: 700; border-left: 4px solid #fff; }
    .admin-nav-item i { width: 20px; text-align: center; font-size: 18px; }
    .admin-nav-item span { transition: opacity 0.3s; }

    #admin-sidebar.collapsed { width: 68px; }
    #admin-sidebar.collapsed span, #admin-sidebar.collapsed #admin-title-text { opacity: 0; pointer-events: none; }
    #admin-sidebar.collapsed .admin-nav-item { justify-content: center; padding: 14px 0; border-left: none; }
    #admin-sidebar.collapsed .admin-nav-item.active { background: var(--p); }

    .admin-tab-content { animation: fadeIn 0.4s ease; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    /* LOGIN */
    #login-screen {
      position: fixed;
      inset: 0;
      z-index: 11000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
      background-color: #0d1526;
      background-image: var(--app-wallpaper, none);
      background-size: cover;
      background-position: center;
    }

    #login-screen.hidden {
      display: none
    }

    .lb {
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-radius: 24px;
      padding: 40px;
      width: 440px;
      max-width: 92vw;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
      border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .lb-logo {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 32px
    }

    .lb-logo .ic {
      width: 44px;
      height: 44px;
      background: var(--p);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      color: #fff;
      font-size: 20px
    }

    .lb-logo .tx {
      font-size: 16px;
      font-weight: 700;
      white-space: nowrap;
    }

    .lb-logo .sx {
      font-size: 11px;
      color: var(--tx2);
      white-space: nowrap;
    }

    .lb-err {
      background: #fef2f2;
      border: 1px solid #fecaca;
      color: var(--err);
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 13px;
      margin-bottom: 14px;
      display: none
    }

    .lb-err.show {
      display: block
    }

    .lb-btn {
      width: 100%;
      padding: 12px;
      background: var(--p);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-family: inherit;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: .15s;
      margin-top: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px
    }

    .lb-btn:hover:not(:disabled) {
      background: var(--pd)
    }

    .lb-btn:disabled {
      opacity: .6;
      cursor: not-allowed
    }

    .lb-hint {
      margin-top: 14px;
      font-size: 12px;
      color: var(--tx3);
      text-align: center
    }

    .lb-hint b {
      color: var(--p)
    }

    /* API CONFIG notice */
    .api-cfg {
      background: #fffbeb;
      border: 1px solid #fde68a;
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 12px;
      color: #92400e;
      margin-bottom: 14px;
      display: none
    }

    .api-cfg.show {
      display: block
    }

    .api-cfg input {
      width: 100%;
      margin-top: 6px;
      padding: 6px 10px;
      border: 1px solid #fde68a;
      border-radius: 6px;
      font-family: inherit;
      font-size: 12px;
      outline: none
    }

    /* LOADING OVERLAY */
    #loading {
      position: fixed;
      inset: 0;
      background: rgba(13, 21, 38, .65);
      z-index: 8888;
      display: none;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 14px
    }

    #loading.show {
      display: flex
    }

    .spinner {
      width: 40px;
      height: 40px;
      border: 3px solid rgba(255, 255, 255, .2);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .7s linear infinite
    }

    @keyframes spin {
      to {
        transform: rotate(360deg)
      }
    }

    .loading-msg {
      color: #fff;
      font-size: 14px;
      font-weight: 500
    }

    /* SIDEBAR */
    #sidebar {
      width: var(--sw);
      background: var(--sidebar-gradient, var(--sb));
      font-family: var(--app-font-sidebar);
      font-size: var(--app-font-sidebar-size);
      font-style: var(--app-font-sidebar-style);
      font-weight: var(--app-font-sidebar-weight);
      text-shadow: var(--app-font-sidebar-shadow);
      display: flex;
      flex-direction: column;
      z-index: 90;
      overflow: hidden;
      /* Prevent double scroll */
      border-right: 1px solid var(--bdr);
      padding-bottom: env(safe-area-inset-bottom);
      height: 100vh;
    }

    .sidebar-toggle {
      position: fixed;
      left: calc(var(--module-bar-w) + var(--sw) - 4px);
      top: 112px;
      z-index: 140;
      width: 8px;
      height: 64px;
      border: 0;
      border-radius: 999px;
      background: color-mix(in srgb, var(--tx3) 46%, transparent);
      color: transparent;
      box-shadow: none;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      font-size: 0;
      font-weight: 900;
      line-height: 1;
      opacity: .24;
      transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease, opacity .18s ease, background .18s ease, box-shadow .18s ease;
    }

    .sidebar-toggle::after {
      content: "";
      position: absolute;
      inset: 0 auto 0 3px;
      width: 2px;
      border-radius: 999px;
      background: currentColor;
      opacity: 0;
      transition: opacity .18s ease;
    }

    .sidebar-toggle:hover {
      opacity: .62;
      background: color-mix(in srgb, var(--p) 58%, transparent);
    }

    .sidebar-toggle:hover::after {
      opacity: .45;
    }

    html.sub-sidebar-collapsed #sidebar {
      display: none !important;
    }

    html.sub-sidebar-collapsed .sidebar-toggle {
      left: var(--sub-sidebar-edge-left, var(--module-bar-w));
      top: var(--sub-sidebar-edge-top, 0px);
      width: 3px;
      height: var(--sub-sidebar-edge-height, 100vh);
      border-radius: 0;
      background: #f59e0b;
      color: var(--p);
      opacity: 1;
      box-shadow: 0 0 10px rgba(245, 158, 11, .28);
    }

    html.sub-sidebar-collapsed .sidebar-toggle::before {
      content: "";
      position: absolute;
      left: 2px;
      top: 10px;
      bottom: 10px;
      width: 1px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .72);
      box-shadow: 0 0 10px rgba(255, 255, 255, .26);
      opacity: .72;
    }

    html.sub-sidebar-collapsed .sidebar-toggle:hover {
      width: 5px;
      background: #f97316;
      box-shadow: 0 0 18px rgba(249, 115, 22, .42);
    }

    html.sub-sidebar-collapsed .sidebar-toggle:hover::before {
      opacity: 1;
      box-shadow: 0 0 14px rgba(255, 255, 255, .45);
    }

    html.sub-sidebar-collapsed.sub-sidebar-peek #sidebar {
      position: fixed;
      left: var(--sub-sidebar-panel-left, var(--sub-sidebar-edge-left, var(--module-bar-w)));
      top: var(--sub-sidebar-edge-top, 0px);
      bottom: auto;
      height: var(--sub-sidebar-edge-height, 100vh);
      display: flex !important;
      z-index: 150;
      transform: none;
      animation: subSidebarPeekIn .16s ease-out;
      box-shadow: 18px 0 42px rgba(15, 23, 42, 0.2);
    }

    html.sub-sidebar-collapsed.sub-sidebar-peek .sidebar-toggle {
      opacity: .18;
    }

    @keyframes subSidebarPeekIn {
      from {
        opacity: 0;
        transform: translateX(-12px);
      }

      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    .sb-content {
      flex: 1;
      overflow-y: auto;
      padding: var(--sidebar-content-pad-y) 0;
      display: flex;
      flex-direction: column;
    }

    .sb-close-btn {
      display: none;
    }

    .sb-logo {
      padding: var(--sidebar-logo-pad);
      /* Đẩy sát ra mép trái */
      display: flex;
      align-items: center;
      gap: 10px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sb-logo .li {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      overflow: hidden;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      font-weight: 800;
      font-size: 16px;
    }

    .sb-logo .li img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .sb-logo .lt {
      color: #fff;
      font-weight: 800;
      font-size: 13px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      /* Cho phép tối đa 2 dòng */
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 170px;
      line-height: 1.3;
    }

    .sb-logo .ls {
      color: #fff;
      font-size: 10px;
      opacity: 0.8;
      display: -webkit-box;
      -webkit-line-clamp: 1;
      line-clamp: 1;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 170px;
    }

    .co-sw {
      margin: var(--sidebar-block-gap);
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 12px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .co-sw:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    .co-nm {
      color: #fff;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .co-tp {
      color: #fff;
      font-size: 11px;
      margin-top: 2px;
      opacity: 0.8;
    }

    .sb-sec {
      padding: var(--sidebar-section-pad)
    }

    .sb-sec-lbl {
      display: none !important;
    }

    .sb-i {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: var(--sidebar-item-py) var(--sidebar-item-px);
      border-radius: var(--sidebar-item-radius);
      cursor: pointer;
      color: #fff;
      font-size: 15px;
      font-weight: 600;
      transition: all 0.2s;
      margin-bottom: 2px;
    }

    .sb-i:hover {
      background: var(--sidebar-hover-gradient, var(--sh));
      color: #fff;
    }

    .sb-i.active {
      background: var(--sidebar-active-gradient, var(--sa));
      color: #fff;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .sb-i .ic {
      font-size: 15px;
      width: 20px;
      text-align: center;
      flex-shrink: 0
    }

    .sb-badge {
      margin-left: auto;
      background: var(--err);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center
    }

    .sb-i.active .sb-badge {
      background: rgba(255, 255, 255, .25)
    }

    .sb-u {
      margin-top: auto;
      padding: var(--sidebar-footer-pad);
      background: rgba(0, 0, 0, 0.15);
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      cursor: pointer;
      position: relative;
      /* CRITICAL FIX */
      transition: background 0.2s;
    }

    .sb-u:hover {
      background: rgba(0, 0, 0, 0.25);
    }

    .sb-u-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .sb-u .av {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: var(--p);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 800;
      font-size: 14px;
      flex-shrink: 0;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .unm {
      color: #fff;
      font-size: 14px;
      font-weight: 700;
    }

    .url {
      color: rgba(255, 255, 255, 0.6);
      font-size: 11px;
    }

    .u-menu {
      display: none;
      position: absolute;
      bottom: 75px;
      left: 10px;
      right: 10px;
      background: var(--card);
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--bdr);
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }

    .u-menu.open {
      display: block
    }

    .u-mi {
      padding: 12px 16px;
      color: var(--tx);
      font-size: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: all 0.15s;
      font-weight: 500;
    }

    .u-mi:hover {
      background: var(--bg);
      color: var(--p);
    }

    .u-mi.danger {
      color: #ef4444;
    }

    .u-mi.danger:hover {
      background: var(--sh);
    }

    /* MAIN */
    #main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      position: relative;
      overflow: hidden;
      background: var(--bg);
    }

    #main::before {
      content: "";
      position: absolute;
      top: -10px;
      left: -10px;
      right: -10px;
      bottom: -10px;
      background-image: var(--app-wallpaper, none);
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      filter: blur(var(--app-wallpaper-blur, 0px));
      z-index: 0;
      pointer-events: none;
      transition: filter 0.3s ease;
    }

    #topbar,
    #content {
      position: relative;
      z-index: 1;
    }


    #topbar {
      height: calc(var(--topbar-h) + env(safe-area-inset-top));
      background: linear-gradient(90deg, #064e3b 0%, #059669 100%);
      font-family: var(--app-font-topbar);
      font-size: var(--app-font-topbar-size);
      font-style: var(--app-font-topbar-style);
      font-weight: var(--app-font-topbar-weight);
      text-shadow: var(--app-font-topbar-shadow);
      display: flex;
      align-items: center;
      padding: env(safe-area-inset-top) var(--topbar-pad-x) 0 var(--topbar-pad-x);
      position: sticky;
      top: 0;
      z-index: 90;
      color: #fff;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    #tb-title {
      color: #ffffff !important;
      font-weight: 700 !important;
      text-shadow: none !important;
      -webkit-text-fill-color: #ffffff !important;
      /* Force for some browsers */
    }

    #co-badge {
      background: rgba(255, 255, 255, 0.15) !important;
      color: #fff !important;
      border-color: rgba(255, 255, 255, 0.3) !important;
    }

    .tb-right {
      display: flex;
      align-items: center;
      gap: 15px;
    }

    .btn {
      padding: 7px 14px;
      border-radius: 8px;
      font-family: inherit;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: .15s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap
    }

    .btn-p {
      background: var(--p);
      color: #fff
    }

    .btn-p:hover {
      background: var(--pd)
    }

    .font-style-active {
      background: var(--p, #059669) !important;
      color: #fff !important;
      border-color: var(--p, #059669) !important;
    }

    .btn-g {
      background: transparent;
      color: var(--tx2);
      border: 1px solid var(--bdr)
    }

    .btn-g:hover {
      background: var(--bg)
    }

    .btn-ok {
      background: var(--bg);
      color: var(--ok);
      border: 1px solid var(--bdr)
    }

    .btn-ok:hover {
      background: #d1fae5
    }

    .btn-err {
      background: var(--bg);
      color: var(--err);
      border: 1px solid var(--bdr)
    }

    .btn-err:hover {
      background: #dc2626;
    }

    .btn-warn {
      background: var(--bg);
      color: var(--warn);
      border: 1px solid var(--bdr)
    }

    .search-bar {
      display: flex;
      align-items: center;
      gap: 7px;
      background: var(--bg);
      border: 1px solid var(--bdr);
      border-radius: 8px;
      padding: 5px 12px;
      width: 200px
    }

    .search-bar input {
      border: none;
      background: transparent;
      font-family: inherit;
      font-size: 13px;
      color: var(--tx1);
      outline: none;
      width: 100%;
    }

    .search-bar span {
      color: rgba(255, 255, 255, 0.95);
      font-size: 14px;
    }

    .search-bar input::placeholder {
      color: rgba(255, 255, 255, 0.9);
    }

    #content {
      padding: var(--content-pad-y) var(--content-pad-x);
      font-family: var(--app-font-content);
      font-size: var(--app-font-content-size);
      font-style: var(--app-font-content-style);
      font-weight: var(--app-font-content-weight);
      text-shadow: var(--app-font-content-shadow);
      flex: 1;
      overflow-y: auto;
      position: relative;
      max-width: var(--content-max);
      width: 100%;
      margin: 0 auto;
    }

    .page {
      display: none
    }

    .page.active {
      display: block
    }

    .ph {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: var(--page-gap);
      flex-wrap: wrap;
      gap: 10px
    }

    .pt {
      font-size: 19px;
      font-weight: 800
    }

    .ps {
      color: var(--tx2);
      font-size: 13px;
      margin-top: 2px
    }

    .card {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--bdr);
      padding: var(--card-pad);
      overflow-x: auto;
      box-shadow: var(--shd);
    }

    .sg {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
      margin-bottom: var(--page-gap)
    }

    .sc {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: var(--r);
      padding: var(--card-pad);
      overflow-x: auto;
      box-shadow: var(--shd);
    }

    .sc .lbl {
      font-size: 11px;
      font-weight: 700;
      color: var(--tx2);
      text-transform: uppercase;
      letter-spacing: .7px;
      margin-bottom: 8px
    }

    .sc .val {
      font-size: 26px;
      font-weight: 800;
      line-height: 1
    }

    .sc .ch {
      font-size: 12px;
      margin-top: 5px
    }

    .sc .ch.up {
      color: var(--ok)
    }

    .sc .ch.dn {
      color: var(--err)
    }

    .sc .ib {
      float: right;
      width: 42px;
      height: 42px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px
    }

    /* TABLE */
    .tw {
      overflow-x: auto
    }

    table {
      width: 100%;
      border-collapse: collapse
    }

    thead th {
      background: var(--bg);
      padding: 9px 13px;
      text-align: left;
      font-size: 11px;
      font-weight: 700;
      color: var(--tx);
      text-transform: uppercase;
      letter-spacing: .8px;
      border-bottom: 1px solid var(--bdr)
    }

    tbody td {
      padding: 11px 13px;
      border-bottom: 1px solid var(--bdr);
      font-size: 13px;
      vertical-align: middle
    }

    tbody tr:last-child td {
      border-bottom: none
    }

    tbody tr:hover td {
      background: var(--bg)
    }

    /* BADGES */
    .badge {
      padding: 2px 9px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      display: inline-block
    }

    .b-blue {
      background: var(--pl);
      color: var(--p)
    }

    .b-green {
      background: #065f46;
      color: #34d399;
    }

    .b-yellow {
      background: #92400e;
      color: #fbbf24;
    }

    .b-red {
      background: #7f1d1d;
      color: #f87171;
    }

    .b-purple {
      background: #4c1d95;
      color: #a78bfa;
    }

    .b-gray {
      background: var(--sh);
      color: var(--tx2)
    }

    .b-cyan {
      background: #164e63;
      color: #22d3ee;
    }

    .b-orange {
      background: #7c2d12;
      color: #fb923c;
      border: 1px solid #9a3412
    }

    .b-teal {
      background: #134e4a;
      color: #2dd4bf;
      border: 1px solid #115e59
    }

    /* Layout preset: Floating Dock. Scoped only to data-layout='dock'. */
    html[data-layout='dock'] body,
    [data-layout='dock'] body {
      background:
        radial-gradient(circle at top left, rgba(var(--p-rgb, 5, 150, 105), 0.16), transparent 28%),
        linear-gradient(135deg, var(--sb) 0%, var(--bg) 38%, var(--bg) 100%);
    }

    html[data-layout='dock'] #module-bar,
    [data-layout='dock'] #module-bar {
      margin: 16px 0 16px 14px;
      height: calc(100vh - 32px);
      border-radius: 28px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: var(--module-bar-gradient, linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.86)));
      box-shadow: 0 24px 60px rgba(2, 6, 23, 0.24);
    }

    html[data-layout='dock'] .mod-i,
    [data-layout='dock'] .mod-i {
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(12px);
    }

    html[data-layout='dock'] .mod-i.active,
    [data-layout='dock'] .mod-i.active {
      background: linear-gradient(135deg, var(--p), color-mix(in srgb, var(--p) 62%, #ffffff 38%));
      transform: translateX(5px);
      box-shadow: 0 14px 28px rgba(var(--p-rgb, 5, 150, 105), 0.28);
    }

    html[data-layout='dock'] .mod-i.active::after,
    [data-layout='dock'] .mod-i.active::after {
      display: none;
    }

    html[data-layout='dock'] #sidebar,
    [data-layout='dock'] #sidebar {
      margin: 16px 0 16px 14px;
      height: calc(100vh - 32px);
      border-radius: 30px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
    }

    html[data-layout='dock'] #main,
    [data-layout='dock'] #main {
      margin: 16px 16px 16px 14px;
      border-radius: 30px;
      overflow: hidden;
      box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
    }

    html[data-layout='dock'] #topbar,
    [data-layout='dock'] #topbar {
      margin: 14px 16px 0;
      border-radius: 24px;
      background: linear-gradient(90deg, color-mix(in srgb, var(--sb) 78%, transparent), color-mix(in srgb, var(--p) 72%, transparent));
      backdrop-filter: blur(18px);
    }

    html[data-layout='dock'] .card,
    [data-layout='dock'] .card,
    html[data-layout='dock'] .sc,
    [data-layout='dock'] .sc {
      border-radius: 22px;
      box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
    }

    /* AVATAR */
    .av {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 11px;
      color: #fff;
      flex-shrink: 0
    }

    .av-1 {
      background: #1a56db
    }

    .av-2 {
      background: #10b981
    }

    .av-3 {
      background: #f59e0b
    }

    .av-4 {
      background: #ef4444
    }

    .av-5 {
      background: #8b5cf6
    }

    .av-6 {
      background: #06b6d4
    }

    .av-7 {
      background: #ec4899
    }

    .av-8 {
      background: #f97316
    }

    .prog {
      background: var(--bdr);
      border-radius: 99px;
      height: 6px;
      overflow: hidden
    }

    .prog-b {
      height: 100%;
      transition: width .3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Cải thiện hiển thị các phần Pháp lý, Tiến độ, Gói thầu, Hạng mục */
    #hydro-view-legal,
    #hydro-view-tenders,
    #hydro-view-implementation,
    #hydro-view-budget,
    #hydro-view-fund,
    #hydro-view-cash {
      font-family: 'Be Vietnam Pro', sans-serif !important;
    }

    /* Bảng trong chi tiết dự án */
    #project-detail table,
    .rpt-table,
    .tbl {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      border: 1px solid var(--bdr);
      border-radius: 12px;
      overflow: hidden;
      margin-top: 10px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    #project-detail th,
    .rpt-table th,
    .tbl th {
      background: var(--bg);
      color: var(--tx);
      font-weight: 800;
      font-size: 13px;
      padding: 14px 16px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 2px solid var(--bdr);
    }

    #project-detail td,
    .rpt-table td,
    .tbl td {
      padding: 14px 16px;
      font-size: 14px;
      color: var(--tx);
      border-bottom: 1px solid var(--bdr);
      line-height: 1.6;
    }

    #project-detail tr:hover td {
      background: var(--card);
    }

    /* Các tiêu đề phần trong tab */
    .hydro-phase-header,
    .hydro-step-header {
      font-family: 'Be Vietnam Pro', sans-serif !important;
      font-weight: 800 !important;
      font-size: 15px !important;
      color: var(--p) !important;
      padding: 12px 0;
    }

    .hydro-task-name,
    .hydro-task-item div {
      font-family: 'Be Vietnam Pro', sans-serif !important;
      font-size: 14px !important;
      line-height: 1.5;
    }

    .hydro-task-meta span {
      font-size: 12px !important;
      color: #64748b !important;
    }

    .hydro-stat-card b,
    .hydro-stat-card div {
      font-family: 'Be Vietnam Pro', sans-serif !important;
    }

    /* Badge cho trạng thái */
    .badge,
    .hydro-badge,
    .status-badge {
      font-weight: 700 !important;
      font-size: 11px !important;
      padding: 3px 10px !important;
      border-radius: 20px !important;
    }


    .hydro-timeline-step {
      display: flex;
      flex-direction: column;
      align-items: center;
      z-index: 1;
      cursor: pointer;
      flex: 1;
      position: relative;
    }

    .hydro-timeline-node {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--card);
      border: 2px solid var(--bdr);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 8px;
      transition: all .2s;
    }

    .hydro-timeline-step.active .hydro-timeline-node {
      border-color: var(--p);
      color: var(--p);
      box-shadow: 0 0 0 4px var(--pl);
    }

    .hydro-timeline-step.done .hydro-timeline-node {
      border-color: var(--ok);
      background: var(--ok);
      color: #fff;
    }

    .hydro-timeline-lbl {
      font-size: 11px;
      font-weight: 700;
      color: var(--tx3);
      text-align: center;
      max-width: 80px;
    }

    .hydro-phase-sec {
      margin-bottom: 24px;
      border: 1px solid var(--bdr);
      border-radius: 12px;
      overflow: hidden;
    }

    .hydro-phase-header {
      padding: 12px 16px;
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
    }

    .hydro-step-item {
      border-top: 1px solid var(--bdr);
      background: var(--card);
    }

    .hydro-step-header {
      padding: 10px 16px;
      font-weight: 700;
      font-size: 13px;
      color: var(--tx2);
      background: var(--bg);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .hydro-task-item {
      padding: 12px 16px 12px 42px;
      border-top: 1px solid var(--bg);
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: background .2s;
    }

    .hydro-task-item:hover {
      background: var(--card);
    }

    .hydro-task-main {
      flex: 1;
    }

    .hydro-task-name {
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .hydro-task-meta {
      font-size: 11px;
      color: var(--tx3);
      margin-top: 3px;
      display: flex;
      gap: 12px;
    }

    .hydro-status-badge {
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .st-todo {
      background: var(--bg);
      color: #64748b;
    }

    /* Implementation Tasks inside Modal */
    .impl-tasks-container {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px dashed var(--bdr);
    }

    .impl-task-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      background: var(--card);
      border-radius: 8px;
      margin-bottom: 6px;
      border: 1px solid var(--bg);
    }

    .impl-task-row.done {
      opacity: 0.6;
    }

    .impl-task-row.done .impl-task-name {
      text-decoration: line-through;
    }

    .impl-task-name {
      flex: 1;
      font-size: 13px;
      color: var(--tx1);
      font-weight: 500;
    }

    .impl-task-del {
      color: var(--err);
      cursor: pointer;
      font-size: 16px;
      padding: 2px 6px;
      border-radius: 4px;
    }

    .impl-task-del:hover {
      background: #fee2e2;
    }

    .st-inprogress {
      background: #92400e;
      color: #fbbf24;
    }

    .st-blocked {
      background: #7f1d1d;
      color: #f87171;
    }

    .st-done {
      background: #065f46;
      color: #34d399;
    }

    .hydro-subtasks {
      margin-top: 8px;
      padding-left: 20px;
      border-left: 1px dashed #cbd5e1;
    }

    .hydro-subtask {
      font-size: 12px;
      color: var(--tx2);
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .hydro-subtask i {
      font-size: 10px;
    }

    .tabs-nav {
      display: flex;
      gap: 20px;
      padding: 0 16px;
      border-bottom: 1px solid var(--bdr);
      background: var(--bg);
    }

    .tab-btn {
      padding: 12px 4px;
      font-size: 13px;
      font-weight: 700;
      color: var(--tx2);
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      transition: all .2s;
    }

    .tab-btn:hover {
      color: var(--p);
    }

    .tab-btn.active {
      color: var(--p);
      border-bottom-color: var(--p);
    }

    .fin-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-bottom: 20px;
    }

    .fin-card {
      padding: 16px;
      border-radius: 12px;
      background: var(--card);
      border: 1px solid var(--bdr);
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .fin-card.in {
      border-left: 4px solid var(--ok);
    }

    .fin-card.out {
      border-left: 4px solid var(--err);
    }

    .fin-card.bal {
      border-left: 4px solid var(--p);
    }

    .fin-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--tx3);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /* GLOBAL 3D Bold Titles - All Pages */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .ph .pt,
    .card-header,
    .modal-header .pt,
    .section-title,
    .tb-title,
    .acc-header-3d,
    .tab-btn {
      font-weight: 900 !important;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--tx) !important;
      /* Ultra Sharp */
      text-shadow: 1px 1px 0px var(--card), 1.5px 1.5px 0.5px rgba(0, 0, 0, 0.1), 2.5px 2.5px 5px rgba(0, 0, 0, 0.2);
    }

    .ph .pt {
      font-size: 24px !important;
      margin-bottom: 5px;
    }

    .tab-btn {
      font-size: 15px !important;
    }

    .modal-header .pt {
      font-size: 20px !important;
    }

    .card-header {
      font-size: 16px !important;
    }

    /* Deeper 3D Sunken Selectors with Border */
    .fc {
      width: 100%;
      border: 1.5px solid #cbd5e1;
      border-radius: 10px;
      padding: 10px 14px;
      font-family: inherit;
      font-size: 14px;
      color: var(--tx);
      background: var(--card);
      transition: all 0.2s;
      outline: none;
    }

    .fc:focus {
      border-color: var(--p);
      box-shadow: 0 0 0 4px var(--pl);
    }

    select.fc {
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 16px;
      padding-right: 40px !important;
    }

    select.fc:focus {
      box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(59, 130, 246, 0.15);
      border-color: var(--p) !important;
    }

    /* Table Header 3D Effect */
    table thead th {
      background: var(--bg);
      font-weight: 700;
      text-transform: uppercase;
      font-size: 11px;
      color: var(--tx);
      border-bottom: 2px solid #e2e8f0;
      /* text-shadow: 0.5px 0.5px 0px #fff; */
      box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    }

    .fin-val {
      font-size: 20px;
      font-weight: 800;
    }

    .fin-sub {
      font-size: 11px;
      color: var(--tx2);
    }

    .cur-tag {
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 800;
      color: #fff;
      margin-left: 6px;
    }

    .cur-vnd {
      background: #64748b;
    }

    .cur-usd {
      background: #10b981;
    }

    .cur-eur {
      background: #3b82f6;
    }

    .g2 {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 20px;
      overflow-x: auto;
    }

    .g3 {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 14px;
      overflow-x: auto;
    }

    /* --- PREMIUM HYDRO DESIGN SYSTEM --- */
    .hydro-section {
      margin-bottom: 32px;
    }

    .hydro-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 2px solid var(--bg);
    }

    .hydro-title {
      font-size: 18px;
      font-weight: 800;
      color: var(--tx);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .hydro-title i {
      color: var(--p);
      font-size: 20px;
    }

    .hydro-card {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 16px;
      padding: 20px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .hydro-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 12px 25px rgba(0, 0, 0, 0.06);
      border-color: var(--p);
    }

    .hydro-badge {
      padding: 4px 10px;
      border-radius: 99px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .badge-blue {
      background: #eff6ff;
      color: #2563eb;
    }

    .badge-green {
      background: #f0fdf4;
      color: #16a34a;
    }

    .badge-orange {
      background: #fff7ed;
      color: #ea580c;
    }

    .badge-red {
      background: #fef2f2;
      color: #dc2626;
    }

    .badge-gray {
      background: var(--card);
      color: #64748b;
    }

    /* TAG SELECTOR UI */
    .tag-input-container {
      border: 1.5px solid #94a3b8;
      border-radius: 12px;
      padding: 10px 14px;
      background: var(--bg);
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      min-height: 48px;
      cursor: text;
      position: relative;
      transition: all 0.2s ease;
      box-shadow: inset 0 4px 8px 0 rgba(0, 0, 0, 0.1);
    }

    .tag-input-container:focus-within {
      background: var(--card);
      border-color: var(--p);
      box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.15), inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
      outline: none;
    }

    .tag-item {
      background: var(--bg);
      color: var(--tx);
      padding: 5px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--bdr);
      box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
      transition: all 0.2s;
    }

    .tag-item:hover {
      background: #e2e8f0;
      transform: translateY(-1px);
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .tag-remove {
      cursor: pointer;
      color: #93c5fd;
    }

    .tag-remove:hover {
      color: var(--err)
    }

    .tag-search {
      border: none;
      outline: none;
      background: transparent;
      color: inherit;
      background: transparent;
      color: inherit;
      font-size: 13px;
      padding: 4px;
      flex: 1;
      min-width: 60px;
    }

    .tag-search::placeholder {
      color: var(--tx2);
      opacity: 0.8;
    }

    .tag-dropdown {
      position: absolute;
      top: 110%;
      left: 0;
      right: 0;
      background: var(--card);
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 16px;
      max-height: 280px;
      overflow-y: auto;
      z-index: 2000;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      display: none;
      animation: tagSlideIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
      padding: 8px 0;
    }

    @keyframes tagSlideIn {
      from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    /* DROPDOWN MULTI-SELECT */
    .ms-container {
      position: relative;
    }

    .ms-trigger {
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-right: 30px !important;
    }

    .ms-trigger::after {
      content: '▼';
      position: absolute;
      right: 15px;
      font-size: 10px;
      color: var(--tx3);
    }

    .ms-dropdown {
      position: fixed;
      background: var(--card);
      border: 1.5px solid var(--p);
      border-radius: 12px;
      max-height: 250px;
      overflow-y: auto;
      z-index: 9999;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
      display: none;
      padding: 8px;
      animation: tagSlideIn 0.2s ease;
      width: inherit;
      min-width: 200px;
    }

    .ms-option {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 13px;
      transition: background 0.2s;
      color: var(--tx1);
    }

    .ms-option:hover {
      background: var(--bg);
    }

    .ms-option input {
      cursor: pointer;
      width: 16px;
      height: 16px;
    }

    .ms-option b {
      font-weight: 600;
    }

    .tag-option {
      padding: 10px 14px;
      font-size: 13px;
      cursor: pointer;
      border-bottom: 1px solid var(--card);
      transition: all 0.2s;
    }

    .tag-option:last-child {
      border-bottom: none;
    }

    .tag-option:hover {
      background: var(--bg);
      padding-left: 18px;
      color: var(--p);
    }

    .tag-option b {
      color: var(--tx1);
    }

    .hydro-stat-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
      overflow-x: auto;
    }

    .hydro-stat-card {
      background: var(--card);
      padding: 20px;
      border-radius: 16px;
      border: 1px solid var(--bdr);
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .hydro-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 20px;
      overflow-x: auto;
    }

    .hydro-items-bar {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 24px;
      overflow-x: auto;
    }

    .hydro-grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      overflow-x: auto;
    }

    .hydro-grid-3 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 20px;
      overflow-x: auto;
    }

    @media (max-width: 768px) {

      .hydro-grid-2,
      .hydro-grid-3 {
        grid-template-columns: 1fr;
      }

      /* Responsive Document Signature Preview Modal */
      .doc-detail-body {
        flex-direction: column !important;
        height: auto !important;
      }
      .doc-detail-body > div:first-child {
        height: 45vh !important;
        flex: none !important;
      }
      .doc-detail-body > div:last-child {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid var(--bdr) !important;
      }
    }

    ::-webkit-scrollbar {
      width: 10px;
      height: 10px
    }

    ::-webkit-scrollbar-track {
      background: var(--bg);
      border-radius: 10px
    }

    ::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
      border-radius: 10px;
      border: 2px solid var(--bg);
      box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.1);
    }

    ::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    }

    .hydro-list-group {
      background: var(--card);
      border-radius: 16px;
      border: 1px solid var(--bdr);
      overflow: hidden;
      margin-bottom: 24px;
      box-shadow: var(--shd);
    }

    .hydro-list-header {
      background: var(--card);
      padding: 14px 20px;
      border-bottom: 1px solid var(--bdr);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .hydro-list-row {
      display: flex;
      align-items: center;
      padding: 12px 20px;
      border-bottom: 1px solid var(--bg);
      gap: 12px;
      transition: background 0.2s;
    }

    .hydro-list-row:hover {
      background: var(--sh);
    }

    .hydro-list-row:last-child {
      border-bottom: none;
    }

    .hydro-action-bar {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 16px;
      padding: 0 20px;
      margin-bottom: 24px;
    }

    .hydro-action-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 0;
      border-bottom: 1px solid var(--bdr);
    }

    .hydro-action-row:last-child {
      border-bottom: none;
    }

    .hydro-horizontal-list {
      display: flex;
      overflow-x: auto;
      gap: 16px;
      padding: 4px 4px 16px;
      scrollbar-width: thin;
      scroll-behavior: smooth;
    }

    .hydro-horizontal-list::-webkit-scrollbar {
      height: 6px;
    }

    .hydro-horizontal-list::-webkit-scrollbar-thumb {
      background: var(--bdr);
      border-radius: 10px;
    }

    .hydro-stat-card-v2 {
      min-width: 280px;
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 16px;
      padding: 20px;
      flex-shrink: 0;
      transition: all 0.3s;
    }

    .hydro-stat-card-v2:hover {
      border-color: var(--p);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    }

    .btn-icon {
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      border-radius: 8px;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      color: #64748b;
    }

    .btn-icon:hover {
      background: var(--bg);
      color: var(--p);
    }

    /* MODAL */
    .mo {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .5);
      z-index: 3000;
      align-items: center;
      justify-content: center;
      padding: 16px
    }

    .mo.open {
      display: flex
    }

    .mbox {
      background: var(--card);
      border-radius: 16px;
      width: 560px;
      max-width: 100%;
      max-height: 92vh;
      overflow-y: auto;
      overflow-x: auto;
      box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
      animation: slideUp .2s ease
    }

    .mbox-lg {
      width: 700px
    }

    .mbox-xl {
      width: 860px
    }

    @keyframes slideUp {
      from {
        transform: translateY(18px);
        opacity: 0
      }

      to {
        transform: translateY(0);
        opacity: 1
      }
    }



    .mh {
      padding: 18px 22px 14px;
      border-bottom: 1px solid var(--bdr);
      display: flex;
      align-items: center;
      justify-content: space-between
    }

    .mt {
      font-size: 15px;
      font-weight: 700
    }

    .mc {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: var(--tx2);
      padding: 2px 6px;
      border-radius: 6px
    }

    .mc:hover {
      background: var(--bg)
    }

    .mb {
      padding: 18px 22px
    }

    .mf {
      padding: 14px 22px;
      border-top: 1px solid var(--bdr);
      display: flex;
      gap: 8px;
      justify-content: flex-end
    }

    /* FORM */
    .fg {
      margin-bottom: 14px
    }

    .fg label {
      display: block;
      font-size: 11px;
      font-weight: 700;
      color: var(--tx2);
      margin-bottom: 5px;
      text-transform: uppercase;
      letter-spacing: .5px
    }

    .fc {
      width: 100%;
      padding: 8px 11px;
      border: 1px solid var(--bdr);
      border-radius: 8px;
      font-family: inherit;
      font-size: 13px;
      color: var(--tx);
      background: var(--card);
      outline: none;
      transition: border .15s
    }

    .fc:focus {
      border-color: var(--p);
      box-shadow: 0 0 0 3px rgba(26, 86, 219, .1)
    }

    select.fc {
      appearance: none;
      background-color: var(--card);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
    }

    [data-theme-mode='dark'] option {
      background: #1e293b;
      color: var(--tx);
    }

    .fhint {
      font-size: 11px;
      color: var(--tx3);
      margin-top: 3px
    }

    .pw {
      position: relative
    }

    .pw input {
      padding-right: 38px
    }

    .pwt {
      position: absolute;
      right: 9px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      cursor: pointer;
      font-size: 13px;
      color: var(--tx3)
    }

    /* KANBAN */
    .kanban {
      display: grid;
      grid-template-columns: repeat(4, minmax(260px, 1fr));
      gap: 14px;
      width: 100%;
      max-height: calc(100dvh - 190px);
      overflow: auto;
      align-items: start;
      overscroll-behavior: contain;
      padding-bottom: 14px
    }

    #task-kanban {
      scrollbar-gutter: stable;
      scrollbar-width: auto;
      scrollbar-color: #64748b var(--bg);
    }

    #task-kanban::-webkit-scrollbar {
      width: 14px;
      height: 14px;
    }

    #task-kanban::-webkit-scrollbar-thumb {
      min-width: 48px;
      min-height: 48px;
      border: 2px solid var(--bg);
      background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    }

    #task-kanban::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    }

    .office-kanban {
      display: grid;
      gap: 14px;
      width: 100%;
      max-height: calc(100dvh - 190px);
      overflow: auto;
      align-items: start;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      scrollbar-width: auto;
      scrollbar-color: #64748b var(--bg);
      padding-bottom: 14px;
    }

    .office-kanban-four {
      grid-template-columns: repeat(4, minmax(280px, 1fr));
    }

    .office-kanban-two {
      grid-template-columns: repeat(2, minmax(380px, 1fr));
    }

    /* 5 cot phe duyet — co gian theo noi dung, cuon ngang o duoi cung khi
       khong du cho, cot nao rong thi tu thu nho lai. */
    .office-kanban-five {
      display: flex;
      flex-direction: row;
      align-items: stretch;
      overflow-x: auto;
      overflow-y: hidden;
    }

    .office-kanban-five .office-kanban-column {
      flex: 1 1 260px;
      min-width: 260px;
      max-height: calc(100dvh - 190px);
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      transition: flex-basis 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
    }

    .office-kanban-five .office-kanban-column.is-empty {
      flex: 0 0 130px;
      min-width: 130px;
      opacity: 0.6;
    }

    .office-kanban-five .office-kanban-head {
      top: -10px;
    }

    .office-kanban::-webkit-scrollbar {
      width: 14px;
      height: 14px;
    }

    .office-kanban::-webkit-scrollbar-thumb {
      min-width: 48px;
      min-height: 48px;
      border: 2px solid var(--bg);
      background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    }

    .office-kanban-column {
      min-width: 0;
      padding: 10px;
      border: 1px solid var(--bdr);
      border-radius: 12px;
      background: var(--bg);
    }

    .office-kanban-head {
      position: sticky;
      top: -10px;
      z-index: 3;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 2px 9px;
      margin-bottom: 8px;
      background: var(--bg);
    }

    .office-kanban-list {
      display: flex;
      flex-direction: column;
      gap: 9px;
    }

    .proposal-kanban-card,
    .document-kanban-card {
      min-width: 0;
      margin: 0 !important;
      padding: 12px !important;
    }

    .proposal-kanban-card > div,
    .document-kanban-card {
      min-width: 0;
    }

    .proposal-kanban-card > div > div:first-child,
    .proposal-kanban-card > div > div:first-child > div,
    .proposal-kanban-card > div > div:first-child > div > div {
      min-width: 0;
      max-width: 100%;
    }

    .proposal-kanban-card [style*="font-size:14px"],
    .document-kanban-card [style*="font-size:15px"] {
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .proposal-kanban-card > div {
      flex-direction: column;
    }

    .proposal-kanban-card > div > div:last-child {
      width: 100%;
      flex-wrap: wrap;
    }

    .document-kanban-card {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
    }

    .document-kanban-card > div {
      width: auto !important;
      margin: 0 !important;
    }

    .office-kanban-empty {
      padding: 24px 10px;
      text-align: center;
      color: var(--tx3);
      font-size: 12px;
      border: 1px dashed var(--bdr);
      border-radius: 9px;
    }

    .office-kanban-head.is-clickable {
      cursor: pointer;
      border-radius: 8px;
      transition: background 0.15s ease;
    }

    .office-kanban-head.is-clickable:hover,
    .office-kanban-head.is-clickable:focus-visible {
      background: var(--bg2, rgba(148, 163, 184, 0.12));
      outline: none;
    }

    .kanban-head-open {
      margin-left: 4px;
      font-size: 11px;
      opacity: 0.55;
    }

    .office-kanban-head.is-clickable:hover .kanban-head-open {
      opacity: 1;
    }

    /* Panel danh sach hang ngang khi bam vao tieu de 1 cot kanban */
    .kanban-focus {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }

    .kanban-focus-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      padding: 10px;
      border: 1px solid var(--bdr);
      border-radius: 12px;
      background: var(--bg);
    }

    .kanban-focus-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .kanban-focus-tab {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 6px;
      border: 1px solid transparent;
      border-radius: 10px;
      background: transparent;
      color: inherit;
      cursor: pointer;
      opacity: 0.6;
      transition: opacity 0.15s ease, border-color 0.15s ease;
    }

    .kanban-focus-tab:hover {
      opacity: 1;
    }

    .kanban-focus-tab.active {
      opacity: 1;
      border-color: var(--p);
    }

    .kanban-focus-search {
      flex: 1 1 240px;
      min-width: 180px;
      padding: 8px 12px;
      border: 1px solid var(--bdr);
      border-radius: 8px;
      background: var(--bg2, var(--bg));
      color: var(--tx);
      font-size: 13px;
    }

    .kanban-focus-meta {
      font-size: 12px;
      color: var(--tx2);
      white-space: nowrap;
    }

    .kanban-focus-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: calc(100dvh - 260px);
      overflow-y: auto;
      padding-right: 4px;
    }

    .kanban-focus-body {
      display: grid;
      grid-template-columns: 190px minmax(0, 1fr);
      gap: 10px;
      align-items: start;
    }

    .kanban-focus-months {
      display: flex;
      flex-direction: column;
      gap: 2px;
      max-height: calc(100dvh - 260px);
      overflow-y: auto;
      padding: 8px;
      border: 1px solid var(--bdr);
      border-radius: 12px;
      background: var(--bg);
    }

    .kanban-months-title {
      padding: 2px 6px 6px;
      font-size: 12px;
      font-weight: 700;
      color: var(--tx2);
    }

    .kanban-year {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-top: 6px;
    }

    .kanban-period {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      width: 100%;
      padding: 6px 8px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: var(--tx2);
      font-size: 13px;
      text-align: left;
      cursor: pointer;
    }

    .kanban-period:hover {
      color: var(--tx);
      background: rgba(148, 163, 184, 0.12);
    }

    .kanban-period.is-all,
    .kanban-period.is-year {
      color: var(--tx);
      font-weight: 700;
    }

    .kanban-period.is-month {
      padding-left: 20px;
    }

    .kanban-period.active {
      color: var(--tx);
      border-color: var(--p);
      background: rgba(148, 163, 184, 0.16);
    }

    .kanban-months-note {
      padding: 8px 6px 2px;
      font-size: 11px;
      color: var(--tx3);
    }

    .kanban-focus .proposal-kanban-card > div {
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
    }

    .kanban-focus .proposal-kanban-card > div > div:last-child {
      width: auto;
      flex-wrap: nowrap;
    }

    .kanban-focus .document-kanban-card {
      grid-template-columns: minmax(0, 1fr) 220px auto;
      align-items: start;
    }

    .kanban-focus .document-kanban-card > div:last-child {
      flex-direction: row !important;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    @media (max-width: 760px) {
      .kanban-focus .proposal-kanban-card > div {
        flex-direction: column;
        align-items: stretch;
      }

      .kanban-focus .proposal-kanban-card > div > div:last-child {
        flex-wrap: wrap;
      }

      .kanban-focus .document-kanban-card {
        grid-template-columns: minmax(0, 1fr);
      }

      .kanban-focus-list {
        max-height: calc(100dvh - 300px);
      }

      .kanban-focus-body {
        grid-template-columns: minmax(0, 1fr);
      }

      .kanban-focus-months {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
      }

      .kanban-year {
        flex-direction: row;
        margin-top: 0;
      }

      .kanban-months-title,
      .kanban-months-note {
        display: none;
      }

      .kanban-period {
        width: auto;
        white-space: nowrap;
      }

      .kanban-period.is-month {
        padding-left: 8px;
      }
    }

    /* Kiem tra trung lap (sysadmin) */
    .ph-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .dup-mbox {
      width: min(980px, 95vw);
      max-width: 980px;
      max-height: 88vh;
      display: flex;
      flex-direction: column;
    }

    .dup-mbox .mb {
      overflow-y: auto;
    }

    .dup-stats {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--tx2);
    }

    .dup-group {
      margin-bottom: 12px;
      padding: 10px;
      border: 1px solid var(--bdr);
      border-radius: 10px;
      background: var(--bg);
    }

    .dup-group-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }

    .dup-group-label {
      flex: 1 1 200px;
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .dup-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 6px;
      border-top: 1px dashed var(--bdr);
    }

    .dup-row-main {
      flex: 1;
      min-width: 0;
    }

    .dup-row-title {
      font-size: 13px;
      font-weight: 600;
      overflow-wrap: anywhere;
    }

    .dup-muted {
      font-size: 11px;
      color: var(--tx2);
      margin-top: 2px;
      overflow-wrap: anywhere;
    }

    /* Trang Quan ly cong van — sidebar "Don vi thanh vien" + noi dung. Dung
       minmax(0, ...) de cot sidebar co the co lai thay vi bi ten don vi dai
       day rong ra (grid track mac dinh khong tu co theo noi dung nowrap). Tren
       mobile, xep chong sidebar len tren thay vi 2 cot, tranh chiem het man hinh. */
    .disp-page-grid {
      display: grid;
      grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
      gap: 20px;
      align-items: start;
    }

    @media (max-width: 760px) {
      .disp-page-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 760px) {
      .office-kanban-four,
      .office-kanban-two {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 280px;
        max-height: calc(100dvh - 220px);
      }

      .office-kanban-five .office-kanban-column {
        flex-basis: 240px;
        min-width: 240px;
        max-height: calc(100dvh - 220px);
      }

      .office-kanban-five .office-kanban-column.is-empty {
        flex-basis: 100px;
        min-width: 100px;
      }
    }

    .dl-tag-tree-modal {
      width: min(560px, 95vw);
      max-width: 560px;
      max-height: 86vh;
      display: flex;
      flex-direction: column;
    }

    #page-digital-library .dl-header-action {
      background: var(--p) !important;
      color: #fff !important;
      border: 0 !important;
      box-shadow: 0 4px 12px rgba(5, 150, 105, .2);
    }

    #page-digital-library .dl-header-action:hover {
      background: var(--pd) !important;
    }

    .dl-tag-tree-modal-body {
      overflow: auto;
      min-height: 260px;
      max-height: calc(86vh - 70px);
    }

    .dl-tag-sidebar-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      padding-bottom: 8px;
      margin-bottom: 5px;
      border-bottom: 1px solid var(--bdr);
    }

    .dl-tag-tree,
    .dl-tag-check-tree {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .dl-tag-check-tree {
      max-height: 330px;
      overflow: auto;
      padding: 10px;
      border: 1px solid var(--bdr);
      border-radius: 10px;
      background: var(--bg);
    }

    .dl-tag-tree-row,
    .dl-tag-check-row {
      display: flex;
      align-items: center;
      gap: 3px;
      padding-left: calc((var(--dl-depth) - 1) * 18px);
    }

    .dl-tag-tree-node,
    .dl-tag-tree-children {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .dl-tag-toggle,
    .dl-tag-toggle-placeholder {
      width: 20px;
      height: 24px;
      flex: 0 0 20px;
    }

    .dl-tag-toggle {
      border: 0;
      background: transparent;
      color: var(--tx3);
      cursor: pointer;
      border-radius: 5px;
      transition: transform .16s, background .16s;
    }

    .dl-tag-toggle:hover {
      background: var(--pale);
      color: var(--p);
    }

    .dl-tag-toggle.expanded {
      transform: rotate(90deg);
    }

    .dl-tag-toggle .fa-chevron-right {
      font-size: 9px;
    }

    .dl-tag-tree-select,
    .dl-tag-check-row label {
      min-width: 0;
      flex: 1;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 6px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--tx);
      text-align: left;
      cursor: pointer;
    }

    .dl-tag-tree-select:hover,
    .dl-tag-tree-row.active .dl-tag-tree-select,
    .dl-tag-check-row label:hover {
      background: var(--pale);
      color: var(--p);
    }

    .dl-tag-tree-select span,
    .dl-tag-check-row label span {
      min-width: 0;
      flex: 1;
      overflow-wrap: anywhere;
    }

    .dl-tag-tree-select small,
    .dl-tag-check-row small {
      color: var(--tx3);
      font-size: 10px;
    }

    .dl-tag-add-child {
      width: 23px;
      height: 23px;
      flex: 0 0 23px;
      border: 1px solid var(--bdr);
      border-radius: 5px;
      background: var(--card);
      color: var(--p);
      font-weight: 800;
      cursor: pointer;
    }

    .dl-tag-add-child .fa-pen {
      font-size: 9px;
    }

    .dl-tag-add-child:hover {
      background: var(--p);
      color: #fff;
    }

    .global-search-box {
      width: min(1050px, 96vw);
      max-width: 1050px;
      max-height: 92vh;
      display: flex;
      flex-direction: column;
    }

    .global-search-box > .mb {
      overflow: auto;
    }

    .global-search-form {
      display: grid;
      grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr));
      gap: 10px;
      align-items: end;
    }

    .global-search-query {
      grid-column: span 2;
    }

    .global-search-results {
      display: flex;
      flex-direction: column;
      gap: 7px;
      max-height: 52vh;
      overflow: auto;
      padding-right: 4px;
    }

    .global-search-result {
      width: 100%;
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 11px 12px;
      border: 1px solid var(--bdr);
      border-radius: 10px;
      background: var(--card);
      color: var(--tx);
      text-align: left;
      cursor: pointer;
      transition: border-color .16s, transform .16s, background .16s;
    }

    .global-search-result:hover {
      border-color: var(--p);
      background: var(--pale);
      transform: translateY(-1px);
    }

    .global-search-result-icon {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 9px;
      background: var(--pale);
      color: var(--p);
    }

    .global-search-result-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .global-search-result-main strong,
    .global-search-result-main small {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .global-search-result-main small,
    .global-search-result-date {
      color: var(--tx3);
      font-size: 11px;
    }

    @media (max-width: 760px) {
      .global-search-form {
        grid-template-columns: 1fr 1fr;
      }

      .global-search-query {
        grid-column: 1 / -1;
      }

      .global-search-result {
        grid-template-columns: 34px minmax(0, 1fr);
      }

      .global-search-result-date {
        display: none;
      }
    }

    .kc {
      background: var(--bg);
      border-radius: 12px;
      padding: 12px;
      min-width: 0;
      border: 1px solid var(--bdr)
    }

    .kch {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      position: sticky;
      top: -12px;
      z-index: 2;
      padding: 12px 0 8px;
      background: var(--bg)
    }

    .kct {
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 7px
    }

    .kcc {
      background: var(--bdr);
      color: var(--tx2);
      font-size: 11px;
      font-weight: 700;
      padding: 1px 7px;
      border-radius: 10px
    }

    .kcard {
      background: var(--card);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 8px;
      border: 1px solid var(--bdr);
      cursor: pointer;
      transition: .15s;
      box-shadow: var(--shd)
    }

    .kcard:hover {
      border-color: var(--p);
      box-shadow: 0 4px 16px rgba(26, 86, 219, .12);
      transform: translateY(-1px)
    }

    .kcard-t {
      font-size: 13px;
      font-weight: 600;
      line-height: 1.45;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
      margin-bottom: 7px
    }

    .task-modal-box {
      width: min(1100px, 96vw) !important;
      max-width: 1100px !important;
    }

    .task-description {
      min-height: 180px;
      resize: vertical;
      line-height: 1.55;
    }

    .task-progress-section {
      border: 1px solid var(--bdr);
      border-radius: 10px;
      padding: 14px;
      background: var(--bg);
    }

    .task-progress-list {
      max-height: 320px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .task-progress-item {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-left: 3px solid var(--p);
      border-radius: 8px;
      padding: 10px 12px;
    }

    .kcard-tags {
      display: flex;
      gap: 3px;
      flex-wrap: wrap;
      margin-bottom: 6px
    }

    .kadd {
      width: 100%;
      background: none;
      border: 1px dashed var(--bdr);
      border-radius: 8px;
      padding: 7px;
      color: var(--tx2);
      font-size: 13px;
      cursor: pointer;
      transition: .15s
    }

    .kadd:hover {
      background: var(--card);
      border-color: var(--p);
      color: var(--p)
    }

    .pr {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      display: inline-block
    }

    .pr-h {
      background: var(--err)
    }

    .pr-m {
      background: var(--warn)
    }

    .pr-l {
      background: var(--ok)
    }

    /* APPROVAL */
    .ap-card {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 10px;
      transition: .15s
    }

    .ap-card:hover {
      border-color: var(--pl);
      box-shadow: var(--shd)
    }

    .ap-card.pending {
      border-left: 3px solid var(--warn)
    }

    .ap-card.approved {
      border-left: 3px solid var(--ok)
    }

    .ap-card.rejected {
      border-left: 3px solid var(--err)
    }

    .ap-card.cancelled {
      border-left: 3px solid var(--tx3)
    }

    /* FILE UPLOAD */
    .file-drop {
      border: 2px dashed var(--bdr);
      border-radius: 10px;
      padding: 20px;
      text-align: center;
      cursor: pointer;
      transition: .15s;
      background: var(--bg)
    }

    .file-drop:hover,
    .file-drop.drag {
      border-color: var(--p);
      background: var(--pl)
    }

    .file-drop input {
      display: none
    }

    .file-list {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 6px
    }

    .file-item {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--bg);
      border: 1px solid var(--bdr);
      border-radius: 8px;
      padding: 7px 10px
    }

    .file-item .fname {
      flex: 1;
      font-size: 12px;
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap
    }

    .file-item .fsize {
      font-size: 11px;
      color: var(--tx3)
    }

    .file-item .fdel {
      background: none;
      border: none;
      color: var(--err);
      cursor: pointer;
      font-size: 14px
    }

    /* WF STEPS */
    .wf-steps {
      display: flex;
      align-items: center;
      gap: 0;
      margin: 14px 0;
      flex-wrap: wrap
    }

    .wf-step {
      display: flex;
      align-items: center;
      gap: 0
    }

    .wf-node {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      min-width: 90px
    }

    .wf-circle {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 2px solid var(--bdr);
      background: var(--card);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      transition: .2s
    }

    .wf-circle.done,
    .wf-circle.approved {
      background: var(--ok);
      border-color: var(--ok);
      color: #fff
    }

    .wf-circle.active,
    .wf-circle.pending {
      background: var(--p);
      border-color: var(--p);
      color: #fff;
      box-shadow: 0 0 0 4px rgba(26, 86, 219, .15)
    }

    .wf-circle.rejected {
      background: var(--err);
      border-color: var(--err);
      color: #fff
    }

    .wf-circle.waiting {
      background: var(--card);
      border-color: var(--bdr);
      color: var(--tx3)
    }

    .wf-label {
      font-size: 10px;
      font-weight: 600;
      color: var(--tx2);
      text-align: center;
      max-width: 80px;
      line-height: 1.3
    }

    .wf-arrow {
      width: 28px;
      height: 2px;
      background: var(--bdr);
      flex-shrink: 0;
      margin-bottom: 20px
    }

    .wf-arrow.done {
      background: var(--ok)
    }

    /* TABS */
    .tabs {
      display: flex;
      gap: 3px;
      background: var(--bg);
      padding: 3px;
      border-radius: 10px;
      width: fit-content;
      margin-bottom: 18px
    }

    .tab {
      padding: 6px 14px;
      border-radius: 7px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      color: var(--tx2);
      border: none;
      background: none;
      font-family: inherit;
      transition: .15s
    }

    .tab.active {
      background: #fff;
      color: var(--p);
      box-shadow: 0 1px 4px rgba(0, 0, 0, .1)
    }

    /* TIMELINE */
    .tl {
      position: relative;
      padding-left: 22px
    }

    .tl::before {
      content: '';
      position: absolute;
      left: 7px;
      top: 4px;
      bottom: 0;
      width: 2px;
      background: var(--bdr)
    }

    .tli {
      position: relative;
      margin-bottom: 16px
    }

    .tli::before {
      content: '';
      position: absolute;
      left: -19px;
      top: 4px;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--p);
      border: 2px solid #fff;
      box-shadow: 0 0 0 2px var(--p)
    }

    .tlt {
      font-size: 10px;
      color: var(--tx3);
      margin-bottom: 1px
    }

    .tlx {
      font-size: 13px
    }

    /* SETTINGS */
    .settings-grid {
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      gap: 20px
    }

    .sn {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 12px;
      padding: 10px;
      height: fit-content
    }

    .sn-group {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 16px;
      margin-bottom: 20px;
      overflow: hidden;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }

    .sn-i {
      padding: 12px 16px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      color: var(--tx2);
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 10px;
      border-bottom: 1px solid var(--bdr);
    }

    .sn-i:last-child {
      border-bottom: none;
    }

    .sn-i:hover {
      background: var(--bg);
      color: var(--tx1);
    }

    .sn-i.active {
      background: var(--pl);
      color: var(--p);
      font-weight: 700;
      position: relative;
    }

    .sn-i.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 8px;
      bottom: 8px;
      width: 4px;
      background: var(--p);
      border-radius: 0 4px 4px 0;
    }

    .sp {
      display: none
    }

    .sp.active {
      display: block
    }

    /* CO TREE — day la "the thong tin" (ten + mo ta nhieu dong + nut), KHONG
       phai du lieu dang bang, nen cuon ngang khong phu hop (cuon xong chi
       thay 1 phan, khong xem duoc ca ten lan nut cung luc). Cho nut Sua/Xoa
       tu xuong dong xuong duoi khi khong du cho thay vi cuon. */
    .co-node {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 10px;
    }

    .co-node.parent {
      border-left: 4px solid var(--p)
    }

    .co-node.child {
      border-left: 4px solid var(--ok);
      margin-left: 28px
    }

    .co-node-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
    }

    /* TOAST */
    #toast-box {
      position: fixed;
      bottom: 22px;
      right: 22px;
      z-index: 99999;
      display: flex;
      flex-direction: column;
      gap: 7px;
      pointer-events: none;
    }

    .toast {
      background: #1a1f36;
      color: #fff;
      padding: 11px 16px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 9px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
      animation: tIn .2s ease;
      min-width: 250px;
      pointer-events: auto;
    }

    .toast.ok {
      border-left: 3px solid var(--ok)
    }

    .toast.err {
      border-left: 3px solid var(--err)
    }

    .toast.info {
      border-left: 3px solid var(--acc)
    }

    @keyframes tIn {
      from {
        transform: translateX(36px);
        opacity: 0
      }

      to {
        transform: translateX(0);
        opacity: 1
      }
    }

    .empty {
      text-align: center;
      padding: 50px 20px;
      color: var(--tx2)
    }

    .empty .ei {
      font-size: 44px;
      margin-bottom: 10px;
      opacity: .35
    }

    .empty h3 {
      font-size: 14px;
      font-weight: 700;
      color: var(--tx3);
      margin-bottom: 3px
    }

    .sdiv {
      height: 1px;
      background: var(--bdr);
      margin: 16px 0
    }

    .detail-row {
      display: flex;
      gap: 8px;
      margin-bottom: 8px
    }

    .dl {
      font-size: 12px;
      font-weight: 600;
      color: var(--tx2);
      min-width: 130px;
      flex-shrink: 0
    }

    .dv {
      font-size: 13px
    }

    .ib {
      background: var(--pl);
      border: 1px solid #bfdbfe;
      border-radius: 8px;
      padding: 10px 13px;
      font-size: 13px;
      color: var(--p);
      display: flex;
      align-items: flex-start;
      gap: 7px;
      margin-bottom: 14px
    }

    .phase-1 {
      background: #fef3c7;
      color: #92400e;
      border: 1px solid #fde68a
    }

    .phase-2 {
      background: #d1fae5;
      color: #065f46;
      border: 1px solid #a7f3d0
    }

    .chart-container {
      position: relative;
      height: 240px
    }


    /* ═══ MOBILE TOGGLE BUTTON ═══ */
    .mobile-menu-btn {
      display: none;
      position: fixed;
      top: 12px;
      left: 12px;
      z-index: 200;
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: var(--sb);
      color: #fff;
      border: none;
      font-size: 20px;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 10px rgba(0, 0, 0, .3)
    }

    .mobile-back-chat {
      display: none
    }

    /* ═══ RESPONSIVE: TABLET (max-width: 1200px) ═══ */
    @media(max-width:1200px) {
      .sg {
        grid-template-columns: repeat(2, 1fr)
      }

      .g3 {
        grid-template-columns: 1fr 1fr
      }
    }

    /* ═══ RESPONSIVE: SMALL TABLET (max-width: 900px) ═══ */
    @media(max-width:900px) {
      .settings-grid {
        grid-template-columns: minmax(0, 1fr)
      }

      .g2,
      .g3 {
        grid-template-columns: 1fr
      }

      .sg {
        grid-template-columns: repeat(2, 1fr)
      }
    }

    /* ═══ RESPONSIVE: MOBILE (max-width: 768px) ═══ */
    @media(max-width:768px) {
      .mo {
        z-index: 9000 !important;
        padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) 10px !important;
        align-items: stretch !important;
      }

      /* Khung xem truoc file (mo-preview) phai LUON noi tren cac modal khac
         (vd mo-dispatch-view, mo-doc-detail...) vi no thuong duoc mo TU BEN
         TRONG 1 modal khac dang mo san. Rule ".mo" o tren dung !important nen
         "z-index:10001" khai bao inline tren #mo-preview bi vo hieu — can 1
         rule rieng cung !important, uu tien cao hon, de thang trong media nay. */
      #mo-preview {
        z-index: 9500 !important;
      }

      .mo.open {
        display: flex !important;
      }

      .mo .mbox,
      .mo .mbox-lg,
      .mo .mbox-xl {
        width: min(100%, 96vw) !important;
        max-width: 96vw !important;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
      }

      .mo .mb,
      .mo .modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
      }

      .mo .mf,
      .mo .modal-footer {
        flex: 0 0 auto !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 2 !important;
        background: var(--card) !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        box-shadow: 0 -10px 24px rgba(15, 23, 42, .12);
      }

      body {
        flex-direction: column;
        overflow: hidden;
        height: 100vh;
      }

      /* --- Sidebar: full overlay --- */
      #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
        z-index: 1100;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .3);
        padding-top: calc(10px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
      }

      .sb-close-btn {
        display: flex;
        position: absolute;
        top: calc(8px + env(safe-area-inset-top));
        right: 12px;
        width: 34px;
        height: 34px;
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        border: none;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        z-index: 310;
        backdrop-filter: blur(4px);
      }

      #sidebar.open {
        transform: translateX(0)
      }

      .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 299;
        animation: fadeIn .2s ease;
      }

      .sidebar-overlay.show {
        display: block
      }

      @keyframes fadeIn {
        from {
          opacity: 0
        }

        to {
          opacity: 1
        }
      }

      /* --- Module Bar: Bottom Navigation on mobile --- */
      #module-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(60px + env(safe-area-inset-bottom));
        flex-direction: row;
        justify-content: space-around;
        padding: 0 10px env(safe-area-inset-bottom) 10px;
        background: #1e293b;
        z-index: 1000;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none;
        gap: 0;
      }

      #module-bar .mod-i {
        width: 50px;
        height: 50px;
        margin-top: 0 !important;
      }

      #module-bar .mod-label {
        display: none !important;
      }

      #module-bar .mod-i.active::after {
        display: none;
      }

      /* --- Mobile menu toggle --- */
      .mobile-menu-btn {
        display: flex;
        position: fixed;
        top: calc(8px + env(safe-area-inset-top));
        left: 12px;
        z-index: 1000;
        width: 56px;
        height: 56px;
        border-radius: 14px;
        background: linear-gradient(145deg, #ffffff, #e2e8f0);
        color: #1e293b;
        border: 2.5px solid #fff;
        font-size: 28px;
        align-items: center;
        justify-content: center;
        box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.25), -3px -3px 8px rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(4px);
        cursor: pointer;
        transition: transform 0.1s;
      }

      .mobile-menu-btn:active {
        transform: scale(0.92);
      }

      .sidebar-toggle {
        display: none !important;
      }

      html.sub-sidebar-collapsed #sidebar {
        display: flex !important;
      }

      /* --- Main: full width --- */
      #main {
        margin-left: 0 !important;
        width: 100vw;
        height: 100%;
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
      }

      #topbar {
        padding: 0 12px 0 76px;
        /* Increased padding for larger menu button */
        height: calc(56px + env(safe-area-inset-top));
        justify-content: flex-start;
        align-items: flex-start;
      }

      /* --- Global Bell Fix --- */
      .notif-wrapper {
        position: fixed;
        top: calc(8px + env(safe-area-inset-top));
        right: 12px;
        z-index: 10050;
        display: flex !important;
        gap: 8px !important;
      }

      .notif-wrapper #top-chat-btn,
      .notif-wrapper #top-theme-btn {
        display: none !important;
      }
      #bell-btn,
      #top-chat-btn,
      #top-theme-btn {
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: linear-gradient(145deg, #ffffff, #e2e8f0) !important;
        border: 2.5px solid #fff !important;
        padding: 0 !important;
        font-size: 28px !important;
        box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.25), -3px -3px 8px rgba(255, 255, 255, 0.9) !important;
        color: #0f172a !important;
        transition: transform 0.1s active !important;
      }

      #notif-dropdown {
        position: fixed !important;
        top: calc(68px + env(safe-area-inset-top)) !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-height: calc(100vh - 100px) !important;
        z-index: 10060 !important;
      }

      #notif-dropdown .notif-list {
        max-height: calc(100vh - 170px) !important;
      }

      #bell-btn:active,
      #top-chat-btn:active,
      #top-theme-btn:active {
        transform: scale(0.92) !important;
        box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2) !important;
      }

      #mod-chat,
      .mod-i[onclick*="chat"],
      div[onclick*="nav('chat')"] {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
      }

      #topbar .tb-right {
        display: none !important;
        /* Hide the old container on mobile */
      }

      .tb-title {
        font-size: 16px;
        margin-top: calc(18px + env(safe-area-inset-top));
        color: #fff !important;
        opacity: 1 !important;
      }

      /* --- AI Button: Move up to avoid bottom nav --- */
      #floating-ai-btn {
        bottom: calc(85px + env(safe-area-inset-bottom)) !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
      }

      #ai-chat-widget {
        bottom: calc(85px + env(safe-area-inset-bottom)) !important;
        right: 10px !important;
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 180px) !important;
      }

      .tb-right .search-bar {
        display: none
      }

      #content {
        padding: 12px
      }

      /* --- Grids full width --- */
      .sg {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px
      }

      .sc .val {
        font-size: 20px
      }

      .sc {
        padding: 12px
      }

      .g2,
      .g3 {
        grid-template-columns: 1fr;
        gap: 10px
      }

      /* --- Page header --- */
      .ph {
        margin-bottom: 14px;
        gap: 8px
      }

      .pt {
        font-size: 16px
      }

      .ph .btn {
        font-size: 12px;
        padding: 6px 10px
      }

      /* --- Cards --- */
      .card {
        padding: 14px;
        border-radius: 10px
      }

      /* --- Tables: horizontal scroll + compact --- */
      .tw {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px
      }

      table {
        min-width: 600px
      }

      thead th {
        padding: 7px 10px;
        font-size: 10px
      }

      tbody td {
        padding: 8px 10px;
        font-size: 12px
      }

      /* --- Modals: nearly full-screen on mobile --- */
      .mbox {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        border-radius: 14px
      }

      .mh {
        padding: 14px 16px
      }

      .mb {
        padding: 14px 16px
      }

      .mf {
        padding: 10px 16px
      }

      /* --- Buttons: bigger touch targets --- */
      .btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 36px
      }

      .btn-p {
        min-height: 40px
      }

      /* --- Forms --- */
      .fc {
        font-size: 14px !important;
        padding: 10px 12px !important
      }

      select.fc {
        padding: 10px 12px !important
      }

      .fg {
        margin-bottom: 12px
      }

      .fg label {
        font-size: 12px
      }

      /* --- Chat layout: stacked on mobile --- */
      .chat-layout {
        height: calc(100vh - 130px);
        flex-direction: column
      }

      .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bdr)
      }

      .chat-main {
        display: none
      }

      .chat-layout.has-active .chat-sidebar {
        display: none
      }

      .chat-layout.has-active .chat-main {
        display: flex;
        height: 100%
      }

      .chat-input-area {
        padding: 8px 10px
      }

      .chat-input-area input[type=text] {
        padding: 8px 12px;
        font-size: 14px
      }

      .chat-messages {
        padding: 12px
      }

      .msg-row {
        max-width: 88%
      }

      .mobile-back-chat {
        display: inline-flex
      }

      /* --- Settings --- */
      .settings-grid {
        grid-template-columns: minmax(0, 1fr)
      }

      .sn {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 12px;
        overflow-x: auto;
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
      }

      .sn-group {
        flex: 0 0 220px;
        min-width: 220px;
        scroll-snap-align: start;
      }

      .sn-i {
        padding: 8px 10px;
        font-size: 12px;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
      }

      /* --- Chart --- */
      .chart-container {
        height: 200px
      }

      /* --- Co switcher --- */
      .co-sw {
        margin: 6px 8px;
        padding: 8px 10px
      }

      /* --- Login responsive --- */
      .lb {
        padding: 28px 20px;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center
      }

      /* --- Toast --- */
      #toast-box {
        bottom: 8px;
        right: 8px;
        left: 8px;
        max-width: none
      }

      /* --- Badge --- */
      #co-badge {
        display: none !important
      }

      /* --- Hydro timeline compact --- */
      .hydro-timeline-node {
        width: 24px;
        height: 24px;
        font-size: 11px
      }

      .hydro-timeline-lbl {
        font-size: 9px;
        max-width: 50px
      }

      /* --- User menu --- */
      .u-menu {
        position: fixed;
        bottom: calc(60px + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        border-radius: 14px 14px 0 0;
        border: none;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .3);
        z-index: 2000;
      }

      .u-mi {
        padding: 14px 20px;
        font-size: 14px
      }

      /* --- Kanban mobile --- */
      .kanban {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 260px;
        gap: 10px;
        max-height: calc(100dvh - 230px);
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch
      }

      .kc {
        min-width: 0;
        padding: 10px
      }

      .kcard {
        padding: 10px
      }

      .kcard-t {
        font-size: 12px
      }

      /* --- Tabs scrollable --- */
      .tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        white-space: nowrap;
        border-bottom: 1px solid var(--bdr);
        margin-bottom: 14px
      }

      .tab {
        padding: 8px 12px;
        font-size: 12px;
        flex-shrink: 0
      }

      /* --- Workflow steps compact --- */
      .wf-steps {
        flex-wrap: wrap;
        gap: 4px
      }

      .wf-node {
        min-width: 60px
      }

      .wf-circle {
        width: 28px;
        height: 28px;
        font-size: 12px
      }

      .wf-lbl {
        font-size: 9px
      }

      .wf-arr {
        font-size: 10px
      }

      /* --- Approval cards --- */
      .ap-card {
        padding: 12px
      }

      /* --- Sidebar labels hidden on small screens --- */
      .sb-sec-lbl {
        font-size: 9px;
        letter-spacing: 1px
      }

      /* --- Proposal filters wrap --- */
      #prop-filters {
        gap: 6px
      }

      #prop-filters select.fc {
        width: 100% !important;
        max-width: 100% !important
      }

      /* --- Finance grid --- */
      .fin-grid {
        grid-template-columns: 1fr 1fr
      }

      .fin-val {
        font-size: 16px
      }

      /* --- PDF viewer mobile --- */
      #pdf-viewer-container {
        padding: 8px
      }

      .viewer-tools {
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 10px
      }
    }

    /* ═══ RESPONSIVE: VERY SMALL (max-width: 480px) ═══ */
    @media(max-width:480px) {
      .sg {
        grid-template-columns: 1fr
      }

      .sc .val {
        font-size: 18px
      }

      .sc .lbl {
        font-size: 10px
      }

      .sc .ib {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px
      }

      .ph {
        flex-direction: column;
        align-items: flex-start
      }

      .pt {
        font-size: 15px
      }

      .chat-tab {
        font-size: 11px;
        padding: 8px 4px
      }

      .ci-name {
        font-size: 12px
      }

      .ci-msg {
        font-size: 11px
      }

      .msg-bubble {
        font-size: 13px;
        padding: 8px 12px
      }

      table {
        min-width: 500px
      }

      .badge {
        font-size: 10px;
        padding: 2px 6px
      }

      #topbar {
        padding-left: 50px
      }

      .tb-right .btn span {
        display: none
      }
    }

    /* Visual E-Sign */
    #pdf-viewer-container {
      position: relative;
      flex: 1;
      overflow: auto;
      background: #525659;
      display: flex;
      justify-content: center;
      padding: 20px;
    }

    #pdf-canvas-wrapper {
      position: relative;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
      background: #fff;
    }

    #pdf-canvas {
      display: block;
    }

    .sig-overlay {
      position: absolute;
      border: 2px dashed var(--p);
      cursor: move;
      user-select: none;
      z-index: 100;
      box-sizing: border-box;
      background: rgba(26, 86, 219, 0.05);
    }

    .sig-overlay img {
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .sig-handle {
      position: absolute;
      width: 12px;
      height: 12px;
      background: var(--p);
      border: 2px solid #fff;
      border-radius: 50%;
      bottom: -6px;
      right: -6px;
      cursor: nwse-resize;
      z-index: 101;
    }

    .lb {
      width: 100%;
      max-width: 460px;
      background: var(--card);
      padding: 40px 32px;
      border-radius: 24px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
      position: relative;
      z-index: 1;
    }

    .viewer-tools {
      display: flex;
      align-items: center;
      gap: 15px;
      background: var(--card);
      padding: 8px 20px;
      border-bottom: 1px solid var(--bdr);
    }

    .v-btn {
      background: none;
      border: none;
      padding: 4px 8px;
      cursor: pointer;
      border-radius: 4px;
      color: var(--tx);
      display: flex;
      align-items: center;
      gap: 5px;
      font-weight: 500;
      font-size: 14px;
    }

    .v-btn:hover {
      background: var(--bg);
    }

    .page-num {
      font-size: 14px;
      color: var(--tx2);
      min-width: 80px;
      text-align: center;
    }

    /* CHAT */
    .chat-layout {
      display: flex;
      height: calc(100vh - 140px);
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: var(--r);
      overflow: hidden
    }



    .chat-sidebar {
      width: 320px;
      border-right: 1px solid var(--bdr);
      display: flex;
      flex-direction: column;
      background: var(--card)
    }

    .chat-sidebar-head {
      padding: 14px 16px;
      border-bottom: 1px solid var(--bdr);
      display: flex;
      align-items: center;
      justify-content: space-between
    }

    .chat-search {
      padding: 8px 12px;
      border-bottom: 1px solid var(--bdr)
    }

    .chat-search input {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid var(--bdr);
      border-radius: 8px;
      font-family: inherit;
      font-size: 13px;
      outline: none;
      background: var(--bg)
    }

    .chat-search input:focus {
      border-color: var(--p)
    }

    .chat-tabs {
      display: flex;
      border-bottom: 1px solid var(--bdr)
    }

    .chat-tab {
      flex: 1;
      padding: 10px 8px;
      text-align: center;
      font-size: 12px;
      font-weight: 700;
      color: var(--tx2);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: .15s;
      background: none;
      border-top: none;
      border-left: none;
      border-right: none;
      font-family: inherit
    }

    .chat-tab:hover {
      color: var(--p);
      background: var(--pl)
    }

    .chat-tab.active {
      color: var(--p);
      border-bottom-color: var(--p);
      background: var(--pl)
    }

    .chat-list {
      flex: 1;
      overflow-y: auto
    }

    .chat-item {
      position: relative;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      cursor: pointer;
      transition: .12s;
      border-bottom: 1px solid var(--bdr)
    }

    .chat-item:hover {
      background: var(--pl)
    }

    .chat-item.active {
      background: var(--pl);
      border-left: 3px solid var(--p)
    }

    .btn-chat-item-del {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: #fee2e2;
      color: var(--err);
      border: none;
      border-radius: 4px;
      width: 28px;
      height: 28px;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
      z-index: 5
    }

    .chat-item:hover .btn-chat-item-del {
      display: flex
    }

    .btn-chat-item-del:hover {
      background: #fecaca
    }

    .chat-item .ci-av {
      position: relative;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
      color: #fff;
      flex-shrink: 0
    }

    .chat-item .ci-info {
      flex: 1;
      min-width: 0
    }

    .chat-item .ci-name {
      font-size: 13px;
      font-weight: 600;
      display: flex;
      justify-content: space-between
    }

    .chat-item .ci-name .ci-time {
      font-size: 10px;
      color: var(--tx3);
      font-weight: 400
    }

    .chat-item .ci-msg {
      font-size: 12px;
      color: var(--tx2);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-top: 2px
    }

    .chat-item .ci-unread {
      background: var(--err);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
      flex-shrink: 0
    }

    .chat-item-group .ci-av {
      border-radius: 12px;
      background: linear-gradient(135deg, var(--p), var(--pur))
    }

    .chat-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: var(--bg)
    }

    .chat-main-head {
      padding: 14px 20px;
      border-bottom: 1px solid var(--bdr);
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--card)
    }

    .chat-main-head .cm-name {
      font-size: 15px;
      font-weight: 700
    }

    .chat-main-head .cm-status {
      font-size: 11px;
      color: var(--tx3)
    }

    .chat-main-actions {
      margin-left: auto;
      display: flex;
      gap: 6px
    }

    .chat-messages {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      background: var(--bg)
    }

    .chat-empty {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--tx3);
      gap: 8px
    }

    .chat-empty .ce-icon {
      font-size: 56px;
      opacity: .3
    }

    .msg-row {
      display: flex;
      align-items: flex-end;
      gap: 8px;
      max-width: 75%;
      animation: msgIn .2s ease
    }

    .msg-row.sent {
      align-self: flex-end;
      flex-direction: row-reverse
    }

    .msg-row .msg-av {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      color: #fff;
      flex-shrink: 0
    }

    .msg-bubble {
      padding: 10px 14px;
      border-radius: 16px;
      font-size: 13px;
      line-height: 1.5;
      word-wrap: break-word;
      max-width: 100%;
      position: relative
    }

    .msg-row.received .msg-bubble {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-bottom-left-radius: 4px
    }

    .msg-row.sent .msg-bubble {
      background: var(--p);
      color: #fff;
      border-bottom-right-radius: 4px
    }

    .msg-meta {
      font-size: 10px;
      color: var(--tx3);
      margin-top: 3px;
      display: flex;
      align-items: center;
      gap: 4px
    }

    .msg-row.sent .msg-meta {
      justify-content: flex-end;
      color: rgba(255, 255, 255, .55)
    }

    .msg-sender-name {
      font-size: 11px;
      font-weight: 600;
      color: var(--p);
      margin-bottom: 2px
    }

    .msg-date-sep {
      text-align: center;
      padding: 10px 0;
      font-size: 11px;
      color: var(--tx3);
      font-weight: 600
    }

    .msg-file {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: rgba(255, 255, 255, .1);
      border-radius: 8px;
      margin-top: 4px;
      font-size: 12px;
      cursor: pointer;
      text-decoration: none
    }

    .msg-row.received .msg-file {
      background: var(--bg);
      color: var(--p)
    }

    .msg-row.sent .msg-file {
      background: rgba(255, 255, 255, .15);
      color: #fff
    }

    .chat-input-area {
      padding: 12px 16px;
      border-top: 1px solid var(--bdr);
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--card)
    }

    .chat-input-area input[type=text] {
      flex: 1;
      padding: 10px 14px;
      border: 1px solid var(--bdr);
      border-radius: 24px;
      font-family: inherit;
      font-size: 13px;
      outline: none;
      transition: .15s
    }

    .chat-input-area input[type=text]:focus {
      border-color: var(--p);
      box-shadow: 0 0 0 3px rgba(26, 86, 219, .1)
    }

    .chat-send-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--p);
      color: #fff;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      transition: .15s;
      flex-shrink: 0
    }

    .chat-send-btn:hover {
      background: var(--pd);
      transform: scale(1.05)
    }

    .chat-send-btn:disabled {
      opacity: .4;
      cursor: not-allowed;
      transform: none
    }

    .chat-file-btn {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--bg);
      border: 1px solid var(--bdr);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      transition: .15s;
      flex-shrink: 0
    }

    .chat-file-btn:hover {
      background: var(--pl);
      border-color: var(--p)
    }

    @keyframes msgIn {
      from {
        opacity: 0;
        transform: translateY(8px)
      }

      to {
        opacity: 1;
        transform: translateY(0)
      }
    }

    .typing-indicator {
      display: flex;
      gap: 3px;
      padding: 8px 14px
    }

    .typing-indicator span {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--tx3);
      animation: typing 1.4s infinite ease-in-out
    }

    .typing-indicator span:nth-child(2) {
      animation-delay: .2s
    }

    .typing-indicator span:nth-child(3) {
      animation-delay: .4s
    }

    @keyframes typing {

      0%,
      60%,
      100% {
        transform: translateY(0)
      }

      30% {
        transform: translateY(-6px)
      }
    }

    .sb-logo-img {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      object-fit: cover;
      flex-shrink: 0
    }

    .lb-logo-img {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      object-fit: cover
    }

    .brand-preview {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px;
      background: var(--bg);
      border-radius: 12px;
      margin-bottom: 16px
    }

    .brand-preview .bp-icon {
      width: 48px;
      height: 48px;
      background: var(--p);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      color: #fff;
      font-size: 20px;
      flex-shrink: 0;
      overflow: hidden
    }

    .brand-preview .bp-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover
    }

    /* Comments Styles */
    .comments-sec {
      margin-top: 24px;
      border-top: 1px solid var(--bdr);
      padding-top: 18px;
    }

    .comment-item {
      display: flex;
      gap: 12px;
      margin-bottom: 16px;
      animation: msgIn .3s ease;
    }

    .comment-main {
      flex: 1;
      background: var(--bg);
      padding: 10px 14px;
      border-radius: 12px;
      font-size: 13px;
    }

    .comment-hdr {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 4px;
    }

    .comment-user {
      font-weight: 700;
      color: var(--tx1);
    }

    .comment-time {
      font-size: 10px;
      color: var(--tx3);
    }

    .comment-box {
      margin-top: 16px;
      display: flex;
      gap: 10px;
    }

    .comment-box textarea {
      flex: 1;
      min-height: 40px;
      max-height: 120px;
      resize: vertical;
      border-radius: 20px;
      padding: 10px 16px;
    }

    @media(max-width:768px) {
      .chat-sidebar {
        width: 100%
      }

      .chat-main {
        display: none
      }

      .chat-layout.has-active .chat-sidebar {
        display: none
      }

      .chat-layout.has-active .chat-main {
        display: flex
      }
    }

    /* NEW: Proposal Comments & Followers Premium Styling */
    .comments-sec {
      margin-top: 24px;
      padding-top: 20px;
      border-top: 1px dashed var(--bdr);
    }

    #prop-comments-list {
      max-height: 380px;
      overflow-y: auto;
      margin-bottom: 16px;
      padding-right: 5px;
    }

    .comment-item {
      display: flex;
      gap: 10px;
      margin-bottom: 14px;
      animation: slideUp 0.3s ease;
    }

    .comment-main {
      flex: 1;
      background: #fff;
      padding: 10px 14px;
      border-radius: 12px;
      border: 1px solid var(--bdr);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    }

    .comment-hdr {
      display: flex;
      justify-content: space-between;
      margin-bottom: 4px;
      align-items: center;
    }

    .comment-user {
      font-weight: 700;
      font-size: 13px;
      color: var(--p);
    }

    .comment-time {
      font-size: 10px;
      color: var(--tx3);
      font-weight: 500;
    }

    .comment-text {
      font-size: 13px;
      line-height: 1.5;
      color: var(--tx);
      white-space: pre-wrap;
    }

    .comment-box {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      margin-top: 16px;
      background: var(--pl);
      padding: 10px;
      border-radius: 12px;
      border: 1px solid var(--pl);
    }

    .comment-box .av {
      flex-shrink: 0;
    }

    .comment-box textarea {
      background: #fff;
      border: 1px solid var(--bdr);
      border-radius: 10px;
      padding: 8px 11px;
      font-size: 13px;
      resize: none;
      flex: 1;
      transition: 0.2s;
      min-height: 38px;
    }

    .comment-box textarea:focus {
      border-color: var(--p);
      box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
    }

    .comment-box .btn-p {
      height: 38px;
      align-self: flex-end;
    }

    .msg-bubble {
      position: relative;
    }

    .msg-del {
      position: absolute;
      top: 0px;
      right: -25px;
      background: none;
      border: none;
      color: var(--tx3);
      cursor: pointer;
      font-size: 14px;
      opacity: 0;
      transition: 0.2s;
    }

    .msg-bubble:hover .msg-del {
      opacity: 1;
    }

    .msg-del:hover {
      color: var(--err);
    }

    /* MENTIONS */
    .mention {
      font-weight: 700;
      color: var(--p);
      background: var(--pl);
      padding: 1px 4px;
      border-radius: 4px;
    }

    .mention-dropdown {
      position: fixed;
      background: #fff;
      border: 1px solid var(--bdr);
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      z-index: 10000;
      width: 220px;
      max-height: 200px;
      overflow-y: auto;
      display: none;
    }

    .mention-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      cursor: pointer;
      font-size: 13px;
      border-bottom: 1px solid var(--bg);
    }

    .mention-item:last-child {
      border-bottom: none;
    }

    .mention-item:hover,
    .mention-item.active {
      background: var(--pl);
      color: var(--p);
    }

    .mention-item .av {
      width: 24px;
      height: 24px;
      font-size: 9px;
    }

    .mention-item .mi-name {
      font-weight: 600;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .comment-del {
      background: none;
      border: none;
      color: var(--tx3);
      cursor: pointer;
      font-size: 12px;
      opacity: 0;
      transition: 0.2s;
    }

    .comment-item:hover .comment-del {
      opacity: 1;
    }

    .comment-del:hover {
      color: var(--err);
    }

    /* CEO REPORT STYLES */
    .ceo-kpi {
      background: var(--card);
      border: 1px solid var(--bdr);
      border-radius: 20px;
      padding: 24px;
      text-align: left;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shd)
    }

    .ceo-kpi::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: #22c55e;
    }

    .ceo-kpi-val {
      font-size: 32px;
      font-weight: 900;
      margin-bottom: 4px;
      letter-spacing: -1px
    }

    .ceo-kpi-lbl {
      font-size: 12px;
      color: var(--tx2);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px
    }

    .ceo-kpi-sub {
      font-size: 11px;
      color: var(--tx3);
      margin-top: 8px;
      display: flex;
      align-items: center;
      gap: 4px
    }

    .ceo-health-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 10px
    }

    .ceo-health-table th {
      text-align: left;
      padding: 12px;
      color: var(--tx3);
      font-size: 11px;
      text-transform: uppercase;
      border-bottom: 1px solid var(--bdr)
    }

    .ceo-health-table td {
      padding: 14px 12px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.03);
      font-size: 13px
    }

    @media (min-width: 901px) {
      #top-chat-btn {
        display: none !important;
      }
    }

    /* --- Signature Resizer Mobile Touch Optimization --- */
    #sig-resizer {
      width: 22px !important;
      height: 22px !important;
      right: -8px !important;
      bottom: -8px !important;
      background: var(--p) !important;
      border: 2px solid #fff !important;
      box-shadow: 0 3px 8px rgba(0,0,0,0.4) !important;
      border-radius: 50% !important;
      cursor: nwse-resize !important;
      touch-action: none;
    }

    #sig-resizer::after {
      content: "";
      position: absolute;
      top: -15px;
      left: -15px;
      right: -15px;
      bottom: -15px;
      border-radius: 50%;
      background: transparent;
      pointer-events: auto;
    }


    /* MOBILE LAYOUT SAFETY OVERRIDE
       Keep mobile navigation usable even when deep layout presets (dock/focus/etc.)
       change desktop positioning, radii, or glass backgrounds. */
    @media(max-width:768px) {
      html body,
      html[data-layout] body,
      [data-layout] body { overflow-x: hidden !important; }

      html #module-bar,
      html[data-layout] #module-bar,
      [data-layout] #module-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: calc(64px + env(safe-area-inset-bottom)) !important;
        min-height: calc(64px + env(safe-area-inset-bottom)) !important;
        max-height: calc(64px + env(safe-area-inset-bottom)) !important;
        transform: none !important;
        border-radius: 0 !important;
        padding: 6px 8px env(safe-area-inset-bottom) 8px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        z-index: 6500 !important;
      }

      html #module-bar .mod-i,
      html[data-layout] #module-bar .mod-i,
      [data-layout] #module-bar .mod-i {
        flex: 0 0 54px !important;
        width: 54px !important;
        height: 52px !important;
        min-width: 54px !important;
        margin: 0 !important;
        border-radius: 18px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
      }

      html #module-bar .mod-i[style*="margin-top:auto"],
      html[data-layout] #module-bar .mod-i[style*="margin-top:auto"],
      [data-layout] #module-bar .mod-i[style*="margin-top:auto"] { margin-top: 0 !important; }

      html #module-bar .mod-label,
      html[data-layout] #module-bar .mod-label,
      [data-layout] #module-bar .mod-label { display: none !important; }

      html #sidebar,
      html[data-layout] #sidebar,
      [data-layout] #sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: min(86vw, 320px) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 22px 22px 0 !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
        z-index: 7000 !important;
      }

      html #sidebar.open,
      html[data-layout] #sidebar.open,
      [data-layout] #sidebar.open { transform: translateX(0) !important; }

      html #main,
      html[data-layout] #main,
      [data-layout] #main {
        margin-left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        padding-bottom: calc(74px + env(safe-area-inset-bottom)) !important;
      }

      html #content,
      html[data-layout] #content,
      [data-layout] #content {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
      }

      html #topbar,
      html[data-layout] #topbar,
      [data-layout] #topbar {
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
      }
    }

    /* Ep dung co chu rieng cho tung vung xuong cac phan tu chua chu ben trong —
       rat nhieu class (vd .sb-i, .mod-label...) da co font-size co dinh rieng,
       khien viec chi dat font-size o container cha khong co tac dung gi.
       CHU Y: dung danh sach the cu the (khong dung selector "*") vi "#id *"
       kem !important tren mot vung DOM lon/dong (Kanban, bang, chat...) buoc
       trinh duyet tinh lai style cho MOI phan tu con moi lan DOM thay doi ->
       gay giat/lag ro ret. Danh sach the co san co chi phi khop thap hon nhieu.
       LOAI TRU icon (the <i>, span.ic, .mod-i) vi icon phai giu kich thuoc
       rieng — neu khong se bi ep nho lai theo co chu van ban (VD 14px). */
    #module-bar, #module-bar div:not(.mod-i), #module-bar span:not(.ic), #module-bar label, #module-bar a, #module-bar b, #module-bar small {
      font-size: var(--app-font-sidebar-size) !important;
    }

    #sidebar, #sidebar div, #sidebar span:not(.ic), #sidebar label, #sidebar a, #sidebar b, #sidebar small {
      font-size: var(--app-font-sidebar-size) !important;
    }

    #topbar, #topbar div, #topbar span:not(.ic), #topbar label, #topbar a, #topbar b, #topbar small {
      font-size: var(--app-font-topbar-size) !important;
    }

    #content div, #content span:not(.ic), #content label, #content p, #content td, #content th, #content li, #content a, #content input, #content textarea, #content select, #content small, #content b, #content strong {
      font-size: var(--app-font-content-size) !important;
    }
