:root {
    --bg: #dfe5e1;
    --panel: #f7f5ef;
    --panel-soft: #ebece5;
    --text: #151a1d;
    --muted: #687170;
    --line: #c8d0cb;
    --green: #1e7558;
    --green-dark: #114d3d;
    --ink: #141d26;
    --ink-2: #202c36;
    --gold: #c7983d;
    --red: #b42318;
    --yellow: #a15c07;
    --shadow: 0 18px 45px rgba(18, 28, 34, .12);
    --glass: rgba(247, 245, 239, .84);
    --field: #f4f2eb;
    --sidebar: #101820;
    --sidebar-soft: rgba(255, 255, 255, .09);
    --row: #f7f5ef;
    --row-hover: #ebece5;
    --hero-filter: rgba(20, 29, 38, .84);
    --chip: #eef6f2;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0f1519;
    --panel: #172026;
    --panel-soft: #1d2930;
    --text: #eef4f1;
    --muted: #9aa8a7;
    --line: #2d3a40;
    --green: #45b98d;
    --green-dark: #84d8b8;
    --ink: #0b1014;
    --ink-2: #141c22;
    --gold: #d4a84d;
    --red: #ff8178;
    --yellow: #f0ba63;
    --shadow: 0 18px 45px rgba(0, 0, 0, .32);
    --glass: rgba(23, 32, 38, .78);
    --field: #11191e;
    --sidebar: #0b1014;
    --sidebar-soft: rgba(255, 255, 255, .08);
    --row: #19242a;
    --row-hover: #202d34;
    --hero-filter: rgba(8, 12, 15, .86);
    --chip: #21342d;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--ink) 10%, transparent), rgba(255, 255, 255, 0) 300px),
        radial-gradient(circle at top right, rgba(30, 117, 88, .18), transparent 360px),
        radial-gradient(circle at 25% 18%, rgba(199, 152, 61, .13), transparent 300px),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 18% 18%, rgba(30, 117, 88, .18), transparent 330px),
        radial-gradient(circle at 82% 22%, rgba(199, 152, 61, .16), transparent 310px),
        linear-gradient(180deg, #f9faf7, #e5ece8);
}

.login-card {
    width: min(1240px, 100%);
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    background: color-mix(in srgb, var(--panel) 94%, #fff);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(16, 28, 34, .18);
}

.brand-panel {
    display: none;
}

.login-choice-panel {
    min-height: 590px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background:
        linear-gradient(120deg, rgba(13, 23, 29, .74), rgba(13, 23, 29, .4) 52%, rgba(13, 23, 29, .78)),
        url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.login-choice {
    position: relative;
    min-height: 530px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(8, 16, 20, .1), rgba(8, 16, 20, .78)),
        rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 18px 40px rgba(0, 0, 0, .22);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.login-choice::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: .58;
    background: center/cover;
    transition: transform .28s ease, opacity .28s ease;
}

.login-choice::after {
    content: "";
    position: absolute;
    inset: auto 32px 28px 32px;
    z-index: -1;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #47c59a, var(--gold));
    transform: scaleX(.34);
    transform-origin: left;
    opacity: .92;
    transition: transform .24s ease;
}

.staff-choice::before {
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .66)),
        url("https://images.unsplash.com/photo-1556740758-90de374c12ad?auto=format&fit=crop&w=900&q=80");
}

.office-choice::before {
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .66)),
        url("https://images.unsplash.com/photo-1554224155-8d04cb21cd6c?auto=format&fit=crop&w=900&q=80");
}

.login-choice:hover::before,
.login-choice.active::before {
    transform: scale(1.04);
    opacity: .78;
}

.login-choice:hover {
    transform: translateY(-2px);
}

.login-choice:hover::after,
.login-choice.active::after {
    transform: scaleX(1);
}

.login-choice strong,
.login-choice small {
    position: relative;
    z-index: 1;
}

.login-choice strong {
    max-width: 330px;
    font-size: clamp(32px, 3.25vw, 48px);
    line-height: 1.02;
    letter-spacing: 0;
    text-shadow: 0 14px 32px rgba(0, 0, 0, .36);
}

.login-choice small {
    max-width: 320px;
    margin: 14px 0 22px;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.login-choice.active {
    border-color: rgba(71, 197, 154, .86);
    box-shadow: 0 0 0 3px rgba(71, 197, 154, .18), 0 22px 45px rgba(0, 0, 0, .28);
}

.brand-mark,
.logo span {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), #2f9a76);
    color: #fff;
    font-weight: 900;
}

.brand-panel h1 {
    max-width: 600px;
    margin: 120px 0 12px;
    font-size: clamp(36px, 5vw, 66px);
    line-height: .95;
}

.brand-panel p {
    max-width: 540px;
    color: rgba(255, 255, 255, .84);
    font-size: 18px;
}

.login-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.login-stats span,
.badge {
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: 13px;
}

.login-form {
    padding: 58px 48px;
    align-self: center;
}

.login-form h2,
.panel h2 {
    margin: 0 0 20px;
}

.login-form h2 {
    font-size: 30px;
    line-height: 1.05;
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    padding: 12px 13px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(30, 117, 88, .14);
}

.primary-btn,
.ghost-btn,
.small-btn {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.primary-btn {
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--green), #145a45);
    color: #fff;
    box-shadow: 0 12px 20px rgba(30, 117, 88, .18);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #176348, var(--green-dark));
}

.primary-btn.dark {
    background: linear-gradient(135deg, var(--ink), var(--ink-2));
    box-shadow: 0 12px 20px rgba(20, 29, 38, .18);
}

.ghost-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.small-btn {
    padding: 10px 12px;
    background: var(--ink);
    color: #fff;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.danger-btn {
    background: color-mix(in srgb, var(--red) 82%, var(--ink));
    color: #fff;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 8px;
    background: #e9f6ef;
    color: var(--green-dark);
    border: 1px solid #bee5cf;
    font-weight: 700;
}

.alert.danger {
    background: #fff0ef;
    color: var(--red);
    border-color: #ffd2ce;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 42%),
        radial-gradient(circle at 20% 0, rgba(30, 117, 88, .28), transparent 210px),
        var(--sidebar);
    color: #edf5f1;
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 18px 0 48px rgba(0, 0, 0, .16);
    overflow-y: auto;
}

.mobile-menu-btn,
.sidebar-backdrop {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.sidebar-header p {
    margin: 12px 4px 0;
    color: rgba(237, 245, 241, .58);
    font-size: 13px;
    line-height: 1.5;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 4px 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.sidebar-status span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #52d18e;
    box-shadow: 0 0 0 5px rgba(82, 209, 142, .12);
}

.logo strong {
    letter-spacing: .2px;
}

.sidebar nav {
    display: grid;
    gap: 7px;
}

.nav-title {
    margin: 14px 4px 6px;
    color: rgba(237, 245, 241, .46);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.sidebar nav a {
    position: relative;
    padding: 12px 13px 12px 16px;
    border-radius: 8px;
    color: rgba(237, 245, 241, .72);
    font-weight: 750;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    color: #fff;
    background: var(--sidebar-soft);
    transform: translateX(2px);
}

.sidebar nav a.active::before {
    content: "";
    position: absolute;
    inset: 10px auto 10px 0;
    width: 3px;
    border-radius: 99px;
    background: var(--gold);
}

.business-nav {
    border-radius: 8px;
    border: 1px solid transparent;
}

.business-nav summary {
    display: grid;
    gap: 2px;
    position: relative;
    padding: 12px 32px 12px 14px;
    border-radius: 8px;
    color: rgba(237, 245, 241, .76);
    cursor: pointer;
    list-style: none;
    list-style-type: none;
    font-weight: 850;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .055);
    transition: background .18s ease, border-color .18s ease;
}

.business-nav summary::marker {
    content: "";
    font-size: 0;
}

.business-nav summary::-webkit-details-marker {
    display: none;
}

.business-nav summary::after {
    content: "+";
    position: absolute;
    right: 13px;
    top: 12px;
    color: rgba(237, 245, 241, .46);
    font-size: 16px;
    font-weight: 900;
    transition: transform .18s ease;
}

.business-nav[open] summary,
.business-nav summary:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(30, 117, 88, .22), rgba(255, 255, 255, .055));
    border-color: rgba(71, 197, 154, .22);
}

.business-nav[open] summary::after {
    content: "-";
    transform: none;
}

.business-nav summary small {
    max-width: 170px;
    color: rgba(237, 245, 241, .46);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.business-nav-children {
    display: grid;
    gap: 4px;
    margin: 7px 0 10px 13px;
    padding-left: 11px;
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.sidebar nav .business-nav-children a {
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 7px;
    color: rgba(237, 245, 241, .62);
}

.sidebar nav .business-nav-children a.active {
    color: #fff;
    background: rgba(199, 152, 61, .18);
}

.sidebar {
    width: 250px;
    padding: 12px 10px 18px;
    gap: 14px;
    background:
        linear-gradient(90deg, rgba(0, 220, 175, .06) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(0, 220, 175, .045) 0 1px, transparent 1px 100%),
        radial-gradient(circle at 100% 18%, rgba(0, 188, 150, .16), transparent 260px),
        #081419;
    background-size: 36px 36px, 36px 36px, auto, auto;
    border-right: 1px solid rgba(15, 213, 169, .22);
}

.sidebar-header {
    padding: 4px 8px 0;
}

.sidebar nav {
    gap: 8px;
}

.nav-title {
    display: none;
}

.sidebar-section {
    border: 1px solid rgba(150, 171, 178, .14);
    border-radius: 14px;
    background: rgba(19, 33, 40, .72);
    overflow: hidden;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.sidebar-section[open] {
    border-color: rgba(0, 214, 170, .28);
    background: rgba(9, 34, 34, .78);
    box-shadow: inset 0 0 0 1px rgba(0, 214, 170, .05), 0 16px 34px rgba(0, 0, 0, .18);
}

.sidebar-section > summary {
    display: grid;
    grid-template-columns: 26px 1fr 16px;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    color: rgba(230, 238, 238, .8);
}

.sidebar-section > summary::marker,
.sidebar-section > summary::-webkit-details-marker {
    display: none;
    content: "";
}

.sidebar-section > summary::after {
    content: "⌄";
    justify-self: end;
    color: rgba(211, 226, 226, .48);
    font-size: 15px;
    line-height: 1;
    transition: transform .18s ease, color .18s ease;
}

.sidebar-section[open] > summary::after {
    transform: rotate(180deg);
    color: rgba(0, 214, 170, .88);
}

.sidebar-section-icon,
.nav-item-icon,
.business-fold-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: transparent;
    color: rgba(203, 220, 220, .72);
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.sidebar-section-icon {
    background: rgba(0, 214, 170, .12);
    color: #27dcae;
}

.sidebar-section[open] > summary .sidebar-section-icon,
.sidebar nav a.nav-item.active .nav-item-icon,
.business-nav[open] .business-fold-icon {
    color: #27dcae;
}

.sidebar-section > summary strong {
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar-section-body {
    display: grid;
    gap: 5px;
    padding: 6px 7px 10px;
}

.sidebar nav a.nav-item {
    display: grid;
    grid-template-columns: 25px 1fr;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 12px;
    color: rgba(220, 231, 231, .68);
    font-size: 12px;
    font-weight: 800;
}

.sidebar nav a.nav-item:hover {
    transform: none;
    background: rgba(255, 255, 255, .055);
    color: #fff;
}

.sidebar nav a.nav-item.active {
    color: #fff;
    background: rgba(15, 214, 181, .18);
    box-shadow: inset 0 0 0 1px rgba(15, 214, 181, .34);
}

.sidebar nav a.nav-item.active::before {
    inset: 7px auto 7px -8px;
    width: 4px;
    background: #06d6b3;
    box-shadow: 0 0 16px rgba(6, 214, 179, .7);
}

.business-nav {
    border: 0;
    border-radius: 12px;
}

.business-nav summary {
    grid-template-columns: 25px 1fr;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 8px 30px 8px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(220, 231, 231, .72);
    font-size: 12px;
    line-height: 1.25;
}

.business-nav summary small {
    grid-column: 2;
    max-width: 145px;
    margin-top: 2px;
    color: rgba(220, 231, 231, .42);
    font-size: 9px;
}

.business-nav summary::after {
    right: 11px;
    top: 11px;
    content: "⌄";
    font-size: 13px;
    color: rgba(211, 226, 226, .42);
}

.business-nav[open] summary::after {
    content: "⌄";
    transform: rotate(180deg);
}

.business-nav[open] summary,
.business-nav summary:hover {
    background: rgba(255, 255, 255, .055);
}

.business-nav-children {
    gap: 4px;
    margin: 2px 0 8px 20px;
    padding-left: 10px;
    border-left: 1px solid rgba(0, 214, 170, .18);
}

.sidebar nav .business-nav-children a {
    min-height: 30px;
    padding: 7px 9px;
    border-radius: 10px;
    color: rgba(220, 231, 231, .58);
    font-size: 11px;
}

.sidebar nav .business-nav-children a.active {
    background: rgba(15, 214, 181, .2);
    box-shadow: inset 0 0 0 1px rgba(15, 214, 181, .28);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .055);
}

.sidebar-footer span,
.sidebar-footer strong {
    display: block;
}

.sidebar-footer span {
    color: rgba(237, 245, 241, .56);
    font-size: 12px;
    font-weight: 800;
}

.sidebar-footer strong {
    margin-top: 3px;
    color: #fff;
}

.main {
    margin-left: 264px;
    padding: 30px 34px;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(220px, max-content) minmax(0, 1fr);
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: -30px -34px 24px;
    padding: 14px 26px;
    min-height: 72px;
    border: 1px solid rgba(42, 187, 153, .18);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background:
        linear-gradient(rgba(12, 29, 33, .92), rgba(12, 29, 33, .92)),
        linear-gradient(90deg, rgba(45, 180, 151, .14) 1px, transparent 1px),
        linear-gradient(180deg, rgba(45, 180, 151, .1) 1px, transparent 1px);
    background-size: auto, 42px 42px, 42px 42px;
    color: #edf8f4;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.topbar::before {
    display: none;
}

.topbar > * {
    position: relative;
    z-index: 1;
}

.topbar-main {
    min-width: 0;
    max-width: 280px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
}

.breadcrumb {
    margin: 6px 0 0;
    color: rgba(237, 248, 244, .56);
    font-size: 12px;
    font-weight: 700;
}

.breadcrumb span {
    color: #47c59a;
    margin: 0 6px;
}

.top-logo {
    min-width: auto;
    padding: 0;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    letter-spacing: 0;
    white-space: nowrap;
}

.top-logo strong,
.top-logo span {
    display: block;
    font-size: 21px;
    line-height: 1;
    letter-spacing: 0;
}

.top-logo span {
    margin-top: 0;
    color: #47c59a;
    font-size: 21px;
    font-weight: 950;
}

.top-actions {
    display: grid;
    grid-template-columns: minmax(190px, 250px) auto auto auto minmax(170px, auto);
    align-items: center;
    justify-content: flex-end;
    justify-items: stretch;
    gap: 12px;
    padding-top: 0;
    min-width: 0;
    width: 100%;
}

.top-actions > * {
    min-width: 0;
}

.business-scope label {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 4px;
    color: rgba(237, 248, 244, .58);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.business-scope select {
    width: 100%;
    min-height: 36px;
    padding: 8px 34px 8px 12px;
    border: 1px solid rgba(71, 197, 154, .22);
    border-radius: 8px;
    background: rgba(7, 22, 26, .72);
    color: rgba(237, 248, 244, .92);
    font-size: 12px;
    font-weight: 850;
}

@media (max-width: 1320px) {
    .topbar {
        grid-template-columns: minmax(170px, max-content) minmax(0, 1fr);
        gap: 14px;
    }

    .top-logo {
        display: none;
    }

    .top-actions {
        display: grid;
        grid-template-columns: minmax(150px, 1fr) auto auto auto minmax(150px, 170px);
        justify-content: stretch;
    }

    .business-scope label {
        width: 100%;
    }

    .time-pill {
        padding-inline: 10px;
    }

    .theme-toggle {
        width: 104px;
    }

    :root[data-theme="dark"] .theme-toggle::before {
        transform: translateX(48px);
    }

    .user-pill {
        min-width: 156px;
    }
}

.time-pill,
.icon-pill {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(71, 197, 154, .22);
    border-radius: 8px;
    background: rgba(7, 22, 26, .6);
    color: rgba(237, 248, 244, .86);
    font-size: 12px;
    font-weight: 850;
}

.icon-pill {
    width: 38px;
    justify-content: center;
    padding: 0;
    color: #47c59a;
}

.theme-toggle {
    position: relative;
    width: 112px;
    height: 46px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    border: 1px solid rgba(71, 197, 154, .22);
    border-radius: 8px;
    background: rgba(7, 22, 26, .6);
    color: var(--muted);
    box-shadow: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.theme-toggle::before {
    content: "";
    position: absolute;
    inset: 5px auto 5px 5px;
    width: calc(50% - 5px);
    border-radius: 7px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    transition: transform .18s ease;
}

.theme-toggle span {
    position: relative;
    z-index: 1;
    text-align: center;
}

.theme-toggle .theme-light {
    color: #fff;
}

:root[data-theme="dark"] .theme-toggle::before {
    transform: translateX(52px);
}

:root[data-theme="dark"] .theme-toggle .theme-light {
    color: var(--muted);
}

:root[data-theme="dark"] .theme-toggle .theme-dark {
    color: #06100d;
}

.profile-menu {
    position: relative;
    z-index: 1001;
}

.profile-menu[open] {
    z-index: 10000;
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.user-pill {
    min-width: 176px;
    padding: 8px 10px;
    border: 1px solid rgba(71, 197, 154, .22);
    border-radius: 8px;
    background: rgba(7, 22, 26, .66);
    color: #eef8f4;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: transform .16s ease, box-shadow .16s ease;
    cursor: pointer;
}

.user-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(22, 26, 31, .1);
}

.avatar,
.profile-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ink), var(--green-dark));
    color: #fff;
    font-weight: 900;
}

.avatar {
    width: 36px;
    height: 36px;
}

.user-meta {
    display: block;
    min-width: 0;
}

.user-meta strong,
.user-meta small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pill .user-meta small {
    color: rgba(238, 248, 244, .64);
}

.profile-card {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 9999;
    width: min(340px, calc(100vw - 36px));
    padding: 16px;
    border: 1px solid #c8d0cb;
    border-radius: 8px;
    background: #f7f5ef;
    box-shadow: var(--shadow);
}

.profile-card::before {
    content: "";
    position: absolute;
    right: 28px;
    top: -7px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    background: #f7f5ef;
    border-left: 1px solid #c8d0cb;
    border-top: 1px solid #c8d0cb;
}

.profile-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.profile-card-avatar {
    width: 50px;
    height: 50px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), var(--gold));
    color: #fff;
    font-weight: 900;
}

.profile-card-head strong,
.profile-card-head small {
    display: block;
}

.profile-card-head strong {
    color: #122026;
    font-weight: 950;
}

.profile-card-head small {
    margin-top: 2px;
    color: #50615f;
}

.profile-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.profile-card-grid article {
    min-width: 0;
    padding: 12px;
    border: 1px solid #c8d0cb;
    border-radius: 8px;
    background: #eceee7;
}

.profile-card-grid span,
.profile-card-grid strong {
    display: block;
}

.profile-card-grid span {
    color: #50615f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-card-grid strong {
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #122026;
    font-weight: 950;
}

.profile-card-link,
.profile-card-logout {
    width: 100%;
    display: block;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 900;
}

.profile-card-link {
    background: linear-gradient(135deg, var(--green), #145a45);
    color: #fff;
}

.profile-card form {
    margin-top: 8px;
}

.profile-card-logout {
    border: 1px solid #c8d0cb;
    background: #eceee7;
    color: #122026;
    cursor: pointer;
}

.profile-card .user-meta small {
    color: var(--muted);
    margin-top: 2px;
}

.chat-shell {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    min-height: calc(100vh - 150px);
}

.chat-sidebar,
.chat-panel {
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(30, 41, 48, .94), rgba(13, 20, 24, .94)),
        var(--panel);
    color: #f4fbf8;
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.chat-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.chat-sidebar-head h2 {
    margin: 2px 0 0;
    font-size: 24px;
}

.chat-sidebar-head strong {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(69, 185, 141, .16);
    color: #5be0ad;
}

.chat-group-list {
    display: grid;
    gap: 10px;
    padding: 14px;
    max-height: 310px;
    overflow: auto;
}

.chat-group-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: rgba(255, 255, 255, .045);
}

.chat-group-card.active {
    border-color: rgba(69, 185, 141, .5);
    background: linear-gradient(135deg, rgba(21, 119, 91, .44), rgba(255, 255, 255, .05));
    box-shadow: inset 3px 0 0 #25d49a;
}

.chat-group-avatar,
.chat-room-avatar,
.chat-author-avatar {
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #147b60, #d0a13e);
    color: #fff;
    font-weight: 950;
}

.chat-group-avatar {
    width: 44px;
    height: 44px;
}

.chat-group-card strong,
.chat-group-card small,
.chat-group-card em {
    display: block;
}

.chat-group-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-group-card small,
.chat-group-card em,
.chat-empty-small {
    color: rgba(244, 251, 248, .62);
    font-size: 12px;
    font-weight: 800;
}

.chat-group-card em {
    font-style: normal;
}

.chat-create-form {
    margin: 0 14px 14px;
    padding: 16px;
    border: 1px solid rgba(69, 185, 141, .16);
    border-radius: 12px;
    background: rgba(7, 16, 19, .48);
}

.chat-create-form h3 {
    margin: 0 0 14px;
}

.chat-member-picker {
    display: grid;
    gap: 8px;
    max-height: 180px;
    margin: 12px 0;
    padding-right: 4px;
    overflow: auto;
}

.chat-member-picker > span {
    color: rgba(244, 251, 248, .66);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.chat-member-picker label {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
}

.chat-member-picker input {
    grid-row: span 2;
    margin-top: 3px;
}

.chat-member-picker strong,
.chat-member-picker small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-member-picker small {
    color: rgba(244, 251, 248, .58);
    font-size: 11px;
}

.chat-panel {
    min-width: 0;
    padding: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-room-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(8, 15, 18, .68);
}

.chat-room-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-room-avatar {
    width: 56px;
    height: 56px;
}

.chat-room-title h2 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 24px;
}

.chat-room-title p {
    margin: 4px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 251, 248, .62);
    font-weight: 800;
}

.chat-room-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-room-meta span,
.chat-room-meta strong,
.chat-day-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: rgba(244, 251, 248, .78);
    font-size: 12px;
    font-weight: 950;
}

.chat-messages {
    min-height: 520px;
    padding: 24px 28px;
    overflow: auto;
    background:
        radial-gradient(circle at 20px 20px, rgba(255, 255, 255, .045) 0 2px, transparent 3px),
        radial-gradient(circle at 80px 80px, rgba(69, 185, 141, .05) 0 2px, transparent 3px),
        linear-gradient(135deg, rgba(255, 255, 255, .02) 25%, transparent 25%) 0 0 / 42px 42px,
        #101719;
}

.chat-day-pill {
    width: max-content;
    margin: 0 auto 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
}

.chat-message {
    width: min(620px, 88%);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.chat-message.mine {
    margin-left: auto;
    grid-template-columns: minmax(0, 1fr) 42px;
}

.chat-message.mine .chat-author-avatar {
    grid-column: 2;
    grid-row: 1;
}

.chat-message.mine .chat-bubble {
    grid-column: 1;
    grid-row: 1;
    background: linear-gradient(135deg, rgba(23, 123, 94, .95), rgba(31, 75, 65, .95));
}

.chat-author-avatar {
    width: 42px;
    height: 42px;
    font-size: 13px;
}

.chat-bubble {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(36, 43, 45, .96);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .2);
}

.chat-message-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.chat-sender-block {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.chat-message-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-message-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffd36b;
}

.chat-sender-block em {
    max-width: 330px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 251, 248, .56);
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.chat-message-head small {
    color: rgba(244, 251, 248, .58);
    font-weight: 850;
}

.chat-ticks {
    color: rgba(244, 251, 248, .58);
    font-size: 13px;
    font-weight: 950;
    letter-spacing: -3px;
}

.chat-ticks.read,
.chat-info-preview b.read {
    color: #35a7ff;
}

.chat-info-btn {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: rgba(244, 251, 248, .82);
    cursor: pointer;
    font-weight: 950;
}

.chat-info-btn:hover {
    background: rgba(255, 255, 255, .18);
}

.chat-bubble p {
    margin: 0;
    color: rgba(244, 251, 248, .9);
    line-height: 1.5;
}

.chat-info-modal {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, .46);
    backdrop-filter: blur(6px);
}

.chat-info-modal[hidden] {
    display: none;
}

.chat-info-dialog {
    width: min(560px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: #f8f7f2;
    color: #182025;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
}

.chat-info-close {
    position: absolute;
    right: 14px;
    top: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    color: #182025;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.chat-info-preview {
    margin: 18px 54px 12px 18px;
    padding: 12px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(215, 244, 207, .95), rgba(235, 252, 229, .95)),
        #ddf7d8;
}

.chat-info-preview p {
    margin: 0 0 6px;
    color: #1c3428;
    font-weight: 850;
}

.chat-info-preview span {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    color: #687170;
    font-size: 12px;
    font-weight: 850;
}

.chat-info-dialog section {
    padding: 16px 18px;
    border-top: 1px solid #e1e2dc;
}

.chat-info-dialog h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: #687170;
    font-size: 14px;
}

.chat-info-person {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-info-person > span {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f171c, #d4a84d);
    color: #fff;
    font-weight: 950;
}

.chat-info-person strong,
.chat-info-person small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-info-person strong {
    color: #101719;
}

.chat-info-person small,
.chat-info-muted {
    color: #687170;
    font-size: 13px;
    font-weight: 750;
}

.chat-info-muted {
    margin: 8px 0 0;
}

.chat-image-link {
    display: block;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
}

.chat-image-link img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.chat-file-link {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
}

.chat-file-link span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #ef5350;
    color: #fff;
    font-weight: 950;
}

.chat-empty-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: rgba(244, 251, 248, .66);
    text-align: center;
}

.chat-empty-state strong {
    color: #fff;
    font-size: 22px;
}

.chat-empty-state.large {
    min-height: 600px;
}

.chat-composer {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) minmax(92px, auto);
    gap: 10px;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(8, 15, 18, .78);
}

.chat-composer textarea {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    max-height: 130px;
    resize: vertical;
}

.chat-attach {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
}

.chat-attach input {
    display: none;
}

.chat-attach span {
    font-size: 24px;
    font-weight: 900;
}

.chat-composer button {
    min-width: 92px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #20c997, #15775b);
    color: #fff;
    font-weight: 950;
    cursor: pointer;
}

@media (min-width: 1101px) and (max-width: 1320px) {
    .topbar {
        grid-template-columns: minmax(170px, max-content) minmax(0, 1fr);
        gap: 14px;
        min-height: 74px;
    }

    .top-logo {
        display: none;
    }

    .top-actions {
        display: grid;
        grid-template-columns: minmax(150px, 1fr) auto auto auto minmax(150px, 170px);
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .business-scope label {
        width: 100%;
    }

    .time-pill {
        padding-inline: 10px;
        white-space: nowrap;
    }

    .theme-toggle {
        width: 104px;
    }

    :root[data-theme="dark"] .theme-toggle::before {
        transform: translateX(48px);
    }

    .user-pill {
        min-width: 146px;
        max-width: 168px;
    }
}

.filter-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.filter-row label {
    width: min(280px, 100%);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.metric,
.panel {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, #fff), var(--panel-soft));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(22, 26, 31, .06);
    min-width: 0;
}

.metric {
    padding: 20px;
    min-height: 168px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 88% 14%, color-mix(in srgb, var(--green) 20%, transparent), transparent 92px),
        linear-gradient(180deg, var(--panel), var(--panel-soft));
}

.metric::after {
    content: "";
    position: absolute;
    inset: auto 18px 0 18px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--green), var(--gold));
}

.metric::before {
    content: "";
    position: absolute;
    right: -30px;
    top: -40px;
    width: 118px;
    height: 118px;
    border-radius: 30px;
    background: color-mix(in srgb, var(--green) 12%, transparent);
    transform: rotate(18deg);
    z-index: -1;
}

.metric-top,
.metric-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.metric-top b,
.metric-bottom em {
    padding: 7px 9px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--green-dark);
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
    text-transform: uppercase;
}

.metric-bottom em {
    background: color-mix(in srgb, var(--gold) 18%, transparent);
    color: var(--yellow);
}

.metric span,
.metric small {
    color: var(--muted);
    font-weight: 750;
}

.metric strong {
    display: block;
    margin: 22px 0 18px;
    font-size: clamp(25px, 2.8vw, 38px);
    letter-spacing: 0;
}

.metric strong.small-metric-text {
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.announcement-list {
    display: grid;
    gap: 12px;
}

.announcement-list article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--row), var(--panel-soft));
}

.announcement-list strong,
.announcement-list p {
    display: block;
    margin: 0;
}

.announcement-list p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.55;
}

.staff-table {
    margin-top: 18px;
}

.metric-sales::after {
    background: linear-gradient(90deg, #1e7558, #50c191);
}

.metric-orders::after {
    background: linear-gradient(90deg, #315fda, #78a4ff);
}

.metric-expense::after {
    background: linear-gradient(90deg, #b35b2d, #e1a15f);
}

.metric-advance::after {
    background: linear-gradient(90deg, #7d4bb4, #bc8eea);
}

.dashboard-hero-strip {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid rgba(71, 197, 154, .2);
    border-radius: 8px;
    background:
        radial-gradient(circle at 8% 10%, rgba(34, 211, 238, .2), transparent 220px),
        radial-gradient(circle at 78% 24%, rgba(236, 72, 153, .16), transparent 260px),
        linear-gradient(135deg, rgba(7, 22, 28, .92), rgba(12, 37, 41, .82));
    color: #f4fbfb;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .16);
}

.dashboard-hero-strip h2 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1;
}

.dashboard-hero-strip .eyebrow {
    color: #47f0c2;
}

.dashboard-hero-strip p {
    margin: 0;
    color: rgba(244, 251, 251, .68);
    font-weight: 750;
}

.dashboard-periods {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
}

.dashboard-periods span {
    padding: 9px 12px;
    border-radius: 7px;
    color: rgba(244, 251, 251, .62);
    font-size: 12px;
    font-weight: 900;
}

.dashboard-periods .active {
    background: linear-gradient(135deg, #20c997, #38bdf8);
    color: #041016;
}

.dashboard-metrics .metric {
    min-height: 228px;
    border-color: rgba(255, 255, 255, .08);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015)),
        radial-gradient(circle at 88% 12%, var(--metric-glow), transparent 118px),
        #0b1a21;
    color: #f3fbfa;
    box-shadow: 0 22px 45px rgba(0, 0, 0, .2);
}

.dashboard-metrics .metric-sales { --metric-main: #38bdf8; --metric-glow: rgba(56, 189, 248, .28); }
.dashboard-metrics .metric-orders { --metric-main: #22c55e; --metric-glow: rgba(34, 197, 94, .26); }
.dashboard-metrics .metric-expense { --metric-main: #fb7185; --metric-glow: rgba(251, 113, 133, .28); }
.dashboard-metrics .metric-advance { --metric-main: #fbbf24; --metric-glow: rgba(251, 191, 36, .28); }

.dashboard-metrics .metric::after {
    height: 4px;
    background: linear-gradient(90deg, var(--metric-main), transparent);
}

.dashboard-metrics .metric::before {
    background: var(--metric-glow);
}

.dashboard-metrics .metric span,
.dashboard-metrics .metric small {
    color: rgba(243, 251, 250, .66);
}

.dashboard-metrics .metric strong {
    margin: 18px 0 8px;
    color: #fff;
}

.dashboard-metrics .metric-top b {
    background: color-mix(in srgb, var(--metric-main) 18%, transparent);
    color: var(--metric-main);
}

.dashboard-metrics .metric-bottom em {
    background: rgba(255, 255, 255, .08);
    color: rgba(243, 251, 250, .8);
}

.metric-chart {
    height: 58px;
    margin: 4px -2px 12px;
}

.metric-chart svg {
    width: 100%;
    height: 100%;
    display: block;
}

.spark-area {
    fill: color-mix(in srgb, var(--metric-main) 35%, transparent);
}

.spark-line {
    fill: none;
    stroke: var(--metric-main);
    stroke-width: 4;
    stroke-linecap: round;
}

.intelligence-panel {
    border-color: rgba(71, 197, 154, .16);
    background:
        linear-gradient(180deg, rgba(9, 26, 31, .9), rgba(9, 18, 24, .9)),
        var(--panel);
    color: #f3fbfa;
}

.intelligence-panel .panel-head span,
.intelligence-grid p {
    color: rgba(243, 251, 250, .62);
}

.intelligence-grid article {
    border-color: rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 90% 20%, rgba(71, 197, 154, .14), transparent 96px),
        rgba(255, 255, 255, .045);
    position: relative;
    overflow: hidden;
}

.intelligence-grid article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #22c55e, #38bdf8, #fbbf24);
}

.commerce-panel,
.action-panel {
    border-color: rgba(56, 189, 248, .14);
    background:
        radial-gradient(circle at 92% 0%, rgba(56, 189, 248, .14), transparent 260px),
        radial-gradient(circle at 4% 100%, rgba(251, 191, 36, .12), transparent 250px),
        linear-gradient(180deg, rgba(8, 22, 29, .94), rgba(8, 17, 23, .92));
    color: #f4fbfb;
}

.commerce-panel .panel-head span,
.action-panel .panel-head span {
    color: rgba(244, 251, 251, .62);
}

.content-grid {
    display: grid;
    grid-template-columns: 1.55fr .75fr;
    gap: 18px;
}

.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
}

.panel-head span {
    color: var(--muted);
    font-weight: 750;
}

.business-list,
.quick-actions,
.advance-list {
    display: grid;
    gap: 12px;
}

.business-list article,
.quick-actions a,
.advance-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--row), var(--panel-soft));
}

.commerce-panel .business-list article,
.action-panel .quick-actions a {
    border-color: rgba(255, 255, 255, .08);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)),
        rgba(255, 255, 255, .025);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.store-row {
    display: grid !important;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, .9fr);
    position: relative;
    overflow: hidden;
}

.store-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-icon {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), var(--gold));
    color: #fff;
    font-weight: 950;
}

.store-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.store-stats span {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 72%, transparent);
    font-weight: 900;
}

.commerce-panel .store-stats span {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .045);
    color: #f4fbfb;
}

.store-stats small {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.commerce-panel .store-stats small,
.commerce-panel .business-list small,
.action-panel .quick-actions a small {
    color: rgba(244, 251, 251, .58);
}

.store-progress {
    grid-column: 1 / -1;
    height: 7px;
    margin-top: 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.store-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #38bdf8, #fbbf24);
    box-shadow: 0 0 24px rgba(56, 189, 248, .28);
}

.business-list small,
.advance-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.quick-actions a {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    font-weight: 850;
    border-left: 0;
    padding: 14px;
}

.quick-actions a span {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    font-weight: 950;
}

.action-panel .quick-actions a span {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}

.quick-actions a strong,
.quick-actions a small {
    display: block;
}

.quick-actions a small {
    color: var(--muted);
    font-size: 12px;
}

.split {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--ink) 8%, var(--panel-soft));
    letter-spacing: .2px;
}

td {
    font-weight: 650;
    background: color-mix(in srgb, var(--panel) 84%, var(--panel-soft));
}

tbody tr:last-child td {
    border-bottom: 0;
}

td:first-child {
    font-weight: 900;
}

td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
    white-space: nowrap;
}

.money-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
}

.money-pill {
    background: var(--chip);
    color: var(--green-dark);
}

.status-pill {
    background: color-mix(in srgb, var(--gold) 16%, transparent);
    color: var(--yellow);
}

.status-approved,
.status-high,
.status-admin,
.status-manager {
    background: var(--chip);
    color: var(--green-dark);
}

.status-rejected {
    background: color-mix(in srgb, var(--red) 14%, transparent);
    color: var(--red);
}

tbody tr:hover td {
    background: var(--row-hover);
}

.advance-list article {
    align-items: stretch;
}

.advance-list article > div {
    min-width: 240px;
}

.advance-list article form {
    width: min(520px, 100%);
    grid-template-columns: 120px 140px 1fr 100px;
    align-items: end;
}

.announcement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.announcement {
    min-height: 220px;
}

.announcement p {
    color: var(--muted);
    line-height: 1.7;
}

.badge {
    display: inline-block;
    margin-bottom: 18px;
    background: #edf7f1;
    color: var(--green-dark);
    border-color: #bee5cf;
}

.badge.high {
    background: #fff5e8;
    color: var(--yellow);
    border-color: #f7d6a9;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 16px;
    align-items: start;
}

.profile-hero {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--hero-filter) 96%, transparent), var(--hero-filter)),
        url("https://images.unsplash.com/photo-1551836022-d5d88e9218df?auto=format&fit=crop&w=900&q=80") center/cover;
    color: #fff;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    margin: 16px 0 18px;
    background: linear-gradient(135deg, var(--green), var(--gold));
    font-size: 34px;
    box-shadow: 0 18px 35px rgba(0, 0, 0, .22);
}

.profile-hero h2 {
    margin-bottom: 6px;
}

.profile-hero p {
    margin: 0 0 26px;
    color: rgba(255, 255, 255, .78);
}

.profile-facts {
    width: 100%;
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.profile-facts article {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    text-align: left;
}

.profile-facts span,
.readonly-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.profile-facts span {
    color: rgba(255, 255, 255, .64);
}

.profile-facts strong,
.readonly-grid strong {
    display: block;
    margin-top: 5px;
}

.profile-main {
    display: grid;
    gap: 16px;
}

.readonly-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.readonly-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.sheet-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.sheet-side {
    position: static;
}

.sheet-side form {
    grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) minmax(280px, 420px) auto;
    align-items: end;
}

.sheet-side .panel-head,
.sheet-side .formula-help {
    grid-column: 1 / -1;
}

.sheet-panel {
    padding: 14px;
}

.formula-help {
    display: grid;
    gap: 9px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ink) 8%, var(--panel-soft));
}

.formula-help strong {
    font-size: 13px;
}

.formula-help code {
    display: block;
    padding: 9px 10px;
    border-radius: 7px;
    background: var(--field);
    color: var(--green-dark);
    font-weight: 900;
}

.sheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.spreadsheet-wrap {
    overflow: auto;
    border: 2px solid #101010;
    border-radius: 0;
    background: #e9e9e9;
    width: 100%;
}

.spreadsheet {
    min-width: 2500px;
    border-collapse: separate;
    border-spacing: 0;
    background: #e9e9e9;
    font-family: Arial, Helvetica, sans-serif;
}

.spreadsheet th,
.spreadsheet td {
    min-width: 156px;
    padding: 0;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
}

.spreadsheet th {
    display: none;
    height: 0;
    width: 0;
    min-width: 0;
    padding: 0;
}

.spreadsheet tbody th {
    display: none;
}

.spreadsheet td {
    height: 30px;
}

.spreadsheet thead {
    display: none;
}

/*
.spreadsheet th {
    text-align: center;
    background: color-mix(in srgb, var(--ink) 14%, var(--panel-soft));
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
}

.spreadsheet th:first-child {
    min-width: 46px;
    width: 46px;
}
*/

.spreadsheet input {
    width: 100%;
    min-height: 36px;
    border: 0;
    border-radius: 0;
    background: #efefef;
    color: #050505;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    padding: 4px 8px;
}

.spreadsheet input:focus {
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 0 2px var(--green);
}

.spreadsheet input.formula-cell {
    background: inherit;
    color: #050505;
    font-weight: 900;
}

.spreadsheet .sheet-title-row td input,
.spreadsheet .sheet-title-row th,
.spreadsheet .sheet-total-row td input,
.spreadsheet .sheet-total-row th {
    color: #050505;
    font-weight: 950;
}

.spreadsheet .sheet-title-row td input {
    background: #ffed00;
}

.spreadsheet .sheet-total-row td input,
.spreadsheet .sheet-total-row th {
    background: #8b8b8b;
    color: #050505;
}

.spreadsheet .sheet-date-col input {
    background: #ffef00;
    color: #050505;
    text-align: left;
}

.spreadsheet .sheet-green-cell input {
    background: #00ff00 !important;
    color: #050505 !important;
}

.spreadsheet .sheet-red-note input {
    background: #e58f8f !important;
    color: #050505 !important;
}

.spreadsheet .sheet-blue-note input {
    background: #98bdea !important;
    color: #050505 !important;
}

.spreadsheet .sheet-offday input {
    background: #efc3c3 !important;
    color: #050505 !important;
    font-weight: 950;
}

.spreadsheet .sheet-accent-col input {
    background: #f5e8bd;
}

.spreadsheet .sheet-blue-col input {
    background: #bfd4f2;
}

.spreadsheet .sheet-cream-col input {
    background: #f4e3ca;
}

.spreadsheet .sheet-red-col input {
    background: #ff1010;
    color: #050505;
}

.spreadsheet .sheet-yellow-col input {
    background: #ffef00;
    color: #050505;
}

.sheet-theme-ya_kosarsa .sheet-title-row td input,
.sheet-theme-ya_kosarsa .sheet-title-row th {
    background: #404040;
    color: #fff;
}

.sheet-theme-pro_iddaa td:nth-child(2) input,
.sheet-theme-pro_iddaa td:nth-child(3) input,
.sheet-theme-pro_iddaa td:nth-child(4) input {
    background: #e8e8e8;
}

.sheet-theme-pro_iddaa td:nth-child(5) input,
.sheet-theme-pro_iddaa td:nth-child(10) input,
.sheet-theme-pro_iddaa td:nth-child(11) input,
.sheet-theme-pro_iddaa td:nth-child(12) input,
.sheet-theme-pro_iddaa td:nth-child(13) input {
    background: #f7edc7;
}

.sheet-theme-pro_iddaa td:nth-child(14) input,
.sheet-theme-pro_iddaa td:nth-child(15) input,
.sheet-theme-pro_iddaa td:nth-child(16) input {
    background: #d8d8d8;
}

.sheet-theme-ya_kosarsa td:nth-child(3) input,
.sheet-theme-ya_kosarsa td:nth-child(4) input {
    background: #efcaca;
}

.sheet-theme-ya_kosarsa td:nth-child(5) input,
.sheet-theme-ya_kosarsa td:nth-child(6) input,
.sheet-theme-ya_kosarsa td:nth-child(7) input {
    background: #c9dcf6;
}

.sheet-theme-kazikazan .sheet-title-row td input,
.sheet-theme-kazikazan .sheet-title-row th,
.sheet-theme-kazikazan .sheet-date-col input {
    background: #5d9de3;
    color: #050505;
}

.sheet-theme-tenten .sheet-title-row td input,
.sheet-theme-tenten .sheet-title-row th,
.sheet-theme-tenten .sheet-total-row td input {
    background: #ff9700;
    color: #050505;
}

.sheet-theme-yanci .sheet-title-row td input,
.sheet-theme-yanci .sheet-title-row th,
.sheet-theme-yanci .sheet-date-col input,
.sheet-theme-yanci .sheet-total-row td input {
    background: #ff1010;
    color: #050505;
}

.sheet-theme-yanci td input {
    background: #fff1c8;
}

.sheet-theme-yanci td:nth-child(n+8) input {
    background: #f4f4f4;
}

.sheet-theme-yanci td:nth-child(13) input,
.sheet-theme-yanci td:nth-child(14) input {
    background: #ffe59c;
}

.sheet-theme-yanci td:nth-child(4) input {
    background: #efcaca;
}

.sheet-theme-salaries .sheet-title-row td input,
.sheet-theme-salaries .sheet-title-row th,
.sheet-theme-salaries .sheet-total-row td input {
    background: #2f6b56;
    color: #fff;
}

.saved-sheet-grid {
    display: grid;
    gap: 10px;
}

.saved-sheet-grid article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--row), var(--panel-soft));
}

.saved-sheet-grid strong,
.saved-sheet-grid small {
    display: block;
}

.saved-sheet-grid small {
    margin-top: 3px;
    color: var(--muted);
}

.saved-sheets {
    margin-top: 18px;
}

.ops-grid {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.business-workspace {
    display: grid;
    gap: 18px;
}

.business-hero {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(360px, .95fr);
    gap: 24px;
    align-items: end;
    overflow: hidden;
    position: relative;
    min-height: 230px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--panel) 88%, transparent), color-mix(in srgb, var(--panel-soft) 92%, transparent)),
        radial-gradient(circle at 88% 20%, rgba(199, 152, 61, .18), transparent 300px),
        radial-gradient(circle at 12% 12%, rgba(30, 117, 88, .16), transparent 260px);
}

.business-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 auto;
    width: 360px;
    height: 220px;
    background: radial-gradient(circle at bottom right, rgba(30, 117, 88, .18), transparent 66%);
    pointer-events: none;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.business-hero h2 {
    max-width: 820px;
    margin: 0 0 8px;
    font-size: clamp(32px, 4vw, 58px);
    line-height: 1;
}

.business-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.business-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    position: relative;
    z-index: 1;
}

.business-quick-stats article {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .07);
}

.business-quick-stats span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.business-quick-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.business-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 78%, transparent);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .06);
}

.business-tabs a {
    padding: 11px 15px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 900;
    border: 1px solid transparent;
}

.business-tabs a.active,
.business-tabs a:hover {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    border-color: color-mix(in srgb, var(--green) 50%, transparent);
}

.wide-form {
    max-width: none;
}

.business-expense-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
}

.business-expense-layout .table-panel {
    grid-column: 1 / -1;
}

.settings-workspace {
    display: grid;
    gap: 18px;
}

.settings-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    min-height: 180px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--panel) 90%, transparent), color-mix(in srgb, var(--panel-soft) 92%, transparent)),
        radial-gradient(circle at 82% 20%, rgba(30, 117, 88, .18), transparent 290px);
}

.settings-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 46px);
    line-height: 1;
}

.settings-hero p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.settings-hero > strong {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    white-space: nowrap;
}

.settings-list {
    display: grid;
    gap: 12px;
}

.settings-business-row {
    display: grid;
    grid-template-columns: 92px minmax(260px, 1fr) minmax(200px, .45fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--row), var(--panel-soft));
}

.settings-theme-card,
.settings-pages {
    overflow: hidden;
}

.settings-theme-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.theme-option {
    min-height: 112px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--green) 16%, transparent), transparent 110px),
        linear-gradient(180deg, var(--row), var(--panel-soft));
    cursor: pointer;
}

.theme-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--green);
}

.theme-option span,
.theme-option strong,
.theme-option small {
    display: block;
}

.theme-option small,
.settings-page-meta span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.settings-page-grid {
    display: grid;
    gap: 12px;
}

.settings-page-row {
    display: grid;
    grid-template-columns: 92px minmax(260px, 1fr) minmax(220px, .55fr);
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--row), var(--panel-soft));
}

.settings-page-meta {
    min-height: 58px;
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-line input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-line i {
    width: 42px;
    height: 24px;
    position: relative;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 72%, transparent);
    box-shadow: inset 0 0 0 1px var(--line);
}

.switch-line i::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--panel);
    transition: transform .18s ease, background .18s ease;
}

.switch-line input:checked + i {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.switch-line input:checked + i::before {
    transform: translateX(18px);
    background: #fff;
}

.switch-line input:disabled + i {
    opacity: .55;
}

.switch-line strong {
    font-size: 12px;
}

.settings-savebar {
    position: sticky;
    bottom: 16px;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.intelligence-panel {
    margin-bottom: 18px;
}

.intelligence-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.intelligence-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--row), var(--panel-soft));
}

.intelligence-grid strong {
    display: block;
    margin-bottom: 7px;
}

.intelligence-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.intelligence-panel {
    border-color: color-mix(in srgb, var(--green) 18%, var(--line));
    background:
        radial-gradient(circle at 92% 10%, rgba(56, 189, 248, .14), transparent 260px),
        radial-gradient(circle at 4% 100%, rgba(251, 191, 36, .12), transparent 240px),
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #fff), var(--panel-soft));
    color: var(--text);
}

.intelligence-panel .panel-head span {
    color: var(--muted);
}

.intel-card.intel-card {
    min-height: 142px;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-color: color-mix(in srgb, var(--intel) 26%, var(--line));
    background:
        radial-gradient(circle at 96% 8%, color-mix(in srgb, var(--intel) 20%, transparent), transparent 120px),
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, #fff), color-mix(in srgb, var(--panel-soft) 96%, #fff));
    box-shadow: 0 12px 28px rgba(17, 29, 34, .07);
}

.intel-card::before {
    width: 5px;
    background: linear-gradient(180deg, var(--intel), color-mix(in srgb, var(--intel) 28%, transparent));
}

.intel-cyan { --intel: #22c1ee; }
.intel-violet { --intel: #9b6dff; }
.intel-rose { --intel: #ff5f7e; }
.intel-amber { --intel: #f6b73c; }
.intel-green { --intel: #25c36b; }
.intel-blue { --intel: #3b82f6; }

.intel-ring {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--panel) 52%, transparent 53%),
        conic-gradient(var(--intel) var(--score), color-mix(in srgb, var(--line) 64%, transparent) 0);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--intel) 22%, transparent),
        0 16px 30px color-mix(in srgb, var(--intel) 16%, transparent);
}

.intel-ring strong {
    max-width: 58px;
    margin: 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.05;
    text-align: center;
    overflow-wrap: anywhere;
}

.intel-copy {
    min-width: 0;
}

.intel-copy strong {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 15px;
}

.intel-copy p {
    color: var(--muted);
}

.intel-copy span {
    display: block;
    height: 7px;
    margin-top: 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 70%, transparent);
    overflow: hidden;
}

.intel-copy span i {
    display: block;
    width: var(--score);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--intel), color-mix(in srgb, var(--intel) 42%, #fff));
}

:root[data-theme="dark"] .intelligence-panel {
    border-color: rgba(71, 197, 154, .16);
    background:
        linear-gradient(180deg, rgba(9, 26, 31, .9), rgba(9, 18, 24, .9)),
        var(--panel);
    color: #f3fbfa;
}

:root[data-theme="dark"] .intel-card.intel-card {
    border-color: rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--intel) 24%, transparent), transparent 110px),
        rgba(255, 255, 255, .045);
}

:root[data-theme="dark"] .intel-ring {
    background:
        radial-gradient(circle, #101f26 52%, transparent 53%),
        conic-gradient(var(--intel) var(--score), rgba(255, 255, 255, .1) 0);
}

:root[data-theme="dark"] .intel-ring strong,
:root[data-theme="dark"] .intel-copy strong {
    color: #f4fbfb;
}

:root[data-theme="dark"] .intel-copy p,
:root[data-theme="dark"] .intelligence-panel .panel-head span {
    color: rgba(243, 251, 250, .62);
}

.command-card {
    min-height: 420px;
}

.goal-ring {
    width: 190px;
    height: 190px;
    margin: 8px auto 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--panel) 55%, transparent 56%),
        conic-gradient(var(--green) var(--value), color-mix(in srgb, var(--line) 70%, transparent) 0);
    box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px rgba(0, 0, 0, .18);
}

.goal-ring strong,
.goal-ring span {
    grid-area: 1 / 1;
    display: block;
    text-align: center;
}

.goal-ring strong {
    margin-bottom: 22px;
    font-size: 42px;
}

.goal-ring span {
    margin-top: 44px;
    color: var(--muted);
    font-weight: 900;
    text-transform: uppercase;
}

@media (max-width: 1100px) {
    .metric-grid,
    .announcement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        grid-template-columns: 1fr;
        margin: -30px -34px 24px;
    }

    .top-logo {
        justify-self: start;
        order: -1;
    }

    .content-grid,
    .split,
    .chat-shell,
    .profile-layout,
    .sheet-workspace,
    .ops-grid,
    .business-expense-layout,
    .business-hero,
    .intelligence-grid,
    .settings-business-row,
    .settings-theme-options,
    .settings-page-row {
        grid-template-columns: 1fr;
    }

    .settings-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .store-row {
        grid-template-columns: 1fr;
    }

    .sheet-side {
        position: static;
    }

    .sheet-side form {
        grid-template-columns: 1fr;
    }

    .profile-hero {
        min-height: auto;
    }

    .chat-sidebar {
        max-height: none;
    }

    .chat-group-list {
        max-height: 220px;
    }
}

@media (max-width: 760px) {
    .login-card {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .login-choice-panel {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .login-choice {
        min-height: 220px;
        padding: 22px;
    }

    .login-choice::after {
        inset: auto 22px 20px 22px;
    }

    .login-choice strong {
        max-width: 260px;
        font-size: 30px;
    }

    .login-choice small {
        max-width: 260px;
        margin: 10px 0 18px;
        font-size: 13px;
    }

    .login-form {
        padding: 30px;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(312px, 86vw);
        z-index: 12000;
        transform: translateX(-105%);
        transition: transform .22s ease;
        overflow-y: auto;
        box-shadow: 24px 0 60px rgba(0, 0, 0, .32);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 11000;
        background: rgba(0, 0, 0, .48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-btn {
        position: sticky;
        top: 12px;
        z-index: 13000;
        width: 46px;
        height: 42px;
        display: inline-grid;
        gap: 5px;
        align-content: center;
        justify-content: center;
        margin: 12px 0 -2px 20px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--glass);
        box-shadow: 0 12px 26px rgba(0, 0, 0, .16);
        backdrop-filter: blur(12px);
        cursor: pointer;
    }

    body.sidebar-open .mobile-menu-btn {
        opacity: 0;
        pointer-events: none;
        z-index: 9000;
    }

    .mobile-menu-btn span {
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: var(--text);
        transition: transform .18s ease, opacity .18s ease;
    }

    body.sidebar-open .mobile-menu-btn span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.sidebar-open .mobile-menu-btn span:nth-child(2) {
        opacity: 0;
    }

    body.sidebar-open .mobile-menu-btn span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .main {
        margin-left: 0;
        padding: 14px 20px 20px;
    }

    .topbar {
        align-items: center;
        grid-template-columns: 1fr;
        margin: 0 -20px 20px;
        padding: 12px 16px;
        gap: 12px;
        min-height: 0;
        z-index: 10;
    }

    .top-logo {
        display: none;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .breadcrumb {
        margin-top: 4px;
        font-size: 11px;
    }

    .top-actions {
        display: grid;
        grid-template-columns: 1fr 104px minmax(0, 1fr);
        align-items: stretch;
        gap: 10px;
    }

    .business-scope {
        grid-column: 1 / -1;
    }

    .business-scope label {
        min-width: 0;
    }

    .refresh-pill,
    .time-pill,
    .icon-pill {
        display: none;
    }

    .user-pill {
        min-width: 0;
        width: 100%;
        height: 42px;
        padding: 6px 8px;
    }

    .user-pill .avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .user-pill .user-meta strong {
        font-size: 13px;
    }

    .user-pill .user-meta small {
        font-size: 11px;
    }

    .profile-card {
        right: auto;
        left: auto;
        right: 0;
        width: min(300px, calc(100vw - 32px));
    }

    .metric-grid,
    .announcement-grid,
    .form-grid,
    .readonly-grid,
    .store-stats {
        grid-template-columns: 1fr;
    }

    .chat-room-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .chat-room-title h2 {
        font-size: 18px;
    }

    .chat-messages {
        min-height: 420px;
        padding: 18px 14px;
    }

    .chat-message,
    .chat-message.mine {
        width: 100%;
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .chat-message.mine .chat-author-avatar,
    .chat-message.mine .chat-bubble {
        grid-column: auto;
        grid-row: auto;
    }

    .chat-author-avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    .chat-composer {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .chat-composer button {
        grid-column: 1 / -1;
        min-height: 42px;
    }

    .advance-list article,
    .advance-list article form {
        grid-template-columns: 1fr;
        display: grid;
    }
}

@media (min-width: 1101px) and (max-width: 1320px) {
    .topbar {
        grid-template-columns: minmax(170px, max-content) minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    .top-logo {
        display: none !important;
    }

    .top-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: minmax(150px, 1fr) auto auto auto minmax(150px, 170px) !important;
        align-items: center;
        justify-content: end;
        justify-items: stretch;
        gap: 10px;
    }

    .business-scope label {
        width: 100% !important;
        min-width: 0 !important;
    }

    .business-scope select {
        min-width: 0;
    }

    .time-pill {
        white-space: nowrap;
        padding-inline: 10px;
    }

    .theme-toggle {
        width: 104px;
    }

    :root[data-theme="dark"] .theme-toggle::before {
        transform: translateX(48px);
    }

    .profile-menu,
    .user-pill {
        min-width: 0;
    }

    .user-pill {
        width: 100%;
        max-width: 170px;
    }
}

.chat-sidebar.panel,
.chat-panel.panel {
    padding: 0;
}

.chat-panel.panel {
    grid-template-columns: minmax(0, 1fr);
}

.chat-panel > *,
.chat-composer {
    min-width: 0;
}
