:root {
    --purple: #9f1ae2;
    --magenta: #bb02c9;
    --rose: #ef3e91;
    --ink: #17131f;
    --muted: #777080;
    --background: #f6f5fa;
    --surface: #fff;
    --soft: #f0eef5;
    --border: #e8e5ed;
    --sidebar: #100e17;
    --shadow: 0 14px 36px rgba(27, 21, 38, .08);
    --sidebar-width: 252px;
}

[data-bs-theme="dark"] {
    --ink: #f7f4fb;
    --muted: #a9a3b4;
    --background: #0c0b11;
    --surface: #17151e;
    --soft: #211e2a;
    --border: #302c39;
    --sidebar: #09080d;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body {
    background: var(--background);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    margin: 0;
    min-width: 320px;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(159, 26, 226, .28);
    outline-offset: 2px;
}

.brand-lockup {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 11px;
    text-decoration: none;
}

.brand-lockup > span, .auth-mobile-logo {
    align-items: center;
    background: linear-gradient(140deg, var(--purple), var(--rose));
    border-radius: 12px;
    box-shadow: 0 9px 25px rgba(176, 28, 202, .3);
    color: #fff;
    display: flex;
    font-size: 18px;
    font-weight: 850;
    height: 39px;
    justify-content: center;
    transform: rotate(-4deg);
    width: 39px;
}

.brand-lockup > div { display: flex; flex-direction: column; line-height: 1; }
.brand-lockup strong { font-size: 18px; font-weight: 820; letter-spacing: .08em; }
.brand-lockup small { color: #aaa3b3; font-size: 8px; font-weight: 750; letter-spacing: .32em; margin-top: 6px; }

.auth-page { min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr); min-height: 100vh; }
.auth-brand {
    background:
        radial-gradient(circle at 18% 12%, rgba(170, 34, 218, .3), transparent 27%),
        radial-gradient(circle at 88% 80%, rgba(239, 62, 145, .16), transparent 33%),
        #0f0c15;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px clamp(35px, 6vw, 90px);
    position: relative;
}

.auth-brand::after {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 50%;
    content: "";
    height: 470px;
    position: absolute;
    right: -210px;
    top: 21%;
    width: 470px;
}

.auth-brand > div:nth-child(2) { position: relative; z-index: 1; }
.auth-kicker { color: #c667e8; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-brand h1 { font-size: clamp(45px, 6vw, 76px); font-weight: 760; letter-spacing: -.06em; line-height: .98; margin: 18px 0 22px; }
.auth-brand p { color: #aaa4b1; font-size: 13px; line-height: 1.7; max-width: 420px; }
.auth-brand > small { color: #6f6978; font-size: 9px; }
.auth-form-pane { align-items: center; background: var(--background); display: flex; justify-content: center; padding: 35px; }
.auth-card { max-width: 420px; width: 100%; }
.auth-card h2 { font-size: 32px; font-weight: 770; letter-spacing: -.04em; margin: 8px 0 5px; }
.auth-card > p { color: var(--muted); font-size: 10px; line-height: 1.6; margin-bottom: 24px; }
.auth-mobile-logo { display: none; margin-bottom: 25px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field > span { font-size: 9px; font-weight: 720; }
.auth-field > div { align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); display: flex; min-height: 46px; padding: 0 13px; }
.auth-field > div:focus-within { border-color: rgba(159, 26, 226, .5); box-shadow: 0 0 0 3px rgba(159, 26, 226, .08); }
.auth-field input { background: transparent; border: 0; color: var(--ink); flex: 1; min-width: 0; outline: 0; padding: 0 0 0 10px; }
.auth-submit {
    align-items: center;
    background: linear-gradient(120deg, var(--purple), var(--magenta) 70%, var(--rose));
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(159, 26, 226, .23);
    color: #fff;
    display: flex;
    font-size: 11px;
    font-weight: 750;
    justify-content: center;
    margin-top: 20px;
    min-height: 47px;
    width: 100%;
}
.auth-submit i { margin-left: 8px; }
.auth-security { align-items: flex-start; background: rgba(159, 26, 226, .06); border: 1px solid rgba(159, 26, 226, .09); border-radius: 10px; color: var(--purple); display: flex; gap: 10px; margin-top: 17px; padding: 11px; }
.auth-security > span { color: var(--muted); display: flex; flex-direction: column; font-size: 8px; }
.auth-security strong { color: var(--ink); font-size: 9px; margin-bottom: 2px; }
.auth-code-shell { align-items: center; background: radial-gradient(circle at 50% 5%, rgba(159,26,226,.1), transparent 32%), var(--background); display: flex; justify-content: center; min-height: 100vh; padding: 25px; }
.code-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); max-width: 450px; padding: 38px; text-align: center; }
.code-icon { align-items: center; background: rgba(159,26,226,.1); border-radius: 16px; color: var(--purple); display: flex; font-size: 27px; height: 66px; justify-content: center; margin: 0 auto 20px; width: 66px; }
.code-field { text-align: left; }
.code-field input { background: var(--background); border: 1px solid var(--border); border-radius: 10px; color: var(--ink); font-size: 24px; font-weight: 750; letter-spacing: .3em; min-height: 56px; outline: 0; padding: 0 15px; text-align: center; width: 100%; }
.back-to-login { color: var(--muted); display: inline-block; font-size: 9px; margin-top: 18px; text-decoration: none; }
.back-to-login i { margin-right: 5px; }
.alert { border: 0; border-radius: 9px; font-size: 9px; padding: 10px 12px; }

.portal-sidebar {
    background: radial-gradient(circle at 10% 7%, rgba(159,26,226,.17), transparent 24%), var(--sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    inset: 0 auto 0 0;
    position: fixed;
    width: var(--sidebar-width);
    z-index: 1045;
}
.portal-sidebar > header { align-items: center; display: flex; height: 76px; justify-content: space-between; padding: 0 23px; }
.portal-sidebar > header > button { background: transparent; border: 0; color: #aaa5b4; display: none; }
.portal-sidebar nav { flex: 1; overflow-y: auto; padding: 18px 14px; scrollbar-color: #322d3b transparent; scrollbar-width: thin; }
.portal-sidebar nav a { align-items: center; border-radius: 10px; color: #aaa5b4; display: flex; font-size: 11px; font-weight: 650; gap: 11px; margin: 3px 0; min-height: 42px; padding: 8px 11px; text-decoration: none; }
.portal-sidebar nav a i { font-size: 16px; text-align: center; width: 20px; }
.portal-sidebar nav a:hover { background: #1d1924; color: #fff; }
.portal-sidebar nav a.active { background: linear-gradient(100deg, rgba(159,26,226,.22), rgba(187,2,201,.08)); color: #fff; position: relative; }
.portal-sidebar nav a.active::before { background: linear-gradient(var(--purple), var(--rose)); border-radius: 0 4px 4px 0; content: ""; height: 22px; left: -14px; position: absolute; width: 3px; }
.portal-sidebar nav a.active i { color: #ce69ef; }
.portal-sidebar footer { border-top: 1px solid #28232f; padding: 17px 22px; }
.portal-sidebar footer > div { align-items: center; color: #8b8594; display: flex; gap: 8px; }
.portal-sidebar footer > div > i { color: #2bc07d; }
.portal-sidebar footer span { display: flex; flex-direction: column; font-size: 7px; }
.portal-sidebar footer strong { color: #c7c2cc; font-size: 8px; }
.portal-frame { margin-left: var(--sidebar-width); min-height: 100vh; }
.portal-topbar {
    align-items: center;
    backdrop-filter: blur(16px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom: 1px solid var(--border);
    display: flex;
    height: 76px;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.portal-topbar > div { align-items: center; display: flex; gap: 7px; }
.portal-topbar > div:first-child > button { display: none; }
.portal-topbar button { background: transparent; border: 0; color: var(--muted); }
.search-button { align-items: center; background: var(--soft); border-radius: 9px; color: var(--muted); display: flex; font-size: 10px; gap: 9px; min-height: 39px; padding: 0 10px 0 13px; text-decoration: none; width: min(35vw, 380px); }
.search-button span { flex: 1; }
kbd { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: 8px; padding: 3px 6px; }
.internal-badge { align-items: center; background: rgba(30,173,110,.1); border-radius: 999px; color: #148959; display: flex; font-size: 8px; font-weight: 750; gap: 5px; margin-right: 5px; padding: 6px 9px; text-transform: uppercase; }
.topbar-button { align-items: center; border-radius: 8px !important; display: flex; height: 37px; justify-content: center; width: 37px; }
.topbar-button:hover { background: var(--soft) !important; color: var(--ink) !important; }
.topbar-divider { background: var(--border); height: 27px; margin: 0 7px; width: 1px; }
.profile-summary { align-items: center; display: flex; gap: 9px; }
.profile-summary > span, .profile-summary > img { align-items: center; background: linear-gradient(135deg,#30253b,#6d287d); border-radius: 50%; color: #fff; display: flex; font-size: 8px; font-weight: 800; height: 38px; justify-content: center; object-fit: cover; text-transform: uppercase; width: 38px; }
.profile-summary > div { display: flex; flex-direction: column; min-width: 90px; }
.profile-summary strong { font-size: 9px; }
.profile-summary small { color: var(--muted); font-size: 7px; margin-top: 2px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-content { margin: 0 auto; max-width: 1500px; padding: 34px clamp(22px, 3vw, 46px) 55px; }
.page-heading { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 25px; }
.eyebrow { align-items: center; color: var(--muted); display: flex; font-size: 8px; font-weight: 780; gap: 7px; letter-spacing: .08em; margin-bottom: 7px; text-transform: uppercase; }
.eyebrow > i { background: #24b376; border: 3px solid rgba(36,179,118,.16); border-radius: 50%; height: 10px; width: 10px; }
.page-heading h1 { font-size: clamp(28px, 2.3vw, 38px); font-weight: 780; letter-spacing: -.045em; margin: 0; }
.page-heading p { color: var(--muted); font-size: 10px; margin: 7px 0 0; }
.heading-actions { display: flex; gap: 8px; }
.button { align-items: center; border: 0; border-radius: 9px; display: inline-flex; font-size: 9px; font-weight: 720; gap: 7px; justify-content: center; min-height: 38px; padding: 0 14px; text-decoration: none; }
.button.secondary { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.button.primary { background: linear-gradient(120deg,var(--purple),var(--magenta) 70%,var(--rose)); box-shadow: 0 8px 20px rgba(159,26,226,.2); color: #fff; }
.button.light { background: #fff; color: #24142c; }
.metric-grid { display: grid; gap: 13px; grid-template-columns: repeat(4,1fr); margin-bottom: 17px; }
.metric-card { align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--ink); display: flex; gap: 12px; min-height: 102px; padding: 15px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.metric-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.metric-icon { align-items: center; border-radius: 11px; display: flex; flex: 0 0 auto; font-size: 19px; height: 44px; justify-content: center; width: 44px; }
.metric-icon.purple { background: rgba(159,26,226,.11); color: var(--purple); }
.metric-icon.green { background: rgba(30,173,110,.11); color: #16935f; }
.metric-icon.blue { background: rgba(52,129,222,.11); color: #347ed5; }
.metric-icon.orange { background: rgba(225,137,48,.12); color: #c77922; }
.metric-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.metric-card small, .metric-card em { color: var(--muted); font-size: 7px; font-style: normal; }
.metric-card strong { font-size: 18px; letter-spacing: -.025em; margin: 3px 0; }
.metric-card > i { color: var(--muted); font-size: 8px; }
.launch-card { align-items: center; background: radial-gradient(circle at 85% 15%,rgba(159,26,226,.35),transparent 30%),linear-gradient(110deg,#0e0a12,#21102a); border: 1px solid rgba(169,55,215,.15); border-radius: 17px; color: #fff; display: flex; justify-content: space-between; margin-bottom: 17px; min-height: 180px; overflow: hidden; padding: 27px 31px; position: relative; }
.launch-card > div { position: relative; z-index: 1; }
.launch-badge { background: rgba(190,75,229,.14); border: 1px solid rgba(215,129,245,.2); border-radius: 999px; color: #d88df1; display: inline-flex; font-size: 7px; font-weight: 800; gap: 5px; letter-spacing: .08em; padding: 6px 9px; text-transform: uppercase; }
.launch-card h2 { font-size: 27px; letter-spacing: -.035em; margin: 14px 0 6px; }
.launch-card p { color: #aaa4b2; font-size: 9px; }
.launch-meta { align-items: center; color: #827b8c; display: flex; font-size: 7px; gap: 9px; margin-top: 15px; }
.launch-meta > i { background: #37303d; height: 14px; width: 1px; }
.dashboard-grid { display: grid; gap: 17px; grid-template-columns: repeat(2,1fr); margin-bottom: 17px; }
.portal-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 6px 20px rgba(29,23,40,.025); padding: 20px; }
.portal-panel > header { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 11px; }
.portal-panel > header > div { display: flex; flex-direction: column; }
.portal-panel > header > div > span { color: var(--purple); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portal-panel h2 { font-size: 13px; font-weight: 760; margin: 3px 0 0; }
.portal-panel > header > a, .portal-panel > header > button { background: transparent; border: 0; color: var(--purple); font-size: 7px; font-weight: 720; text-decoration: none; }
.deadline-list > a { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 10px; padding: 9px 0; text-decoration: none; }
.deadline-list > a:last-child { border: 0; }
.date-chip { align-items: center; background: rgba(159,26,226,.09); border-radius: 8px; color: var(--purple); display: flex; flex: 0 0 auto; flex-direction: column; height: 38px; justify-content: center; width: 38px; }
.date-chip strong { font-size: 12px; line-height: 1; }
.date-chip small { font-size: 6px; font-weight: 800; margin-top: 3px; }
.deadline-list > a > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.deadline-list > a > span:nth-child(2) strong { font-size: 8px; }
.deadline-list > a > span:nth-child(2) small { color: var(--muted); font-size: 7px; margin-top: 2px; }
.deadline-list > a > i { color: var(--muted); font-size: 7px; }
.activity-list > div { align-items: center; display: flex; gap: 9px; padding: 8px 0; }
.activity-icon { align-items: center; background: rgba(159,26,226,.09); border-radius: 8px; color: var(--purple); display: flex; height: 33px; justify-content: center; width: 33px; }
.activity-list > div > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.activity-list strong { font-size: 8px; }
.activity-list small, .activity-list time { color: var(--muted); font-size: 7px; }
.empty-state { color: var(--muted); font-size: 9px; padding: 20px 0; text-align: center; }
.security-panel > header b { color: #16935f; font-size: 7px; }
.security-panel > header b i { margin-right: 4px; }
.security-grid { display: grid; gap: 9px; grid-template-columns: repeat(4,1fr); }
.security-grid > div { align-items: center; background: var(--soft); border-radius: 9px; display: flex; gap: 9px; padding: 10px; }
.security-grid > div > i { align-items: center; background: var(--surface); border-radius: 7px; color: var(--purple); display: flex; height: 32px; justify-content: center; width: 32px; }
.security-grid > div > span { display: flex; flex-direction: column; }
.security-grid strong { font-size: 8px; }
.security-grid small { color: var(--muted); font-size: 6px; }
.create-panel { margin-bottom: 17px; }
.create-panel[hidden] { display: none; }
.entry-form { display: grid; gap: 12px; grid-template-columns: repeat(2,1fr); padding-top: 7px; }
.entry-form label { display: flex; flex-direction: column; gap: 5px; }
.entry-form label.full, .entry-form .full { grid-column: 1/-1; }
.entry-form label > span { font-size: 8px; font-weight: 720; }
.entry-form input, .entry-form select, .entry-form textarea { background: var(--background); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); font-size: 9px; outline: 0; padding: 9px 10px; resize: vertical; }
.entry-form input:focus, .entry-form select:focus, .entry-form textarea:focus { border-color: rgba(159,26,226,.55); box-shadow: 0 0 0 3px rgba(159,26,226,.07); }
.form-actions { display: flex; justify-content: flex-end; }
.dual-form { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.subform-grid { border-top: 1px solid var(--border); display: grid; gap: 18px; grid-template-columns: repeat(2,1fr); margin-top: 20px; padding-top: 20px; }
.compact-form { background: var(--soft); border-radius: 11px; padding: 15px; }
.compact-form h3 { font-size: 10px; margin: 0 0 3px; }
.file-form { margin-top: 18px; }
.check-label { align-items: center; flex-direction: row !important; }
.check-label input { width: auto; }
.form-hint { align-items: center; color: var(--muted); display: flex; font-size: 8px; gap: 6px; margin: 0; }
.insight-grid { display: grid; gap: 13px; grid-template-columns: repeat(3,1fr); margin-bottom: 17px; }
.insight-grid article { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; display: flex; flex-direction: column; min-height: 104px; padding: 17px; }
.insight-grid article > span { color: var(--muted); font-size: 8px; font-weight: 720; text-transform: uppercase; }
.insight-grid article strong { font-size: 21px; letter-spacing: -.035em; margin: 7px 0 3px; }
.insight-grid article small { color: var(--muted); font-size: 7px; }
.insight-grid article.positive strong { color: #16935f; }
.insight-grid article.negative strong { color: #d44756; }
.finance-overview { margin-bottom: 17px; }
.period-filter { align-items: flex-end; display: flex; gap: 9px; justify-content: flex-end; margin-bottom: 13px; }
.period-filter label { display: flex; flex-direction: column; gap: 4px; }
.period-filter label > span { color: var(--muted); font-size: 7px; font-weight: 720; }
.period-filter select { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); font-size: 8px; min-height: 38px; padding: 0 10px; }
.period-filter > span { align-items: center; color: var(--muted); display: flex; font-size: 8px; gap: 6px; margin: 0 0 11px 6px; }
.cashflow-panel > header > small { color: var(--muted); font-size: 7px; }
.cashflow-chart { display: grid; gap: 11px; min-height: 110px; padding-top: 8px; }
.cashflow-month { align-items: center; display: grid; gap: 10px; grid-template-columns: 58px 1fr; }
.cashflow-month > span { color: var(--muted); font-size: 7px; order: -1; }
.cashflow-bars { display: grid; gap: 4px; }
.cashflow-bars progress { appearance: none; background: var(--soft); border: 0; border-radius: 999px; height: 7px; overflow: hidden; width: 100%; }
.cashflow-bars progress::-webkit-progress-bar { background: var(--soft); border-radius: 999px; }
.cashflow-bars progress.income::-webkit-progress-value { background: #1ead6e; border-radius: 999px; }
.cashflow-bars progress.expense::-webkit-progress-value { background: linear-gradient(90deg,var(--purple),var(--rose)); border-radius: 999px; }
.cashflow-bars progress.income::-moz-progress-bar { background: #1ead6e; border-radius: 999px; }
.cashflow-bars progress.expense::-moz-progress-bar { background: var(--rose); border-radius: 999px; }
.file-link { align-items: center; color: var(--purple); display: inline-flex; font-weight: 720; gap: 5px; text-decoration: none; }
.data-panel { overflow: hidden; }
.data-panel > header { align-items: center; }
.module-search { align-items: center; background: var(--soft); border-radius: 8px; color: var(--muted); display: flex; gap: 7px; padding: 7px 9px; }
.module-search input { background: transparent; border: 0; color: var(--ink); font-size: 8px; outline: 0; }
.data-panel .table-responsive { margin: 0 -20px -20px; }
.data-table { border-collapse: collapse; color: var(--ink); min-width: 720px; width: 100%; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); font-size: 8px; padding: 11px 12px; vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 20px; }
.data-table th { color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.data-table tbody tr:hover { background: color-mix(in srgb,var(--soft) 75%,transparent); }
.table-badge { background: var(--soft); border-radius: 999px; color: var(--muted); display: inline-flex; font-size: 6px; font-weight: 720; padding: 5px 7px; white-space: nowrap; }
.empty-table { color: var(--muted); padding: 35px !important; text-align: center; }
.mobile-backdrop { background: rgba(7,5,10,.65); border: 0; display: none; inset: 0; position: fixed; z-index: 1040; }

/* Final application components */
.global-search-form { border: 0; margin: 0; }
.global-search-form input {
    background: transparent;
    border: 0;
    color: var(--ink);
    flex: 1;
    font-size: 9px;
    min-width: 0;
    outline: 0;
}
.global-search-form input::placeholder { color: var(--muted); }
.module-heading { align-items: center; }
.module-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 0 16px;
}
.module-toolbar > div { align-items: center; display: flex; gap: 8px; }
.module-toolbar .module-search { margin-left: auto; min-width: 250px; }
.select-filter, .filter-form label {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    display: flex;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
}
.select-filter span, .filter-form label span { color: var(--muted); font-size: 7px; font-weight: 700; }
.select-filter select, .filter-form select { background: transparent; border: 0; color: var(--ink); font-size: 8px; outline: 0; }
.filter-form { align-items: flex-end; display: flex; gap: 8px; }
.count-badge {
    background: rgba(159,26,226,.11);
    border-radius: 999px;
    color: var(--purple);
    font-size: 8px;
    font-weight: 760;
    padding: 7px 10px;
}
.button.compact { min-height: 30px; padding: 0 10px; }
.icon-action {
    align-items: center;
    background: var(--soft);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    text-decoration: none;
    width: 32px;
}
button.icon-action { cursor: pointer; }
.icon-action:hover { border-color: var(--border); color: var(--purple); }
.icon-action.danger:hover { background: rgba(212,71,86,.1); color: #d44756; }
.table-actions, .detail-actions { align-items: center; display: flex; gap: 7px; }
.strong-link { color: var(--ink); display: flex; flex-direction: column; text-decoration: none; }
.strong-link strong { color: var(--purple); font-size: 8px; }
.strong-link span, .data-table td small { color: var(--muted); display: block; font-size: 7px; margin-top: 2px; }
.money-positive { color: #16935f; font-weight: 750; }
.money-negative { color: #d44756; font-weight: 750; }
.progress-copy { align-items: center; display: flex; font-size: 7px; justify-content: space-between; margin: 11px 0 6px; }
.progress-copy span { color: var(--muted); }
progress {
    appearance: none;
    background: var(--soft);
    border: 0;
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    width: 100%;
}
progress::-webkit-progress-bar { background: var(--soft); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg,var(--purple),var(--rose)); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg,var(--purple),var(--rose)); border-radius: 999px; }
.span-all { grid-column: 1/-1; }
.rich-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 190px;
}
.rich-empty > i { color: var(--purple); font-size: 28px; margin-bottom: 9px; }
.rich-empty strong { color: var(--ink); font-size: 12px; }
.rich-empty span { margin-top: 4px; }
.section-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; }
.section-heading > div { display: flex; flex-direction: column; }
.section-heading span { color: var(--purple); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.section-heading h2 { font-size: 15px; margin: 3px 0 0; }
.section-heading b { align-items: center; background: var(--soft); border-radius: 999px; color: var(--muted); display: flex; font-size: 8px; height: 25px; justify-content: center; min-width: 25px; padding: 0 8px; }

/* Modals */
.portal-modal { --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--border); }
.portal-modal .modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 30px 80px rgba(15,9,22,.28);
    color: var(--ink);
    overflow: hidden;
}
.portal-modal .modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding: 19px 22px;
}
.portal-modal .modal-header > div { display: flex; flex-direction: column; }
.portal-modal .modal-header span { color: var(--purple); font-size: 7px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.portal-modal .modal-header h2 { font-size: 17px; margin: 3px 0 0; }
[data-bs-theme="dark"] .portal-modal .btn-close { filter: invert(1) grayscale(1); }
.portal-modal .modal-body { padding: 20px 22px; }
.portal-modal .modal-footer { background: color-mix(in srgb,var(--soft) 68%,transparent); border-top: 1px solid var(--border); gap: 7px; padding: 13px 22px; }
.entry-form small { color: var(--muted); font-size: 7px; line-height: 1.5; }
.entry-form select[multiple] { min-height: 105px; }
.entry-form fieldset { border: 0; margin: 0; padding: 0; }
.entry-form legend { font-size: 8px; font-weight: 720; margin-bottom: 7px; }
.role-selector { display: grid; gap: 8px; grid-template-columns: repeat(2,1fr); }
.role-selector > label {
    align-items: flex-start;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 9px;
    flex-direction: row;
    gap: 9px;
    padding: 10px;
}
.role-selector input { margin-top: 2px; width: auto; }
.role-selector label span { display: flex; flex-direction: column; }
.role-selector label strong { font-size: 8px; }
.role-selector label small { margin-top: 2px; }

/* Lists, projects and tickets */
.entity-grid { display: grid; gap: 15px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.compact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.entity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 7px 22px rgba(29,23,40,.035);
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 18px;
}
.entity-card > header { align-items: center; display: flex; gap: 10px; }
.entity-card > header > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.entity-card header small { color: var(--purple); font-size: 7px; font-weight: 750; text-transform: uppercase; }
.entity-card h2 { font-size: 13px; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-icon, .room-icon {
    align-items: center;
    background: rgba(159,26,226,.1);
    border-radius: 9px;
    color: var(--purple);
    display: flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.entity-card > p { color: var(--muted); font-size: 8px; line-height: 1.65; margin: 14px 0 2px; min-height: 42px; }
.entity-meta { display: grid; gap: 9px; grid-template-columns: repeat(2,1fr); margin: 14px 0 0; }
.entity-meta > div { display: flex; flex-direction: column; }
.entity-meta dt { color: var(--muted); font-size: 6px; font-weight: 700; text-transform: uppercase; }
.entity-meta dd { font-size: 8px; margin: 2px 0 0; overflow-wrap: anywhere; }
.entity-card > footer { align-items: center; display: flex; gap: 7px; margin-top: auto; padding-top: 16px; }
.entity-card > footer form { margin-left: auto; }
.inline-status-form select {
    background: var(--soft);
    border: 0;
    border-radius: 999px;
    color: var(--ink);
    font-size: 7px;
    padding: 5px 8px;
}
.ticket-detail { margin-bottom: 17px; }
.ticket-detail-grid { display: grid; gap: 25px; grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr); }
.ticket-detail-grid > article > p { color: var(--muted); font-size: 9px; line-height: 1.7; }
.ticket-timeline { border-left: 1px solid var(--border); padding-left: 20px; }
.ticket-timeline h3 { font-size: 10px; margin: 0 0 14px; }
.timeline-item { display: grid; gap: 9px; grid-template-columns: 8px 1fr; margin-bottom: 15px; }
.timeline-item > span { background: var(--purple); border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 2px rgba(159,26,226,.17); height: 8px; margin-top: 4px; width: 8px; }
.timeline-item > div { display: grid; grid-template-columns: 1fr auto; }
.timeline-item strong { font-size: 8px; }
.timeline-item time { color: var(--muted); font-size: 6px; }
.timeline-item p { background: var(--soft); border-radius: 8px; color: var(--muted); font-size: 8px; grid-column: 1/-1; line-height: 1.55; margin: 6px 0 0; padding: 9px; }
.timeline-item.compact { opacity: .72; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.attachment-list a, .message-file { background: var(--soft); border-radius: 8px; color: var(--purple); font-size: 7px; padding: 7px 9px; text-decoration: none; }
.attachment-list i, .message-file i { margin-right: 5px; }

/* Inbox */
.notification-list { padding: 4px 20px; }
.notification-row {
    align-items: center;
    background: transparent;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 11px;
    padding: 14px 4px;
}
.notification-row:last-child { border: 0; }
.notification-row.unread { position: relative; }
.notification-row.unread::before { background: var(--purple); border-radius: 999px; content: ""; height: 6px; left: -10px; position: absolute; width: 6px; }
.notification-row > span:nth-of-type(2) { display: flex; flex: 1; flex-direction: column; }
.notification-row strong { font-size: 9px; }
.notification-row small, .notification-row time { color: var(--muted); font-size: 7px; }
.notification-row > button { background: transparent; border: 0; color: var(--muted); }

/* Chat */
.chat-workspace {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: grid;
    grid-template-columns: 330px minmax(0,1fr);
    height: calc(100vh - 190px);
    min-height: 610px;
    overflow: hidden;
}
.chat-directory { border-right: 1px solid var(--border); min-height: 0; overflow-y: auto; padding: 14px; }
.chat-search { align-items: center; background: var(--soft); border-radius: 9px; color: var(--muted); display: flex; gap: 7px; margin-bottom: 13px; padding: 9px 10px; }
.chat-search input { background: transparent; border: 0; color: var(--ink); font-size: 8px; min-width: 0; outline: 0; width: 100%; }
.directory-heading { align-items: center; color: var(--muted); display: flex; font-size: 7px; font-weight: 800; justify-content: space-between; letter-spacing: .08em; margin: 13px 5px 6px; text-transform: uppercase; }
.employee-chat-list form { margin: 0; }
.employee-chat-list button, .room-list a {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--ink);
    display: flex;
    gap: 9px;
    padding: 8px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}
.employee-chat-list button:hover, .room-list a:hover, .room-list a.active { background: var(--soft); }
.employee-chat-list button > span:nth-child(2), .room-list a > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.employee-chat-list strong, .room-list strong { font-size: 8px; }
.employee-chat-list small, .room-list small { color: var(--muted); font-size: 7px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-chat-list button > i { color: var(--muted); }
.room-list b { align-items: center; background: var(--purple); border-radius: 999px; color: #fff; display: flex; font-size: 6px; height: 19px; justify-content: center; min-width: 19px; padding: 0 5px; }
.person-avatar {
    align-items: center;
    background: linear-gradient(135deg,#33253e,#732787);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 7px;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    position: relative;
    text-transform: uppercase;
    width: 36px;
}
.avatar-small { height: 28px; width: 28px; }
.avatar-large { font-size: 13px; height: 70px; width: 70px; }
.presence-dot {
    background: #8b8492;
    border: 2px solid var(--surface);
    border-radius: 50%;
    bottom: 0;
    height: 10px;
    position: absolute;
    right: 0;
    width: 10px;
}
.presence-dot.online { background: #21b777; }
.chat-conversation { display: flex; flex-direction: column; min-height: 0; }
.chat-conversation > header { align-items: center; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; min-height: 70px; padding: 12px 18px; }
.chat-conversation > header > div:first-child { align-items: center; display: flex; gap: 10px; }
.chat-conversation h2 { font-size: 12px; margin: 0; }
.chat-conversation header small { color: var(--muted); font-size: 7px; }
.member-stack { display: flex; }
.member-stack span { align-items: center; background: var(--soft); border: 2px solid var(--surface); border-radius: 50%; display: flex; font-size: 6px; height: 28px; justify-content: center; margin-left: -7px; width: 28px; }
.message-stream { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }
.chat-message { align-items: flex-start; display: flex; gap: 9px; margin-bottom: 14px; }
.chat-message > div { max-width: min(75%,650px); }
.chat-message > div > header { align-items: center; display: flex; gap: 8px; }
.chat-message strong { font-size: 7px; }
.chat-message time { color: var(--muted); font-size: 6px; }
.chat-message p { background: var(--soft); border-radius: 3px 10px 10px; font-size: 8px; line-height: 1.55; margin: 4px 0; padding: 9px 11px; }
.chat-message.mine { flex-direction: row-reverse; }
.chat-message.mine > div > header { justify-content: flex-end; }
.chat-message.mine p { background: linear-gradient(130deg,var(--purple),var(--magenta)); border-radius: 10px 3px 10px 10px; color: #fff; }
.message-composer { align-items: flex-end; border-top: 1px solid var(--border); display: flex; gap: 8px; padding: 13px 17px; }
.message-composer textarea { background: var(--soft); border: 1px solid transparent; border-radius: 11px; color: var(--ink); flex: 1; font-size: 8px; min-height: 38px; outline: 0; padding: 11px; resize: none; }
.attachment-button { align-items: center; color: var(--muted); cursor: pointer; display: flex; height: 38px; justify-content: center; width: 30px; }
.attachment-button input { display: none; }
.chat-empty { height: 100%; }

/* Finance */
.segmented-tabs { background: var(--soft); border-radius: 9px; display: inline-flex; padding: 3px; }
.segmented-tabs button { background: transparent; border: 0; border-radius: 7px; color: var(--muted); font-size: 8px; min-height: 31px; padding: 0 11px; }
.segmented-tabs button.active { background: var(--surface); box-shadow: 0 3px 10px rgba(20,14,29,.08); color: var(--ink); font-weight: 720; }
.segmented-tabs b { align-items: center; background: rgba(159,26,226,.12); border-radius: 999px; color: var(--purple); display: inline-flex; font-size: 6px; height: 17px; justify-content: center; margin-left: 4px; min-width: 17px; }
.chart-legend { align-items: center; display: flex; gap: 10px; }
.chart-legend span { align-items: center; color: var(--muted); display: flex; font-size: 7px; gap: 4px; }
.chart-legend i { background: var(--purple); border-radius: 50%; height: 6px; width: 6px; }
.chart-legend i.income { background: #1ead6e; }
.chart-legend i.expense { background: var(--rose); }
.budget-grid { display: grid; gap: 12px; grid-template-columns: repeat(3,1fr); }
.budget-grid article { background: var(--soft); border-radius: 12px; padding: 14px; }
.budget-grid header { align-items: center; display: flex; justify-content: space-between; }
.budget-grid header span { color: var(--purple); font-size: 6px; font-weight: 750; text-transform: uppercase; }
.budget-grid h3 { font-size: 10px; margin: 2px 0; }
.budget-grid > article > small { color: var(--muted); display: block; font-size: 6px; margin-top: 7px; }

/* Documents and knowledge */
.document-type-pills { display: flex; flex-wrap: wrap; }
.document-type-pills span { background: var(--soft); border-radius: 999px; color: var(--muted); font-size: 7px; padding: 6px 9px; }
.document-editor-grid { display: grid; gap: 20px; grid-template-columns: minmax(380px,.8fr) minmax(430px,1.2fr); padding: 0 !important; }
.editor-controls { max-height: 72vh; overflow-y: auto; padding: 22px; }
.live-document-preview, .markup-preview { background: #d8d4de; min-height: 620px; padding: 18px; }
[data-bs-theme="dark"] .live-document-preview, [data-bs-theme="dark"] .markup-preview { background: #25222b; }
.preview-toolbar { align-items: center; color: #67616c; display: flex; font-size: 7px; justify-content: space-between; margin: 0 auto 10px; max-width: 560px; }
[data-bs-theme="dark"] .preview-toolbar { color: #aaa4b1; }
.preview-paper, .document-viewer > .rnqt-document, .document-viewer > .legacy-document {
    background: #fff;
    box-shadow: 0 12px 36px rgba(20,14,29,.18);
    color: #211b27;
    margin: 0 auto;
    max-width: 760px;
    min-height: 740px;
    padding: 48px 52px 35px;
}
.preview-paper { max-width: 560px; min-height: 690px; padding: 34px 38px 27px; transform-origin: top center; }
.preview-paper > header, .doc-letterhead { align-items: flex-start; border-bottom: 2px solid #a11fe0; display: flex; justify-content: space-between; padding-bottom: 16px; }
.preview-paper > header > div:last-child, .doc-letterhead > div:last-child { display: flex; flex-direction: column; font-size: 7px; text-align: right; }
.doc-brand { align-items: center; display: flex; gap: 8px; }
.doc-brand b { align-items: center; background: linear-gradient(140deg,#9f1ae2,#ef3e91); border-radius: 8px; color: #fff; display: flex; font-size: 14px; height: 30px; justify-content: center; transform: rotate(-4deg); width: 30px; }
.doc-brand span { display: flex; flex-direction: column; line-height: 1; }
.doc-brand strong { font-size: 12px; letter-spacing: .08em; }
.doc-brand small { color: #827b87; font-size: 5px; letter-spacing: .27em; margin-top: 4px; }
.preview-address, .doc-address { display: flex; flex-direction: column; font-size: 8px; line-height: 1.5; margin-top: 48px; min-height: 72px; white-space: pre-line; }
.doc-address small { color: #766f7b; font-size: 6px; margin-bottom: 9px; text-decoration: underline; }
.preview-title, .doc-title-row { align-items: flex-start; display: flex; justify-content: space-between; margin: 32px 0 24px; }
.preview-title span, .doc-title-row > div > span { color: #9f1ae2; font-size: 6px; font-weight: 750; text-transform: uppercase; }
.preview-title h3, .doc-title-row h1 { font-size: 18px; margin: 4px 0 0; }
.preview-title time, .doc-title-row time { color: #766f7b; font-size: 7px; }
.preview-body, .doc-body { font-size: 8px; line-height: 1.75; min-height: 250px; white-space: pre-line; }
.preview-paper > footer, .doc-footer { border-top: 1px solid #ded9e3; display: grid; font-size: 6px; gap: 10px; grid-template-columns: repeat(3,1fr); margin-top: 70px; padding-top: 12px; }
.invoice-items-heading { align-items: center; display: flex; justify-content: space-between; margin: 13px 0 7px; }
.invoice-items-heading > span { font-size: 8px; font-weight: 720; }
.invoice-item-row { display: grid; gap: 6px; grid-template-columns: minmax(120px,1fr) 66px 80px 66px 32px; margin-bottom: 6px; }
.invoice-item-row input, .invoice-item-row select { min-width: 0; }
.preview-invoice table, .invoice-table { border-collapse: collapse; font-size: 7px; margin: 20px 0 10px; width: 100%; }
.preview-invoice th, .preview-invoice td, .invoice-table th, .invoice-table td { border-bottom: 1px solid #e7e2ea; padding: 7px 5px; text-align: left; }
.preview-invoice td:not(:first-child), .preview-invoice th:not(:first-child), .invoice-table .num { text-align: right; }
.preview-invoice-totals { margin: 12px 0 0 auto; width: min(240px, 65%); }
.preview-invoice-totals div { display: flex; font-size: 7px; justify-content: space-between; padding: 4px 0; }
.preview-invoice-totals dt { color: #726d77; font-weight: 500; }
.preview-invoice-totals dd { font-weight: 700; margin: 0; }
.preview-invoice-totals div:last-child { border-top: 2px solid #9f1ae2; font-size: 10px; margin-top: 3px; padding-top: 7px; }
.scan-review-panel { margin-bottom: 18px; }
.scan-review-form { align-items: center; display: flex; gap: 6px; min-width: 310px; }
.scan-review-form input[type="text"], .scan-review-form input:not([type]) { background: var(--background); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); flex: 1; font-size: 8px; min-width: 180px; padding: 8px 9px; }
.icon-action.success { color: #19a66b; }
.invoice-totals { margin: 12px 0 20px auto; max-width: 270px; }
.invoice-totals > div { display: flex; font-size: 8px; justify-content: space-between; padding: 5px 0; }
.invoice-totals .grand { border-top: 2px solid #9f1ae2; font-size: 11px; margin-top: 5px; padding-top: 9px; }
.doc-notes { color: #766f7b; font-size: 7px; }
.document-viewer { background: var(--soft); border-radius: 16px; padding: 28px; }
.knowledge-workspace { display: grid; gap: 16px; grid-template-columns: 280px minmax(0,1fr); }
.knowledge-directory { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 13px; }
.knowledge-directory nav { display: flex; flex-direction: column; margin-top: 8px; }
.knowledge-directory nav a { align-items: center; border-radius: 9px; color: var(--ink); display: flex; gap: 8px; padding: 9px; text-decoration: none; }
.knowledge-directory nav a:hover, .knowledge-directory nav a.active { background: var(--soft); }
.knowledge-directory nav a > i { color: var(--purple); }
.knowledge-directory nav span { display: flex; flex-direction: column; }
.knowledge-directory strong { font-size: 8px; }
.knowledge-directory small { color: var(--muted); font-size: 6px; margin-top: 2px; }
.knowledge-article { min-height: 620px; }
.knowledge-article > header { align-items: center; }
.knowledge-article > header small { color: var(--muted); font-size: 7px; margin-top: 3px; }
.knowledge-rendered, .markup-preview article { color: var(--ink); font-size: 9px; line-height: 1.7; padding: 13px 5px; }
.knowledge-rendered h1, .markup-preview h1 { font-size: 24px; }
.knowledge-rendered h2, .markup-preview h2 { font-size: 17px; margin-top: 24px; }
.knowledge-rendered h3, .markup-preview h3 { font-size: 13px; margin-top: 18px; }
.editor-split { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.markup-preview { border-radius: 12px; min-height: 500px; }
.markup-preview article { background: var(--surface); border-radius: 9px; min-height: 440px; padding: 20px; }

/* Marketing */
.campaign-card { min-height: 315px; }

/* Team */
.employee-grid { display: grid; gap: 15px; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 18px; }
.employee-card { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 17px; }
.employee-card > header { align-items: center; display: flex; gap: 10px; position: relative; }
.employee-card > header > img { border-radius: 50%; height: 54px; object-fit: cover; width: 54px; }
.employee-card > header > .presence-dot { bottom: 2px; left: 43px; right: auto; }
.employee-card > header > div { flex: 1; min-width: 0; }
.employee-card h2 { font-size: 12px; margin: 0; }
.employee-card p { color: var(--muted); font-size: 7px; margin: 3px 0 0; }
.employee-card dl { display: grid; gap: 9px; margin: 16px 0; }
.employee-card dl div { display: grid; gap: 8px; grid-template-columns: 70px 1fr; }
.employee-card dt { color: var(--muted); font-size: 7px; }
.employee-card dd { font-size: 8px; margin: 0; overflow-wrap: anywhere; }
.employee-card footer { align-items: center; border-top: 1px solid var(--border); display: flex; gap: 7px; padding-top: 13px; }
.invitation-panel { margin-top: 18px; }

/* Private and settings */
.private-workspace { display: grid; gap: 18px; grid-template-columns: 1.2fr .8fr; margin-bottom: 18px; }
.note-grid { display: grid; gap: 12px; grid-template-columns: repeat(2,1fr); }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; min-height: 185px; padding: 14px; }
.note-card.note-blue { border-top: 3px solid #347ed5; }
.note-card.note-green { border-top: 3px solid #1ead6e; }
.note-card.note-orange { border-top: 3px solid #df932e; }
.note-card.note-rose { border-top: 3px solid var(--rose); }
.note-card.note-purple { border-top: 3px solid var(--purple); }
.note-card > header { align-items: flex-start; display: flex; gap: 8px; }
.note-card > header > i { color: var(--purple); }
.note-card > header > div { display: flex; flex: 1; flex-direction: column; }
.note-card h3 { font-size: 10px; margin: 0; }
.note-card time { color: var(--muted); font-size: 6px; margin-top: 2px; }
.note-card > p { color: var(--muted); font-size: 8px; line-height: 1.6; max-height: 84px; overflow: hidden; }
.note-card footer { display: flex; gap: 5px; justify-content: flex-end; margin-top: auto; }
.todo-list { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.todo-list article { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 8px; padding: 11px; }
.todo-list article:last-child { border: 0; }
.todo-list article > span { display: flex; flex: 1; flex-direction: column; }
.todo-list strong { font-size: 8px; }
.todo-list small { color: var(--muted); font-size: 6px; margin-top: 2px; }
.todo-list article.completed strong { color: var(--muted); text-decoration: line-through; }
.todo-check { background: transparent; border: 0; color: var(--purple); }
.file-grid { display: grid; gap: 8px; grid-template-columns: repeat(2,1fr); }
.file-grid article { align-items: center; background: var(--soft); border-radius: 10px; display: flex; gap: 10px; padding: 10px; }
.file-grid article > i { color: var(--purple); font-size: 17px; }
.file-grid article > span { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.file-grid strong { font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-grid small { color: var(--muted); font-size: 6px; margin-top: 2px; }
.settings-grid { display: grid; gap: 17px; grid-template-columns: 1fr 1fr; margin-bottom: 17px; }
.profile-overview { align-items: center; display: flex; gap: 18px; padding: 14px 0; }
.profile-overview > img { border-radius: 50%; height: 78px; object-fit: cover; width: 78px; }
.profile-overview dl { display: grid; flex: 1; gap: 8px; grid-template-columns: repeat(2,1fr); margin: 0; }
.profile-overview dt { color: var(--muted); font-size: 6px; }
.profile-overview dd { font-size: 8px; margin: 2px 0 0; }
.profile-settings-card > p { color: var(--muted); font-size: 8px; line-height: 1.6; }
.security-settings-card > header b { color: #16935f; font-size: 7px; }
.session-list article { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 10px; padding: 11px 0; }
.session-list article:last-child { border: 0; }
.session-list article > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.session-list strong { font-size: 8px; }
.session-list small { color: var(--muted); font-size: 6px; margin-top: 2px; }

/* Search */
.search-page-form {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    display: flex;
    gap: 10px;
    margin-bottom: 17px;
    padding: 10px 12px 10px 16px;
}
.search-page-form > i { color: var(--purple); font-size: 18px; }
.search-page-form input { background: transparent; border: 0; color: var(--ink); flex: 1; font-size: 12px; outline: 0; }
.search-result-list a { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 11px; padding: 12px 3px; text-decoration: none; }
.search-result-list a:last-child { border: 0; }
.search-result-list a > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.search-result-list small { color: var(--purple); font-size: 6px; font-weight: 750; text-transform: uppercase; }
.search-result-list strong { font-size: 9px; margin: 2px 0; }
.search-result-list em { color: var(--muted); font-size: 7px; font-style: normal; }
.search-result-list a > i { color: var(--muted); }
.invite-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); margin: 6vh auto; max-width: 560px; padding: 32px; }
.invite-card .auth-mobile-logo { display: flex; }
.invite-card .form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.invite-card > p { font-size: 9px; }
.invite-card > .auth-submit { text-decoration: none; }

@media (max-width: 1120px) {
    .metric-grid, .security-grid { grid-template-columns: repeat(2,1fr); }
    .entity-grid, .employee-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .budget-grid { grid-template-columns: repeat(2,1fr); }
    .document-editor-grid { grid-template-columns: 1fr; }
    .live-document-preview { min-height: auto; }
}

@media (max-width: 900px) {
    .portal-sidebar { box-shadow: 25px 0 60px rgba(0,0,0,.3); transform: translateX(-102%); transition: transform .18s ease; }
    body.sidebar-open .portal-sidebar { transform: translateX(0); }
    body.sidebar-open .mobile-backdrop { display: block; }
    .portal-sidebar > header > button { display: block; }
    .portal-frame { margin-left: 0; }
    .portal-topbar > div:first-child > button { display: block; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .chat-workspace { grid-template-columns: 280px minmax(0,1fr); }
    .knowledge-workspace { grid-template-columns: 230px minmax(0,1fr); }
    .private-workspace, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .auth-shell { display: block; }
    .auth-brand { display: none; }
    .auth-form-pane { min-height: 100vh; padding: 25px; }
    .auth-mobile-logo { display: flex; }
    .code-card { padding: 28px 22px; }
    .portal-topbar { height: 66px; padding: 0 12px; }
    .portal-content { padding: 23px 14px 42px; }
    .search-button { width: 40px; }
    .search-button input, .search-button kbd, .internal-badge, .topbar-divider, .profile-summary > div { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .metric-grid, .security-grid { grid-template-columns: 1fr; }
    .launch-card { align-items: flex-start; flex-direction: column; gap: 20px; padding: 22px; }
    .entry-form, .dual-form, .subform-grid, .insight-grid { grid-template-columns: 1fr; }
    .entry-form label.full, .entry-form .full { grid-column: auto; }
    .module-search { width: 100%; }
    .data-panel > header { align-items: stretch; flex-direction: column; gap: 10px; }
    .period-filter { align-items: stretch; flex-wrap: wrap; justify-content: flex-start; }
    .period-filter label { flex: 1 1 190px; }
    .period-filter > span { margin: 8px 0 0; width: 100%; }
    .module-toolbar { align-items: stretch; flex-direction: column; }
    .module-toolbar .module-search { margin-left: 0; min-width: 0; }
    .entity-grid, .employee-grid, .budget-grid, .note-grid, .file-grid { grid-template-columns: 1fr; }
    .ticket-detail-grid { grid-template-columns: 1fr; }
    .ticket-timeline { border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 0; }
    .chat-workspace { display: block; height: auto; min-height: 0; }
    .chat-directory { border-bottom: 1px solid var(--border); border-right: 0; max-height: 420px; }
    .chat-conversation { min-height: 520px; }
    .knowledge-workspace { grid-template-columns: 1fr; }
    .knowledge-directory { max-height: 300px; overflow-y: auto; }
    .editor-split { grid-template-columns: 1fr; }
    .preview-paper { min-height: 560px; padding: 28px 24px; }
    .document-viewer { padding: 10px; }
    .document-viewer > .rnqt-document, .document-viewer > .legacy-document { min-height: 600px; padding: 30px 24px; }
    .role-selector { grid-template-columns: 1fr; }
    .invoice-item-row { grid-template-columns: 1fr 70px 90px 70px 32px; }
    .profile-overview { align-items: flex-start; flex-direction: column; }
    .profile-overview dl { grid-template-columns: 1fr; width: 100%; }
}

@media print {
    .portal-sidebar, .portal-topbar, .document-page-heading, .mobile-backdrop { display: none !important; }
    .portal-frame { margin: 0; }
    .portal-content { margin: 0; max-width: none; padding: 0; }
    .document-viewer { background: #fff; padding: 0; }
    .document-viewer > .rnqt-document, .document-viewer > .legacy-document { box-shadow: none; margin: 0; max-width: none; min-height: 0; padding: 12mm 15mm; }
    @page { margin: 0; size: A4; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
