    :root {
      --navy: #173f67;
      --navy-2: #245d8d;
      --blue-soft: #edf4fa;
      --ink: #17202b;
      --muted: #687584;
      --line: #dce4ec;
      --surface: #ffffff;
      --canvas: #f4f7fa;
      --green: #16835f;
      --green-bg: #e9f7f1;
      --amber: #b56b00;
      --amber-bg: #fff3d9;
      --red: #bd3944;
      --red-bg: #fdecef;
      --grey: #7b8794;
      --grey-bg: #eef1f4;
      --shadow: 0 8px 28px rgba(28, 53, 79, .08);
      --radius: 18px;
      --radius-sm: 12px;
    }

    * { box-sizing: border-box; }
    html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; }

    .app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
    .sidebar { background: #102f4f; color: white; padding: 26px 18px 20px; position: sticky; top: 0; height: 100vh; overflow: auto; }
    .brand { display: flex; align-items: center; justify-content: center; padding: 0 4px 24px; border-bottom: 1px solid rgba(255,255,255,.13); }
    .brand-logo { display: block; width: 100%; max-width: 214px; height: auto; object-fit: contain; border-radius: 8px; }
    .nav { padding-top: 20px; display: grid; gap: 7px; }
    .nav button { border: 0; background: transparent; color: #cbd8e4; padding: 12px 13px; border-radius: 12px; text-align: left; display: flex; align-items: center; gap: 11px; font-weight: 650; }
    .nav button:hover, .nav button.active { background: rgba(255,255,255,.10); color: white; }
    .nav button.nav-subitem { margin-left: 18px; width: calc(100% - 18px); padding-top: 10px; padding-bottom: 10px; font-size: 13px; color: #afc3d5; }
    .nav button.nav-subitem.active { color: white; }
    .nav .icon { width: 22px; text-align: center; opacity: .92; }
    .sidebar-note { margin-top: 28px; padding: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); border-radius: 13px; font-size: 12px; color: #c8d6e3; line-height: 1.5; }
    .sidebar-note strong { color: white; display: block; margin-bottom: 3px; }

    .main { min-width: 0; }
    .topbar { height: 76px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 20; }
    .topbar-left { min-width: 0; }
    .eyebrow { color: var(--navy-2); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
    .page-title { font-size: 21px; font-weight: 790; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .top-actions { display: flex; align-items: center; gap: 10px; }
    .search { position: relative; }
    .search input { width: 280px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px 11px 38px; background: #fbfcfd; outline: none; }
    .search input:focus { border-color: #8eb3d2; box-shadow: 0 0 0 3px #e6f0f7; }
    .search::before { content: "⌕"; position: absolute; left: 14px; top: 8px; color: #748391; font-size: 21px; pointer-events: none; }
    .search-results { position: absolute; top: calc(100% + 9px); right: 0; width: min(440px, calc(100vw - 42px)); max-height: 480px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(19,47,77,.18); display: none; z-index: 80; }
    .search-results.show { display: block; }
    .search-section + .search-section { border-top: 1px solid #edf1f4; }
    .search-section-title { padding: 10px 13px 6px; color: #748391; font-size: 10px; font-weight: 820; text-transform: uppercase; letter-spacing: .07em; background: #fbfcfd; }
    .search-result { width: 100%; border: 0; background: #fff; padding: 11px 13px; display: flex; align-items: center; gap: 11px; text-align: left; color: var(--ink); }
    .search-result:hover, .search-result:focus { background: var(--blue-soft); outline: none; }
    .search-result-icon { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; background: #eef4f9; color: var(--navy); font-weight: 850; font-size: 12px; }
    .search-result-main { min-width: 0; flex: 1; }
    .search-result-title { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .search-result-meta { margin-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .search-result-arrow { color: #91a0ae; font-size: 16px; }
    .search-empty { padding: 18px 16px; color: var(--muted); font-size: 12px; text-align: center; }
    .avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-weight: 800; font-size: 13px; }

    .content { padding: 28px 30px 60px; max-width: 1600px; margin: 0 auto; }
    .view { display: none; }
    .view.active { display: block; }

    .hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
    .hero h2 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
    .hero p { margin: 7px 0 0; color: var(--muted); max-width: 720px; }
    .actions { display: flex; flex-wrap: wrap; gap: 9px; }
    .btn { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 11px; padding: 10px 14px; font-weight: 720; box-shadow: 0 1px 1px rgba(0,0,0,.02); }
    .btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(28,53,79,.08); }
    .btn.primary { background: var(--navy); color: white; border-color: var(--navy); }
    .btn.danger { color: var(--red); border-color: #ecc2c7; background: #fff8f9; }
    .btn.small { padding: 7px 10px; font-size: 12px; border-radius: 9px; }
    .btn.ghost { background: transparent; box-shadow: none; }

    .stats { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
    .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); min-height: 108px; position: relative; overflow: hidden; }
    .stat::after { content: ""; position: absolute; width: 74px; height: 74px; right: -16px; bottom: -20px; border-radius: 50%; background: var(--blue-soft); }
    .stat .label { color: var(--muted); font-size: 12px; font-weight: 760; text-transform: uppercase; letter-spacing: .05em; }
    .stat .value { font-size: 29px; font-weight: 850; margin-top: 9px; line-height: 1; }
    .stat .sub { color: var(--muted); font-size: 12px; margin-top: 8px; }
    .stat.good .value { color: var(--green); }
    .stat.warn .value { color: var(--amber); }
    .stat.bad .value { color: var(--red); }

    .grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
    .panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
    .panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .panel-head h3 { margin: 0; font-size: 17px; }
    .panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
    .panel-body { padding: 18px 20px; }
    .panel-body.flush { padding: 0; }

    .hospital-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
    .hospital-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow); transition: .18s ease; }
    .hospital-card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(28,53,79,.12); }
    .template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
    .template-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow); transition: .18s ease; }
    .template-card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(28,53,79,.12); }
    .template-head { display: flex; align-items: flex-start; gap: 13px; }
    .template-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; background: var(--blue-soft); color: var(--navy); font-size: 20px; }
    .template-name { font-size: 17px; font-weight: 830; line-height: 1.25; }
    .template-desc { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 5px; min-height: 36px; }
    .template-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
    .template-pill { border: 1px solid #e4eaf0; background: #f8fafc; color: #5f6d7a; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 760; }
    .template-pill.locked { background: #eef5fb; border-color: #d8e6f1; color: var(--navy-2); }
    .hospital-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
    .hospital-name { font-size: 18px; font-weight: 820; margin-bottom: 4px; }
    .hospital-meta { color: var(--muted); font-size: 12px; }
    .ring { --pct: 0; width: 72px; height: 72px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--pct) * 1%), #e8edf2 0); position: relative; flex: 0 0 auto; display: grid; place-items: center; }
    .ring::after { content: ""; width: 54px; height: 54px; background: white; border-radius: 50%; position: absolute; }
    .ring span { position: relative; z-index: 1; font-weight: 850; font-size: 13px; color: var(--ink); }
    .mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
    .mini-stat { border-radius: 11px; padding: 10px; background: #f8fafc; border: 1px solid #edf1f5; }
    .mini-stat strong { display: block; font-size: 16px; }
    .mini-stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 750; }
    .card-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

    .status { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 790; white-space: nowrap; }
    .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
    .status.green { color: var(--green); background: var(--green-bg); }
    .status.amber { color: var(--amber); background: var(--amber-bg); }
    .status.red { color: var(--red); background: var(--red-bg); }
    .status.grey { color: var(--grey); background: var(--grey-bg); }

    table { width: 100%; border-collapse: collapse; }
    th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid #edf1f4; vertical-align: middle; }
    th { color: #61707f; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: #fbfcfd; font-weight: 820; }
    td { font-size: 13px; }
    tr:last-child td { border-bottom: 0; }
    tbody tr:hover { background: #fbfdff; }
    .doctor-cell { display: flex; align-items: center; gap: 10px; }
    .doctor-initials { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; font-weight: 850; font-size: 11px; }
    .doctor-cell strong { display: block; }
    .doctor-cell small { color: var(--muted); }

    .attention-list { display: grid; gap: 10px; }
    .attention-item { border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 13px 14px; background: white; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
    .attention-item.red { border-left-color: var(--red); }
    .attention-item .title { font-weight: 780; }
    .attention-item .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

    .subnav { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 20px; }
    .subnav button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 8px 12px; font-size: 12px; color: #5f6f7d; font-weight: 730; }
    .subnav button.active { color: white; background: var(--navy); border-color: var(--navy); }

    .detail-header { background: linear-gradient(135deg, #153c62, #245d8d); color: white; border-radius: 22px; padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
    .detail-header h2 { margin: 0; font-size: 27px; }
    .detail-header p { color: #d5e2ed; margin: 6px 0 0; }
    .detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
    .detail-badges span { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.13); border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 720; }
    .score-box { min-width: 120px; text-align: center; align-self: center; }
    .score-box .score { font-size: 37px; font-weight: 900; }
    .score-box .score-label { font-size: 11px; color: #cfdeea; text-transform: uppercase; letter-spacing: .07em; }
    .profile-export { margin-top:14px; display:flex; justify-content:center; }
    .profile-export .btn { background:rgba(255,255,255,.14); color:white; border-color:rgba(255,255,255,.32); box-shadow:none; white-space:nowrap; }
    .profile-export .btn:hover { background:rgba(255,255,255,.22); box-shadow:none; }
    .profile-export .btn:disabled { opacity:.5; cursor:not-allowed; transform:none; }

    .section-title { margin: 24px 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
    .section-title h3 { margin: 0; font-size: 18px; }
    .section-title p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
    .requirements { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
    .req-card { border: 1px solid var(--line); border-radius: 15px; background: white; padding: 15px; box-shadow: 0 3px 14px rgba(28,53,79,.045); }
    .req-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
    .req-title { font-weight: 820; font-size: 14px; line-height: 1.3; }
    .req-section { font-size: 10px; color: var(--muted); margin-top: 4px; text-transform: uppercase; font-weight: 760; letter-spacing: .05em; }
    .req-info { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 11px 0; min-height: 34px; }
    .req-date { background: #f7f9fb; border: 1px solid #edf1f4; border-radius: 10px; padding: 9px 10px; font-size: 12px; margin-bottom: 11px; }
    .req-actions { display: flex; gap: 7px; flex-wrap: wrap; }
    .progress { height: 8px; background: #e9eef2; border-radius: 999px; overflow: hidden; margin-top: 8px; }
    .progress > span { display: block; height: 100%; border-radius: inherit; background: var(--navy-2); }
    .tag-row { display:flex; flex-wrap:wrap; gap:7px; }
    .tag { display:inline-flex; align-items:center; border:1px solid #dce6ee; background:#f4f8fb; color:#315b78; padding:6px 9px; border-radius:999px; font-size:11px; font-weight:760; }
    .file-list { display:grid; gap:9px; }
    .file-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; border:1px solid #e5ebf0; border-radius:12px; padding:11px 12px; background:#fbfcfd; }
    .file-item strong { display:block; font-size:12px; overflow-wrap:anywhere; }
    .file-item small { display:block; color:var(--muted); margin-top:3px; line-height:1.4; }
    .reminder-plan { margin-top:9px; padding-top:9px; border-top:1px dashed #dfe7ed; color:#6a7885; font-size:10px; line-height:1.45; }

    .req-manager-row { display: grid; grid-template-columns: 44px minmax(180px, 1.3fr) minmax(140px,.8fr) minmax(190px, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border-bottom: 1px solid #edf1f4; }
    .req-manager-row:last-child { border-bottom: 0; }
    .req-index { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; font-weight: 850; font-size: 11px; }
    .req-manager-row .name { font-weight: 790; }
    .req-manager-row .desc { color: var(--muted); font-size: 11px; margin-top: 2px; }

    .empty { padding: 34px 20px; text-align: center; color: var(--muted); }
    .empty .big { font-size: 36px; margin-bottom: 10px; }

    .modal-backdrop { position: fixed; inset: 0; background: rgba(13, 30, 46, .45); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 22px; z-index: 100; }
    .modal-backdrop.open { display: flex; }
    .modal { width: min(680px, 100%); max-height: calc(100vh - 44px); overflow: auto; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(9, 28, 43, .26); }
    .modal-head { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; background: white; z-index: 2; }
    .modal-head h3 { margin: 0; }
    .modal-close { width: 34px; height: 34px; border: 0; background: #f3f6f8; border-radius: 10px; }
    .modal-body { padding: 20px 22px; }
    .modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; position: sticky; bottom: 0; background: white; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .field { display: grid; gap: 6px; }
    .field.full { grid-column: 1 / -1; }
    .field label { font-size: 11px; font-weight: 800; color: #566573; text-transform: uppercase; letter-spacing: .04em; }
    .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; outline: none; background: white; }
    .field textarea { min-height: 78px; resize: vertical; }
    .field input:focus, .field select:focus, .field textarea:focus { border-color: #8db1cf; box-shadow: 0 0 0 3px #e8f1f7; }
    .check-row { display: flex; flex-wrap: wrap; gap: 9px; }
    .check-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; font-size: 12px; }
    .helper { color: var(--muted); font-size: 11px; line-height: 1.5; }
    .file-box { border: 1px dashed #9fb2c4; border-radius: 13px; padding: 18px; background: #f9fbfc; text-align: center; }

    .toast-wrap { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 9px; z-index: 150; }
    .toast { background: #142f49; color: white; border-radius: 12px; padding: 12px 14px; box-shadow: 0 14px 38px rgba(17,38,58,.24); min-width: 260px; font-size: 13px; animation: toastIn .2s ease; }
    @keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

    .filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
    .filter-row button { padding: 8px 11px; border-radius: 999px; border: 1px solid var(--line); background: white; font-size: 11px; font-weight: 750; color: #63717e; }
    .filter-row button.active { background: var(--navy); color: white; border-color: var(--navy); }

    .note { border: 1px solid #d8e6f1; background: #f1f7fb; color: #315b78; padding: 12px 14px; border-radius: 12px; font-size: 12px; line-height: 1.5; }
    .danger-note { border-color: #f1cfd3; background: #fff5f6; color: #8b323c; }

    @media (max-width: 1120px) {
      .app { grid-template-columns: 86px minmax(0,1fr); }
      .sidebar { padding-left: 12px; padding-right: 12px; }
      .brand { padding-left: 8px; justify-content: center; }
      .nav .label, .sidebar-note { display: none; }
      .brand-logo { max-width: 62px; border-radius: 6px; }
      .nav button { justify-content: center; padding: 12px 8px; }
      .nav button.nav-subitem { margin-left: 0; width: 100%; }
      .stats { grid-template-columns: repeat(3, 1fr); }
      .grid-2 { grid-template-columns: 1fr; }
    }
    @media (max-width: 760px) {
      .app { display: block; }
      .sidebar { position: fixed; z-index: 70; height: 64px; width: 100%; bottom: 0; top: auto; padding: 7px 8px; display: flex; align-items: center; }
      .brand { display: none; }
      .nav { padding: 0; display: flex; width: 100%; justify-content: space-around; gap: 3px; }
      .nav button { padding: 8px; min-width: 52px; }
      .topbar { padding: 0 15px; }
      .search { display: none; }
      .content { padding: 20px 15px 90px; }
      .hero { align-items: flex-start; flex-direction: column; }
      .hero h2 { font-size: 25px; }
      .stats { grid-template-columns: repeat(2, 1fr); }
      .detail-header { grid-template-columns: 1fr; }
      .score-box { text-align: left; }
      .profile-export { justify-content:flex-start; }
      .form-grid { grid-template-columns: 1fr; }
      .field.full { grid-column: auto; }
      .req-manager-row { grid-template-columns: 40px 1fr auto; }
      .req-manager-row > :nth-child(3), .req-manager-row > :nth-child(4) { display: none; }
      th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) { display: none; }
    }


    /* Operations portal / authentication */
    .portal-hidden { display:none !important; }
    .auth-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr); background:#f4f7fa; }
    .auth-brand { background:linear-gradient(145deg,#0e2c49,#184f7c); color:white; padding:54px; display:flex; flex-direction:column; justify-content:space-between; min-height:100vh; }
    .auth-brand img { max-width:260px; width:100%; border-radius:10px; }
    .auth-brand h1 { font-size:44px; line-height:1.04; margin:34px 0 16px; letter-spacing:-.035em; max-width:580px; }
    .auth-brand p { color:#d6e3ed; font-size:16px; line-height:1.65; max-width:590px; }
    .auth-features { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:28px; max-width:620px; }
    .auth-feature { border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.07); border-radius:14px; padding:14px; font-size:12px; color:#d9e5ee; }
    .auth-feature strong { display:block; color:#fff; margin-bottom:4px; font-size:13px; }
    .auth-side { display:grid; place-items:center; padding:40px 28px; }
    .auth-card { width:min(470px,100%); background:white; border:1px solid var(--line); border-radius:24px; box-shadow:0 24px 70px rgba(28,53,79,.12); padding:30px; }
    .auth-card h2 { margin:0; font-size:28px; }
    .auth-card .lead { color:var(--muted); line-height:1.55; margin:8px 0 22px; }
    .auth-card .field { margin-bottom:14px; }
    .auth-card input { width:100%; border:1px solid var(--line); border-radius:11px; padding:12px; outline:none; }
    .auth-card input:focus { border-color:#8db1cf; box-shadow:0 0 0 3px #e8f1f7; }
    .auth-actions { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:18px; }
    .auth-demo { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
    .demo-users { display:grid; gap:7px; margin-top:9px; }
    .demo-user { border:1px solid #e6edf3; background:#f8fafc; border-radius:10px; padding:9px 10px; font-size:11px; color:#5d6b78; cursor:pointer; }
    .demo-user strong { color:var(--ink); }
    .user-menu { display:flex; align-items:center; gap:9px; }
    .user-meta { text-align:right; line-height:1.15; }
    .user-meta strong { display:block; font-size:12px; }
    .user-meta span { font-size:10px; color:var(--muted); }
    .nav-divider { height:1px; background:rgba(255,255,255,.1); margin:8px 5px; }
    .nav-heading { color:#7794ad; font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.12em; padding:10px 13px 4px; }
    .nav button[hidden], .nav-heading[hidden], .nav-divider[hidden] { display:none !important; }
    .module-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(245px,1fr)); gap:15px; }
    .module-card { background:white; border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:var(--shadow); }
    .module-card .module-icon { width:44px; height:44px; border-radius:13px; background:var(--blue-soft); color:var(--navy); display:grid; place-items:center; font-weight:900; font-size:18px; margin-bottom:14px; }
    .module-card h3 { margin:0 0 7px; font-size:17px; }
    .module-card p { margin:0 0 16px; color:var(--muted); font-size:12px; line-height:1.55; min-height:38px; }
    .permission-pill { display:inline-flex; align-items:center; border-radius:999px; padding:5px 8px; font-size:10px; font-weight:780; background:#eef4f9; color:var(--navy); }
    .security-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); gap:18px; }
    .security-user { display:grid; grid-template-columns:minmax(190px,1.2fr) minmax(130px,.7fr) minmax(150px,.9fr) auto; gap:12px; align-items:center; padding:13px 14px; border-bottom:1px solid #edf1f4; }
    .security-user:last-child { border-bottom:0; }
    .security-user .who strong { display:block; }
    .security-user .who small { color:var(--muted); }
    .audit-list { display:grid; gap:8px; }
    .audit-item { border-left:3px solid #bdd1e1; background:#f8fafc; border-radius:9px; padding:9px 11px; font-size:11px; line-height:1.45; }
    .audit-item strong { display:block; color:var(--ink); }
    .audit-item span { color:var(--muted); }
    .vat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(285px,1fr)); gap:16px; }
    .vat-card { background:white; border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:var(--shadow); }
    .vat-card-top { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
    .vat-label { font-size:19px; font-weight:850; }
    .vat-dates { color:var(--muted); font-size:12px; margin-top:3px; }
    .vat-metrics { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin:15px 0; }
    .vat-metric { background:#f8fafc; border:1px solid #edf1f4; border-radius:11px; padding:10px; }
    .vat-metric strong { display:block; font-size:17px; }
    .vat-metric span { color:var(--muted); font-size:10px; text-transform:uppercase; font-weight:780; }
    .receipt-drop { border:1px dashed #9fb2c4; border-radius:14px; padding:18px; text-align:center; background:#f9fbfc; }
    .receipt-list { display:grid; gap:8px; margin-top:13px; }
    .receipt-row { display:grid; grid-template-columns:40px minmax(160px,1fr) minmax(95px,.45fr) auto; gap:10px; align-items:center; border:1px solid #edf1f4; border-radius:11px; padding:9px 10px; }
    .receipt-icon { width:36px; height:36px; border-radius:10px; background:var(--blue-soft); color:var(--navy); display:grid; place-items:center; font-size:11px; font-weight:850; }
    .receipt-row .name { font-size:12px; font-weight:790; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .receipt-row .meta { font-size:10px; color:var(--muted); margin-top:2px; }
    .money { font-variant-numeric:tabular-nums; }
    .role-checks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .role-check { border:1px solid var(--line); border-radius:10px; padding:9px 10px; display:flex; align-items:center; gap:8px; font-size:12px; background:#fbfcfd; }
    .tiny { font-size:10px; color:var(--muted); }

    @media(max-width:900px){
      .auth-shell{grid-template-columns:1fr}.auth-brand{min-height:auto;padding:30px}.auth-brand h1{font-size:32px}.auth-features{display:none}.security-grid{grid-template-columns:1fr}.security-user{grid-template-columns:1fr auto}.security-user>:nth-child(2),.security-user>:nth-child(3){display:none}
    }


    /* v2: narrower centred layout + improved phone/tablet responsiveness */
    .content {
      width: min(100%, 1080px);
      max-width: 1080px;
      padding: 24px 22px 56px;
      margin: 0 auto;
    }
    .main { min-width: 0; overflow-x: hidden; }
    .hero { align-items: flex-start; }
    .module-card-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .hospital-grid, .template-grid, .vat-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .requirements { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }

    @media (max-width: 1180px) {
      .content { width: min(100%, 940px); max-width: 940px; padding-left: 20px; padding-right: 20px; }
      .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .grid-2, .security-grid { grid-template-columns: 1fr; }
      .req-manager-row { grid-template-columns: 44px minmax(160px, 1fr) minmax(120px,.65fr) auto; }
      .req-manager-row > :nth-child(4) { display:none; }
    }

    @media (max-width: 760px) {
      body { overflow-x: hidden; }
      .content { width: 100%; max-width: 640px; padding: 16px 12px 92px; }
      .topbar { height: 66px; padding: 0 12px; }
      .eyebrow { font-size: 9px; }
      .page-title { font-size: 17px; }
      .user-meta { display:none; }
      .user-menu { gap:6px; }
      .user-menu .avatar { width:34px; height:34px; font-size:11px; }
      .user-menu .btn { padding:7px 9px; font-size:11px; }
      .hero { gap:12px; margin-bottom:16px; }
      .hero h2 { font-size:24px; }
      .hero p { font-size:12px; line-height:1.5; }
      .hero .actions { width:100%; }
      .hero .actions .btn { flex:1 1 auto; }
      .stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; }
      .stat { min-height:92px; padding:14px; }
      .stat .value { font-size:25px; }
      .module-card-grid, .hospital-grid, .template-grid, .vat-grid, .requirements { grid-template-columns: 1fr; gap:12px; }
      .module-card, .hospital-card, .template-card, .vat-card { padding:15px; border-radius:15px; }
      .panel { border-radius:15px; }
      .panel-head { padding:14px 15px; align-items:flex-start; }
      .panel-body { padding:14px 15px; }
      .detail-header { padding:17px; border-radius:17px; }
      .detail-header h2 { font-size:23px; }
      .form-grid { grid-template-columns:1fr; }
      .field.full { grid-column:auto; }
      .modal-backdrop { padding:8px; }
      .modal { border-radius:16px; max-height:calc(100vh - 16px); }
      .modal-head, .modal-body, .modal-foot { padding-left:15px; padding-right:15px; }
      .receipt-row { grid-template-columns:36px minmax(0,1fr) auto; gap:8px; }
      .receipt-row > :nth-child(3) { display:none; }
      .security-user { grid-template-columns:minmax(0,1fr) auto; }
      .role-checks { grid-template-columns:1fr; }
      .auth-side { padding:18px 12px; }
      .auth-card { padding:22px 18px; border-radius:18px; }
      .auth-card h2 { font-size:24px; }
      .auth-brand { padding:24px 18px; }
      .auth-brand img { max-width:190px; }
      .auth-brand h1 { font-size:29px; margin-top:24px; }
      .auth-brand p { font-size:14px; }

      /* Mobile navigation becomes a compact horizontal dock. */
      .sidebar { overflow:visible; }
      .sidebar .nav-heading, .sidebar .nav-divider, .sidebar-note { display:none !important; }
      .nav { overflow-x:auto; overflow-y:hidden; justify-content:flex-start; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
      .nav::-webkit-scrollbar { display:none; }
      .nav button, .nav button.nav-subitem { flex:0 0 58px; min-width:58px; width:58px; margin-left:0; padding:8px 5px; }
      .nav .icon { width:auto; font-size:18px; }
    }

    @media (max-width: 480px) {
      .content { max-width: 430px; padding-left:10px; padding-right:10px; }
      .stats { grid-template-columns:1fr; }
      .mini-stats, .vat-metrics { grid-template-columns:1fr 1fr; }
      .attention-item { grid-template-columns:1fr; }
      .attention-item .actions { justify-content:flex-start; }
      .card-actions { align-items:flex-start; flex-direction:column; }
      .card-actions .actions { width:100%; }
      .card-actions .actions .btn { flex:1; }
      .top-actions { gap:5px; }
      .page-title { max-width:180px; }
      .auth-brand { display:none; }
      .auth-shell { min-height:100svh; }
      .auth-side { min-height:100svh; }
      .auth-card { width:100%; }
    }

  

    /* v3: genuinely compact app shell — designed around a phone/tablet-sized working column */
    body { overflow-x:hidden; }
    #portalApp.app {
      width:min(100%, 900px);
      max-width:900px;
      margin:0 auto;
      grid-template-columns:190px minmax(0,1fr);
      min-height:100vh;
      background:var(--canvas);
      box-shadow:0 0 42px rgba(16,47,79,.08);
    }
    #portalApp .sidebar { padding:22px 12px 18px; }
    #portalApp .brand-logo { max-width:158px; }
    #portalApp .nav button { padding:10px 10px; gap:8px; font-size:13px; }
    #portalApp .nav button.nav-subitem { margin-left:10px; width:calc(100% - 10px); font-size:12px; }
    #portalApp .topbar { height:68px; padding:0 16px; }
    #portalApp .search input { width:190px; }
    #portalApp .content {
      width:100%;
      max-width:690px;
      padding:18px 16px 50px;
      margin:0 auto;
    }
    #portalApp .hero { gap:12px; margin-bottom:16px; }
    #portalApp .hero h2 { font-size:25px; }
    #portalApp .hero p { max-width:580px; }
    #portalApp .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    #portalApp .stats[style] { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
    #portalApp .stat { min-width:0; min-height:94px; padding:14px; }
    #portalApp .stat .value { font-size:25px; }
    #portalApp .grid-2,
    #portalApp .security-grid { grid-template-columns:1fr; }
    #portalApp .module-card-grid,
    #portalApp .hospital-grid,
    #portalApp .template-grid,
    #portalApp .vat-grid,
    #portalApp .requirements { grid-template-columns:1fr; gap:12px; }
    #portalApp .module-card,
    #portalApp .hospital-card,
    #portalApp .template-card,
    #portalApp .vat-card { padding:15px; }
    #portalApp .panel-head { padding:15px 16px; }
    #portalApp .panel-body { padding:15px 16px; }
    #portalApp .detail-header { padding:17px; grid-template-columns:1fr; border-radius:17px; }
    #portalApp .score-box { text-align:left; }
    #portalApp .req-manager-row {
      grid-template-columns:38px minmax(0,1fr) auto;
      gap:8px;
    }
    #portalApp .req-manager-row > :nth-child(3),
    #portalApp .req-manager-row > :nth-child(4) { display:none; }
    #portalApp .security-user { grid-template-columns:minmax(0,1fr) auto; }
    #portalApp .security-user > :nth-child(2),
    #portalApp .security-user > :nth-child(3) { display:none; }
    #portalApp .receipt-row { grid-template-columns:36px minmax(0,1fr) auto; }
    #portalApp .receipt-row > :nth-child(3) { display:none; }
    #portalApp .form-grid { grid-template-columns:1fr; }
    #portalApp .field.full { grid-column:auto; }

    /* Login is also constrained rather than spanning an ultra-wide monitor. */
    #authShell.auth-shell {
      width:min(100%, 900px);
      max-width:900px;
      margin:0 auto;
      grid-template-columns:minmax(0,.9fr) minmax(360px,1.1fr);
      box-shadow:0 0 42px rgba(16,47,79,.08);
    }
    #authShell .auth-brand { padding:34px 28px; }
    #authShell .auth-brand h1 { font-size:34px; }
    #authShell .auth-side { padding:28px 22px; }
    #authShell .auth-card { max-width:410px; }

    @media (max-width: 900px) {
      #portalApp.app { width:100%; max-width:760px; grid-template-columns:74px minmax(0,1fr); box-shadow:none; }
      #portalApp .sidebar { padding-left:8px; padding-right:8px; }
      #portalApp .brand-logo { max-width:54px; }
      #portalApp .nav .label, #portalApp .sidebar-note, #portalApp .nav-heading, #portalApp .nav-divider { display:none !important; }
      #portalApp .nav button, #portalApp .nav button.nav-subitem { justify-content:center; margin-left:0; width:100%; padding:10px 6px; }
      #portalApp .content { max-width:620px; padding-left:12px; padding-right:12px; }
      #authShell.auth-shell { width:100%; max-width:620px; grid-template-columns:1fr; box-shadow:none; }
      #authShell .auth-brand { display:none; }
      #authShell .auth-side { min-height:100svh; padding:20px 12px; }
    }

    @media (max-width: 760px) {
      #portalApp.app { display:block; max-width:520px; margin:0 auto; }
      #portalApp .main { width:100%; }
      #portalApp .content { max-width:500px; padding:14px 10px 88px; }
      #portalApp .topbar { height:62px; padding:0 10px; }
      #portalApp .page-title { font-size:16px; max-width:150px; }
      #portalApp .eyebrow { display:none; }
      #portalApp .stats, #portalApp .stats[style] { grid-template-columns:1fr !important; }
      #portalApp .mini-stats, #portalApp .vat-metrics { grid-template-columns:1fr 1fr; }
      #portalApp .hero { flex-direction:column; }
      #portalApp .hero h2 { font-size:22px; }
      #portalApp .hero .actions { width:100%; }
      #portalApp .hero .actions .btn { flex:1 1 auto; }
      #portalApp .attention-item { grid-template-columns:1fr; }
      #portalApp .sidebar {
        position:fixed; z-index:70; left:50%; transform:translateX(-50%);
        width:min(100%,520px); height:62px; top:auto; bottom:0;
        padding:6px 7px; display:flex; align-items:center;
      }
      #portalApp .brand { display:none; }
      #portalApp .nav { padding:0; display:flex; width:100%; overflow-x:auto; overflow-y:hidden; justify-content:flex-start; gap:3px; scrollbar-width:none; }
      #portalApp .nav::-webkit-scrollbar { display:none; }
      #portalApp .nav button, #portalApp .nav button.nav-subitem { flex:0 0 54px; min-width:54px; width:54px; padding:7px 4px; }
      #portalApp .nav .icon { font-size:17px; }
      #portalApp .top-actions .search { display:none; }
    }

    @media (max-width: 430px) {
      #portalApp.app, #portalApp .sidebar { max-width:430px; }
      #portalApp .content { max-width:410px; padding-left:8px; padding-right:8px; }
      #portalApp .panel-head, #portalApp .panel-body { padding-left:12px; padding-right:12px; }
      #portalApp .module-card, #portalApp .hospital-card, #portalApp .template-card, #portalApp .vat-card { padding:13px; }
      #portalApp .mini-stats, #portalApp .vat-metrics { grid-template-columns:1fr; }
      #portalApp .btn { padding:9px 11px; }
      #authShell.auth-shell { max-width:430px; }
      #authShell .auth-card { max-width:390px; padding:20px 15px; }
    }


    /* v4 login redesign: login card sits inside one wider blue branded panel */
    body:has(#authShell:not(.portal-hidden)) {
      background:#eef3f7;
    }
    #authShell.auth-shell {
      width:min(calc(100% - 40px), 980px) !important;
      max-width:980px !important;
      min-height:620px !important;
      margin:34px auto !important;
      grid-template-columns:minmax(0,1.08fr) minmax(350px,.92fr) !important;
      background:linear-gradient(145deg,#0e2c49,#184f7c) !important;
      border-radius:30px;
      overflow:hidden;
      box-shadow:0 24px 70px rgba(16,47,79,.20) !important;
    }
    #authShell .auth-brand {
      background:transparent !important;
      min-height:620px !important;
      padding:48px 42px !important;
    }
    #authShell .auth-brand img { max-width:230px !important; }
    #authShell .auth-brand h1 { font-size:39px !important; margin-top:38px !important; }
    #authShell .auth-brand p { max-width:500px; color:#dce8f1; }
    #authShell .auth-features { grid-template-columns:1fr 1fr; gap:10px; }
    #authShell .auth-side {
      background:transparent !important;
      padding:44px 42px 44px 8px !important;
      min-height:620px;
      display:flex;
      align-items:center;
      justify-content:center;
    }
    #authShell .auth-card {
      width:100% !important;
      max-width:380px !important;
      padding:28px 26px !important;
      border:1px solid rgba(255,255,255,.36) !important;
      box-shadow:0 20px 55px rgba(4,24,42,.26) !important;
      border-radius:22px !important;
    }

    @media (max-width: 900px) {
      #authShell.auth-shell {
        width:min(calc(100% - 28px), 690px) !important;
        max-width:690px !important;
        grid-template-columns:1fr !important;
        min-height:auto !important;
        margin:22px auto !important;
      }
      #authShell .auth-brand {
        display:block !important;
        min-height:auto !important;
        padding:30px 28px 14px !important;
      }
      #authShell .auth-brand h1 { font-size:31px !important; margin:24px 0 10px !important; }
      #authShell .auth-brand p { font-size:14px; margin-bottom:0; }
      #authShell .auth-features { display:none !important; }
      #authShell .auth-brand > div:last-child { display:none; }
      #authShell .auth-side {
        min-height:auto !important;
        padding:12px 28px 30px !important;
      }
      #authShell .auth-card { max-width:520px !important; }
    }

    @media (max-width: 520px) {
      #authShell.auth-shell {
        width:calc(100% - 18px) !important;
        max-width:450px !important;
        margin:9px auto !important;
        border-radius:22px;
      }
      #authShell .auth-brand { padding:22px 18px 10px !important; }
      #authShell .auth-brand img { max-width:170px !important; }
      #authShell .auth-brand h1 { font-size:27px !important; margin-top:20px !important; }
      #authShell .auth-brand p { font-size:13px; line-height:1.5; }
      #authShell .auth-side { padding:10px 14px 22px !important; }
      #authShell .auth-card { max-width:none !important; padding:20px 16px !important; border-radius:18px !important; }
      #authShell .auth-card h2 { font-size:23px; }
      #authShell .auth-actions { flex-wrap:wrap; }
      #authShell .auth-actions .btn { flex:1 1 135px; }
    }


    /* v5: wide desktop workspace + automatic mobile layout. The blue login remains unchanged. */
    .layout-toggle { white-space:nowrap; }
    @media (min-width: 901px) {
      body:not(.compact-portal) #portalApp.app {
        width:100%; max-width:none; margin:0;
        grid-template-columns:260px minmax(0,1fr);
        box-shadow:none;
      }
      body:not(.compact-portal) #portalApp .sidebar { padding:26px 18px 20px; }
      body:not(.compact-portal) #portalApp .brand-logo { max-width:214px; }
      body:not(.compact-portal) #portalApp .nav button { padding:12px 13px; gap:11px; font-size:inherit; }
      body:not(.compact-portal) #portalApp .nav button.nav-subitem { margin-left:18px; width:calc(100% - 18px); font-size:13px; }
      body:not(.compact-portal) #portalApp .topbar { height:76px; padding:0 30px; }
      body:not(.compact-portal) #portalApp .search input { width:280px; }
      body:not(.compact-portal) #portalApp .content { max-width:1600px; padding:28px 30px 60px; }
      body:not(.compact-portal) #portalApp .hero { gap:20px; margin-bottom:22px; }
      body:not(.compact-portal) #portalApp .hero h2 { font-size:30px; }
      body:not(.compact-portal) #portalApp .stats,
      body:not(.compact-portal) #portalApp .stats[style] { grid-template-columns:repeat(5,minmax(150px,1fr)) !important; gap:14px; }
      body:not(.compact-portal) #portalApp .stat { min-height:108px; padding:17px 18px; }
      body:not(.compact-portal) #portalApp .stat .value { font-size:29px; }
      body:not(.compact-portal) #portalApp .grid-2 { grid-template-columns:minmax(0,1.45fr) minmax(300px,.75fr); }
      body:not(.compact-portal) #portalApp .security-grid { grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); }
      body:not(.compact-portal) #portalApp .module-card-grid { grid-template-columns:repeat(auto-fit,minmax(245px,1fr)); gap:15px; }
      body:not(.compact-portal) #portalApp .hospital-grid { grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:16px; }
      body:not(.compact-portal) #portalApp .template-grid { grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; }
      body:not(.compact-portal) #portalApp .vat-grid { grid-template-columns:repeat(auto-fit,minmax(285px,1fr)); gap:16px; }
      body:not(.compact-portal) #portalApp .requirements { grid-template-columns:repeat(auto-fit,minmax(270px,1fr)); gap:12px; }
      body:not(.compact-portal) #portalApp .module-card { padding:20px; }
      body:not(.compact-portal) #portalApp .hospital-card,
      body:not(.compact-portal) #portalApp .template-card { padding:19px; }
      body:not(.compact-portal) #portalApp .vat-card { padding:18px; }
      body:not(.compact-portal) #portalApp .panel-head { padding:18px 20px; }
      body:not(.compact-portal) #portalApp .panel-body { padding:18px 20px; }
      body:not(.compact-portal) #portalApp .detail-header { padding:22px; grid-template-columns:1fr auto; border-radius:22px; }
      body:not(.compact-portal) #portalApp .score-box { text-align:center; }
      body:not(.compact-portal) #portalApp .req-manager-row { grid-template-columns:44px minmax(180px,1.3fr) minmax(140px,.8fr) minmax(190px,1fr) auto; gap:10px; }
      body:not(.compact-portal) #portalApp .req-manager-row > :nth-child(3),
      body:not(.compact-portal) #portalApp .req-manager-row > :nth-child(4) { display:block; }
      body:not(.compact-portal) #portalApp .security-user { grid-template-columns:minmax(190px,1.2fr) minmax(130px,.7fr) minmax(150px,.9fr) auto; }
      body:not(.compact-portal) #portalApp .security-user > :nth-child(2),
      body:not(.compact-portal) #portalApp .security-user > :nth-child(3) { display:block; }
      body:not(.compact-portal) #portalApp .receipt-row { grid-template-columns:40px minmax(160px,1fr) minmax(95px,.45fr) auto; }
      body:not(.compact-portal) #portalApp .receipt-row > :nth-child(3) { display:block; }
      body:not(.compact-portal) #portalApp .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      body:not(.compact-portal) #portalApp .field.full { grid-column:1 / -1; }
    }

    /* Full-page VAT quarter folder */
    .vat-folder-head { background:linear-gradient(135deg,#153c62,#245d8d); color:white; border-radius:22px; padding:22px; margin-bottom:18px; display:flex; justify-content:space-between; gap:18px; align-items:flex-start; box-shadow:var(--shadow); }
    .vat-folder-head h2 { margin:5px 0 4px; font-size:28px; }
    .vat-folder-head p { margin:0; color:#d5e2ed; font-size:13px; }
    .vat-folder-head .folder-count { min-width:108px; text-align:center; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.10); border-radius:15px; padding:12px; }
    .vat-folder-head .folder-count strong { display:block; font-size:29px; }
    .vat-folder-head .folder-count span { display:block; font-size:10px; text-transform:uppercase; letter-spacing:.07em; color:#d8e5ef; margin-top:3px; }
    .folder-upload-bar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; padding:16px 18px; border-bottom:1px solid var(--line); background:#fbfcfd; }
    .folder-upload-controls { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
    .folder-upload-controls input[type=file] { max-width:340px; font-size:12px; }
    .folder-file-list { padding:12px; display:grid; gap:8px; }
    .folder-empty { padding:44px 20px; text-align:center; color:var(--muted); }
    .folder-empty .big { font-size:42px; margin-bottom:9px; }
    .file-type-pill { display:inline-flex; border:1px solid #e1e8ee; background:#f6f9fb; color:#667583; padding:4px 7px; border-radius:999px; font-size:9px; font-weight:780; text-transform:uppercase; }
    .vat-card { transition:.16s ease; }
    .vat-card:hover { transform:translateY(-2px); box-shadow:0 12px 34px rgba(28,53,79,.12); }
    @media (max-width:760px) {
      .layout-toggle { display:none; }
      .vat-folder-head { border-radius:17px; padding:17px; flex-direction:column; }
      .vat-folder-head h2 { font-size:23px; }
      .vat-folder-head .folder-count { text-align:left; min-width:0; width:100%; }
      .folder-upload-bar { align-items:flex-start; }
      .folder-upload-controls { width:100%; }
      .folder-upload-controls input[type=file] { max-width:100%; width:100%; }
      .folder-upload-controls .btn { width:100%; }
    }



    /* v7: Tasks + Employees */
    .status.blue { color:#27689a; background:#eaf3fb; }
    .task-summary-grid { display:grid; grid-template-columns:repeat(5,minmax(130px,1fr)); gap:12px; margin-bottom:18px; }
    .task-summary { background:#fff; border:1px solid var(--line); border-radius:15px; padding:14px 15px; box-shadow:0 4px 16px rgba(28,53,79,.05); }
    .task-summary strong { display:block; font-size:24px; line-height:1; margin-bottom:6px; }
    .task-summary span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
    .task-summary.red strong { color:var(--red); }
    .task-summary.amber strong { color:var(--amber); }
    .task-summary.green strong { color:var(--green); }
    .task-summary.blue strong { color:var(--navy-2); }
    .task-list { display:grid; gap:11px; }
    .task-card { --task-accent:#8ea0b0; border:1px solid var(--line); border-left:5px solid var(--task-accent); border-radius:15px; background:#fff; padding:15px 16px; box-shadow:0 3px 14px rgba(28,53,79,.045); }
    .task-card.red { --task-accent:var(--red); }
    .task-card.amber { --task-accent:var(--amber); }
    .task-card.green { --task-accent:var(--green); }
    .task-card.blue { --task-accent:var(--navy-2); }
    .task-card.grey { --task-accent:#8b98a5; }
    .task-card-top { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
    .task-title { font-size:15px; font-weight:850; line-height:1.3; }
    .task-meta { display:flex; gap:7px; flex-wrap:wrap; margin-top:7px; color:var(--muted); font-size:11px; }
    .task-meta-pill { display:inline-flex; align-items:center; border-radius:999px; padding:5px 8px; background:#f6f9fb; border:1px solid #e5ebf0; color:#61707d; font-size:10px; font-weight:760; }
    .priority-high { color:var(--red); background:var(--red-bg); border-color:#f1cfd3; }
    .priority-medium { color:var(--amber); background:var(--amber-bg); border-color:#f1dfb7; }
    .priority-low { color:#58758b; background:#eef4f8; border-color:#dde8ef; }
    .task-description { color:#596977; font-size:12px; line-height:1.5; margin:10px 0 12px; }
    .task-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding-top:11px; border-top:1px solid #edf1f4; }
    .task-assignees { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
    .employee-chip { display:inline-flex; align-items:center; gap:6px; background:#eef4f9; color:#315b78; border:1px solid #dbe7ef; border-radius:999px; padding:5px 8px; font-size:10px; font-weight:780; }
    .employee-chip::before { content:'•'; color:var(--navy-2); }
    .task-email-log { font-size:10px; color:var(--muted); margin-top:8px; }
    .notification-row { border:1px solid var(--line); border-left:4px solid var(--amber); border-radius:12px; padding:12px 13px; background:#fff; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; }
    .notification-row.red { border-left-color:var(--red); background:#fffafb; }
    .notification-row .who { font-size:11px; color:var(--muted); margin-top:3px; line-height:1.45; }
    .employee-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
    .employee-card { background:#fff; border:1px solid var(--line); border-radius:17px; padding:17px; box-shadow:var(--shadow); }
    .employee-head { display:flex; gap:11px; align-items:flex-start; }
    .employee-avatar { width:44px; height:44px; border-radius:13px; display:grid; place-items:center; background:var(--blue-soft); color:var(--navy); font-weight:900; flex:0 0 auto; }
    .employee-name { font-weight:850; font-size:15px; }
    .employee-role { color:var(--muted); font-size:11px; margin-top:3px; }
    .employee-contact { margin:13px 0; font-size:11px; line-height:1.65; color:#536575; overflow-wrap:anywhere; }
    .employee-task-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin:12px 0; }
    .employee-task-stat { background:#f8fafc; border:1px solid #edf1f4; border-radius:10px; padding:9px; }
    .employee-task-stat strong { display:block; font-size:16px; }
    .employee-task-stat span { color:var(--muted); font-size:9px; text-transform:uppercase; font-weight:790; }
    .notification-note { border:1px solid #d8e6f1; background:#f1f7fb; color:#315b78; border-radius:13px; padding:12px 14px; font-size:11px; line-height:1.5; }
    @media (max-width:1180px){ .task-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr));} }
    @media (max-width:760px){
      .task-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
      .task-card-top{flex-direction:column}
      .notification-row{grid-template-columns:1fr}
      .notification-row .actions{justify-content:flex-start}
      .employee-grid{grid-template-columns:1fr}
    }
    @media (max-width:430px){ .task-summary-grid{grid-template-columns:1fr 1fr}.task-footer{align-items:flex-start;flex-direction:column}.task-footer .actions{width:100%}.task-footer .actions .btn{flex:1 1 auto} }


    /* v10: automation architecture — Action Centre, recurring/automatic tasks, bulk tools, documents, contracts and audit */
    .action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:18px}
    .action-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;box-shadow:var(--shadow)}
    .action-card h3{margin:0 0 5px;font-size:15px}.action-card p{margin:0;color:var(--muted);font-size:11px;line-height:1.5}
    .action-number{font-size:30px;font-weight:900;line-height:1;margin:11px 0 5px}.action-card.red .action-number{color:var(--red)}.action-card.amber .action-number{color:var(--amber)}.action-card.green .action-number{color:var(--green)}.action-card.blue .action-number{color:var(--navy-2)}
    .today-list{display:grid;gap:9px}.today-row{border:1px solid #e5ebf0;border-radius:12px;background:#fff;padding:11px 12px;display:flex;justify-content:space-between;gap:12px;align-items:center}.today-row.red{border-left:4px solid var(--red)}.today-row.amber{border-left:4px solid var(--amber)}.today-row .meta{color:var(--muted);font-size:10px;margin-top:3px}
    .bulk-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#f8fafc;margin-bottom:12px}.bulk-toolbar .spacer{flex:1}.bulk-count{font-size:11px;color:var(--muted);font-weight:760}
    .task-select-wrap{display:flex;align-items:flex-start;gap:9px}.task-select{margin-top:3px;width:17px;height:17px;accent-color:var(--navy)}
    .recurring-badge,.auto-badge{display:inline-flex;border-radius:999px;padding:4px 7px;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.recurring-badge{background:#eef4fb;color:#2d5d86}.auto-badge{background:#eef7f2;color:#187457}
    .task-activity{display:grid;gap:10px}.task-comment{border:1px solid #e6edf3;border-radius:11px;padding:10px 11px;background:#fbfcfd}.task-comment strong{font-size:11px}.task-comment small{color:var(--muted);font-size:9px;display:block;margin-top:2px}.task-comment div{font-size:12px;line-height:1.45;margin-top:5px}.task-history-row{border-left:3px solid #c9d7e3;padding:7px 9px;background:#f8fafc;border-radius:8px;font-size:10px;line-height:1.45}.task-history-row strong{display:block;font-size:10px}.task-history-row span{color:var(--muted)}
    .document-folder-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.document-folder{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;box-shadow:var(--shadow);transition:.15s ease}.document-folder:hover{transform:translateY(-2px)}.folder-icon{width:42px;height:42px;border-radius:12px;background:var(--blue-soft);display:grid;place-items:center;color:var(--navy);font-size:20px;font-weight:900;margin-bottom:12px}.document-folder h3{margin:0;font-size:15px}.document-folder p{font-size:11px;color:var(--muted);line-height:1.45;min-height:32px}.document-folder .count{font-size:22px;font-weight:900;margin:10px 0 4px}
    .document-table-wrap{overflow:auto}.document-source{display:inline-flex;border:1px solid #e3eaf0;background:#f7f9fb;border-radius:999px;padding:4px 7px;font-size:9px;font-weight:780;color:#637280;white-space:nowrap}
    .contract-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:15px}.client-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:17px;box-shadow:var(--shadow)}.client-card h3{margin:0;font-size:17px}.client-contact{font-size:11px;color:var(--muted);line-height:1.5;margin-top:5px}.contract-item{border:1px solid #e7edf2;border-radius:12px;padding:11px;margin-top:10px;background:#fbfcfd}.contract-item-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.contract-name{font-size:12px;font-weight:820}.contract-meta{font-size:10px;color:var(--muted);margin-top:3px;line-height:1.45}.contract-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
    .audit-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.audit-toolbar input{min-width:260px;flex:1;border:1px solid var(--line);border-radius:10px;padding:9px 11px}.audit-table .audit-cat{font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:4px 7px;background:#eef4f8;color:#47677f;display:inline-flex}.audit-table td{font-size:11px}
    .automation-rule{border:1px solid #e5ebf0;border-radius:12px;padding:11px;background:#fbfcfd;margin-top:8px}.automation-rule strong{display:block;font-size:11px}.automation-rule span{display:block;color:var(--muted);font-size:10px;margin-top:3px;line-height:1.4}
    @media(max-width:760px){.action-grid{grid-template-columns:1fr 1fr}.today-row{align-items:flex-start;flex-direction:column}.bulk-toolbar .spacer{display:none}.bulk-toolbar .btn{flex:1 1 auto}.contract-grid,.document-folder-grid{grid-template-columns:1fr}.audit-toolbar input{min-width:0;width:100%}}
    @media(max-width:430px){.action-grid{grid-template-columns:1fr}.bulk-toolbar{align-items:stretch;flex-direction:column}.bulk-toolbar .btn{width:100%}}

