:root {
    --ink: #0B162C;
    --muted: #5b6b86;
    --paper: #f4f7fb;
    --panel: #ffffff;
    --line: #d7e0ef;
    --forest: #0B162C;
    --forest-2: #091223;
    --copper: #0099FF;
    --copper-dark: #007acc;
    --accent: #9D32F5;
    --good: #1f8a5b;
    --danger: #c0392b;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
[x-cloak] { display: none !important; }

.guest-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(0, 153, 255, 0.22), transparent 30%),
        radial-gradient(circle at bottom left, rgba(157, 50, 245, 0.18), transparent 34%),
        linear-gradient(160deg, #0B162C 0%, #091223 52%, #0099FF 160%);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-panel {
    width: min(440px, 100%);
    background: var(--panel);
    border-radius: 22px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(20, 16, 10, 0.28);
}

.login-body {
    padding: 28px 32px 36px;
}

.login-brand {
    padding: 28px 24px 8px;
    text-align: center;
    background: var(--panel);
}

.login-brand .login-logo {
    width: min(300px, 100%);
    margin: 0 auto;
    display: block;
}

.login-panel.wide { width: min(760px, 100%); }
.login-panel a:not(.btn-primary):not(.btn-ghost) { color: var(--copper); font-weight: 700; }

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--copper);
    font-weight: 700;
}

h1, h2 { margin: 0 0 8px; letter-spacing: -0.03em; }
.lede, .muted, .welcome { color: var(--muted); }

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    /* Prevents iOS zoom that breaks edit focus */
    font-size: 16px;
    line-height: 1.35;
    -webkit-appearance: none;
    appearance: none;
}

textarea { min-height: 90px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(0, 153, 255, 0.35);
    border-color: var(--copper);
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: transparent;
}

input::placeholder,
textarea::placeholder {
    color: #a89f94;
    opacity: 1;
}

input[type="file"] {
    padding: 10px 12px;
    background: #fff;
    border: 1px dashed var(--line);
}

.logo-preview {
    display: block;
    max-width: 160px;
    max-height: 80px;
    margin-top: 8px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 6px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    background: var(--copper);
    color: #fff;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus {
    color: #fff;
}

.btn-primary:hover { background: var(--copper-dark); }

.error { color: var(--danger); font-size: 13px; font-weight: 600; }

.demo-box {
    margin-top: 28px;
    padding: 14px 16px;
    background: #f7f1e6;
    border-radius: 12px;
    font-size: 13px;
    color: var(--muted);
}

.demo-box p { margin: 4px 0 0; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: linear-gradient(180deg, var(--forest) 0%, var(--forest-2) 100%);
    color: #f4eee4;
    padding: 22px 16px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    overflow: hidden;
    box-sizing: border-box;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 0;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 42px;
}

.brand-logo,
.login-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--copper);
    font-weight: 800;
}

.brand small,
.sidebar-user small,
.nav-link em {
    display: block;
    color: #c8bfb0;
    font-weight: 500;
    font-style: normal;
    font-size: 12px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    color: #efe7d8;
    flex: 0 0 auto;
    line-height: 1.3;
}

.nav-link:hover,
.nav-link.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.nav-link em {
    background: rgba(0, 153, 255, 0.2);
    color: #f0c2a6;
    padding: 2px 7px;
    border-radius: 999px;
}

.sidebar-user {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 14px;
    display: grid;
    gap: 10px;
    min-height: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12));
}

.link-button {
    background: none;
    border: 0;
    color: #f0c2a6;
    cursor: pointer;
    padding: 0;
    font-weight: 700;
}

.link-button:focus {
    outline: none;
}

.link-button:focus-visible {
    outline: 2px solid rgba(0, 153, 255, 0.45);
    outline-offset: 3px;
    border-radius: 4px;
}

.app-main { min-width: 0; }
.topbar {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 22px 28px 8px;
}

.topbar h1 { font-size: 28px; }
.topbar p { margin: 0; color: var(--muted); }

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    width: 40px;
    height: 40px;
}

.content { padding: 12px 28px 40px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 8px 0 22px;
}

.stat-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.panel.highlight {
    border-color: #efc8b1;
    background: #fff6ef;
}

.overlay { display: none; }

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

.toolbar-dates input[type="date"] {
    width: auto;
    min-width: 140px;
    flex: 1 1 140px;
}

.data-table .table-input {
    width: 100%;
    min-width: 72px;
    max-width: 120px;
    padding: 8px 10px;
}

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, 86vw);
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        z-index: 20;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 16, 10, 0.45);
        z-index: 15;
    }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
    .topbar {
        padding-top: 14px;
        align-items: flex-start;
        gap: 12px;
    }
    .topbar h1 { font-size: 22px; line-height: 1.2; }
    .roles-layout { grid-template-columns: 1fr; }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .customer-row {
        align-items: stretch;
    }
    .customer-add-btn {
        width: 100%;
        align-self: stretch;
    }
    .toolbar .btn-primary,
    .toolbar .btn-ghost {
        width: 100%;
    }
    .detail-grid { grid-template-columns: 1fr; }
    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .filter-tabs button { flex: 0 0 auto; }
}

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

.customer-row {
    align-items: flex-end;
    margin-bottom: 0;
}

.customer-row .grow {
    margin: 0;
}

.customer-add-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 46px;
    align-self: flex-end;
}

.toolbar input[type="search"] {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}

select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    padding-right: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6258' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E") no-repeat right 14px center;
    background-size: 12px 8px;
}

.flash {
    background: #e7f3ea;
    color: var(--good);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 650;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 12px 12px;
}

.data-table td {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    vertical-align: top;
}

.data-table th:nth-last-child(-n+2),
.data-table td:nth-last-child(-n+2) {
    width: 1%;
    white-space: nowrap;
}

.data-table th:last-child,
.data-table td:last-child {
    text-align: right;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.row-actions .link-button,
.row-actions a {
    color: var(--copper);
    font-weight: 700;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.badge-good,
.badge-active { background: #e7f3ea; color: var(--good); }
.badge-muted,
.badge-suspended,
.badge-deactivated { background: #efe8dc; color: var(--muted); }
.badge-pending { background: #fff3d6; color: #8a6a12; }
.badge-rejected { background: #f8e4e0; color: var(--danger); }

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tabs button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}

.filter-tabs button.is-active {
    background: var(--forest);
    border-color: var(--forest);
    color: #fff;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin-top: 18px;
}

.detail-grid dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.detail-grid dd { margin: 4px 0 0; font-weight: 650; }

.table-wrap { overflow-x: auto; }
.data-table a { color: var(--copper); font-weight: 700; }
.panel + .panel { margin-top: 16px; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.form-grid .toolbar,
.form-grid .full { grid-column: 1 / -1; }

.roles-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
}

.role-list { display: grid; gap: 8px; align-content: start; }

.role-item {
    display: grid;
    gap: 4px;
    text-align: left;
    border: 1px solid transparent;
    background: #f7f1e6;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    color: inherit;
}

.role-item.is-active {
    border-color: var(--copper);
    background: #fff6ef;
}

.perm-group {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 14px 0;
}

.perm-group legend {
    padding: 0 6px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
    .login-body { padding: 22px 18px 28px; }
    .login-brand { padding: 22px 16px 4px; }
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card strong { font-size: 24px; }
    .content { padding-bottom: 28px; }
    .panel, .stat-card { padding: 14px; }
    .invoice-sheet { margin: 12px; padding: 16px; }
    .invoice-header { flex-direction: column; gap: 10px; }
    .invoice-meta { flex-direction: column; gap: 8px; }
    .pay-grid { grid-template-columns: 1fr; }
    .totals input { width: 100%; max-width: 140px; }
    .btn-primary,
    .btn-ghost {
        min-height: 44px;
        width: 100%;
    }
    .form-grid .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    /* Stack editable line tables on phones so qty/price stay editable */
    .stack-table thead { display: none; }
    .stack-table,
    .stack-table tbody,
    .stack-table tr,
    .stack-table td {
        display: block;
        width: 100%;
    }
    .stack-table tr {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 10px;
    }
    .stack-table td {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 8px 0;
        border-top: 0;
        text-align: left !important;
        white-space: normal;
        width: 100% !important;
    }
    .stack-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
    }
    .stack-table td:first-child {
        display: block;
        padding-top: 0;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--line);
        margin-bottom: 4px;
    }
    .stack-table td:first-child::before { display: none; }
    .stack-table td:last-child {
        display: flex;
        justify-content: flex-end;
        grid-template-columns: none;
        padding-bottom: 0;
    }
    .stack-table td:last-child::before { display: none; }
    .stack-table .table-input {
        max-width: none;
        width: 100%;
    }
    .data-table th:nth-last-child(-n+2),
    .data-table td:nth-last-child(-n+2) {
        white-space: normal;
    }
    .row-actions {
        justify-content: flex-end;
    }
    .stack-table tr.empty-row {
        border: 0;
        padding: 0;
        background: transparent;
        margin: 0;
    }
    .stack-table tr.empty-row td {
        display: block;
        padding: 12px;
        border: 0;
    }
    .stack-table tr.empty-row td::before {
        display: none;
    }
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.plan-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.plan-card.is-current {
    border-color: #efc8b1;
    background: #fff6ef;
}

.plan-card strong {
    font-size: 28px;
    letter-spacing: -0.04em;
}

.plan-benefits {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 14px;
}

.plan-benefits li { margin: 4px 0; }

select:disabled {
    background-color: #f3efe6;
    color: var(--ink);
    cursor: not-allowed;
    opacity: 1;
}

.grow { flex: 1; min-width: 0; }

.search-results {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.search-results button {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    cursor: pointer;
    display: grid;
    gap: 2px;
}
.search-results button:hover { background: #fff6ef; }
.bill-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    gap: 16px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}
.bill-main {
    min-width: 0;
    max-width: 100%;
}
.bill-side {
    position: sticky;
    top: 16px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.totals { display: grid; gap: 8px; margin: 16px 0; }
.totals dt,
.totals dd { margin: 0; }
.totals > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.totals .grand { font-size: 18px; font-weight: 800; }
.totals input {
    width: 110px;
    min-width: 0;
    padding: 8px 10px;
}
.pay-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin: 12px 0;
    min-width: 0;
}
.pay-grid label {
    min-width: 0;
}
.pay-grid input {
    width: 100%;
    min-width: 0;
}
.toolbar.stacked { flex-direction: column; align-items: stretch; }
.invoice-sheet {
    max-width: 720px;
    margin: 24px auto;
    background: #fff;
    padding: 28px;
    border: 1px solid var(--line);
}
.invoice-meta { display: flex; justify-content: space-between; margin: 18px 0; }
.invoice-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.invoice-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 72px;
}
.print-body { background: #fff; }
@media print {
    .no-print { display: none !important; }
    .invoice-sheet { border: 0; margin: 0; max-width: none; }
}

@media (max-width: 960px) {
    .bill-screen {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        max-width: 100%;
    }
    .bill-main,
    .bill-side {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        position: static;
    }
    .bill-side {
        order: 2;
    }
    .bill-main {
        order: 1;
    }
    .customer-row {
        flex-direction: column;
        align-items: stretch;
    }
    .customer-add-btn {
        width: 100%;
    }
    .pay-grid {
        grid-template-columns: 1fr;
    }
}


.success { color: var(--good); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-card span { display:block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat-card strong { font-size: 24px; color: var(--ink); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom: 14px; }
.toolbar { display:flex; justify-content:space-between; align-items:end; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.filters { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
th, td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
.badge { display:inline-block; padding:4px 10px; border-radius:999px; background: rgba(0,153,255,.12); color: var(--copper-dark); font-size:12px; font-weight:700; text-transform:capitalize; }
.stack { display:grid; gap:14px; }
.grid-2 { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
@media (max-width:720px){ .grid-2{ grid-template-columns:1fr; } }
.row-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.row-actions.wrap { flex-wrap:wrap; }
.inline-form { display:flex; gap:10px; flex-wrap:wrap; margin: 10px 0 14px; }
.chip-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:8px; margin-bottom:12px; }
.detail-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap:12px; }
.detail-grid dt { color: var(--muted); font-size:12px; }
.detail-grid dd { margin:4px 0 0; font-weight:600; }
.timeline { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.form-panel { max-width:720px; }
.check { display:flex; gap:8px; align-items:center; }
.center { text-align:center; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.link-button { background:none; border:0; color: var(--copper); cursor:pointer; font-weight:700; padding:0; }
.btn-primary, button.btn-primary, a.btn-primary {
    display:inline-flex; align-items:center; justify-content:center;
    background: linear-gradient(135deg, var(--copper), var(--accent));
    color:#fff; border:0; border-radius:12px; padding:10px 16px; font-weight:700; cursor:pointer;
}
.btn-ghost, a.btn-ghost, button.btn-ghost {
    display:inline-flex; align-items:center; justify-content:center;
    background: transparent; color: var(--ink); border:1px solid var(--line); border-radius:12px; padding:10px 16px; font-weight:600; cursor:pointer;
}
label span { display:block; margin-bottom:6px; font-size:13px; color: var(--muted); font-weight:600; }
input, select, textarea {
    width:100%; border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fff; color: var(--ink);
}

button:disabled { opacity:.55; cursor:not-allowed; }
.alert { padding:12px 14px; border-radius:12px; margin:12px 0; border:1px solid transparent; }
.alert-danger { color:#8f2f24; background:#fff0ed; border-color:#f4c8c1; }
.alert-success { color:#176a47; background:#eaf8f1; border-color:#bfe7d2; }
.alert-info { color:#075e99; background:#eaf6ff; border-color:#b9ddf6; }
.field-error { color:var(--danger); font-size:12px; font-weight:650; }
.split-actions,.topbar-actions,.flow-actions,.setup-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.topbar-actions { margin-left:auto; }
.location-selector { background:#fff; border:1px solid var(--line); border-radius:999px; padding:9px 13px; font-size:13px; font-weight:700; }
.quick-add { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; color:#fff; background:linear-gradient(135deg,var(--copper),var(--accent)); font-size:22px; }
.empty-state { text-align:center; padding:30px 18px; max-width:520px; margin:auto; }
.empty-state h3 { margin:6px 0; }.empty-icon { display:inline-grid; place-items:center; width:44px; height:44px; border-radius:50%; background:#eaf6ff; color:var(--copper); font-size:22px; }
.btn-danger { display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:12px; padding:10px 16px; color:#fff; background:var(--danger); font-weight:700; cursor:pointer; }
.badge-confirmed,.badge-completed,.badge-active { background:#e7f3ea;color:var(--good) }.badge-cancelled,.badge-no_show { background:#f8e4e0;color:var(--danger) }.badge-checked_in,.badge-in_progress { background:#eaf6ff;color:#075e99 }
.workspace-grid,.setup-shell,.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr); gap:18px; align-items:start; }
.card-list { display:grid; gap:10px; }.location-card,.list-card { border:1px solid var(--line); border-radius:12px; padding:14px; display:flex; justify-content:space-between; gap:12px; align-items:center; background:#fff; }.location-card.is-selected,.choice-card.is-selected { border-color:var(--copper); box-shadow:0 0 0 2px rgba(0,153,255,.12); }
.progress-track { height:8px; border-radius:99px; background:#e5ebf5; overflow:hidden; margin:14px 0; }.progress-track span { display:block; height:100%; background:linear-gradient(90deg,var(--copper),var(--accent)); }
.setup-checklist { list-style:none; padding:0; display:grid; gap:5px; }.setup-checklist button { width:100%; display:flex; gap:10px; align-items:center; border:0; background:transparent; padding:9px; border-radius:10px; text-align:left; color:var(--ink); }.setup-checklist button.is-active { background:#eaf6ff; }.setup-checklist button span { width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:#edf1f7;font-weight:700; }
.setup-stage { min-height:440px; }.setup-actions,.flow-actions { border-top:1px solid var(--line); padding-top:16px; margin-top:22px; }
.stepper { display:flex; overflow:auto; gap:6px; margin-bottom:16px; padding-bottom:5px; }.stepper button { flex:1 0 90px; border:0; background:transparent; color:var(--muted); font-size:12px; font-weight:700; padding:8px 4px; }.stepper button span { display:grid; place-items:center; margin:0 auto 5px; width:28px; height:28px; border-radius:50%; background:#e4eaf3; }.stepper button.is-active { color:var(--copper-dark); }.stepper button.is-active span,.stepper button.is-done span { color:#fff;background:linear-gradient(135deg,var(--copper),var(--accent)); }
.booking-flow { max-width:980px; margin:auto; }.flow-stage { min-height:420px; }.choice-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; }.choice-card { display:grid; gap:6px; text-align:left; padding:16px; border-radius:14px; border:1px solid var(--line); background:#fff; color:var(--ink); cursor:pointer; }.choice-card span { color:var(--muted); }.choice-card b { color:var(--copper-dark); }
.slot-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:9px; }.slot-grid button { border:1px solid var(--line); background:#fff; border-radius:10px; padding:12px; font-weight:700; }.slot-grid button.is-selected { border-color:var(--copper); color:var(--copper-dark); background:#eaf6ff; }
.summary-list { display:grid; gap:0; border:1px solid var(--line); border-radius:14px; overflow:hidden; }.summary-list div { display:flex; justify-content:space-between; gap:20px; padding:13px 15px; border-bottom:1px solid var(--line); }.summary-list div:last-child{border:0}.summary-list dt{color:var(--muted)}.summary-list dd{margin:0;font-weight:700;text-align:right}
.loading-panel { padding:16px; border-radius:12px; background:#edf4fb; color:var(--muted); margin:10px 0; }.is-loading { opacity:.65; pointer-events:none; }
.calendar-toolbar { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px; }.view-switch { display:flex; border:1px solid var(--line); border-radius:12px; overflow:hidden; }.view-switch button { border:0; background:#fff; padding:10px 12px; }.view-switch button.is-active { background:var(--forest);color:#fff; }
.calendar-board { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; align-items:start; }.calendar-column { display:grid; gap:8px; }.calendar-event { border-left:4px solid var(--copper); background:#f5faff; border-radius:10px; padding:11px; display:grid; gap:3px; }.calendar-event time,.calendar-event span{font-size:12px;color:var(--muted)}
.tabs { display:flex; overflow:auto; gap:4px; margin:18px 0 10px; border-bottom:1px solid var(--line); }.tabs button { border:0; border-bottom:3px solid transparent; padding:11px 14px; background:transparent; font-weight:700; }.tabs button.is-active { color:var(--copper-dark); border-color:var(--copper); }
.profile-head { display:flex; justify-content:space-between; align-items:center; gap:16px; }.service-chip { border:1px solid var(--line); border-radius:999px; padding:8px 12px; background:#fff; text-align:left; }.service-chip span { color:var(--copper); font-size:11px; margin-left:5px; }.schedule-list { display:grid; gap:8px; margin-bottom:20px; }.schedule-row { display:grid; grid-template-columns:70px 70px 1fr 1fr; gap:10px; align-items:center; }
.quick-actions { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }.quick-actions a { background:#fff; border:1px solid var(--line); border-radius:12px; padding:14px; color:var(--copper-dark); font-weight:700; }.setup-callout { margin-top:18px; display:flex; justify-content:space-between; align-items:center; gap:16px; background:linear-gradient(120deg,#fff,#eef8ff); }
.dialog-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:center; background:rgba(9,18,35,.65); padding:16px; }.confirm-dialog { width:min(500px,100%); background:#fff; border-radius:18px; padding:22px; box-shadow:0 24px 70px rgba(0,0,0,.3); }
.status-orb { display:block; width:56px;height:56px;border-radius:50%;margin:0 auto 14px;background:#fff3d6;border:10px solid #ffdf8d}.status-rejected,.status-suspended{background:#f8e4e0;border-color:#efafa4}.application-ref{background:#f5f7fb;padding:12px;border-radius:10px}
.success-mark { display:grid;place-items:center;width:64px;height:64px;border-radius:50%;margin:0 auto 14px;background:#e7f3ea;color:var(--good);font-size:32px;font-weight:800}.pagination{display:flex;justify-content:center;align-items:center;gap:14px;margin-top:16px}
.mobile-nav { display:none; }
@media(max-width:960px){.workspace-grid,.setup-shell,.dashboard-grid{grid-template-columns:1fr}.quick-actions{grid-template-columns:1fr 1fr}.content{padding-bottom:96px}.mobile-nav{position:fixed;display:flex;z-index:40;bottom:0;left:0;right:0;height:72px;padding:8px max(10px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);justify-content:space-around;align-items:center}.mobile-nav a,.mobile-nav button{border:0;background:transparent;display:grid;gap:2px;place-items:center;font-size:11px;color:var(--muted)}.mobile-nav .is-active{color:var(--copper-dark)}.mobile-nav .mobile-add{width:48px;height:48px;margin-top:-24px;border-radius:50%;background:linear-gradient(135deg,var(--copper),var(--accent));color:#fff;font-size:24px;box-shadow:0 5px 16px rgba(0,153,255,.32)}}
@media(max-width:720px){.topbar-actions .location-selector span{display:none}.quick-actions{grid-template-columns:1fr}.schedule-row{grid-template-columns:1fr 1fr}.schedule-row strong{grid-column:1/-1}.profile-head,.setup-callout,.location-card,.list-card{align-items:flex-start;flex-direction:column}.calendar-board{grid-template-columns:1fr}.stepper button{flex-basis:76px}.summary-list div{display:block}.summary-list dd{text-align:left;margin-top:4px}.data-table,.table-wrap table{min-width:620px}}
