:root {
    --ink: #202d3d;
    --muted: #738092;
    --line: #e3e8ee;
    --blue: #315bea;
    --bg: #f4f6fa;
    --green: #177b65;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font:
        14px/1.55 system-ui,
        -apple-system,
        Segoe UI,
        sans-serif;
}
a {
    color: var(--blue);
    text-decoration: none;
}
button,
input,
select,
textarea {
    font: inherit;
}
aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 238px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 32px 22px;
    display: flex;
    flex-direction: column;
}
.brand {
    position: relative;
    color: var(--ink);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 2px;
    padding-left: 48px;
    line-height: 1.1;
}
.brand-mark {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 36px;
    height: 39px;
    background: var(--blue);
    color: #fff;
    border-radius: 10px;
    font-size: 23px;
}
.brand-sub {
    display: block;
    font-size: 10px;
    letter-spacing: 0;
    font-weight: 500;
    margin-top: 7px;
    color: var(--muted);
}
.nav-label {
    font-size: 10px;
    letter-spacing: 1.8px;
    color: #8a94a3;
    margin: 36px 12px 12px;
    font-weight: 700;
}
nav a {
    display: block;
    color: #596677;
    border-radius: 8px;
    padding: 11px 13px;
    margin: 4px 0;
    font-weight: 550;
}
nav a span {
    margin-right: 12px;
}
nav a:hover,
nav a.active {
    color: var(--blue);
    background: #edf1ff;
}
.sidebar-foot {
    margin-top: auto;
    padding: 20px 10px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}
.workspace {
    margin-left: 238px;
}
.workspace.guest {
    margin-left: 0;
}
header {
    height: 79px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 0 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
header > span {
    font-weight: 600;
}
.account {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    border-radius: 50%;
    background: #eaf0ff;
    color: var(--blue);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-weight: 700;
}
main {
    max-width: 1660px;
    margin: auto;
    padding: 34px 42px 60px;
}
h1 {
    font-size: 30px;
    letter-spacing: -1px;
    margin: 4px 0 5px;
    line-height: 1.3;
}
h2 {
    font-size: 17px;
    margin: 0 0 20px;
}
h3 {
    font-size: 14px;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 1.6px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.muted,
.subtitle {
    color: var(--muted);
}
.subtitle {
    margin: 0 0 26px;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 26px;
}
.page-head .subtitle {
    margin: 5px 0 0;
}
.actions {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}
.button,
button {
    cursor: pointer;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    padding: 9px 15px;
    border-radius: 7px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}
.primary {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.danger {
    color: #b43c41;
    border-color: #edc4c7;
}
.link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--muted);
    font-size: 12px;
}
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}
.panel-body {
    padding: 24px;
}
.panel-title {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-title h2 {
    margin: 0;
}
.filters,
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    align-items: end;
}
.filters {
    padding: 20px 24px;
}
label {
    display: block;
    font-size: 12px;
    color: #5b697a;
    font-weight: 600;
}
input,
select,
textarea {
    display: block;
    width: 100%;
    border: 1px solid #d8dfe9;
    background: #fff;
    color: var(--ink);
    border-radius: 6px;
    padding: 9px 10px;
    margin-top: 6px;
    min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #b7c6ff;
    border-color: var(--blue);
}
input[type="checkbox"] {
    display: inline-block;
    width: auto;
    margin: 0 7px 0 0;
}
.check {
    display: flex;
    align-items: center;
    padding: 8px 0;
}
.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0;
}
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 22px;
}
.card .label {
    color: var(--muted);
    font-size: 12px;
}
.card .value {
    font-size: 27px;
    font-weight: 720;
    margin: 12px 0 7px;
    letter-spacing: -0.7px;
    white-space: nowrap;
}
.card .foot {
    font-size: 11px;
    color: var(--muted);
}
.card.accent {
    border-top: 3px solid var(--blue);
}
.card.green .value {
    color: var(--green);
}
.table-scroll {
    overflow: auto;
}
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
th {
    text-align: left;
    background: #fafbfe;
    color: #778294;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
th,
td {
    padding: 15px 24px;
    border-bottom: 1px solid #edf0f4;
}
tbody tr:last-child td {
    border-bottom: 0;
}
tbody tr:hover {
    background: #fbfcff;
}
.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.total {
    font-weight: 700;
    background: #f4f7fc;
}
.badge {
    display: inline-block;
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 11px;
    background: #edf2fa;
    color: #506986;
}
.badge.accepted {
    background: #e8f5ef;
    color: #247354;
}
.badge.draft {
    background: #fff3da;
    color: #95711b;
}
.badge.cancelled {
    background: #fcebef;
    color: #ad445b;
}
.empty {
    text-align: center;
    padding: 54px 24px;
    color: var(--muted);
}
.empty strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    margin-bottom: 8px;
}
.notice,
.success,
.error {
    padding: 12px 17px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}
.notice {
    background: #fff5de;
    border: 1px solid #f1e2bb;
    color: #846527;
}
.success {
    background: #e8f5ef;
    color: #247354;
}
.error {
    background: #fcebef;
    color: #9b3047;
}
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
}
.stack > * + * {
    margin-top: 16px;
}
.login {
    max-width: 420px;
    margin: 7vh auto;
}
.login h1 {
    font-size: 26px;
}
.login button {
    width: 100%;
    margin-top: 22px;
}
.small {
    font-size: 11px;
}
.money-input {
    min-width: 125px;
}
.item-edit {
    padding: 22px;
    border-bottom: 1px solid var(--line);
}
.item-edit:last-child {
    border-bottom: 0;
}
.item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.history {
    border-top: 1px solid var(--line);
    padding: 15px 0;
}
details summary {
    cursor: pointer;
    color: var(--blue);
}
pre {
    overflow: auto;
    background: #f5f7fa;
    padding: 12px;
    max-height: 350px;
    font-size: 11px;
}
footer {
    padding: 20px 42px;
    color: #929baa;
    border-top: 1px solid var(--line);
    font-size: 11px;
    display: flex;
    justify-content: space-between;
}
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3px 16px;
}
.pagination svg {
    width: 16px;
}
.pagination {
    padding: 16px;
}
.form-grid .full {
    grid-column: 1/-1;
}
@media (max-width: 1200px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .split {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    aside {
        position: static;
        width: 100%;
        padding: 20px;
    }
    .sidebar-foot,
    .nav-label {
        display: none;
    }
    nav {
        display: flex;
        flex-wrap: wrap;
        margin-top: 20px;
    }
    nav a {
        font-size: 12px;
        padding: 6px 9px;
    }
    .workspace {
        margin: 0;
    }
    header {
        padding: 0 20px;
        height: 65px;
    }
    main {
        padding: 24px 18px;
    }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .cards {
        gap: 10px;
    }
    .card {
        padding: 15px;
    }
    .card .value {
        font-size: 21px;
    }
    th,
    td {
        padding: 12px 16px;
    }
    footer {
        padding: 20px;
    }
    .account {
        font-size: 11px;
    }
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
