/* =============================================================================
   NortSide Connect Portal — design system
   Palette taken from the NortSide Connect brand sheet:
     green  #7EB40A   black #0B0D0A   off-white #F1F5EC
   =========================================================================== */

:root {
    --brand:          #7EB40A;
    --brand-strong:   #96D30C;
    --brand-dark:     #5F880A;
    --brand-tint:     #F0F7DF;
    --brand-tint-2:   #E1EFC2;

    --ink:            #0B0D0A;
    --ink-soft:       #1A1D17;
    --ink-line:       #2A2F26;

    --canvas:         #F1F5EC;
    --surface:        #FFFFFF;
    --surface-2:      #F8FAF4;
    --border:         #E1E7D8;
    --border-strong:  #CBD5BC;

    --text:           #14170F;
    --text-muted:     #626E58;
    --text-faint:     #8A957F;

    --danger:         #C0392B;
    --danger-tint:    #FBEAE8;
    --warning:        #B7791F;
    --warning-tint:   #FDF3E2;
    --info:           #2B6CB0;
    --info-tint:      #E8F1FA;
    --success:        #4F7A10;
    --success-tint:   #EDF5DC;

    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  16px;

    --shadow-sm:  0 1px 2px rgba(11, 13, 10, .06);
    --shadow:     0 2px 10px rgba(11, 13, 10, .07);
    --shadow-lg:  0 12px 32px rgba(11, 13, 10, .14);

    --sidebar-w:  256px;
    --topbar-h:   64px;
    --bottomnav-h: 64px;

    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

/* Inline icons carry no width/height attributes so they can inherit
   currentColor. Without a default they render at the SVG's natural size, which
   is enormous — this is the baseline every component then overrides. */
svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    vertical-align: -3px;
}

/* Wrappers that want the icon to fill them. */
.icon-block svg,
.empty__icon svg,
.ring__svg { width: 100%; height: 100%; vertical-align: baseline; }

.icon-block { display: block; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }

/* ---------------------------------------------------------------- app shell */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--ink);
    color: #E7ECE1;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--ink-line);
}

.sidebar__mark {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--brand);
    display: grid; place-items: center;
    font-weight: 800; font-size: .85rem;
    color: var(--brand);
    letter-spacing: .02em;
    flex: 0 0 auto;
}

.sidebar__name  { font-weight: 700; font-size: .98rem; color: #fff; line-height: 1.15; }
.sidebar__role  { font-size: .72rem; color: var(--brand); text-transform: uppercase; letter-spacing: .09em; }

.sidebar__nav { padding: .85rem .7rem; overflow-y: auto; flex: 1; }

.sidebar__section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6C7A60;
    padding: 1rem .6rem .35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .7rem;
    border-radius: var(--radius-sm);
    color: #CBD5BC;
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(126, 180, 10, .13); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--brand); color: var(--ink); font-weight: 700; }
.nav-link.is-active .nav-link__icon { opacity: 1; }
.nav-link__icon { width: 18px; height: 18px; flex: 0 0 18px; opacity: .8; }
.nav-link__badge {
    margin-left: auto;
    background: var(--brand);
    color: var(--ink);
    font-size: .7rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 0 .45rem;
    min-width: 20px;
    text-align: center;
}
.nav-link.is-active .nav-link__badge { background: var(--ink); color: var(--brand); }

.sidebar__footer { padding: .85rem; border-top: 1px solid var(--ink-line); }

.sidebar__user {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .3rem .7rem;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: var(--ink);
    display: grid; place-items: center;
    font-weight: 700; font-size: .78rem;
    flex: 0 0 auto;
}
.sidebar__user-name  { font-size: .85rem; color: #fff; font-weight: 600; }
.sidebar__user-meta  { font-size: .72rem; color: #7E8C72; }

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar__title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.topbar__mobile-brand { display: none; align-items: center; gap: .55rem; }

.content { padding: 1.5rem; flex: 1; }
.content--narrow { max-width: 780px; margin: 0 auto; width: 100%; }

/* ------------------------------------------------------- mobile bottom nav */

.bottom-nav { display: none; }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }

    .topbar { padding: 0 1rem; }
    .topbar__title { font-size: .98rem; }
    .topbar__mobile-brand { display: flex; }
    .topbar__mobile-brand .sidebar__mark { width: 34px; height: 34px; font-size: .72rem; border-color: var(--brand); }

    .content {
        padding: 1rem;
        padding-bottom: calc(var(--bottomnav-h) + 1.5rem + env(safe-area-inset-bottom, 0px));
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--ink);
        border-top: 1px solid var(--ink-line);
        z-index: 50;
        box-shadow: 0 -4px 18px rgba(11, 13, 10, .18);
    }

    .bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #96A38A;
        font-size: .68rem;
        font-weight: 600;
        letter-spacing: .01em;
        position: relative;
        padding-top: 3px;
    }
    .bottom-nav__item:hover { text-decoration: none; }
    .bottom-nav__item svg { width: 22px; height: 22px; }
    .bottom-nav__item.is-active { color: var(--brand); }
    .bottom-nav__item.is-active::before {
        content: "";
        position: absolute;
        top: 0; left: 50%;
        transform: translateX(-50%);
        width: 26px; height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--brand);
    }
    .bottom-nav__badge {
        position: absolute;
        top: 4px; left: 50%;
        margin-left: 4px;
        background: var(--brand);
        color: var(--ink);
        font-size: .6rem;
        font-weight: 800;
        line-height: 1;
        padding: 2px 4px;
        border-radius: 10px;
        min-width: 15px;
        text-align: center;
    }
}

/* -------------------------------------------------------------- components */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1rem; }
.card__header {
    display: flex; align-items: center; gap: .75rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--border);
}
.card__header h2, .card__header h3 { margin: 0; }
.card__header .card__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.card__body { padding: 1.15rem; }
.card__body--flush { padding: 0; }
.card__footer { padding: .85rem 1.15rem; border-top: 1px solid var(--border); background: var(--surface-2); }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

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

/* Stat tiles */
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}
.stat > * { margin: 0; }
.stat__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; line-height: 1.3; }
.stat__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: .15rem !important; line-height: 1.15; }
.stat__meta  { font-size: .8rem; color: var(--text-muted); margin-top: .2rem !important; line-height: 1.35; }
.stat--brand { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat--brand .stat__label { color: var(--brand); }
.stat--brand .stat__meta { color: #97A48B; }
.stat--accent { border-left: 4px solid var(--brand); }

/* Page header */
.page-head {
    display: flex; align-items: flex-start; gap: 1rem;
    margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-head__text { min-width: 0; }
.page-head h1 { margin-bottom: .15rem; }
.page-head__sub { color: var(--text-muted); font-size: .9rem; margin: 0; }
.page-head__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 700px) {
    .page-head__actions { margin-left: 0; width: 100%; }
    .page-head__actions .btn { flex: 1; justify-content: center; }
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .55rem .95rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: .875rem; font-weight: 600;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
    transition: background .15s, border-color .15s, transform .05s;
    text-decoration: none;
    line-height: 1.3;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--ink); font-weight: 700; }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-soft); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #E8C6C1; }
.btn--danger:hover { background: var(--danger-tint); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: .35rem .6rem; font-size: .8rem; }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 20px;
    font-size: .74rem; font-weight: 700;
    letter-spacing: .01em;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.badge--green   { background: var(--success-tint); color: var(--success);  border-color: #D5E5B4; }
.badge--amber   { background: var(--warning-tint); color: var(--warning);  border-color: #F0DCB6; }
.badge--red     { background: var(--danger-tint);  color: var(--danger);   border-color: #EFCFCA; }
.badge--blue    { background: var(--info-tint);    color: var(--info);     border-color: #C7DCF0; }
.badge--dark    { background: var(--ink);          color: var(--brand);    border-color: var(--ink); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Progress */
.progress {
    height: 8px;
    background: var(--brand-tint-2);
    border-radius: 20px;
    overflow: hidden;
}
.progress__bar {
    height: 100%;
    background: var(--brand);
    border-radius: 20px;
    transition: width .4s ease;
}
.progress--lg { height: 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: .35rem; color: var(--text-muted); font-weight: 600; }

/* Ring progress for the project cards */
.ring { --value: 0; width: 62px; height: 62px; flex: 0 0 62px; position: relative; }
.ring__svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring__track { stroke: var(--brand-tint-2); }
.ring__fill  { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring__text {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: .82rem; font-weight: 800;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    min-width: 560px;
}
table.data th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
table.data td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--brand-tint); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label, .label {
    display: block;
    font-size: .8rem; font-weight: 700;
    margin-bottom: .3rem;
    color: var(--text);
}
.field .hint { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.field-error { color: var(--danger); font-size: .78rem; margin: .3rem 0 0; font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], input[type="url"],
select, textarea {
    width: 100%;
    padding: .55rem .7rem;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(126, 180, 10, .18);
}
textarea { min-height: 100px; resize: vertical; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }

input[type="file"] {
    width: 100%;
    padding: .5rem;
    font-size: .85rem;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
}

.check {
    display: flex; align-items: flex-start; gap: .55rem;
    font-size: .875rem; font-weight: 500;
    cursor: pointer;
    margin-bottom: .5rem;
}
.check input { margin-top: .2rem; accent-color: var(--brand); width: 16px; height: 16px; flex: 0 0 16px; }

.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .form-row, .form-row--3 { grid-template-columns: minmax(0, 1fr); } }

.form-actions {
    display: flex; gap: .6rem; flex-wrap: wrap;
    padding-top: .35rem;
}
@media (max-width: 700px) { .form-actions .btn { flex: 1; justify-content: center; } }

.filters {
    display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end;
    margin-bottom: 1rem;
}
.filters .field { margin-bottom: 0; min-width: 150px; flex: 1 1 150px; }
.filters .btn { flex: 0 0 auto; }

/* Alerts */
.alert {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: .885rem;
}
.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert--success { background: var(--success-tint); border-color: #D5E5B4; color: #3D5F0C; }
.alert--error   { background: var(--danger-tint);  border-color: #EFCFCA; color: #8E2C20; }
.alert--info    { background: var(--info-tint);    border-color: #C7DCF0; color: #21507F; }
.alert--warning { background: var(--warning-tint); border-color: #F0DCB6; color: #8A5A12; }

/* Timeline */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before {
    content: ""; position: absolute;
    left: 7px; top: 6px; bottom: 6px;
    width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 1.2rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
    position: absolute; left: -1.6rem; top: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--border-strong);
}
.timeline__dot--done    { background: var(--brand); border-color: var(--brand); }
.timeline__dot--active  { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px rgba(126,180,10,.16); }
.timeline__dot--blocked { border-color: var(--danger); }
.timeline__title { font-weight: 700; font-size: .93rem; margin: 0 0 .1rem; }
.timeline__meta  { font-size: .78rem; color: var(--text-muted); }
.timeline__body  { font-size: .875rem; color: var(--text-muted); margin: .3rem 0 0; white-space: pre-line; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
    display: flex; gap: .8rem; align-items: center;
    padding: .8rem 1.15rem;
    border-bottom: 1px solid var(--border);
}
.list__item:last-child { border-bottom: 0; }
.list__item:hover { background: var(--surface-2); }
.list__main { min-width: 0; flex: 1; }
.list__title { font-weight: 600; font-size: .9rem; margin: 0; }
.list__meta  { font-size: .78rem; color: var(--text-muted); }
.list__side  { margin-left: auto; text-align: right; white-space: nowrap; }

.file-icon {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: var(--radius-sm);
    background: var(--brand-tint);
    color: var(--brand-dark);
    display: grid; place-items: center;
    font-size: .64rem; font-weight: 800;
    text-transform: uppercase;
    border: 1px solid var(--brand-tint-2);
}

/* Empty state */
.empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
}
.empty__icon {
    width: 48px; height: 48px;
    margin: 0 auto .75rem;
    color: var(--border-strong);
}
.empty h3 { color: var(--text); margin-bottom: .25rem; }
.empty p { margin-bottom: 1rem; font-size: .9rem; }

/* Key/value */
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: .45rem 1rem; font-size: .875rem; }
.kv dt { color: var(--text-muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }

/* Copy field */
.copy-field { display: flex; gap: .5rem; align-items: stretch; }
.copy-field input { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.copy-field .btn { flex: 0 0 auto; }

.code-block {
    background: var(--ink);
    color: #D6E4C0;
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: .8rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

/* Pagination */
.pagination { display: flex; gap: .35rem; align-items: center; justify-content: center; padding: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: .35rem .7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: .82rem; font-weight: 600;
    background: var(--surface);
    color: var(--text-muted);
}
.pagination .is-current { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.pagination a:hover { background: var(--surface-2); text-decoration: none; }

/* Payment method picker */
.pay-option {
    display: flex; gap: .8rem; align-items: flex-start;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: .65rem;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .15s, background .15s;
}
.pay-option:hover { border-color: var(--brand); background: var(--brand-tint); }
.pay-option input { margin-top: .25rem; accent-color: var(--brand); width: 18px; height: 18px; flex: 0 0 18px; }
.pay-option__label { font-weight: 700; font-size: .92rem; }
.pay-option__desc  { font-size: .81rem; color: var(--text-muted); }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 3px rgba(126,180,10,.14); }

/* Misc */
.muted   { color: var(--text-muted); }
.faint   { color: var(--text-faint); }
.strong  { font-weight: 700; }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap  { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; gap: .6rem; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.inline-form { display: inline; }
.divider { height: 1px; background: var(--border); margin: 1.15rem 0; border: 0; }
.hide-sm { display: initial; }
@media (max-width: 700px) { .hide-sm { display: none !important; } }

/* Auth screens */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--canvas);
}
.auth__panel {
    background: var(--ink);
    color: #E7ECE1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth__panel::after {
    content: "";
    position: absolute;
    right: -120px; bottom: -140px;
    width: 380px; height: 380px;
    border-radius: 50%;
    border: 60px solid rgba(126, 180, 10, .09);
}
.auth__tagline { color: var(--brand); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 700; }
.auth__panel h1 { font-size: 2.1rem; color: #fff; margin: .8rem 0; max-width: 15ch; }
.auth__panel h1 em { color: var(--brand); font-style: normal; }
.auth__panel p { color: #A6B399; max-width: 42ch; }
.auth__points { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.auth__points li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .7rem; font-size: .9rem; color: #CBD5BC; }
.auth__points svg { width: 18px; height: 18px; color: var(--brand); flex: 0 0 18px; margin-top: 2px; }

.auth__form-wrap {
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1.5rem;
}
.auth__card { width: 100%; max-width: 400px; }
.auth__logo { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.5rem; }
.auth__logo .sidebar__mark { border-color: var(--ink); color: var(--ink); }
.auth__logo-name { font-weight: 800; font-size: 1.05rem; }
.auth__logo-role { font-size: .72rem; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__panel { display: none; }
    .auth__form-wrap { align-items: flex-start; padding-top: 3rem; }
}

/* Password strength meter */
.pw-meter { height: 5px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: .45rem; }
.pw-meter__bar { height: 100%; width: 0; transition: width .25s, background .25s; }
.pw-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* Repeating rows (invoice lines, template milestones) */
.repeat-row {
    display: grid;
    gap: .6rem;
    align-items: start;
    padding: .7rem 0;
    border-bottom: 1px dashed var(--border);
}
.repeat-row:last-of-type { border-bottom: 0; }
.repeat-row__remove { color: var(--danger); background: none; border: 0; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: .4rem; }
.line-row  { grid-template-columns: minmax(0, 3fr) 90px 130px 120px 36px; }
.mstone-row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 80px 36px; }
@media (max-width: 800px) {
    .line-row, .mstone-row { grid-template-columns: minmax(0, 1fr); }
    .repeat-row { border-bottom: 1px solid var(--border); padding: .9rem 0; }
}

.totals { margin-left: auto; max-width: 300px; font-size: .9rem; }
.totals__row { display: flex; justify-content: space-between; padding: .3rem 0; }
.totals__row--grand {
    border-top: 2px solid var(--ink);
    margin-top: .35rem; padding-top: .55rem;
    font-size: 1.05rem; font-weight: 800;
}

/* "More" sheet, opened by the mobile bottom nav (CSS-only, no JavaScript) */
.more-toggle { position: absolute; opacity: 0; pointer-events: none; }
.more-sheet { display: none; }

.more-toggle:checked ~ .more-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
}
.more-sheet__scrim {
    position: absolute; inset: 0;
    background: rgba(11, 13, 10, .55);
    cursor: pointer;
}
.more-sheet__panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
}
.more-sheet__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: .5rem; }
.more-sheet__links { display: grid; gap: .2rem; padding: .25rem 0 .75rem; }
.more-sheet__links a {
    display: flex; align-items: center; gap: .7rem;
    padding: .8rem .6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 600; font-size: .92rem;
    border-bottom: 1px solid var(--border);
}
.more-sheet__links a:last-child { border-bottom: 0; }
.more-sheet__links a:hover { background: var(--brand-tint); text-decoration: none; }
.more-sheet__links svg { width: 19px; height: 19px; color: var(--text-muted); }
.more-sheet__foot { padding-top: .35rem; }

/* Nav links that are really buttons (sign out) */
.nav-link--button {
    width: 100%;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 500;
    text-align: left;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute; left: -9999px;
    background: var(--brand); color: var(--ink);
    padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 700; z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }
