/* Nudge app shell and shared components. Loaded last, so it sets the final look. */

:root {
    color-scheme: dark;
    --nd-page: #0a1322;
    --nd-side: #0c1729;
    --nd-surface: #101c30;
    --nd-raised: #15243b;
    --nd-hover: #1a2b45;
    --nd-line: rgba(196, 210, 230, .1);
    --nd-line-strong: rgba(196, 210, 230, .18);
    --nd-text: #e9eef5;
    --nd-soft: #c3cedc;
    --nd-muted: #8f9eb3;
    --nd-gold: #d7b779;
    --nd-gold-hi: #ecd3a0;
    --nd-gold-ink: #1a1408;
    --nd-gold-wash: rgba(215, 183, 121, .1);
    --nd-red: #f2878f;
    --nd-red-wash: rgba(214, 72, 86, .13);
    --nd-green: #74d3b0;
    --nd-green-wash: rgba(84, 196, 156, .12);
    --nd-radius: 12px;
    --nd-side-w: 268px;
    --nd-font: Inter, ui-sans-serif, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

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

html, body {
    margin: 0;
    background: var(--nd-page);
    color: var(--nd-text);
    font-family: var(--nd-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.nd-app, body.nd-guest { background: var(--nd-page); }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

:focus-visible { outline: 2px solid var(--nd-gold); outline-offset: 2px; }

/* ---------- Brand ---------- */

.nd-brand { display: inline-flex; align-items: center; gap: 10px; }
.nd-mark { width: 32px; height: 32px; flex: 0 0 auto; display: block; }
.nd-wordmark {
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.035em;
    color: var(--nd-text);
    line-height: 1;
}
.nd-brand.is-small .nd-mark { width: 28px; height: 28px; }
.nd-brand.is-small .nd-wordmark { font-size: 19px; }

/* ---------- Shell ---------- */

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

.nd-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--nd-side-w);
    width: var(--nd-side-w);
    height: 100vh;
    padding: 20px 14px 14px;
    border-right: 1px solid var(--nd-line);
    background: var(--nd-side);
    overflow-y: auto;
    z-index: 40;
}

.nd-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px 18px;
}

.nd-side .nd-close { display: none; }

.nd-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 4px 18px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--nd-gold);
    color: var(--nd-gold-ink);
    font-weight: 650;
    font-size: 13.5px;
    transition: background .15s ease;
}
.nd-new:hover { background: var(--nd-gold-hi); }
.nd-new svg { width: 16px; height: 16px; }

.nd-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nd-nav-label {
    margin: 18px 12px 6px;
    color: var(--nd-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nd-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 38px;
    padding: 7px 10px 7px 12px;
    border-radius: 9px;
    color: var(--nd-soft);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nd-link svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--nd-muted); }
.nd-link:hover { background: rgba(255, 255, 255, .035); color: var(--nd-text); }
.nd-link.is-active { background: var(--nd-gold-wash); color: var(--nd-gold-hi); }
.nd-link.is-active svg { color: var(--nd-gold); }
.nd-link.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--nd-gold);
}
.nd-link > .nd-count, .nd-counts { margin-left: auto; }
.nd-counts { display: inline-flex; gap: 4px; }

.nd-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(196, 210, 230, .08);
    color: var(--nd-muted);
    font-size: 11.5px;
    font-weight: 650;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.nd-count.is-hot { background: var(--nd-red-wash); color: var(--nd-red); }

/* Account block at the bottom of the sidebar. */
.nd-account { position: relative; margin-top: 16px; border-top: 1px solid var(--nd-line); padding-top: 12px; }
.nd-account summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
}
.nd-account summary::-webkit-details-marker { display: none; }
.nd-account summary:hover, .nd-account[open] summary { background: rgba(255, 255, 255, .04); }
.nd-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #22344f;
    color: var(--nd-gold-hi);
    font-weight: 700;
    font-size: 13px;
}
.nd-account-text { display: grid; min-width: 0; }
.nd-account-name, .nd-account-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-account-name { font-size: 13px; font-weight: 600; }
.nd-account-mail { font-size: 11.5px; color: var(--nd-muted); }
.nd-account-chev { width: 15px; height: 15px; margin-left: auto; color: var(--nd-muted); transition: transform .15s ease; }
.nd-account:not([open]) .nd-account-chev { transform: rotate(180deg); }
.nd-account-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    padding: 6px;
    border: 1px solid var(--nd-line-strong);
    border-radius: 12px;
    background: var(--nd-raised);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.nd-account-menu a, .nd-account-menu button {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--nd-soft);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.nd-account-menu a:hover, .nd-account-menu button:hover { background: var(--nd-hover); color: var(--nd-text); }
.nd-account-menu .is-danger { color: var(--nd-red); }
.nd-account-menu form { margin: 0; }

.nd-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.nd-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px clamp(18px, 3.4vw, 44px) 24px;
}

.nd-top, .nd-tabs, .nd-scrim { display: none; }

.nd-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--nd-line);
    border-radius: 10px;
    background: transparent;
    color: var(--nd-soft);
    cursor: pointer;
}
.nd-icon-btn svg { width: 20px; height: 20px; }
.nd-icon-btn.is-gold { background: var(--nd-gold); border-color: var(--nd-gold); color: var(--nd-gold-ink); }

.nd-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 18px clamp(18px, 3.4vw, 44px) 26px;
    color: var(--nd-muted);
    font-size: 12px;
}
.nd-foot a:hover { color: var(--nd-gold-hi); }

/* Old shell elements some pages still print. */
.app-topbar { display: none !important; }

/* ---------- Alerts ---------- */

.alert-success, .alert-error {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
}
.alert-success { border: 1px solid rgba(116, 211, 176, .28); background: var(--nd-green-wash); color: #a6e9cf; }
.alert-error { border: 1px solid rgba(242, 135, 143, .3); background: var(--nd-red-wash); color: #ffc4c8; }
.alert-error ul { margin: 0; padding-left: 18px; }

/* ---------- Page header + buttons ---------- */

.nd-page { color: var(--nd-text); }

.nd-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 26px;
}
.nd-page-head h1 {
    margin: 2px 0 4px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.15;
    color: var(--nd-text);
}
.nd-eyebrow {
    margin: 0;
    color: var(--nd-gold);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
}
.nd-page-sub { margin: 0; color: var(--nd-muted); font-size: 14px; }

.nd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 15px;
    border: 1px solid var(--nd-line-strong);
    border-radius: 9px;
    background: var(--nd-raised);
    color: var(--nd-text);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nd-btn:hover { background: var(--nd-hover); border-color: rgba(196, 210, 230, .26); }
.nd-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nd-btn.is-primary { background: var(--nd-gold); border-color: var(--nd-gold); color: var(--nd-gold-ink); }
.nd-btn.is-primary:hover { background: var(--nd-gold-hi); border-color: var(--nd-gold-hi); }
.nd-btn.is-ghost { background: transparent; color: var(--nd-soft); }
.nd-btn.is-ghost:hover { background: rgba(255, 255, 255, .04); color: var(--nd-text); }
.nd-btn.is-danger { color: var(--nd-red); }
.nd-btn.is-danger:hover { background: var(--nd-red-wash); border-color: rgba(242, 135, 143, .35); }
.nd-btn.is-small { min-height: 32px; padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }

.nd-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid rgba(116, 211, 176, .32);
    border-radius: 999px;
    background: var(--nd-green-wash);
    color: var(--nd-green);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.nd-chip-btn:hover { background: rgba(84, 196, 156, .22); }
.nd-chip-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.nd-link-btn {
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--nd-muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.nd-link-btn:hover { color: var(--nd-gold-hi); text-decoration: underline; text-underline-offset: 3px; }

.nd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nd-muted { color: var(--nd-muted); }

/* ---------- KPIs ---------- */

.nd-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 22px;
    border: 1px solid var(--nd-line);
    border-radius: var(--nd-radius);
    background: var(--nd-line);
    overflow: hidden;
}
.nd-kpi {
    display: grid;
    gap: 2px;
    padding: 16px 18px;
    background: var(--nd-surface);
    transition: background .15s ease;
}
a.nd-kpi:hover { background: var(--nd-raised); }
.nd-kpi-label { color: var(--nd-muted); font-size: 12.5px; font-weight: 500; }
.nd-kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.nd-kpi-note { color: var(--nd-muted); font-size: 12px; }
.nd-kpi.is-hot .nd-kpi-value { color: var(--nd-red); }
.nd-kpi.is-gold .nd-kpi-value { color: var(--nd-gold-hi); }
.nd-kpi.is-calm .nd-kpi-value { color: var(--nd-text); }
.nd-kpis.is-compact .nd-kpi { padding: 13px 16px; }
.nd-kpis.is-compact .nd-kpi-value { font-size: 23px; }

/* ---------- Due board ---------- */

.nd-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.nd-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--nd-line);
    border-radius: var(--nd-radius);
    background: var(--nd-surface);
}
.nd-col-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--nd-line);
}
.nd-col-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.nd-col-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--nd-muted); }
.nd-col.is-overdue .nd-col-head::before { background: var(--nd-red); }
.nd-col.is-today .nd-col-head::before { background: var(--nd-gold); }
.nd-col.is-week .nd-col-head::before { background: #7f9cc4; }
.nd-col-count { margin-left: auto; color: var(--nd-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nd-col.is-overdue .nd-col-count { color: var(--nd-red); font-weight: 650; }

.nd-due {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main side" "pay pay";
    gap: 6px 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--nd-line);
}
.nd-due:last-of-type { border-bottom: 0; }
.nd-due-main { grid-area: main; display: grid; min-width: 0; }
.nd-due-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-due-title:hover { color: var(--nd-gold-hi); }
.nd-due-meta { color: var(--nd-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-due-side { grid-area: side; display: grid; justify-items: end; }
.nd-due-amount { font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.nd-due-date { color: var(--nd-muted); font-size: 12px; white-space: nowrap; }
.nd-col.is-overdue .nd-due-date { color: var(--nd-red); }
.nd-due-pay { grid-area: pay; margin: 0; }
.nd-col-empty { margin: 0; padding: 26px 16px; color: var(--nd-muted); font-size: 13px; text-align: center; }
.nd-col-more { margin-top: auto; padding: 11px 16px; border-top: 1px solid var(--nd-line); color: var(--nd-gold); font-size: 12.5px; font-weight: 600; }
.nd-col-more:hover { color: var(--nd-gold-hi); }

/* ---------- Type tiles ---------- */

.nd-types-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}
.nd-type-tile {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--nd-line);
    border-radius: 10px;
    background: var(--nd-surface);
    transition: border-color .15s ease, background .15s ease;
}
.nd-type-tile:hover { border-color: rgba(215, 183, 121, .4); background: var(--nd-raised); }
.nd-type-name { font-size: 13px; font-weight: 600; }
.nd-type-nums { color: var(--nd-muted); font-size: 12px; }
.nd-type-nums strong { color: var(--nd-text); font-weight: 650; }
.nd-type-nums em { display: block; font-style: normal; color: var(--nd-red); }
.nd-type-tile.has-overdue { border-color: rgba(242, 135, 143, .28); }

/* ---------- Payment report (collapsible) ---------- */

.nd-report {
    margin-bottom: 30px;
    border: 1px solid var(--nd-line);
    border-radius: var(--nd-radius);
    background: var(--nd-surface);
}
.nd-report > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
}
.nd-report > summary::-webkit-details-marker { display: none; }
.nd-report > summary span { display: grid; }
.nd-report > summary strong { font-size: 14px; font-weight: 650; }
.nd-report > summary small { color: var(--nd-muted); font-size: 12.5px; }
.nd-report > summary svg { width: 18px; height: 18px; fill: none; stroke: var(--nd-muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.nd-report[open] > summary svg { transform: rotate(180deg); }
.nd-report[open] > summary { border-bottom: 1px solid var(--nd-line); }
.nd-report .dp-payment-report {
    margin: 0;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.nd-report .dp-payment-report-head { display: none; }
.nd-report label { color: var(--nd-soft); }
.nd-report input, .nd-report select, .nd-report .dp-range-trigger {
    background: var(--nd-page) !important;
    border: 1px solid var(--nd-line-strong) !important;
    border-radius: 9px !important;
    color: var(--nd-text) !important;
    box-shadow: none !important;
}
.nd-report .dp-btn.edit { background: var(--nd-raised); color: var(--nd-text); border-color: var(--nd-line-strong); }
.nd-report .dp-btn.success { background: var(--nd-gold); color: var(--nd-gold-ink); border-color: var(--nd-gold); }

/* ---------- Section head + filter ---------- */

.nd-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.nd-section-head h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.nd-section-head p { margin: 0; color: var(--nd-muted); font-size: 12.5px; }

.nd-filter {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
}
.nd-search {
    position: relative;
    flex: 1;
    min-width: 0;
}
.nd-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--nd-muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}
.nd-filter input, .nd-filter select, .nd-add-cycle input {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--nd-line-strong);
    border-radius: 9px;
    background: var(--nd-surface);
    color: var(--nd-text);
    font-size: 13.5px;
}
.nd-search input { padding-left: 36px; }
.nd-filter select { width: auto; min-width: 160px; }
.nd-filter input:focus, .nd-filter select:focus, .nd-add-cycle input:focus {
    outline: none;
    border-color: var(--nd-gold);
    box-shadow: 0 0 0 3px rgba(215, 183, 121, .18);
}

/* Type tabs on list pages. */
.dp-types {
    display: flex;
    gap: 6px;
    margin: -8px 0 20px !important;
    padding: 0 0 2px !important;
    border: 0 !important;
    background: none !important;
    overflow-x: auto;
    scrollbar-width: none;
}
.dp-types::-webkit-scrollbar { display: none; }
.dp-type {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px !important;
    border: 1px solid var(--nd-line) !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--nd-soft) !important;
    font-size: 12.5px !important;
    white-space: nowrap;
}
.dp-type:hover { border-color: var(--nd-line-strong) !important; color: var(--nd-text) !important; }
.dp-type.is-active { border-color: rgba(215, 183, 121, .45) !important; background: var(--nd-gold-wash) !important; color: var(--nd-gold-hi) !important; }
.dp-type-count { color: var(--nd-muted); font-variant-numeric: tabular-nums; background: none !important; padding: 0 !important; }
.dp-type-count.is-hot { color: var(--nd-red) !important; }

/* ---------- Reminder cards ---------- */

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

.nd-card {
    border: 1px solid var(--nd-line);
    border-radius: var(--nd-radius);
    background: var(--nd-surface);
    overflow: hidden;
}
.nd-card.is-late { border-left: 3px solid var(--nd-red); }
.nd-card.is-archived, .nd-card.cancelled-only { opacity: .78; }

.nd-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 14px;
}
.nd-card-title { min-width: 0; }
.nd-card-title h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; color: var(--nd-text); }
.nd-card-company { margin-left: 8px; color: var(--nd-muted); font-weight: 500; font-size: 13.5px; }
.nd-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--nd-muted);
    font-size: 12.5px;
}
.nd-card-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.nd-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 0 auto; }
.nd-card-actions form { margin: 0; }

.nd-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border: 0 !important;
    border-radius: 999px;
    background: rgba(196, 210, 230, .08) !important;
    color: var(--nd-soft) !important;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.nd-pill.is-active, .nd-pill.is-paid { background: var(--nd-green-wash) !important; color: var(--nd-green) !important; }
.nd-pill.is-paused, .nd-pill.is-unpaid { background: var(--nd-gold-wash) !important; color: var(--nd-gold-hi) !important; }
.nd-pill.is-late { background: var(--nd-red-wash) !important; color: var(--nd-red) !important; }
.nd-pill.is-muted, .nd-pill.is-cancelled { color: var(--nd-muted) !important; }

.nd-cycles { width: 100%; border-collapse: collapse; font-size: 13px; }
.nd-cycles th {
    padding: 8px 18px;
    border-top: 1px solid var(--nd-line);
    border-bottom: 1px solid var(--nd-line);
    background: rgba(0, 0, 0, .12);
    color: var(--nd-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-align: left;
}
.nd-cycles td { padding: 10px 18px; border-bottom: 1px solid var(--nd-line); color: var(--nd-soft); vertical-align: middle; }
.nd-cycles tbody tr:last-child td { border-bottom: 0; }
.nd-cycles tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.nd-cycles tr.is-late td:first-child { color: var(--nd-red); font-weight: 600; }
.nd-num { font-variant-numeric: tabular-nums; color: var(--nd-text) !important; font-weight: 600; }
.nd-row-actions { text-align: right; white-space: nowrap; }
.nd-row-actions form { display: inline; margin: 0; }
.nd-row-actions > * + * { margin-left: 10px; }
.nd-cycles-empty { color: var(--nd-muted) !important; text-align: center; padding: 18px !important; }

.nd-add-cycle { border-top: 1px solid var(--nd-line); }
.nd-add-cycle > summary {
    padding: 11px 18px;
    color: var(--nd-gold);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.nd-add-cycle > summary::-webkit-details-marker { display: none; }
.nd-add-cycle > summary:hover { color: var(--nd-gold-hi); }
.nd-add-cycle form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 0 18px 16px; margin: 0; }
.nd-add-cycle label { display: grid; gap: 4px; color: var(--nd-muted); font-size: 12px; }
.nd-add-cycle input { width: 180px; }

.nd-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--nd-line); color: var(--nd-muted); font-size: 12.5px; }

.nd-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 46px 20px;
    border: 1px dashed var(--nd-line-strong);
    border-radius: var(--nd-radius);
    text-align: center;
}
.nd-empty svg { width: 44px; height: 44px; fill: none; stroke: var(--nd-gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.nd-empty h3 { margin: 6px 0 0; font-size: 16px; font-weight: 650; }
.nd-empty p { margin: 0 0 10px; color: var(--nd-muted); font-size: 13.5px; }

/* Pagination from the old stylesheet, recoloured. */
.dp-pagination { margin-top: 18px !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.dp-page-link, .dp-page-disabled, .dp-page-current { border-radius: 8px !important; }
.dp-page-link { background: var(--nd-surface) !important; border-color: var(--nd-line-strong) !important; color: var(--nd-soft) !important; }
.dp-page-link:hover { border-color: var(--nd-gold) !important; color: var(--nd-gold-hi) !important; }
.dp-page-current { background: var(--nd-gold) !important; border-color: var(--nd-gold) !important; color: var(--nd-gold-ink) !important; box-shadow: none !important; }
.dp-page-disabled { background: transparent !important; color: #5b6a80 !important; }
.dp-pagination-info { color: var(--nd-muted) !important; }

/* Slack share dialog. */
.dp-share-dialog { border-color: var(--nd-line-strong) !important; background: var(--nd-surface) !important; border-radius: 14px !important; }
.dp-share-form { background: var(--nd-surface) !important; }
.dp-share-submit { background: var(--nd-gold) !important; border-color: var(--nd-gold) !important; color: var(--nd-gold-ink) !important; box-shadow: none !important; }

/* ---------- Guest pages ---------- */

.nd-guest-top { padding: 22px clamp(18px, 4vw, 48px); }
.nd-guest-main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px); min-height: calc(100vh - 160px); }

/* ---------- Tablet and phone ---------- */

@media (max-width: 1100px) {
    .nd-types-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nd-board { grid-template-columns: 1fr 1fr; }
    .nd-col.is-week { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
    .nd-side {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
    }
    .nd-nav-open .nd-side { transform: none; }
    .nd-side .nd-close { display: inline-grid; }
    .nd-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(3, 8, 16, .6); }
    .nd-scrim[hidden] { display: none; }

    .nd-top {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--nd-line);
        background: rgba(10, 19, 34, .92);
        backdrop-filter: blur(12px);
    }
    .nd-content { padding: 22px 16px 24px; }
    .nd-foot { padding-bottom: 96px; }
    .nd-kpis { grid-template-columns: 1fr 1fr; }

    .nd-tabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        display: flex;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--nd-line);
        background: rgba(12, 23, 41, .96);
        backdrop-filter: blur(12px);
    }
    .nd-tabs a, .nd-tabs button {
        position: relative;
        display: grid;
        justify-items: center;
        gap: 2px;
        flex: 1;
        padding: 6px 4px;
        border: 0;
        border-radius: 10px;
        background: none;
        color: var(--nd-muted);
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
    }
    .nd-tabs svg { width: 22px; height: 22px; }
    .nd-tabs .is-active { color: var(--nd-gold-hi); }
    .nd-dot {
        position: absolute;
        top: 2px;
        left: calc(50% + 6px);
        min-width: 17px;
        padding: 0 5px;
        border-radius: 999px;
        background: #d64856;
        color: #fff;
        font-size: 10px;
        line-height: 17px;
    }
}

@media (max-width: 640px) {
    html, body { font-size: 14px; }
    .nd-page-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px; }
    .nd-page-head h1 { font-size: 24px; }
    .nd-page-head .nd-btn { width: 100%; min-height: 44px; }
    .nd-kpi { padding: 13px 14px; }
    .nd-kpi-value { font-size: 23px; }
    .nd-board { grid-template-columns: 1fr; gap: 12px; }
    .nd-types-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

    .nd-filter { flex-wrap: wrap; }
    .nd-search { flex-basis: 100%; }
    .nd-filter select { flex: 1; min-width: 0; }
    .nd-filter input, .nd-filter select, .nd-filter .nd-btn { min-height: 44px; }

    .nd-card-head { flex-direction: column; gap: 12px; padding: 14px 14px 12px; }
    .nd-card-actions { justify-content: flex-start; }
    .nd-card-company { display: block; margin: 2px 0 0; }

    /* Payment rows turn into small stacked blocks. */
    .nd-cycles thead { display: none; }
    .nd-cycles, .nd-cycles tbody, .nd-cycles tr, .nd-cycles td { display: block; width: 100%; }
    .nd-cycles tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 4px 12px;
        padding: 12px 14px;
        border-top: 1px solid var(--nd-line);
    }
    .nd-cycles td { padding: 0; border: 0; }
    .nd-cycles td[data-label="Due date"] { font-weight: 600; color: var(--nd-text); }
    .nd-cycles td[data-label="Amount"] { text-align: right; }
    .nd-cycles td[data-label="Paid at"] { text-align: right; color: var(--nd-muted); font-size: 12px; align-self: center; }
    .nd-cycles td[data-label="Paid at"]::before { content: "Paid "; }
    .nd-cycles td.nd-hide-sm { display: none; }
    .nd-cycles .nd-row-actions { grid-column: 1 / -1; text-align: left; margin-top: 6px; }
    .nd-cycles-empty { grid-column: 1 / -1; }
    .nd-row-actions .nd-chip-btn { padding: 7px 14px; }
    .nd-add-cycle form { padding: 0 14px 14px; }
    .nd-add-cycle label { flex: 1 1 140px; }
    .nd-add-cycle input { width: 100%; min-height: 44px; }
    .nd-add-cycle .nd-btn { flex: 1 1 100%; min-height: 44px; }
    .nd-add-cycle > summary { padding: 12px 14px; }
    .nd-card-mail { max-width: 100%; }
    .dp-pagination { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .nd-side, .nd-link, .nd-btn { transition: none; }
}

/* ---------- Forms, meetings and account pages ---------- */

.nd-content input[type=checkbox], .nd-content input[type=radio] { accent-color: var(--nd-gold); }

.nd-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.nd-content select,
.nd-content textarea {
    background-color: #0b1526;
    border: 1px solid var(--nd-line-strong);
    border-radius: 9px;
    color: var(--nd-text);
    box-shadow: none;
}
.nd-content input:not([type=checkbox]):not([type=radio]):focus,
.nd-content select:focus,
.nd-content textarea:focus {
    outline: none;
    border-color: var(--nd-gold);
    box-shadow: 0 0 0 3px rgba(215, 183, 121, .18);
}
.nd-content .nd-search input { padding-left: 36px; }

/* Shared page title for the form pages. */
.nd-form-title h1, .dp-create .header h1, .nd-content .meeting-calendar-title h1 {
    margin: 2px 0 4px;
    color: var(--nd-text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.15;
}
.nd-form-title .nd-page-sub, .dp-create .subtitle, .nd-content .meeting-calendar-title p { color: var(--nd-muted); font-size: 14px; margin: 0; }

/* Reminder create / edit. */
.dp-create { --blue: var(--nd-gold); --border: var(--nd-line); max-width: 960px; margin: 0 auto 40px; padding: 0; }
.dp-create .header { align-items: flex-end; margin: 0 0 24px; }
.dp-create .eyebrow { color: var(--nd-gold); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: none; }
.dp-create .form { background: var(--nd-surface); border-color: var(--nd-line); border-radius: var(--nd-radius); }
.dp-create .section { border-color: var(--nd-line); }
.dp-create .step { background: var(--nd-gold-wash); color: var(--nd-gold-hi); border-radius: 9px; font-weight: 700; }
.dp-create label, .dp-create .field > label { color: var(--nd-soft); }
.dp-create .footer { background: rgba(0, 0, 0, .14); border-top: 1px solid var(--nd-line); }
.dp-create .notice { background: var(--nd-gold-wash); border-color: rgba(215, 183, 121, .25); color: var(--nd-soft); }
.dp-create .check { background: #0b1526; border-color: var(--nd-line-strong); }

/* One button language across the old pages. */
.dp-create .back, .dp-create .cancel, .nd-content .meeting-btn.secondary, .nd-content .meeting-detail-btn {
    min-height: 38px;
    padding: 8px 15px;
    border: 1px solid var(--nd-line-strong);
    border-radius: 9px;
    background: var(--nd-raised);
    color: var(--nd-text);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: none;
}
.dp-create .back:hover, .dp-create .cancel:hover, .nd-content .meeting-btn.secondary:hover, .nd-content .meeting-detail-btn:hover { background: var(--nd-hover); }
.dp-create .submit, .nd-content .meeting-btn:not(.secondary), .nd-content .meeting-calendar-controls .meeting-calendar-create, .nd-content .meeting-detail-btn.accept, .dp-button {
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid var(--nd-gold);
    border-radius: 9px;
    background: var(--nd-gold);
    color: var(--nd-gold-ink);
    font-size: 13.5px;
    font-weight: 650;
    box-shadow: none;
}
.dp-create .submit:hover, .nd-content .meeting-btn:not(.secondary):hover, .nd-content .meeting-calendar-controls .meeting-calendar-create:hover, .dp-button:hover { background: var(--nd-gold-hi); border-color: var(--nd-gold-hi); }
.nd-content .meeting-detail-btn.decline { color: var(--nd-red); }

/* Meetings. */
.nd-content .meetings-page { max-width: 960px; margin: 0 auto; }
.nd-content .meetings-page > header { margin: 0 0 24px !important; align-items: flex-end !important; }
.nd-content .meeting-form-card, .nd-content .meeting-detail-card, .nd-content .deletion-card {
    background: var(--nd-surface);
    border: 1px solid var(--nd-line);
    border-radius: var(--nd-radius);
    box-shadow: none;
}
.nd-content .meeting-choice { background: #0b1526; border-color: var(--nd-line-strong); }

.nd-content .meeting-calendar-page {
    --calendar-bg: var(--nd-page);
    --calendar-panel: var(--nd-surface);
    --calendar-panel-soft: var(--nd-raised);
    --calendar-border: rgba(196, 210, 230, .12);
    --calendar-text: var(--nd-text);
    --calendar-muted: var(--nd-muted);
    --calendar-accent: var(--nd-gold);
    padding: 0 0 20px;
}
.nd-content .meeting-calendar-views a.is-active { background: var(--nd-gold-wash); color: var(--nd-gold-hi); }

@media (max-width: 640px) {
    .nd-form-title h1, .dp-create .header h1, .nd-content .meeting-calendar-title h1 { font-size: 24px; }
    .dp-create .header { align-items: stretch; }
    .nd-content .meetings-page > header { flex-direction: column; align-items: stretch !important; }
}

.nd-content a.meeting-calendar-day-number:hover { background: var(--nd-gold-wash); color: var(--nd-gold-hi); }
