:root {
    color-scheme: light;
    --blue: #0075de;
    --blue-active: #005bab;
    --indigo: #213183;
    --canvas: #f6f5f4;
    --surface: #ffffff;
    --ink: #000000;
    --ink-2: #31302e;
    --muted: #615d59;
    --faint: #a39e98;
    --hairline: #e6e6e6;
    --sky: #62aef0;
    --purple: #d6b6f6;
    --pink: #ff64c8;
    --orange: #dd5b00;
    --teal: #2a9d99;
    --green: #1aae39;
    --brown: #523410;
    --shadow-soft:
        0 .175px 1.041px rgba(0, 0, 0, .01),
        0 .8px 2.925px rgba(0, 0, 0, .02),
        0 2.025px 7.847px rgba(0, 0, 0, .027),
        0 4px 18px rgba(0, 0, 0, .04);
    --shadow-pop:
        0 2px 8px rgba(0, 0, 0, .04),
        0 12px 32px rgba(0, 0, 0, .06);
    --theme-gradient-1: rgba(214, 182, 246, .34);
    --theme-gradient-2: rgba(98, 174, 240, .22);
}

:root.dark {
    color-scheme: dark;
    --canvas: #191817;
    --surface: #22211f;
    --ink: #ffffff;
    --ink-2: #f0eeeb;
    --muted: #c6c1bb;
    --faint: #8c8781;
    --hairline: #35322f;
    --shadow-soft:
        0 .175px 1.041px rgba(0, 0, 0, .08),
        0 .8px 2.925px rgba(0, 0, 0, .1),
        0 2.025px 7.847px rgba(0, 0, 0, .12),
        0 4px 18px rgba(0, 0, 0, .16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

.boot-screen,
.auth-screen {
    min-height: 100vh;
}

.boot-screen {
    display: grid;
    place-items: center;
}

.loading-card {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .7fr);
    gap: 32px;
    align-items: center;
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 0;
}

.auth-hero {
    padding: 36px 0;
}

.auth-hero h1 {
    max-width: 780px;
    margin: 18px 0 18px;
    font-size: clamp(42px, 8vw, 64px);
    line-height: 1;
}

.auth-hero p {
    max-width: 620px;
    color: var(--ink-2);
    font-size: 18px;
}

.auth-card {
    box-shadow: var(--shadow-pop);
}

.auth-brand {
    margin-bottom: 20px;
    padding: 0;
}

.auth-stickers {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.auth-stickers span {
    width: 42px;
    height: 42px;
    background: var(--dot);
    border: 2px solid var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transform: rotate(-4deg);
}

.auth-stickers span:nth-child(even) {
    transform: rotate(5deg);
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 8%, var(--theme-gradient-1), transparent 180px),
        radial-gradient(circle at 86% 18%, var(--theme-gradient-2), transparent 210px),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-feature-settings: "lnum" 1, "locl" 1;
}

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

button {
    cursor: pointer;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 16px;
    background: rgba(255, 255, 255, .74);
    border-right: 1px solid var(--hairline);
    backdrop-filter: blur(18px);
    overflow-y: auto;
}

:root.dark .sidebar {
    background: rgba(34, 33, 31, .78);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 8px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--surface);
    font-size: 18px;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
    font-weight: 750;
}

.brand small,
.eyebrow,
.metric span,
.muted {
    color: var(--muted);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    color: var(--blue);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.portal-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 999px;
}

.portal-toggle button,
.nav-list button,
.icon-button,
.primary-action,
.ghost-action,
.chip,
.segmented button {
    border: 0;
}

.portal-toggle button {
    min-height: 34px;
    color: var(--muted);
    background: transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
}

.portal-toggle button.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.nav-list {
    display: grid;
    gap: 3px;
}

.user-card {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

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

.nav-list button {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 39px;
    padding: 8px 10px 8px 14px;
    background: transparent;
    color: var(--muted);
    border-radius: 5px;
    text-align: left;
    font-size: 15px;
}

.nav-list button::before {
    content: "";
    position: absolute;
    left: 4px;
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: transparent;
}

.nav-list button.is-active,
.nav-list button:hover {
    background: var(--surface);
    color: var(--ink);
}

.nav-list button.is-active::before {
    background: var(--blue);
}

.nav-list small {
    color: var(--faint);
    font-size: 12px;
}

.workspace {
    min-width: 0;
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 18px 32px;
    background: rgba(246, 245, 244, .82);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(18px);
}

:root.dark .topbar {
    background: rgba(25, 24, 23, .82);
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.33;
    letter-spacing: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 760;
    line-height: 1.1;
    letter-spacing: 0;
}

h2 {
    font-size: 26px;
    font-weight: 750;
    line-height: 1.23;
    letter-spacing: 0;
}

h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: 0;
}

p {
    line-height: 1.5;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(380px, 34vw);
    min-height: 38px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .01);
}

.search:focus-within {
    border-color: rgba(0, 117, 222, .34);
    box-shadow: var(--shadow-soft);
}

.search span {
    color: var(--faint);
    font-size: 12px;
    font-weight: 650;
}

.search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.icon-button,
.primary-action,
.ghost-action {
    min-height: 40px;
    padding: 0 16px;
    font-weight: 650;
    transition: transform .12s ease, background-color .12s ease;
}

.full {
    width: 100%;
}

.tiny {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.icon-button:active,
.primary-action:active,
.ghost-action:active {
    transform: scale(.97);
}

.icon-button {
    width: 40px;
    padding: 0;
    background: rgba(0, 0, 0, .05);
    color: var(--ink);
    border-radius: 999px;
}

:root.dark .icon-button {
    background: rgba(255, 255, 255, .08);
}

.primary-action {
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
}

.primary-action:hover {
    background: var(--blue-active);
}

.ghost-action {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 8px;
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px 56px;
}

.command-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
    padding: 18px 20px;
}

.command-strip p {
    margin: 3px 0 0;
}

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

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

.sticky-panel {
    position: sticky;
    top: 96px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.kpis {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.grid.two {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
}

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

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

.card::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--purple);
    opacity: .9;
}

.card:nth-child(4n + 2)::after {
    background: var(--sky);
}

.card:nth-child(4n + 3)::after {
    background: var(--orange);
}

.card:nth-child(4n + 4)::after {
    background: var(--teal);
}

.panel {
    padding: 24px;
}

.metric {
    padding: 20px;
}

.metric strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 34px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: 0;
}

.metric span {
    font-size: 12px;
    font-weight: 650;
    line-height: 1.33;
}

.metric small {
    color: var(--blue);
    font-weight: 650;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--hairline);
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--surface);
}

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

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

th {
    background: var(--canvas);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
}

tbody tr:hover {
    background: rgba(0, 0, 0, .025);
}

:root.dark tbody tr:hover {
    background: rgba(255, 255, 255, .04);
}

.status,
.chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--canvas);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--faint);
}

.status.completed::before,
.status.approved::before,
.status.active::before,
.status.paid::before {
    background: var(--green);
}

.status.pending::before,
.status.pending_review::before,
.status.generated::before,
.status.in_progress::before {
    background: var(--orange);
}

.status.urgent::before,
.status.rejected::before,
.status.returned_for_revision::before {
    background: var(--pink);
}

.status.high::before {
    background: var(--orange);
}

.status.normal::before,
.status.not_started::before,
.status.draft::before {
    background: var(--sky);
}

.chips,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    border-radius: 4px;
}

hr {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin: 16px 0;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 12px 0 12px 18px;
    border-left: 2px solid var(--hairline);
}

.timeline-item:nth-child(3n + 1) {
    border-left-color: var(--blue);
}

.timeline-item:nth-child(3n + 2) {
    border-left-color: var(--purple);
}

.timeline-item:nth-child(3n + 3) {
    border-left-color: var(--teal);
}

.timeline-item p {
    margin-bottom: 4px;
}

.progress-row {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-weight: 650;
}

.bar {
    height: 8px;
    overflow: hidden;
    background: var(--canvas);
    border-radius: 999px;
}

.bar span {
    display: block;
    height: 100%;
    background: var(--blue);
}

.bar.warn span {
    background: var(--orange);
}

.bar.danger span {
    background: var(--pink);
}

.kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(230px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.kanban-column {
    min-height: 360px;
    padding: 12px;
    background: rgba(255, 255, 255, .58);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

:root.dark .kanban-column {
    background: rgba(255, 255, 255, .03);
}

.kanban-column h3 {
    font-size: 15px;
}

.task-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    margin-top: 12px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.client-card {
    padding: 24px;
}

.client-card h3 {
    margin-bottom: 4px;
}

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

.form-stack {
    display: grid;
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field textarea {
    width: 100%;
    min-height: 40px;
    padding: 6px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preset-btn {
    border-radius: 99px !important;
    padding: 6px 14px !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    transition: all 0.2s ease;
    border: 1px solid var(--hairline) !important;
    user-select: none;
    -webkit-user-select: none;
}

.preset-btn:hover {
    background: var(--sky) !important;
    border-color: var(--blue) !important;
    color: var(--blue) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 0;
    border-color: rgba(0, 117, 222, .44);
    box-shadow: var(--shadow-soft);
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

/* Password field with eye toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 42px !important;
}

.eye-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.eye-toggle:hover {
    color: var(--accent);
    background: rgba(0, 117, 222, 0.08);
}

.eye-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
}

.segmented button {
    min-height: 32px;
    padding: 0 12px;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    font-weight: 650;
}

.segmented button.is-active {
    background: var(--blue);
    color: #fff;
}

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

.empty-state {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 36px 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
}

.empty-state p {
    margin: 0;
}

.approval-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
}

.approval-row:last-child {
    border-bottom: 0;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    max-width: 360px;
    padding: 12px 16px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: var(--shadow-pop);
}

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

.skeleton span,
.skeleton strong,
.skeleton small {
    display: block;
    min-height: 14px;
    color: transparent;
    background: linear-gradient(90deg, var(--canvas), var(--surface), var(--canvas));
    background-size: 220% 100%;
    border-radius: 999px;
    animation: pulse 1.4s infinite;
}

.skeleton strong {
    width: 60%;
    min-height: 34px;
}

@keyframes pulse {
    to {
        background-position: -220% 0;
    }
}

@media (min-width: 1101px) {
    .grid.two > .card:nth-child(2),
    .grid.three > .card,
    .metric:hover,
    .client-card:hover,
    .task-card:hover {
        box-shadow: var(--shadow-soft);
    }
}

@media (max-width: 1100px) {
    .auth-layout,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
    }

    .nav-list {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .split-page,
    .task-layout,
    .grid.kpis,
    .grid.two,
    .grid.three,
    .loading-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar,
    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar,
    .content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .search {
        width: 100%;
    }

    .auth-layout {
        width: min(100% - 28px, 560px);
    }

    .auth-hero h1 {
        font-size: 42px;
    }

    .command-strip,
    .approval-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .split-page,
    .task-layout,
    .grid.kpis,
    .grid.two,
    .grid.three,
    .form-grid,
    .loading-grid {
        grid-template-columns: 1fr;
    }

    }
}

/* Custom enhancements for NCP Bookkeeping */

:root.theme-rose, html.theme-rose, .theme-rose {
    --blue: #e11d48;
    --blue-active: #be123c;
    --indigo: #9f1239;
    --theme-gradient-1: rgba(251, 113, 133, .26);
    --theme-gradient-2: rgba(190, 18, 60, .18);
}

:root.theme-mint, html.theme-mint, .theme-mint {
    --blue: #2a9d8f;
    --blue-active: #207a6f;
    --indigo: #264653;
    --theme-gradient-1: rgba(162, 217, 206, .26);
    --theme-gradient-2: rgba(42, 157, 143, .18);
}

:root.theme-peach, html.theme-peach, .theme-peach {
    --blue: #e76f51;
    --blue-active: #cd5437;
    --indigo: #f4a261;
    --theme-gradient-1: rgba(250, 215, 160, .26);
    --theme-gradient-2: rgba(231, 111, 81, .18);
}

:root.theme-classic, html.theme-classic, .theme-classic {
    --blue: #0075de;
    --blue-active: #005bab;
    --indigo: #213183;
    --theme-gradient-1: rgba(214, 182, 246, .34);
    --theme-gradient-2: rgba(98, 174, 240, .22);
}

.app-shell {
    transition: grid-template-columns 0.25s ease;
}

.sidebar {
    transition: transform 0.25s ease, width 0.25s ease, padding 0.25s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 0px minmax(0, 1fr) !important;
}

.app-shell.sidebar-collapsed .sidebar {
    transform: translateX(-100%) !important;
    pointer-events: none;
    padding: 0 !important;
    border-right: 0 !important;
    width: 0 !important;
    overflow: hidden;
}

.sidebar-toggle-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.12s ease;
}

.sidebar-toggle-btn:hover {
    background-color: var(--canvas);
}

.sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-close-btn:hover {
    background-color: var(--hairline);
    color: var(--ink);
}

.task-status-select {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 600;
}

.brand-logo-img {
    max-height: 36px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.auth-stickers span {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
}

.auth-stickers span:hover {
    transform: scale(1.18) rotate(8deg);
    filter: brightness(1.15);
}

.auth-stickers span:active {
    transform: scale(0.95);
}

.theme-selector {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.theme-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid var(--hairline);
    cursor: pointer;
    transition: transform 0.12s ease;
}

.theme-dot:hover {
    transform: scale(1.1);
}

.theme-dot.is-active {
    border-color: var(--ink);
    transform: scale(1.1);
}

.sop-screenshot-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    padding: 8px;
    border: 1px dashed var(--hairline);
    border-radius: 6px;
    background: var(--canvas);
}

.sop-screenshot-preview img {
    height: 48px;
    width: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.sop-screenshot-preview span {
    font-size: 12px;
    color: var(--muted);
}

.logo-uploader-card {
    padding: 16px;
    border: 1px dashed var(--hairline);
    border-radius: 8px;
    background: var(--canvas);
    margin-bottom: 16px;
}

/* Modals & Search Overlay Enhancements */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: var(--shadow-pop);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-normal {
    width: min(680px, calc(100% - 32px));
}

.modal-card.modal-medium {
    width: min(840px, calc(100% - 32px));
}

.modal-card.modal-large {
    width: min(1120px, calc(100% - 32px));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--hairline);
}

.modal-body {
    padding: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.search-container {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    box-shadow: var(--shadow-pop);
    margin-top: 8px;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.search-results-dropdown.is-active {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    text-align: left;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item:hover {
    background: var(--canvas);
}

.search-result-item strong {
    color: var(--ink);
}

.search-result-item small {
    color: var(--muted);
}

.sop-inline-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px 0;
    border-radius: 12px;
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sop-inline-img:hover {
    transform: scale(1.015);
    box-shadow: var(--shadow-pop);
}

/* Checkbox Pills & Toggle Switch Styles */
.checkbox-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    user-select: none;
}

.checkbox-pill:hover {
    background-color: var(--canvas);
    border-color: var(--faint);
}

.checkbox-pill input[type="checkbox"] {
    width: 14px !important;
    min-height: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    cursor: pointer;
}

.checkbox-pill:has(input[type="checkbox"]:checked) {
    border-color: var(--blue);
    background-color: rgba(0, 117, 222, 0.05);
    color: var(--blue);
}

.switch-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.switch-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: calc(25% - 6px);
    min-width: 145px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
    user-select: none;
}

.switch-pill:hover {
    background-color: var(--canvas);
}

.switch-pill input[type="checkbox"] {
    display: none !important;
}

.switch-pill .switch-slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    background-color: #cbd5e1;
    border-radius: 999px;
    transition: background-color 0.2s;
}

.switch-pill .switch-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background-color: white;
    transition: transform 0.2s;
}

.switch-pill input[type="checkbox"]:checked + .switch-slider {
    background-color: var(--blue);
}

.switch-pill input[type="checkbox"]:checked + .switch-slider::before {
    transform: translateX(14px);
}

.switch-pill:has(input[type="checkbox"]:checked) {
    border-color: rgba(0, 117, 222, 0.3);
    background-color: rgba(0, 117, 222, 0.02);
}

@media (max-width: 720px) {
    .switch-pill {
        width: calc(50% - 4px);
    }
}

