@font-face
{
    font-family: Montserrat;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('brand/montserrat-regular.ttf') format('truetype');
}

@font-face
{
    font-family: Montserrat;
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('brand/montserrat-semibold.ttf') format('truetype');
}

@font-face
{
    font-family: Montserrat;
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('brand/montserrat-bold.ttf') format('truetype');
}

:root
{
    --ink: #303030;
    --primary: #1e73be;
    --primary-dark: #19609e;
    --brand-dark: #0a0a0a;
    --brand-accent: #ffd401;
    --muted: #66717e;
    --border: #e0e5eb;
    --paper: #ffffff;
    --bg: #f6f6f6;
    --blue-soft: #edf5fc;
    --danger: #b42639;
}

*
{
    box-sizing: border-box;
}

body
{
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 14px/1.6 Montserrat, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

a
{
    color: var(--primary-dark);
    text-decoration: none;
    text-underline-offset: 3px;
}

a:hover
{
    text-decoration: underline;
}

h1,
h2,
h3
{
    color: #20252b;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

h1
{
    margin: 0 0 9px;
    font-size: clamp(25px, 2.2vw, 32px);
    letter-spacing: -1px;
}

h2
{
    margin: 0 0 18px;
    font-size: 18px;
    letter-spacing: -.35px;
}

h3
{
    font-size: 16px;
}

p
{
    max-width: 78ch;
    overflow-wrap: anywhere;
}

small,
.muted
{
    color: var(--muted);
}

small
{
    font-size: 12px;
}

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

button,
.btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid #cdd6df;
    border-radius: 6px;
    background: var(--paper);
    color: #394653;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

button:hover,
.btn:hover
{
    background: #f0f5fa;
    border-color: #a9bfd3;
    text-decoration: none;
}

button.primary,
.btn.primary
{
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

button.primary:hover,
.btn.primary:hover
{
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

button.danger
{
    color: var(--danger);
    border-color: #edcbd0;
}

button.danger:hover
{
    background: #fff1f3;
    border-color: #d8a0aa;
}

button:disabled
{
    opacity: .55;
    cursor: not-allowed;
}

button.is-loading
{
    cursor: progress;
}

button.is-loading::before
{
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: .5em;
    vertical-align: -.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-loading .7s linear infinite;
}

@keyframes button-loading
{
    to
    {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce)
{
    button.is-loading::before
    {
        animation: none;
    }
}

:focus-visible
{
    outline: 3px solid #86b8e5;
    outline-offset: 3px;
}

input,
select,
textarea
{
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cdd6df;
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
}

input::placeholder,
textarea::placeholder
{
    color: #74808c;
}

input:focus,
select:focus,
textarea:focus
{
    border-color: var(--primary);
    outline: 3px solid #d9eafb;
    outline-offset: 0;
}

input[type=checkbox],
input[type=radio]
{
    width: 16px;
    min-height: 16px;
    height: 16px;
    accent-color: var(--primary);
    vertical-align: middle;
}

label
{
    display: block;
    margin-bottom: 7px;
    color: #465361;
    font-size: 12px;
    font-weight: 600;
}

form .field
{
    margin-bottom: 20px;
}

header.top
{
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 80px;
    padding: 12px 28px;
    background: var(--brand-dark);
    color: #fff;
    border-bottom: 3px solid var(--primary);
}

.brand
{
    display: flex;
    align-items: center;
    flex: 0 0 208px;
    min-width: 0;
}

.brand img
{
    display: block;
    width: 194px;
    max-width: 100%;
    height: auto;
}

.workspace-name
{
    padding-left: 24px;
    border-left: 1px solid #393939;
    color: #e3e7eb;
    font-size: 14px;
    font-weight: 600;
}

.account-area
{
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.account-person
{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
}

.account-person b
{
    display: block;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.account-person small
{
    display: block;
    color: #b6bdc5;
    font-size: 11px;
}

.account-avatar
{
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #435269;
    border-radius: 50%;
    background: #182737;
    color: #d9ebfc;
    font-size: 13px;
    font-weight: 600;
}

.header-action
{
    min-height: 34px;
    padding: 7px 11px;
    border-color: #3e454d;
    background: transparent;
    color: #e4e8ed;
    font-size: 11px;
}

.header-action:hover
{
    background: #202a34;
    border-color: #61778a;
    color: white;
}

.shell
{
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: calc(100vh - 80px);
}

aside.nav
{
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    align-self: start;
    height: calc(100vh - 80px);
    padding: 28px 16px 18px;
    overflow-y: auto;
    background: var(--paper);
    border-right: 1px solid var(--border);
}

aside.nav nav>a
{
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    margin-bottom: 5px;
    padding: 11px 14px;
    border-radius: 6px;
    color: #56616d;
    font-size: 12px;
    font-weight: 600;
}

aside.nav nav>a svg
{
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
}

aside.nav nav>a.active,
aside.nav nav>a:hover
{
    background: var(--blue-soft);
    color: var(--primary-dark);
    text-decoration: none;
}

aside.nav nav>a.active::before
{
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--primary);
    content: '';
}

aside.nav nav>a.nav-settings
{
    margin-top: 25px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
}

.nav-footer
{
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: auto;
    padding: 32px 14px 0;
    color: var(--muted);
    font-size: 10px;
}

.nav-footer a
{
    align-self: start;
    color: #596979;
    font-size: 11px;
}

main
{
    width: 100%;
    min-width: 0;
    padding: 34px 32px 48px;
}

main:focus
{
    outline: none;
}

.page-head
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-head p
{
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.page-head>div
{
    min-width: 0;
    max-width: 100%;
}

.page-head>div>a:first-child
{
    display: inline-block;
    margin-bottom: 9px;
    font-size: 12px;
}

.panel
{
    min-width: 0;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--paper);
}

.stats
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
    margin-bottom: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--paper);
}

.stat
{
    min-width: 0;
    padding: 20px 22px;
    border-right: 1px solid var(--border);
}

.stat:last-child
{
    border-right: 0;
}

.stat small
{
    display: block;
    font-size: 11px;
    font-weight: 600;
}

.stat b
{
    display: block;
    margin-top: 10px;
    color: var(--primary-dark);
    font-size: clamp(20px, 1.7vw, 28px);
    font-weight: 600;
    letter-spacing: -.7px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.dashboard-head
{
    margin-bottom: 22px;
}

.dashboard-stats
{
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stats .stat
{
    padding: 18px 20px;
}

.dashboard-stats .stat:nth-child(4n)
{
    border-right: 0;
}

.dashboard-stats .stat b
{
    margin-top: 6px;
    color: var(--ink);
    font-size: clamp(20px, 2vw, 28px);
}

.dashboard-stats .stat:nth-child(3)
{
    background: var(--blue-soft);
}

.dashboard-stats .stat:nth-child(3) b
{
    color: var(--primary-dark);
}

.dashboard-stats .stat:nth-child(n+5)
{
    padding-top: 13px;
    padding-bottom: 13px;
    border-top: 1px solid var(--border);
}

.dashboard-stats .stat:nth-child(n+5) b
{
    font-size: 17px;
    letter-spacing: -.3px;
}

.dashboard-section-head
{
    margin-bottom: 22px;
}

.dashboard-section-head h2
{
    margin-bottom: 5px;
}

.dashboard-section-head p
{
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-trend-body
{
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
    align-items: start;
    gap: 28px;
}

.dashboard-trend #trend-chart
{
    min-width: 0;
}

.dashboard-trend svg
{
    display: block;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.chart-legend
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.chart-legend span
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-legend i
{
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: var(--primary);
}

.chart-legend .legend-cost
{
    background: #b4c6d8;
}

.chart-legend .legend-margin
{
    height: 2px;
    width: 14px;
    background: var(--ink);
}

.dashboard-trend-table
{
    max-height: 268px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.dashboard-trend-table th
{
    position: sticky;
    top: 0;
}

.dashboard-trend-table th,
.dashboard-trend-table td
{
    padding: 12px 10px;
    white-space: nowrap;
}

.dashboard-invoices td
{
    padding-top: 15px;
    padding-bottom: 15px;
}

.dashboard-invoices tbody a
{
    font-weight: 600;
}

@media(max-width:1280px)
{
    .dashboard-trend-body
    {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }
}

@media(max-width:600px)
{
    .dashboard-stats
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stats .stat
    {
        padding: 15px 13px;
    }

    .dashboard-stats .stat:nth-child(2n)
    {
        border-right: 0;
    }

    .dashboard-stats .stat:nth-child(n+3)
    {
        border-top: 1px solid var(--border);
    }

    .dashboard-stats .stat b
    {
        font-size: 20px;
    }
}

.toolbar,
.inline
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar
{
    margin-bottom: 20px;
}

.toolbar input,
.toolbar select
{
    max-width: 260px;
}

.toolbar label
{
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.table-wrap,
.chart-scroll
{
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

table
{
    width: 100%;
    border-collapse: collapse;
    font: 13px/1.55 'Segoe UI', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}

th,
td
{
    padding: 13px 12px;
    border-bottom: 1px solid #e9edf1;
    text-align: left;
    vertical-align: middle;
}

th
{
    background: #f5f7fa;
    color: #5e6b78;
    font-family: Montserrat, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

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

tr:hover>td
{
    background: #f8fbfe;
}

td.right,
th.right
{
    text-align: right;
}

td.num
{
    font-variant-numeric: tabular-nums;
}

td input,
td select
{
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
}

td button
{
    min-height: 30px;
    padding: 6px 9px;
    font-size: 10px;
}

.total-row>td
{
    background: #e9f2fb;
    color: #195486;
    font-weight: 700;
}

.subtotal-row>td
{
    background: #f5f7fa;
    font-weight: 600;
}

.tag
{
    display: inline-block;
    margin: 3px 5px 3px 0;
    padding: 3px 7px;
    border-radius: 4px;
    background: #eaf1f8;
    color: #466580;
    font: 600 10px/1.5 Montserrat, 'Segoe UI', sans-serif;
    vertical-align: middle;
}

.cell-meta,
.table-actions
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cell-meta
{
    margin-top: 7px;
}

.cell-meta>.tag,
.table-actions>.tag
{
    margin: 0;
}

.table-actions>.btn,
.table-actions>button
{
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 11px;
    font-size: 11px;
}

.table-actions-stacked
{
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.permission-tags
{
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 170px;
    max-width: 340px;
}

.permission-tags>.tag
{
    margin: 0;
}

.permission-option
{
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.permission-option input
{
    flex: 0 0 16px;
    margin: 0;
}

#subs
{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.subcustomer-item
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.subcustomer-item>.tag
{
    margin: 0;
}

.price-history-row
{
    margin: 8px 0;
}

.cell-note
{
    display: block;
    margin-top: 5px;
}

.adjustment-detail
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 250px;
    margin-top: 10px;
    border-radius: 5px;
}

.adjustment-content
{
    min-width: 0;
}

.adjustment-detail .cell-meta
{
    margin-top: 0;
}

.adjustment-detail p
{
    margin: 7px 0 0;
    font-size: 12px;
}

.adjustment-note
{
    color: var(--muted);
    overflow-wrap: anywhere;
}

.adjustment-user
{
    display: block;
    margin-top: 7px;
    overflow-wrap: anywhere;
}

.adjustment-detail>button
{
    flex: 0 0 auto;
    margin-top: 2px;
}

@media(max-width:800px)
{
    .table-actions>.btn,
    .table-actions>button,
    .adjustment-detail>button
    {
        min-height: 44px;
    }
}

.tag.warn
{
    background: #fff3cd;
    color: #775700;
}

.tag.good
{
    background: #e2f4ec;
    color: #216448;
}

.tag.bad
{
    background: #ffe8ec;
    color: #a7253a;
}

.notice
{
    margin: 16px 0;
    padding: 14px 17px;
    border: 1px solid #e9d89e;
    border-left: 3px solid #cbab38;
    border-radius: 5px;
    background: #fffbee;
    color: #6c5925;
    font-size: 12px;
}

.error
{
    color: var(--danger);
}

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

.row>*
{
    min-width: 0;
}

.row.three
{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row.two
{
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty
{
    padding: 42px 20px;
    color: var(--muted);
    text-align: center;
}

.modal-backdrop
{
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #101a2bb3;
}

.modal
{
    width: 100%;
    max-width: 800px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 20px 70px #0a182e38;
    overscroll-behavior: contain;
}

.modal h2
{
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    font-size: 21px;
}

.modal-footer
{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

details summary
{
    color: var(--primary-dark);
    cursor: pointer;
}

details[open]>summary
{
    margin-bottom: 12px;
}

.drawer
{
    padding: 14px;
    background: #f5f8fc;
}

.mono
{
    font-family: ui-monospace, SFMono-Regular, monospace;
}

.nowrap
{
    white-space: nowrap;
}

.pdf-dropzone
{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 300px;
    padding: 48px 24px;
    gap: 14px;
    border: 2px dashed #9dbfdf;
    border-radius: 8px;
    background: #f8fbfe;
    color: var(--primary);
    text-align: center;
    white-space: normal;
}

.pdf-dropzone strong
{
    color: #2d465e;
    font-size: 19px;
    font-weight: 600;
}

.pdf-dropzone>span
{
    color: var(--primary-dark);
    font-size: 13px;
}

.pdf-dropzone:hover,
.pdf-dropzone.drop-active
{
    background: #edf5fd;
    border-color: var(--primary);
}

.pdf-dropzone[aria-busy="true"]
{
    cursor: wait;
}

#upload-status:empty
{
    display: none;
}

#upload-help
{
    margin-bottom: 0;
    font-size: 11px;
}

#toast
{
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    display: none;
    max-width: min(420px, calc(100vw - 32px));
    padding: 16px 22px;
    border-left: 4px solid #4c9de2;
    border-radius: 6px;
    background: #172a3c;
    color: #fff;
    box-shadow: 0 8px 30px #0b1d3333;
    font-size: 12px;
}

#toast.error
{
    background: #792438;
    border-left-color: #ed8a9c;
}

svg text
{
    fill: var(--muted);
}

#menu-toggle
{
    display: none;
    padding: 7px;
    border-color: #48525f;
    background: transparent;
    color: #fff;
}

#menu-toggle svg
{
    width: 22px;
    height: 22px;
}

.nav-backdrop
{
    display: none;
}

.skip-link
{
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 1000;
    padding: 12px 18px;
    border-radius: 4px;
    background: white;
    color: var(--primary-dark);
}

.skip-link:focus
{
    top: 10px;
}

.auth-wrap
{
    display: grid;
    grid-template-columns: minmax(340px, 43%) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100svh;
}

.auth-brand
{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 64px;
    padding: 54px clamp(32px, 5vw, 76px);
    border-right: 5px solid var(--primary);
    background: var(--brand-dark);
    color: #fff;
}

.auth-logo
{
    align-self: flex-start;
}

.auth-logo img
{
    display: block;
    width: 225px;
    max-width: 100%;
    height: auto;
}

.auth-intro h2
{
    margin: 30px 0 24px;
    color: white;
    font-size: clamp(32px, 3.4vw, 52px);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -1.8px;
}

.auth-intro p
{
    color: #b5bec9;
    font-size: 14px;
    line-height: 1.9;
}

.auth-rule
{
    display: block;
    width: 48px;
    height: 4px;
    background: var(--brand-accent);
}

.auth-site
{
    align-self: flex-start;
    color: #c1ccd8;
    font-size: 12px;
}

.auth-site span
{
    margin-left: 18px;
    color: #60a9e7;
}

.auth-main
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: #fff;
}

.auth-card
{
    width: 100%;
    max-width: 390px;
    min-width: 0;
}

.auth-card h1
{
    margin-bottom: 13px;
    font-size: 27px;
    letter-spacing: -.7px;
}

.auth-card>p
{
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 13px;
}

.auth-card form
{
    margin-top: 28px;
}

.auth-card input
{
    min-height: 48px;
}

.auth-card button
{
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    font-size: 13px;
}

.auth-card form+p
{
    margin-top: 24px;
    font-size: 12px;
}

.auth-note
{
    margin: 54px 0 0;
    color: #73808d;
    font-size: 10px;
    text-align: center;
}

[hidden]
{
    display: none !important;
}

@media(min-width:1700px)
{
    main
    {
        max-width: 1720px;
        margin: 0 auto;
        padding-right: 48px;
        padding-left: 48px;
    }
}

@media(max-width:1100px)
{
    .shell
    {
        grid-template-columns: 216px minmax(0, 1fr);
    }

    header.top
    {
        gap: 16px;
        padding-right: 20px;
        padding-left: 20px;
    }

    .brand
    {
        flex-basis: 178px;
    }

    .brand img
    {
        width: 174px;
    }

    .workspace-name
    {
        padding-left: 18px;
        font-size: 12px;
    }

    main
    {
        padding: 28px 22px;
    }

    aside.nav
    {
        padding-right: 10px;
        padding-left: 10px;
    }

    .account-person
    {
        margin-right: 0;
    }

    .account-person b
    {
        max-width: 140px;
    }

    .row,
    .row.three
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:800px)
{

    input,
    select,
    textarea,
    td input,
    td select
    {
        font-size: 16px;
        min-height: 44px;
    }

    input[type=checkbox],
    input[type=radio]
    {
        min-height: 16px;
    }

    button,
    .btn,
    td button
    {
        min-height: 44px;
        min-width: 44px;
    }

    .permission-option
    {
        min-height: 44px;
    }

    .toolbar>input,
    .toolbar>select,
    .toolbar>label
    {
        flex: 1 1 210px;
        min-width: 0;
    }

    header.top
    {
        min-height: 72px;
        gap: 12px;
        padding: 12px 16px;
    }

    .brand
    {
        flex-basis: auto;
    }

    .brand img
    {
        width: 154px;
    }

    .workspace-name,
    .account-person
    {
        display: none;
    }

    #menu-toggle
    {
        display: inline-flex;
        min-height: 44px;
        width: 44px;
    }

    .account-area
    {
        gap: 8px;
    }

    .header-action
    {
        min-height: 44px;
    }

    .shell
    {
        display: block;
        min-height: calc(100vh - 72px);
    }

    aside.nav
    {
        position: fixed;
        top: 72px;
        bottom: 0;
        left: 0;
        z-index: 14;
        display: none;
        width: 264px;
        height: calc(100dvh - 72px);
        padding: 24px 16px;
        box-shadow: 18px 0 40px #12253a22;
    }

    .nav-backdrop
    {
        position: fixed;
        inset: 72px 0 0;
        z-index: 13;
        display: block;
        width: 100%;
        height: calc(100dvh - 72px);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: #101a2b80;
    }

    .nav-backdrop:hover
    {
        background: #101a2b80;
    }

    body.nav-open
    {
        overflow: hidden;
    }

    aside.nav.open
    {
        display: flex;
    }

    aside.nav nav>a
    {
        min-height: 48px;
        font-size: 13px;
    }

    .page-head
    {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 16px;
    }

    .auth-wrap
    {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-brand
    {
        gap: 0;
        padding: 28px 28px 32px;
        border-right: 0;
        border-bottom: 4px solid var(--primary);
    }

    .auth-logo img
    {
        width: 185px;
    }

    .auth-intro,
    .auth-site
    {
        display: none;
    }

    .auth-main
    {
        justify-content: flex-start;
        padding: 44px 28px;
    }

    .auth-note
    {
        margin-top: 32px;
    }
}

@media(max-width:480px)
{
    header.top
    {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 12px 10px;
    }

    .brand img
    {
        width: 123px;
    }

    .header-action
    {
        padding: 7px 8px;
        font-size: 10px;
    }

    .account-area
    {
        gap: 5px;
    }

    .header-action span
    {
        display: none;
    }

    main
    {
        padding: 24px 14px 36px;
    }

    h1
    {
        font-size: 25px;
    }

    .panel
    {
        padding: 17px;
        border-radius: 8px;
    }

    .stats
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat
    {
        padding: 17px 14px;
        border-bottom: 1px solid var(--border);
    }

    .stat b
    {
        font-size: clamp(16px, 4.4vw, 21px);
    }

    .row,
    .row.two,
    .row.three
    {
        grid-template-columns: 1fr;
    }

    .toolbar input,
    .toolbar select
    {
        max-width: 100%;
    }

    .toolbar>input,
    .toolbar>select,
    .toolbar>label
    {
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
    }

    .toolbar>button
    {
        flex: 1 1 auto;
    }

    .toolbar button,
    .page-head .btn
    {
        min-height: 44px;
    }

    .modal-backdrop
    {
        padding: 12px;
    }

    .modal
    {
        padding: 20px;
        max-height: calc(100dvh - 24px);
    }

    .pdf-dropzone
    {
        min-height: 260px;
        padding: 30px 16px;
    }

    .pdf-dropzone strong
    {
        font-size: 17px;
    }

    #toast
    {
        right: 16px;
        bottom: 16px;
    }
}

@media(pointer:coarse)
{
    button,
    .btn,
    td button,
    .table-actions>.btn,
    .table-actions>button,
    .adjustment-detail>button
    {
        min-width: 44px;
        min-height: 44px;
    }

    .permission-option
    {
        min-height: 44px;
    }
}

@media(prefers-reduced-motion:reduce)
{

    *,
    *::before,
    *::after
    {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
