:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --border: #d9e2ef;
    --text: #10233f;
    --muted: #66758c;
    --primary: #2457ff;
    --primary-strong: #1636d8;
    --accent: #15a36a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --sidebar: #0f172a;
    --sidebar-soft: #17213a;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
}

body {
    line-height: 1.45;
    background: #f5f6f8;
}

.hidden {
    display: none !important;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(36, 87, 255, 0.24), transparent 30%),
        radial-gradient(circle at right center, rgba(21, 163, 106, 0.16), transparent 24%),
        linear-gradient(180deg, #eef4ff 0%, #f3f6fb 100%);
}

.login-panel {
    width: min(560px, 100%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(217, 226, 239, 0.9);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 36px;
}

.login-brand {
    display: grid;
    gap: 18px;
    align-items: start;
    margin-bottom: 28px;
}

.brand-mark {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, #00b7ff 100%);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 16px 40px rgba(36, 87, 255, 0.24);
}

.login-logo-mark {
    width: min(260px, 100%);
    height: 142px;
    overflow: hidden;
    border-radius: 20px;
    background: #f3f4f6;
    border: 1px solid rgba(217, 226, 239, 0.9);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.login-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-logo-mark span {
    display: none;
}

.brand-mark-sm {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 16px;
}

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

h1, h2, h3, h4 {
    margin: 0;
    letter-spacing: 0;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.tiny {
    font-size: 11px;
}

.strong {
    font-weight: 600;
}

.stack {
    display: flex;
    flex-direction: column;
}

.gap-lg {
    gap: 18px;
}

.field,
.field-inline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-inline {
    flex-direction: row;
    align-items: end;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #32435e;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    font: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

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

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
}

.check-card input {
    width: auto;
}

.check-card span {
    display: grid;
    gap: 2px;
}

.check-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(36, 87, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(36, 87, 255, 0.14);
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 120ms ease, opacity 120ms ease, filter 120ms ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-lg {
    padding: 14px 18px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #2f86ff 100%);
    color: #fff;
}

.btn-secondary {
    background: #eef3fb;
    color: #32435e;
    border: 1px solid var(--border);
}

.btn-success {
    background: rgba(21, 163, 106, 0.12);
    color: #0f8a58;
    border: 1px solid rgba(21, 163, 106, 0.26);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.28);
}

.login-footnote {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    font-size: 12px;
    color: var(--muted);
}

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

.sidebar {
    display: none;
}

.sidebar-header {
    display: flex;
    gap: 14px;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 18px;
}

.sidebar-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.nav-link {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.84);
    text-align: left;
    padding: 11px 18px;
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: max-content;
}

.nav-link:hover,
.nav-link.active {
    background: #e30613;
    border-color: #ff6b73;
    color: #fff;
}

.nav-link .tiny {
    display: none;
}

.sidebar-footer {
    margin-top: 0;
    display: flex;
    gap: 14px;
    align-items: center;
}

.user-chip {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 700;
}

.main-shell {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.topbar {
    display: none;
}

.topbar h1 {
    font-size: 32px;
}

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

.view-content {
    display: block;
    width: 100%;
    margin: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    padding: 18px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.panel-body {
    padding: 20px;
}

.panel-body.compact {
    padding-top: 10px;
}

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

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

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

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

.card-metric {
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.card-metric h3 {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.metric-value {
    font-size: 30px;
    font-weight: 700;
}

.metric-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

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

.toolbar .field {
    min-width: 160px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th, td {
    border-bottom: 1px solid #edf2f8;
    text-align: left;
    padding: 12px 14px;
    vertical-align: top;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

tbody tr:hover {
    background: #fbfcfe;
}

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

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.page-size-group {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: var(--radius-sm);
    background: #eef2f7;
}

.page-size-button {
    min-width: 42px;
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.page-size-button.active {
    background: var(--primary);
    color: #fff;
}

.page-summary {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

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

.item-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
    padding: 16px;
    display: grid;
    gap: 10px;
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.badge-row,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge {
    background: #eef4ff;
    color: #355a92;
}

.badge.success,
.chip.success {
    background: rgba(21, 163, 106, 0.12);
    color: #0f8a58;
}

.badge.warning,
.chip.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #a45a06;
}

.badge.danger,
.chip.danger {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.badge.info,
.chip.info {
    background: rgba(36, 87, 255, 0.12);
    color: #2044c8;
}

.badge.neutral,
.chip.neutral {
    background: #eef2f7;
    color: #55657d;
}

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

.stat-box {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
}

.stat-box .label {
    font-size: 12px;
    color: var(--muted);
}

.stat-box .value {
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
}

.code-block,
pre.json {
    margin: 0;
    border-radius: 16px;
    padding: 14px 16px;
    background: #0f172a;
    color: #dce8ff;
    overflow: auto;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
}

.empty-state {
    padding: 28px;
    border-radius: 16px;
    border: 1px dashed var(--border);
    background: var(--panel-soft);
    text-align: center;
    color: var(--muted);
}

.media-requirements {
    margin: 12px 0;
}

.portfolio-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.portfolio-media-thumb {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.portfolio-media-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eef3fb;
}

.portfolio-media-thumb span {
    display: block;
    padding: 7px 8px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-note {
    font-size: 12px;
    color: var(--muted);
}

.toast-region {
    position: fixed;
    top: 20px;
    right: 20px;
    display: grid;
    gap: 10px;
    z-index: 2000;
}

.toast {
    min-width: 280px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    background: #fff;
    border: 1px solid var(--border);
}

.toast.success {
    border-color: rgba(21, 163, 106, 0.28);
}

.toast.error {
    border-color: rgba(220, 38, 38, 0.28);
}

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

.form-grid .span-2 {
    grid-column: 1 / -1;
}

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

.api-workbench {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
}

.endpoint-list {
    max-height: 72vh;
    overflow: auto;
    padding: 10px;
}

.endpoint-item {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    gap: 4px;
}

.endpoint-item:hover,
.endpoint-item.active {
    background: #f4f7fc;
    border-color: var(--border);
}

.endpoint-method {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.method-get { color: #0f8a58; }
.method-post { color: #2044c8; }
.method-put { color: #7c3aed; }
.method-patch { color: #b45309; }
.method-delete { color: #b91c1c; }

.loading {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
}

.loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #d7e4ff;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.manager-hero {
    background: radial-gradient(circle at 80% -20%, rgba(80, 105, 150, 0.36), transparent 34%),
        linear-gradient(135deg, #111827 0%, #0b1630 100%);
    color: #fff;
    border-radius: 0 0 34px 34px;
    padding: 28px clamp(52px, 5vw, 100px) 44px;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.22);
    display: grid;
    gap: 54px;
    position: relative;
}

.manager-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 240px;
    height: 44px;
    transform: translateX(-50%);
    background: #000;
    border-radius: 0 0 12px 12px;
}

.manager-inner,
.manager-main {
    max-width: 1740px;
    width: 100%;
    margin: 0 auto;
}

.manager-hero-top,
.manager-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.manager-brand {
    display: grid;
    gap: 4px;
    min-width: 190px;
}

.manager-logo-mark {
    width: 164px;
    height: 112px;
    position: relative;
    display: grid;
    align-content: end;
    justify-items: center;
    color: #fff;
}

.manager-logo-mark .roof {
    position: absolute;
    top: 6px;
    left: 28px;
    width: 108px;
    height: 62px;
    border-left: 7px solid #fff;
    border-top: 7px solid #fff;
    transform: rotate(45deg);
    opacity: 0.96;
}

.manager-logo-mark .house-row {
    font-size: 31px;
    line-height: 0.92;
    font-weight: 950;
    transform: skew(-7deg);
    letter-spacing: 0;
    z-index: 1;
}

.manager-subtitle {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1;
}

.manager-tabs {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    align-self: start;
    padding-top: 18px;
}

.manager-tab {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    min-width: 170px;
    padding: 11px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 10px 22px rgba(0, 0, 0, 0.16);
}

.manager-tab.active {
    color: #fff;
    background: #e30613;
    border-color: #ff6169;
}

.manager-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    align-self: start;
    padding-top: 18px;
}

.icon-button,
.manager-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.92);
    color: #9a6700;
    font-weight: 900;
    position: relative;
}

.icon-button b {
    position: absolute;
    right: -8px;
    top: -8px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #d99500;
    color: #fff;
    font-size: 12px;
}

.manager-avatar {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.manager-welcome h2 {
    font-size: 30px;
    font-weight: 800;
}

.manager-welcome p {
    color: rgba(255, 255, 255, 0.72);
    margin: 6px 0 0;
    font-size: 18px;
}

.branch-filter label {
    color: rgba(255, 255, 255, 0.76);
}

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

.branch-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 28px;
    min-height: 304px;
    position: relative;
}

.branch-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.branch-card h3 {
    font-size: 26px;
    color: rgba(255, 255, 255, 0.9);
}

.branch-card p {
    margin: 6px 0 0;
    font-size: 17px;
}

.branch-card p,
.branch-revenue-label,
.branch-card-stats span {
    color: rgba(255, 255, 255, 0.62);
}

.branch-revenue-label {
    margin-top: 30px;
    font-size: 17px;
}

.branch-revenue {
    margin-top: 6px;
    font-size: 31px;
    font-weight: 900;
}

.branch-trend {
    position: absolute;
    right: 24px;
    top: 150px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.branch-trend.up {
    background: rgba(21, 163, 106, 0.22);
    color: #baf7d8;
}

.branch-trend.neutral {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
}

.branch-card-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 22px;
    padding-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: center;
}

.branch-card-stats b {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.sparkline {
    width: 78px;
    height: 48px;
    display: flex;
    align-items: end;
    gap: 4px;
    opacity: 0.6;
}

.sparkline span {
    width: 16px;
    border-radius: 4px 4px 0 0;
    background: rgba(255, 255, 255, 0.42);
}

.sparkline span:nth-child(1) { height: 20px; }
.sparkline span:nth-child(2) { height: 30px; }
.sparkline span:nth-child(3) { height: 26px; }
.sparkline span:nth-child(4) { height: 40px; }

.quick-center {
    display: flex;
    justify-content: center;
    gap: clamp(54px, 8vw, 120px);
    padding: 30px 0 34px;
}

.round-shortcut {
    border: 0;
    background: transparent;
    display: grid;
    justify-items: center;
    gap: 10px;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.round-icon {
    width: 94px;
    height: 94px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eaf1ff;
    color: #2044c8;
    box-shadow: var(--shadow);
    font-weight: 900;
}

.round-icon.portfolio-add {
    background: #fff7df;
    color: #a45a06;
}

.round-icon.calendar-ok {
    background: #e8f8ee;
    color: #127a45;
}

.manager-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    max-width: 1740px;
    width: 100%;
    margin: 0 auto;
}

.manager-action-tile {
    min-height: 102px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 24px 34px;
    font: inherit;
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.manager-action-tile span {
    width: 42px;
    text-align: center;
    font-weight: 900;
}

.manager-action-tile.blue { background: #24439d; }
.manager-action-tile.orange { background: #f24a00; }
.manager-action-tile.purple { background: #7c3aed; }
.manager-action-tile.cyan { background: #1097aa; }
.manager-action-tile.red { background: #c90f3e; }
.manager-action-tile.green { background: #168442; }

.customer-hero {
    gap: 30px;
    padding-bottom: 28px;
}

.customer-tabs {
    max-width: 1060px;
}

.customer-title-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.customer-title-row h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 850;
}

.customer-title-row p {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.76);
}

.customer-filter-icon {
    margin-left: auto;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.customer-page {
    max-width: 1880px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 20px 38px;
}

.customer-search-bar {
    height: 58px;
    border: 1px solid #dfe5ee;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    color: #94a3b8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.customer-search-bar input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    font: inherit;
    color: #0f172a;
}

.customer-filter-row {
    display: grid;
    grid-template-columns: 170px repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 38px;
}

.customer-filter-label,
.customer-filter-tab {
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: #f1f3f6;
    color: #1f2937;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.customer-filter-tab.active {
    border: 1px solid #2f6bff;
    background: #eaf2ff;
    color: #1456e8;
}

.customer-list-panel {
    max-width: 1710px;
    margin: 0 auto;
    display: grid;
    gap: 10px;
}

.customer-list-card {
    min-height: 154px;
    border: 1px solid #dfe5ec;
    border-radius: 18px;
    background: #fff;
    padding: 20px 20px 18px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.07);
    cursor: pointer;
}

.customer-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.customer-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #3f5fff;
    color: #fff;
    font-weight: 850;
}

.customer-card-main h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #111827;
}

.customer-card-main p {
    margin: 4px 0 6px;
    color: #667085;
    font-size: 13px;
}

.customer-status,
.customer-demand-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.customer-status.active {
    background: #dcfce7;
    color: #16a34a;
}

.customer-status.pending {
    background: #ffedd5;
    color: #f97316;
}

.customer-status.passive {
    background: #eef2f7;
    color: #64748b;
}

.customer-card-arrow {
    margin-left: auto;
    color: #94a3b8;
    font-size: 30px;
    line-height: 1;
}

.customer-card-divider {
    height: 1px;
    background: #eef2f7;
    margin: 18px 0 14px;
}

.customer-card-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
}

.customer-card-bottom small {
    display: block;
    color: #667085;
    font-size: 12px;
    margin-bottom: 4px;
}

.customer-card-bottom strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.customer-demand-chip {
    margin-top: 10px;
    border-radius: 6px;
    background: #e8f1ff;
    color: #2463eb;
}

.customer-branch-block {
    text-align: right;
    min-width: 170px;
}

.customer-branch-block em {
    display: block;
    margin-top: 26px;
    color: #667085;
    font-style: normal;
    font-size: 12px;
}

.manager-footer {
    background: linear-gradient(135deg, #172236, #0f172a);
    color: #fff;
    min-height: 300px;
    padding: 58px 28px 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
}

.manager-footer-brand {
    display: grid;
    align-content: start;
    gap: 22px;
}

.manager-footer-logo {
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
}

.manager-footer-logo span {
    font-size: 9px;
}

.manager-footer-brand strong {
    font-size: 22px;
}

.manager-footer-socials {
    display: flex;
    gap: 14px;
}

.manager-footer-socials span,
.manager-footer-contact span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
    font-weight: 800;
}

.manager-footer-contact {
    display: grid;
    gap: 14px;
}

.manager-footer-contact h3 {
    font-size: 20px;
    margin: 0 0 4px;
}

.manager-footer-contact div {
    display: flex;
    gap: 14px;
    align-items: center;
}

.manager-footer-contact p {
    margin: 0;
    color: #94a3b8;
}

.manager-footer-contact strong {
    color: #e5e7eb;
    font-weight: 600;
}

.manager-footer-bottom {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 26px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #94a3b8;
}

.manager-map-shell {
    margin-top: 20px;
    min-height: 420px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(rgba(36, 67, 157, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 67, 157, 0.08) 1px, transparent 1px),
        #eef4ff;
    background-size: 46px 46px;
    border: 1px solid var(--border);
}

.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    gap: 4px;
}

.map-marker span {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 4px rgba(36, 87, 255, 0.14), var(--shadow);
    background: var(--primary);
}

.map-marker.online span { background: var(--accent); }
.map-marker.passive span { background: var(--warning); }
.map-marker.offline span { background: var(--muted); }
.map-marker.location_unavailable span,
.map-marker.location_disabled span { background: var(--danger); }

.map-marker strong {
    background: #fff;
    border: 1px solid var(--border);
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 11px;
}

.map-marker small {
    display: none;
}

.feedback-card {
    background: #fff;
}

.section-title {
    max-width: 1740px;
    margin: 46px auto 14px;
    font-size: 24px;
}

.manager-lower {
    max-width: 1740px;
    margin: 0 auto;
    width: 100%;
}

.personnel-hero {
    gap: 34px;
    padding-bottom: 34px;
}

.personnel-title-row {
    display: flex;
    align-items: center;
    gap: 22px;
}

.personnel-title-row h2 {
    font-size: 31px;
    margin: 0;
}

.personnel-title-row p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 18px;
}

.back-circle {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font: inherit;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.personnel-main {
    max-width: 1780px;
    width: calc(100% - 48px);
    margin: 22px auto 54px;
}

.personnel-branch-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    background: #eef0f4;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.personnel-branch-tab {
    min-height: 52px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #445066;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.personnel-branch-tab.active {
    background: #fff;
    color: #9917ff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.empty-branch {
    padding: 16px;
    color: var(--muted);
}

.personnel-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 38px auto 22px;
    max-width: 1600px;
}

.personnel-summary-card {
    min-height: 104px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    display: grid;
    place-items: center;
    gap: 4px;
}

.personnel-summary-card strong {
    color: #111827;
    font-size: 30px;
}

.personnel-summary-card span {
    color: #6b7280;
}

.personnel-summary-card.orange strong {
    color: #fb6b36;
}

.personnel-summary-card.green strong {
    color: #4fbf7a;
}

.personnel-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin: 26px 0 18px;
}

.personnel-section-head h2 {
    margin: 0;
    font-size: 26px;
}

.personnel-section-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.appointment-calendar-layout {
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: start;
}

.personnel-calendar-panel,
.appointments-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    padding: 22px;
}

.personnel-calendar-head,
.appointments-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.personnel-calendar-head button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font: inherit;
    font-size: 30px;
    cursor: pointer;
}

.personnel-calendar-head h3,
.appointments-panel-head h3 {
    margin: 0;
    font-size: 22px;
}

.personnel-calendar-head p,
.appointments-panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.appointments-panel-head > span {
    background: #ffe8ec;
    color: #e30613;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
    font-size: 13px;
}

.personnel-calendar-weekdays,
.personnel-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.personnel-calendar-weekdays {
    margin-top: 18px;
    color: #7b8495;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.personnel-calendar-grid {
    gap: 8px;
    margin-top: 10px;
}

.personnel-calendar-day {
    min-height: 66px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: #111827;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    position: relative;
}

.personnel-calendar-day.muted-day {
    color: #b0b7c3;
}

.personnel-calendar-day.has-events {
    background: #fff0f2;
    color: #e30613;
}

.personnel-calendar-day.selected {
    background: #e30613;
    color: #fff;
    box-shadow: 0 8px 18px rgba(227, 6, 19, 0.25);
}

.personnel-calendar-day b {
    position: absolute;
    left: 50%;
    bottom: 9px;
    transform: translateX(-50%);
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ff7b84;
    color: #fff;
    font-size: 11px;
}

.personnel-calendar-day.selected b {
    background: rgba(255, 255, 255, 0.25);
}

.personnel-appointment-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.personnel-appointment-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    background: #fff;
}

.personnel-appointment-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.appointment-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #e7f0ff;
    color: #2256d6;
    font-weight: 900;
}

.personnel-appointment-main h3 {
    margin: 0;
    font-size: 19px;
}

.personnel-appointment-main p,
.personnel-appointment-note {
    margin: 5px 0 0;
    color: var(--muted);
}

.personnel-appointment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.personnel-appointment-meta > span {
    background: #f5f7fb;
    border-radius: 999px;
    padding: 7px 10px;
    color: #445066;
    font-size: 13px;
    font-weight: 700;
}

.revenue-hero {
    border-radius: 0 0 30px 30px;
    padding-bottom: 30px;
}

.revenue-hero-compact {
    padding-top: 18px;
    padding-bottom: 28px;
    gap: 22px;
}

.revenue-hero-compact .manager-logo-mark {
    width: 128px;
    height: 86px;
}

.revenue-hero-compact .manager-logo-mark .roof {
    left: 23px;
    width: 82px;
    height: 46px;
    border-left-width: 5px;
    border-top-width: 5px;
}

.revenue-hero-compact .manager-logo-mark .house-row {
    font-size: 23px;
}

.revenue-hero-compact .manager-subtitle {
    font-size: 13px;
}

.revenue-hero-compact .icon-button,
.revenue-hero-compact .manager-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.revenue-title-row {
    gap: 14px;
}

.revenue-title-row h2 {
    font-size: 22px;
}

.revenue-title-row .back-circle {
    width: 40px;
    height: 40px;
    font-size: 26px;
}

.revenue-page {
    min-height: calc(100vh - 190px);
    padding: 24px clamp(34px, 4.5vw, 84px) 70px;
    background:
        radial-gradient(circle at 22% 8%, rgba(110, 17, 190, 0.7), transparent 34%),
        radial-gradient(circle at 70% 36%, rgba(35, 39, 154, 0.62), transparent 38%),
        linear-gradient(135deg, #45106e 0%, #281151 50%, #160b33 100%);
}

.revenue-page-form {
    padding-top: 0;
}

.revenue-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 1580px;
    margin: 0 auto 14px;
}

.revenue-metric-card {
    min-height: 96px;
    border-radius: 12px;
    padding: 18px 20px;
    color: #fff;
    display: grid;
    align-content: center;
    gap: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.revenue-metric-card.blue {
    background: linear-gradient(135deg, #2196ff, #1271ff);
}

.revenue-metric-card.purple {
    background: linear-gradient(135deg, #b83bff, #a100ff);
}

.revenue-metric-card.orange {
    background: linear-gradient(135deg, #ff7a00, #ff3d00);
}

.revenue-metric-card.dark {
    background: linear-gradient(135deg, #332287, #451b91);
}

.revenue-metric-card div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.revenue-metric-card span {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 900;
}

.revenue-metric-card small {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.revenue-metric-card strong {
    font-size: 24px;
    line-height: 1;
}

.revenue-accordion {
    max-width: 1580px;
    margin: 14px auto;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.revenue-entry-accordion {
    background: #f3edf6;
}

.revenue-accordion-dark {
    background: linear-gradient(135deg, rgba(12, 24, 58, 0.95), rgba(63, 24, 130, 0.94));
    color: #fff;
}

.revenue-accordion summary {
    min-height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.revenue-accordion summary::-webkit-details-marker {
    display: none;
}

.revenue-accordion summary::after {
    content: "⌄";
    margin-left: auto;
    font-size: 18px;
}

.revenue-accordion[open] summary::after {
    transform: rotate(180deg);
}

.revenue-accordion-body {
    padding: 18px 20px 22px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

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

.commission-level-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.commission-level-form .revenue-save-button {
    grid-column: 1 / -1;
}

.commission-level-table {
    margin-top: 16px;
    overflow-x: auto;
}

.commission-level-table table {
    min-width: 680px;
}

.commission-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: #253047;
    font-weight: 800;
    font-size: 13px;
}

.commission-check input {
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
}

.revenue-entry-field {
    display: grid;
    gap: 8px;
}

.revenue-entry-field label {
    font-size: 13px;
    font-weight: 800;
    color: #253047;
}

.revenue-entry-field select,
.revenue-entry-field input,
.revenue-input-wrap {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: #111827;
}

.revenue-entry-field select {
    padding: 0 12px;
    font: inherit;
}

.revenue-entry-field input {
    padding: 0 12px;
    font: inherit;
}

.revenue-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
}

.revenue-input-wrap span {
    color: #8a94a6;
    font-weight: 800;
}

.revenue-input-wrap input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
}

.broker-share-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.broker-share-row input[type="range"] {
    accent-color: #9ff2cf;
}

.broker-share-row span {
    min-width: 56px;
    border-radius: 9px;
    padding: 10px 12px;
    text-align: center;
    background: #d9fff0;
    color: #00985a;
    font-weight: 800;
}

.revenue-save-button {
    min-height: 40px;
    border: 0;
    border-radius: 11px;
    background: #101b31;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.22);
}

.revenue-pool-button {
    margin-left: auto;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    background: #5738ff;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.revenue-accordion-dark .revenue-accordion-body {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.revenue-filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.revenue-net-card {
    max-width: 1580px;
    min-height: 116px;
    margin: 18px auto;
    border-radius: 14px;
    padding: 22px 20px;
    color: #fff;
    background: linear-gradient(135deg, #00d06b, #00a968);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    display: grid;
    align-content: center;
    gap: 14px;
}

.revenue-net-card div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.revenue-net-card span {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.2);
}

.revenue-net-card small {
    font-weight: 800;
}

.revenue-net-card strong {
    font-size: 30px;
}

.revenue-table-grid {
    max-width: 1580px;
    margin: 18px auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.revenue-transactions-panel,
.revenue-history-panel {
    max-width: 1580px;
    margin: 18px auto;
}

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

    .sidebar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .split,
    .api-workbench,
    .grid-4,
    .grid-3,
    .grid-2,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .manager-hero-top,
    .manager-welcome {
        align-items: stretch;
        flex-direction: column;
    }

    .manager-branch-grid,
    .manager-action-grid,
    .personnel-summary-grid,
    .appointment-calendar-layout,
    .revenue-card-grid,
    .revenue-filter-row,
    .revenue-table-grid,
    .customer-filter-row,
    .commission-level-form {
        grid-template-columns: 1fr;
    }

    .customer-page {
        padding: 22px 12px 28px;
    }

    .customer-card-bottom,
    .manager-footer {
        grid-template-columns: 1fr;
    }

    .customer-branch-block {
        text-align: left;
        min-width: 0;
    }

    .customer-branch-block em {
        margin-top: 10px;
    }

    .manager-footer-bottom {
        flex-direction: column;
    }

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

    .quick-center {
        gap: 22px;
        justify-content: space-between;
    }
}
