:root {
    --body: #0b1222;
    --panel: #172231;
    --panel-dark: #111a28;
    --line: #2b394b;
    --input: #101925;
    --muted: #9aa8bd;
    --text: #eef3fb;
    --purple: #d400ff;
    --purple-dark: #7200ff;
    --green: #47d7a0;
    --red: #f06278;
    --orange: #f9a84d;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(
        circle at 65% 0%,
        #1b1b42 0%,
        #0d1526 46%,
        var(--body) 100%
    );
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.layout {
    display: grid;
    grid-template-columns: 185px minmax(720px, 1040px);
    gap: 16px;
    max-width: 1270px;
    margin: 4px auto;
    padding: 0 8px;
}

.sidebar,
.card {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(23, 34, 49, 0.97);
}

.sidebar {
    height: max-content;
    padding: 12px;
}

.brand {
    padding: 2px 0 12px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
}

.nav-link {
    display: block;
    margin-top: 10px;
    padding: 9px;
    color: #dce6f4;
    border: 1px solid #354357;
    border-radius: 7px;
    background: #111a28;
    font-size: 12px;
    text-decoration: none;
}

.nav-link:hover {
    background: #26344a;
}

.nav-link.active {
    color: white;
    border-color: #8b2be0;
    background: linear-gradient(90deg, #4b1f78, #291e5b);
}

.side-stat {
    margin-top: 11px;
    padding: 10px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.01);
}

.side-label,
.eyebrow {
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.side-number {
    overflow: hidden;
    margin-top: 6px;
    font-size: 16px;
    font-weight: bold;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live {
    margin-top: 11px;
    padding: 6px;
    border: 1px solid #328f78;
    border-radius: 3px;
    color: #d6fff3;
    background: rgba(71, 215, 160, 0.15);
    font-size: 11px;
}

.tip {
    margin-top: 12px;
    padding: 8px;
    border-left: 2px solid #9c3cff;
    color: #c5cede;
    font-size: 10px;
    line-height: 1.8;
}

.top-card {
    margin-bottom: 16px;
    padding: 14px 15px;
}

.eyebrow {
    margin-bottom: 6px;
}

.title {
    color: transparent;
    font-size: 43px;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    background: linear-gradient(90deg, #ed00db, #6f00ff);
    background-clip: text;
    -webkit-background-clip: text;
}

.subtitle {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

.card {
    margin-bottom: 16px;
    padding: 13px;
}

h2 {
    margin: 1px 0 12px;
    font-size: 14px;
}

.toolbar-header,
.profile-bar,
.toolbar,
.table-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
}

.profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-tab {
    padding: 8px 11px;
    color: #cbd5e4;
    border: 1px solid #344258;
    border-radius: 7px;
    background: #111a28;
    font-size: 11px;
    font-weight: bold;
}

.profile-tab:hover {
    background: #26344a;
}

.profile-tab.active {
    color: white;
    border-color: #9d23f5;
    background: linear-gradient(90deg, #6517a8, #37207c);
}

.button {
    padding: 9px 13px;
    color: white;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(90deg, #e100f4, #8500ff);
    font-size: 11px;
    font-weight: bold;
}

.button:hover {
    filter: brightness(1.1);
}

.button.secondary {
    background: #344154;
}

.button.danger {
    color: #ffe3e8;
    border: 1px solid #7d3543;
    background: #4d2632;
}

.button.danger:hover {
    background: #6a3041;
}

.button.small {
    padding: 7px 9px;
    font-size: 10px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.toolbar {
    margin-top: 13px;
}

.search-wrapper {
    flex: 1;
}

.search-wrapper input,
.toolbar select,
.table-input {
    width: 100%;
    outline: none;
    color: white;
    border: 1px solid #2d3b4d;
    border-radius: 7px;
    background: var(--input);
}

.search-wrapper input,
.toolbar select {
    padding: 9px;
}

.search-wrapper input:focus,
.toolbar select:focus,
.table-input:focus {
    border-color: #a21cff;
    box-shadow: 0 0 0 2px rgba(162, 28, 255, 0.14);
}

.toolbar select {
    width: 170px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 13px;
}

.summary-box {
    padding: 9px;
    border: 1px solid #37316d;
    border-radius: 7px;
    background: #211e4b;
}

.summary-box span {
    display: block;
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.summary-box b {
    display: block;
    overflow: hidden;
    margin-top: 6px;
    color: #d985ff;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status {
    min-height: 16px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 11px;
}

.status.success {
    color: #72eac0;
}

.status.error {
    color: #ff9aaa;
}

.status.saving {
    color: #f9c678;
}

.table-topline {
    margin-bottom: 11px;
}

.table-topline h2 {
    margin-bottom: 4px;
}

.table-topline p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.row-count {
    color: #cfa0ff;
    font-size: 11px;
    font-weight: bold;
}

.table-wrapper {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: none;
}

.table-wrapper:focus {
    border-color: #7c38bd;
}

table {
    width: 100%;
    min-width: 980px;
    border-spacing: 0;
    border-collapse: collapse;
    font-size: 11px;
}

thead {
    background: #121d2b;
}

th,
td {
    padding: 9px;
    border-bottom: 1px solid rgba(42, 56, 74, 0.85);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

th.sortable button {
    padding: 0;
    color: inherit;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: bold;
}

th.sortable button:hover {
    color: white;
}

tbody tr {
    background: rgba(10, 17, 30, 0.26);
}

tbody tr:hover {
    background: rgba(79, 42, 120, 0.13);
}

tbody tr.changed {
    box-shadow: inset 3px 0 0 #a52cff;
}

tbody tr.complete {
    box-shadow: inset 3px 0 0 #3cbd91;
}

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

.mob-photo {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #3d4d63;
    border-radius: 7px;
    background: #101925;
}

.mob-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    color: #6f819b;
    font-size: 17px;
}

.upload-label {
    display: inline-flex;
    margin-top: 5px;
    color: #bd7aff;
    font-size: 9px;
    cursor: pointer;
}

.upload-label:hover {
    color: #f0d6ff;
}

.upload-input {
    display: none;
}

.table-input {
    min-width: 90px;
    padding: 8px;
}

.table-input.name {
    min-width: 130px;
}

.table-input[type="number"] {
    min-width: 84px;
}

.computed {
    color: #e1b5ff;
    font-weight: bold;
    white-space: nowrap;
}

.progress-cell {
    min-width: 125px;
}

.progress-value {
    display: flex;
    justify-content: space-between;
    gap: 7px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
}

.progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border: 1px solid #374257;
    border-radius: 999px;
    background: #0d1522;
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e100f4, #6d18ff);
    transition: width 160ms ease;
}

.progress-fill.complete {
    background: linear-gradient(90deg, #27bd88, #5ee4b1);
}

.actions-cell {
    min-width: 156px;
    white-space: nowrap;
}

.action-row {
    display: flex;
    gap: 5px;
}

.state-label {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
}

.state-label.changed {
    color: #f6be72;
}

.empty-state {
    display: none;
    padding: 42px 16px;
    color: var(--muted);
    text-align: center;
}

.empty-state.visible {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
}

.empty-icon {
    color: #bd65ff;
    font-size: 26px;
}

.empty-state strong {
    color: #dce6f4;
    font-size: 13px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 650px) {
    .layout {
        display: block;
        padding: 8px;
    }

    .title {
        font-size: 37px;
    }

    .toolbar-header,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar select,
    .search-wrapper {
        width: 100%;
    }

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

    .table-topline {
        align-items: flex-start;
        flex-direction: column;
    }
}