:root {
    --primary: #2563eb;
    --primary2: #1d4ed8;
    --bg: #f5f7fb;
    --surface: #fff;
    --surface2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    --radius: 18px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        Segoe UI,
        sans-serif;
}
a {
    text-decoration: none;
    color: inherit;
}
.app-shell {
    min-height: 100vh;
}
.sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    bottom: 0;
    width: 252px;
    background: #0b1220;
    color: #cbd5e1;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 8px 10px 22px;
    color: white;
}
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: grid;
    place-items: center;
    font-weight: 800;
}
.brand strong {
    display: block;
    font-size: 17px;
}
.brand small,
.profile small,
.sidebar-bottom small {
    display: block;
    color: #7f8ea8;
    font-size: 9px;
    letter-spacing: 0.11em;
    margin-top: 3px;
}
.sidebar nav {
    display: grid;
    gap: 3px;
}
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
}
.sidebar nav a span {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #8fa0b9;
}
.sidebar nav a:hover {
    background: #172235;
    color: #fff;
}
.sidebar nav a.active {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.sidebar nav a.active span {
    color: #fff;
}
.nav-label {
    font-size: 9px;
    letter-spacing: 0.16em;
    color: #52617a;
    margin: 18px 12px 5px;
}
.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid #1d293c;
    padding: 15px 9px;
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 11px;
}
.secure-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.main {
    margin-left: 252px;
    min-height: 100vh;
}
.topbar {
    height: 72px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.top-search {
    width: min(500px, 48vw);
    height: 42px;
    border: 1px solid var(--line);
    background: var(--surface2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    gap: 9px;
    color: #94a3b8;
}
.top-search input {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    font: inherit;
    font-size: 12px;
}
.top-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}
.icon-btn {
    position: relative;
    border: 0;
    background: var(--surface2);
    color: #475569;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    cursor: pointer;
}
.icon-btn i {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    right: 9px;
    top: 8px;
    border: 1px solid white;
}
.profile {
    display: flex;
    align-items: center;
    gap: 9px;
}
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 11px;
}
.profile-text b {
    display: block;
    font-size: 12px;
}
.profile-text small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0;
}
.mobile-menu {
    display: none;
}
.page {
    padding: 28px;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
}
.eyebrow {
    font-size: 9px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.16em;
}
.page h1 {
    margin: 5px 0 4px;
    font-size: 26px;
    letter-spacing: -0.03em;
}
.page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}
.head-actions {
    display: flex;
    gap: 9px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: var(--primary);
    color: white;
}
.btn:hover {
    background: var(--primary2);
}
.btn.light {
    background: #eef2f7;
    color: #334155;
}
.btn.danger {
    background: #fee2e2;
    color: #b91c1c;
}
.btn.green {
    background: #dcfce7;
    color: #15803d;
}
.grid {
    display: grid;
    gap: 16px;
}
.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
.stat {
    position: relative;
    overflow: hidden;
}
.stat:after {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #eff6ff;
    right: -28px;
    top: -30px;
}
.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #eff6ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
}
.stat-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}
.stat-value {
    font-size: 25px;
    font-weight: 800;
    margin-top: 10px;
    letter-spacing: -0.03em;
}
.stat-foot {
    font-size: 10px;
    margin-top: 8px;
    color: var(--green);
}
.content-grid {
    grid-template-columns: 1.5fr 1fr;
    margin-top: 16px;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-title {
    font-size: 14px;
    font-weight: 800;
}
.card-sub {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
}
.chart {
    height: 240px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 18px 8px 4px;
}
.bar {
    flex: 1;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    min-height: 20px;
}
.bars-labels {
    display: flex;
    gap: 10px;
    padding: 0 8px;
    color: #94a3b8;
    font-size: 9px;
}
.bars-labels span {
    flex: 1;
    text-align: center;
}
.table-card {
    margin-top: 16px;
}
.toolbar {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.input,
.select {
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 0 11px;
    outline: 0;
    font: inherit;
    font-size: 11px;
}
.input {
    min-width: 220px;
}
.table-wrap {
    overflow: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    text-align: left;
    padding: 11px;
    border-bottom: 1px solid var(--line);
}
.table td {
    font-size: 11px;
    padding: 13px 11px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}
.table tr:hover td {
    background: #fafcff;
}
.status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
}
.success {
    background: #dcfce7;
    color: #15803d;
}
.warning {
    background: #fef3c7;
    color: #a16207;
}
.failed {
    background: #fee2e2;
    color: #b91c1c;
}
.neutral {
    background: #f1f5f9;
    color: #475569;
}
.list {
    display: grid;
    gap: 11px;
}
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.list-row:last-child {
    border: 0;
}
.mini {
    display: flex;
    gap: 10px;
    align-items: center;
}
.mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
    display: grid;
    place-items: center;
    font-size: 9px;
    font-weight: 800;
}
.mini b {
    display: block;
    font-size: 11px;
}
.mini small {
    color: var(--muted);
    font-size: 9px;
}
.amount {
    font-weight: 800;
    font-size: 11px;
}
.empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}
.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #0f172a;
    color: white;
    padding: 12px 16px;
    border-radius: 11px;
    font-size: 11px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: 0.2s;
    z-index: 99;
}
.toast.show {
    opacity: 1;
    transform: none;
}
.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, #1d4ed8 0, #0b1220 42%, #050913 100%);
    display: grid;
    place-items: center;
    padding: 20px;
}
.auth-box {
    width: min(430px, 100%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
.auth-logo {
    display: flex;
    gap: 11px;
    align-items: center;
    margin-bottom: 28px;
}
.auth-logo .brand-mark {
    color: white;
}
.auth-box h1 {
    margin: 0 0 7px;
    font-size: 24px;
}
.auth-box p {
    color: var(--muted);
    font-size: 12px;
    margin: 0 0 24px;
}
.auth-box label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    margin: 0 0 6px;
}
.auth-box input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0 13px;
    margin-bottom: 15px;
    outline: 0;
}
.auth-box .btn {
    width: 100%;
    height: 46px;
}
.alert {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 10px;
    font-size: 11px;
    margin-bottom: 14px;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 50;
}
.modal-backdrop.open {
    display: flex;
}
.modal {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.modal-body {
    padding: 20px;
}
.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.field label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    margin-bottom: 6px;
    color: #475569;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    font: inherit;
    font-size: 11px;
}
.modal-foot {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: 0.2s;
    }
    .sidebar.open {
        transform: none;
    }
    .main {
        margin-left: 0;
    }
    .mobile-menu {
        display: block;
    }
    .topbar {
        padding: 0 14px;
    }
    .top-search {
        width: auto;
        flex: 1;
    }
    .profile-text,
    .profile > span {
        display: none;
    }
    .page {
        padding: 18px;
    }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .stats {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 520px) {
    .stats {
        grid-template-columns: 1fr;
    }
    .top-search {
        display: none;
    }
    .page h1 {
        font-size: 22px;
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .input {
        min-width: 160px;
    }
}
/* Phase 1 admin control center */
.neutral-text {
    color: var(--muted) !important;
}
.table-sub,
.list-row small,
.service-row small,
.hierarchy-item small,
.price-name small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 3px;
}
.no-top-margin {
    margin-top: 0;
}
.compact-empty {
    padding: 18px;
}
.stack {
    display: grid;
    gap: 16px;
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.quick-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 14px;
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 10px;
    box-shadow: var(--shadow);
}
.quick-card:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
}
.quick-card .quick-icon {
    grid-row: 1/3;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #eff6ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
}
.quick-card b {
    font-size: 11px;
    align-self: end;
}
.quick-card small {
    font-size: 9px;
    color: var(--muted);
    align-self: start;
}
.dashboard-columns {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.8fr);
    margin-top: 16px;
    align-items: start;
}
.list-link {
    border-radius: 10px;
    padding-left: 8px;
    padding-right: 8px;
}
.list-link:hover {
    background: var(--surface2);
}
.service-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.service-list-card {
    position: sticky;
    top: 92px;
}
.service-stack {
    display: grid;
    gap: 8px;
}
.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.service-row:hover,
.service-row.selected {
    border-color: #bfdbfe;
    background: #f8fbff;
}
.service-row.selected {
    box-shadow: inset 3px 0 0 var(--primary);
}
.service-row-main b {
    display: block;
    font-size: 11px;
}
.service-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.section-title {
    font-size: 20px;
    margin: 5px 0;
}
.section-copy {
    font-size: 10px;
    color: var(--muted);
    margin: 0;
    max-width: 650px;
}
.hierarchy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.hierarchy-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.hierarchy-item b {
    display: block;
    font-size: 11px;
}
.switch-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 10px;
}
.switch-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.switch-control span {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: 0.18s;
}
.switch-control span:after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    transition: 0.18s;
}
.switch-control input:checked + span {
    background: var(--primary);
}
.switch-control input:checked + span:after {
    transform: translateX(18px);
}
.switch-control input:disabled + span {
    opacity: 0.5;
}
.small-switch span {
    width: 36px;
    height: 20px;
}
.small-switch span:after {
    width: 14px;
    height: 14px;
}
.small-switch input:checked + span:after {
    transform: translateX(16px);
}
.product-toolbar {
    align-items: center;
}
.filter-summary {
    font-size: 9px;
    color: var(--muted);
    margin: -3px 0 10px;
}
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 7px;
}
.pagination-controls span {
    font-size: 10px;
    padding: 0 5px;
    min-width: 62px;
    text-align: center;
}
.modal-subtitle {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 4px;
}
.product-modal {
    width: min(1280px, calc(100vw - 32px));
}
.full-field {
    grid-column: 1/-1;
}
.subsection {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.subsection-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.subsection-head b {
    display: block;
    font-size: 12px;
}
.subsection-head small {
    display: block;
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
}
.price-editor,
.vendor-editor {
    display: grid;
    gap: 9px;
}
.price-row {
    display: grid;
    grid-template-columns: 160px repeat(4, minmax(110px, 1fr)) 90px;
    gap: 8px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
}
.price-row label,
.vendor-map-row label {
    font-size: 8px;
    font-weight: 700;
    color: #64748b;
}
.price-row input,
.vendor-map-row input,
.vendor-map-row select {
    width: 100%;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0 8px;
    font: inherit;
    font-size: 10px;
    background: #fff;
    margin-top: 5px;
}
.price-name {
    align-self: center;
}
.price-name b {
    display: block;
    font-size: 10px;
}
.mini-check {
    display: flex !important;
    align-items: center;
    gap: 6px;
    height: 36px;
}
.mini-check input {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
}
.vendor-map-row {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 1fr 90px 40px;
    gap: 8px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
}
.danger-icon {
    background: #fee2e2;
    color: #b91c1c;
}
.analytics-chart {
    height: 260px;
    align-items: stretch;
}
.analytics-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    height: 100%;
}
.analytics-bar-wrap .bar {
    width: 100%;
    flex: none;
}
.analytics-bar-wrap small {
    font-size: 8px;
    color: var(--muted);
}
@media (max-width: 1150px) {
    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
    .service-layout {
        grid-template-columns: 1fr;
    }
    .service-list-card {
        position: static;
    }
    .price-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .price-name {
        grid-column: 1/-1;
    }
}
@media (max-width: 760px) {
    .quick-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hierarchy-grid {
        grid-template-columns: 1fr;
    }
    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
    }
    .pagination-controls {
        width: 100%;
        overflow: auto;
        padding-bottom: 3px;
    }
    .price-row,
    .vendor-map-row {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 520px) {
    .quick-grid {
        grid-template-columns: 1fr;
    }
    .service-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .price-row,
    .vendor-map-row {
        grid-template-columns: 1fr;
    }
}
