@font-face {
    font-family: "Euclid";
    src:
        url("/fonts/EuclidCircularA-Regular.woff2") format("woff2"),
        url("/fonts/EuclidCircularA-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Euclid";
    src:
        url("/fonts/EuclidCircularA-Medium.woff2") format("woff2"),
        url("/fonts/EuclidCircularA-Medium.woff") format("woff");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #24243f;
    --ink-strong: #101010;
    --accent: #6B094C;
    --accent-strong: #870c62;
    --teal: #0f9f91;
    --teal-dark: #087d73;
    --blue: #1d8fca;
    --amber: #f2a812;
    --paper: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fbfe;
    --line: #dfe8f2;
    --line-strong: #cbd9e8;
    --muted: #68758a;
    --success: #15936d;
    --warning: #b97808;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(35, 50, 80, 0.09);
    --shadow-soft: 0 10px 28px rgba(35, 50, 80, 0.07);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Euclid", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    outline: none;
}

input,
select {
    height: 44px;
    padding: 0 14px;
}

textarea {
    min-height: 112px;
    resize: vertical;
    padding: 12px 14px;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 159, 145, 0.75);
    box-shadow: 0 0 0 4px rgba(15, 159, 145, 0.12);
}

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--ink-strong);
    transition: opacity 220ms ease, visibility 220ms ease;
}

body.loaded .splash-screen {
    visibility: hidden;
    opacity: 0;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--teal-dark));
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.primary-button,
.success-button,
.ghost-button,
.primary-link,
.soft-link,
.pill-action {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 600;
    white-space: nowrap;
}

.primary-button,
.primary-link {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 12px 22px rgba(107, 9, 76, 0.18);
}

.primary-button:hover,
.primary-link:hover {
    transform: translateY(-1px);
}

.soft-link,
.ghost-button {
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.success-button {
    color: #fff;
    background: var(--success);
}

.alert {
    margin-bottom: 20px;
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
}

.alert-error {
    color: #7a1d15;
    background: #fff0ee;
}

.alert-success {
    color: #135c39;
    background: #edf9f2;
}

.auth-screen {
    display: grid;
    place-items: center;
    padding: 28px;
    background: var(--ink-strong);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    width: min(1080px, 100%);
    min-height: 650px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    background: #181818;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 56px;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(107, 9, 76, 0.74), rgba(16, 16, 16, 0.9)),
        url("../img/fabric-pattern.svg");
    background-size: cover;
}

.auth-brand h1 {
    max-width: 620px;
    margin: 16px 0 14px;
    font-size: 56px;
    line-height: 1;
}

.auth-brand p:not(.eyebrow) {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
    line-height: 1.65;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    background: var(--surface);
}

.login-form {
    display: grid;
    gap: 18px;
}

.form-heading h2,
.page-heading h1,
.wizard-step h2,
.panel-heading h2,
.module-state h2,
.empty-state h1 {
    margin: 0;
    line-height: 1.1;
}

.form-heading h2 {
    font-size: 32px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.split {
    justify-content: space-between;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-line input,
.service-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.check-line span {
    margin: 0;
}

.app-shell {
    display: block;
    background: var(--paper);
}

.workspace {
    min-width: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(35, 50, 80, 0.04);
}

.app-topbar,
.app-menubar,
.page-content {
    width: min(1424px, calc(100% - 48px));
    margin: 0 auto;
}

.app-topbar {
    display: grid;
    grid-template-columns: 260px minmax(280px, 520px) minmax(330px, 1fr);
    gap: 24px;
    align-items: center;
    min-height: 74px;
}

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

.brand-block strong,
.brand-block small,
.user-menu strong,
.user-menu small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-block strong {
    color: var(--ink);
    font-weight: 600;
}

.brand-block small,
.user-menu small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.app-search {
    position: relative;
}

.app-search span {
    position: absolute;
    left: 16px;
    top: 6px;
    margin: 0;
    color: #91a0b5;
    font-size: 10px;
    font-weight: 600;
}

.app-search input {
    height: 48px;
    border-radius: 999px;
    padding: 14px 18px 0;
    background: var(--surface-soft);
}

.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.top-icon-button,
.mobile-nav-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--blue);
    background: #fff;
    font-weight: 600;
}

.branch-filter {
    width: 170px;
    border-radius: 999px;
    background: #fff;
}

.user-menu {
    display: flex;
    min-width: 172px;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--blue);
    font-weight: 600;
}

.mobile-nav-button {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
}

.app-menubar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 58px;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.top-nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border-radius: 999px;
    padding: 0 16px;
    color: #46556d;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.top-nav a:hover,
.top-nav a.active {
    color: #04709a;
    background: #e9f8ff;
}

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

.pill-action {
    min-height: 42px;
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.pill-action.teal {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.pill-action.dark {
    background: linear-gradient(135deg, #2f405d, #17223a);
}

.page-content {
    position: relative;
    padding: 28px 0 58px;
}

.page-content[aria-busy="true"] {
    opacity: 0.62;
    pointer-events: none;
}

.page-content[aria-busy="true"]::before {
    position: fixed;
    left: 0;
    right: 0;
    top: 132px;
    z-index: 45;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--teal), var(--blue));
    content: "";
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-heading h1 {
    font-size: 32px;
}

.page-heading p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

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

.dashboard-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
    gap: 16px;
    margin-bottom: 18px;
}

.welcome-panel,
.summary-panel,
.metric-card,
.panel,
.data-panel,
.wizard-shell,
.module-state,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.welcome-panel {
    min-height: 340px;
    padding: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(236, 249, 255, 0.9)),
        url("../img/fabric-pattern.svg");
    background-size: cover;
}

.status-badge {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
}

.status-badge i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(21, 147, 109, 0.13);
}

.welcome-panel h2 {
    margin: 22px 0 12px;
    font-size: 30px;
    line-height: 1.15;
}

.welcome-panel p {
    max-width: 720px;
    margin: 0;
    color: #536278;
    line-height: 1.75;
}

.welcome-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.activity-pill {
    display: grid;
    gap: 6px;
    width: min(680px, 100%);
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.86);
}

.activity-pill strong {
    font-size: 14px;
}

.activity-pill span {
    color: var(--muted);
    font-size: 14px;
}

.summary-panel,
.panel,
.data-panel {
    padding: 18px;
}

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

.panel-heading h2 {
    font-size: 18px;
}

.panel-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.panel-heading a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
}

.segment-control {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    background: var(--surface-soft);
}

.segment-control button {
    min-width: 72px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
}

.segment-control button.active {
    color: #fff;
    background: var(--blue);
    box-shadow: 0 8px 16px rgba(29, 143, 202, 0.2);
}

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

.summary-matrix div {
    min-height: 116px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: #fff;
}

.summary-matrix span,
.metric-card span,
.quote-box span,
.summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.summary-matrix strong {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    line-height: 1.1;
}

.summary-matrix small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    display: grid;
    min-height: 124px;
    align-content: space-between;
    border-left-width: 4px;
    padding: 18px;
}

.metric-card strong {
    font-size: 28px;
    line-height: 1.05;
}

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

.metric-card.violet {
    border-left-color: #7d5cff;
}

.metric-card.teal {
    border-left-color: var(--teal);
}

.metric-card.amber,
.metric-card.warn {
    border-left-color: var(--amber);
}

.metric-card.blue,
.metric-card.danger {
    border-left-color: var(--blue);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 16px;
    margin-bottom: 18px;
}

.panel.wide {
    min-height: 278px;
}

.branch-list {
    display: grid;
    gap: 14px;
}

.branch-row {
    display: grid;
    grid-template-columns: 160px minmax(100px, 1fr) 130px;
    gap: 14px;
    align-items: center;
    min-height: 48px;
}

.branch-row strong,
.branch-row small {
    display: block;
}

.branch-row small {
    margin-top: 4px;
    color: var(--muted);
}

.branch-row b {
    text-align: right;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef6;
}

.bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--teal));
}

.rank-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-list li {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.rank-list strong {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
}

.data-panel {
    overflow: hidden;
}

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

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
}

.data-table th {
    color: #8a96aa;
    background: #f8fbfe;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.table-status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    color: #086d55;
    background: #eaf8f3;
    font-size: 12px;
    font-weight: 600;
}

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

.timeline-item {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
}

.timeline-item strong,
.timeline-item span {
    display: block;
}

.timeline-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.status-pill {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    border-radius: 999px;
    padding: 0 12px;
    color: #fff;
    background: var(--ink);
    font-weight: 600;
}

.wizard-shell {
    padding: 18px;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.step-dot {
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: #fff;
    font-weight: 600;
}

.step-dot span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
}

.step-dot.active {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.wizard-form {
    display: grid;
    gap: 18px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: grid;
    gap: 18px;
}

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

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

.service-option {
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) 130px;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fff;
}

.service-option span {
    margin: 0;
    color: var(--ink);
}

.quote-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(107, 9, 76, 0.24);
    border-radius: var(--radius);
    padding: 18px;
    background: #fbf7fa;
}

.quote-box strong {
    color: var(--accent);
    font-size: 28px;
}

.contract-preview {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 18px;
    background: #fbfaf8;
}

.contract-preview p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

.summary-grid div,
.installment-list div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fff;
}

.summary-grid strong {
    display: block;
    margin-top: 7px;
    font-size: 17px;
}

.installment-list {
    display: grid;
    gap: 8px;
}

.installment-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.module-state,
.empty-state {
    padding: 28px;
}

.module-state p,
.empty-state p {
    max-width: 680px;
    color: var(--muted);
    line-height: 1.65;
}

.module-state-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.module-state-grid span {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    font-weight: 600;
    background: #fff;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
}

.toast {
    border-radius: var(--radius);
    padding: 13px 15px;
    color: #fff;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
    animation: toast-in 180ms ease-out;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

@keyframes toast-in {
    from {
        transform: translateY(8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 1180px) {
    .app-topbar {
        grid-template-columns: 240px minmax(240px, 1fr) auto;
    }

    .branch-filter {
        display: none;
    }

    .dashboard-hero-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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

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

    .auth-brand {
        min-height: 320px;
        padding: 34px;
    }

    .auth-brand h1 {
        font-size: 40px;
    }

    .app-topbar,
    .app-menubar,
    .page-content {
        width: min(100% - 32px, 1424px);
    }

    .app-topbar {
        grid-template-columns: 1fr auto;
        min-height: 70px;
    }

    .app-search {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-bottom: 12px;
    }

    .header-tools {
        justify-content: flex-end;
    }

    .top-icon-button,
    .user-menu > span:not(.avatar) {
        display: none;
    }

    .user-menu {
        min-width: 0;
    }

    .mobile-nav-button {
        display: inline-flex;
    }

    .app-menubar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding-bottom: 14px;
    }

    .top-nav {
        display: none;
        flex-wrap: wrap;
        overflow: visible;
    }

    .top-nav.open {
        display: flex;
    }

    .nav-actions {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .page-content[aria-busy="true"]::before {
        top: 128px;
    }

    .form-grid,
    .service-grid,
    .summary-grid,
    .module-state-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .auth-screen {
        padding: 16px;
    }

    .auth-panel,
    .auth-brand {
        padding: 24px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-actions,
    .welcome-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-actions a,
    .welcome-actions a {
        width: 100%;
    }

    .page-heading h1 {
        font-size: 28px;
    }

    .dashboard-hero-grid {
        grid-template-columns: 1fr;
    }

    .welcome-panel {
        padding: 22px;
    }

    .welcome-panel h2 {
        font-size: 25px;
    }

    .summary-matrix,
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .segment-control {
        width: 100%;
    }

    .segment-control button {
        min-width: 0;
        flex: 1;
    }

    .branch-row {
        grid-template-columns: 1fr;
    }

    .branch-row b {
        text-align: left;
    }

    .activity-pill {
        border-radius: var(--radius);
    }

    .service-option {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .service-option input[type="number"] {
        grid-column: 1 / -1;
    }

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

    .wizard-actions {
        flex-direction: column-reverse;
    }

    .wizard-actions button {
        width: 100%;
    }
}

.branch-select {
    position: relative;
    width: 190px;
    flex: 0 0 190px;
}

.branch-select-trigger {
    display: flex;
    width: 100%;
    height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(15, 159, 145, 0.26);
    border-radius: 999px;
    padding: 0 14px 0 16px;
    color: var(--ink);
    background: linear-gradient(180deg, #ffffff, #f5fbfb);
    box-shadow: 0 10px 26px rgba(15, 159, 145, 0.10);
}

.branch-select-trigger span {
    display: grid;
    gap: 2px;
    text-align: left;
}

.branch-select-trigger small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.branch-select-trigger strong {
    font-size: 14px;
    font-weight: 600;
}

.branch-select-trigger i {
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--teal-dark);
    border-bottom: 2px solid var(--teal-dark);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
}

.branch-select.open .branch-select-trigger {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 159, 145, 0.12), 0 14px 30px rgba(15, 159, 145, 0.16);
}

.branch-select.open .branch-select-trigger i {
    transform: rotate(225deg) translate(-2px, -1px);
}

.branch-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 80;
    display: none;
    width: 220px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(35, 50, 80, 0.18);
}

.branch-select.open .branch-select-menu {
    display: grid;
    gap: 4px;
}

.branch-select-menu button {
    height: 38px;
    border: 0;
    border-radius: 7px;
    padding: 0 12px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    font-weight: 600;
}

.branch-select-menu button:hover,
.branch-select-menu button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.sales-wizard-shell {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.wizard-aside,
.wizard-main {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.wizard-aside {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px;
    background:
        linear-gradient(160deg, rgba(107, 9, 76, 0.08), rgba(15, 159, 145, 0.08)),
        #fff;
}

.wizard-brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
}

.wizard-brand-card strong,
.wizard-brand-card small {
    display: block;
}

.wizard-brand-card small,
.wizard-aside-list span,
.wizard-note p {
    color: var(--muted);
}

.wizard-aside-list {
    display: grid;
    gap: 10px;
}

.wizard-aside-list div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(255, 255, 255, 0.76);
}

.wizard-aside-list strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

.wizard-note {
    border-radius: var(--radius);
    padding: 14px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), #35142d);
}

.wizard-note p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.55;
}

.wizard-main {
    padding: 18px;
}

.sales-wizard-shell .wizard-steps {
    grid-template-columns: repeat(6, minmax(88px, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    background: var(--surface-soft);
}

.sales-wizard-shell .step-dot {
    min-height: 62px;
    border: 0;
    background: transparent;
}

.sales-wizard-shell .step-dot.active {
    background: linear-gradient(135deg, var(--accent), var(--teal-dark));
    box-shadow: 0 12px 22px rgba(107, 9, 76, 0.16);
}

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

.step-header span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    color: var(--teal-dark);
    background: #e9fbf8;
    font-size: 12px;
    font-weight: 600;
}

.step-header h2 {
    margin-top: 10px;
}

.step-header p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.form-grid.elevated {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: #fff;
}

.field-wide {
    grid-column: span 2;
}

.payment-layout,
.contract-layout {
    display: grid;
    gap: 14px;
}

.sms-hero-panel,
.invoice-grid,
.branch-card-grid,
.sales-card-grid,
.stock-summary-grid,
.product-card-grid,
.sms-card-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.sms-hero-panel {
    grid-template-columns: minmax(0, 1fr) 420px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: linear-gradient(145deg, #ffffff, #eefbff);
    box-shadow: var(--shadow);
}

.sms-hero-panel h2 {
    max-width: 720px;
    margin: 18px 0 10px;
    font-size: 28px;
}

.sms-hero-panel p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.sms-hero-stats,
.branch-metrics,
.product-stock-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sms-hero-stats div,
.branch-metrics div,
.product-stock-row div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fff;
}

.sms-hero-stats span,
.branch-metrics span,
.product-stock-row span,
.sale-total span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.sms-hero-stats strong,
.branch-metrics strong,
.product-stock-row strong,
.sale-total strong {
    display: block;
    margin-top: 7px;
    font-size: 24px;
}

.sms-card-grid,
.branch-card-grid,
.sales-card-grid,
.product-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sms-action-card,
.branch-card,
.sale-card,
.product-card {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.sms-action-card {
    min-height: 280px;
}

.sms-card-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--teal-dark));
    font-weight: 600;
}

.sms-action-card h2,
.branch-card h2,
.sale-card h2,
.product-card h2 {
    margin: 0;
    font-size: 19px;
}

.sms-action-card p,
.branch-card p,
.sale-card p,
.product-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.sms-card-meta,
.branch-contact,
.product-price-row,
.sale-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sms-card-meta span,
.branch-contact span,
.product-price-row span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    color: #526176;
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 600;
}

.branch-card-head,
.sale-card-head,
.product-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.branch-card-head h2,
.sale-card-head h2,
.product-card-head h2 {
    margin-top: 8px;
}

.branch-code,
.sale-card-head span,
.product-card-head span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.branch-progress {
    display: grid;
    gap: 8px;
}

.branch-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
}

.sale-total {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--surface-soft);
}

.sale-actions a {
    min-height: 38px;
    box-shadow: none;
}

.invoice-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}

.mini-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-list button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    padding: 0 12px;
    color: #fff;
    background: var(--accent);
    font-weight: 600;
}

.empty-table-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 140px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

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

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

.product-card.critical {
    border-color: rgba(180, 35, 24, 0.25);
}

.stock-badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    color: #086d55;
    background: #eaf8f3;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.stock-badge.danger {
    color: #8b1f17;
    background: #fff0ee;
}

.warehouse-summary {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    font-size: 13px;
}

.employee-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
    gap: 16px;
}

.employee-form {
    display: grid;
    gap: 16px;
}

.employee-list {
    display: grid;
    gap: 10px;
}

.employee-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: #fff;
}

.employee-row strong,
.employee-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-row small {
    margin-top: 4px;
    color: var(--muted);
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
}

.calendar-panel,
.appointment-detail-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.calendar-panel {
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 78px repeat(7, minmax(138px, 1fr));
}

.calendar-head {
    position: sticky;
    top: 132px;
    z-index: 5;
    background: #fff;
}

.time-head,
.day-head {
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 12px;
}

.time-head {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.day-head strong,
.day-head span {
    display: block;
}

.day-head span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.calendar-body {
    max-height: calc(100vh - 270px);
    overflow: auto;
}

.calendar-row {
    min-height: 86px;
}

.time-cell {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    background: var(--surface-soft);
}

.calendar-cell {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 86px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 8px;
    background: #fff;
}

.appointment-chip {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid rgba(15, 159, 145, 0.22);
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--ink);
    background: #ebfbf8;
    text-align: left;
}

.appointment-chip strong,
.appointment-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-chip span {
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 600;
}

.appointment-chip.active,
.appointment-chip:hover {
    border-color: var(--accent);
    background: #fbedf7;
}

.appointment-detail-panel {
    position: sticky;
    top: 150px;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px;
}

.appointment-detail-panel h2 {
    margin: 0;
}

.appointment-detail-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-list div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-soft);
}

.detail-list span,
.detail-list strong {
    display: block;
}

.detail-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.detail-list strong {
    margin-top: 5px;
}

@media (max-width: 1180px) {
    .sms-card-grid,
    .branch-card-grid,
    .sales-card-grid,
    .product-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-wizard-shell,
    .sms-hero-panel,
    .invoice-grid,
    .employee-layout,
    .calendar-layout {
        grid-template-columns: 1fr;
    }

    .appointment-detail-panel {
        position: static;
    }

    .wizard-aside {
        order: 2;
    }
}

@media (max-width: 920px) {
    .branch-select {
        display: none;
    }

    .sales-wizard-shell .wizard-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .sms-card-grid,
    .branch-card-grid,
    .sales-card-grid,
    .product-card-grid,
    .stock-summary-grid {
        grid-template-columns: 1fr;
    }

    .sms-hero-stats,
    .branch-metrics,
    .product-stock-row {
        grid-template-columns: 1fr;
    }

    .mini-list div {
        grid-template-columns: 1fr;
    }

    .sales-wizard-shell .wizard-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
