:root {
    color-scheme: dark;
    /* Layout */
    --sidebar-width: 26rem;
    /* Colors - Background */
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface-hover: #1a1a24;
    --border: rgba(255, 255, 255, 0.08);
    /* Colors - Text */
    --text: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.3);
    /* Colors - Accent */
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99, 102, 241, 0.15);
    /* Colors - Status */
    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.15);
    /* Radius */
    --radius-sm: 0.6rem;
    --radius: 0.8rem;
    --radius-lg: 1.2rem;
    --radius-xl: 1.6rem;
}

/*-------------------------------------| $Reset
*/
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    font-size: 10px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.5rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/*-------------------------------------| $Login
*/
.login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}
.login__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 4rem;
    width: 100%;
    max-width: 42rem;
}
.login__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 3.2rem;
}
.login__logo-icon {
    width: 3.6rem;
    height: 3.6rem;
    color: var(--accent);
}
.login__logo-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.login__logo-text-sub {
    font-weight: 100;
}
.login__title {
    text-align: center;
    font-size: 1.6rem;
    color: var(--text-muted);
    margin-bottom: 2.4rem;
    font-weight: 400;
}
.login__actions {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.8rem;
}

/*-------------------------------------| $Layout
*/
.dash {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}
.dash__sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
}
.dash__sidebar-inner {
    display: flex;
    flex-direction: column;
    padding: 2.4rem;
    height: 100%;
}
.dash__logo {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3.2rem;
}
.dash__logo-icon {
    width: 3.6rem;
    height: 3.6rem;
    flex-shrink: 0;
    color: var(--accent);
}
.dash__logo-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.dash__logo-text-sub {
    font-weight: 100;
}

/*-------------------------------------| $Navigation
*/
.dash__nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.dash__nav-link {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.4rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 1.4rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
}
.dash__nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
    text-decoration: none;
}
.dash__nav-link--active {
    color: #fff;
    background: var(--accent);
}
.dash__nav-link--active:hover {
    color: #fff;
    background: var(--accent-hover);
}
.dash__nav-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

/*-------------------------------------| $Sidebar-User
*/
.dash__user {
    margin-top: auto;
    padding-top: 2.4rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.3rem;
    color: var(--text-muted);
}
.dash__user-name {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s ease;
}
a.dash__user-name:hover {
    color: var(--accent);
    text-decoration: none;
}
.dash__user-icon {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
}
.dash__user-logout {
    color: var(--text-dim);
    font-size: 1.2rem;
}
.dash__user-logout:hover {
    color: var(--danger);
}

/*-------------------------------------| $Main-Content
*/
.dash__main {
    grid-column: 2;
    padding: 3.2rem 4rem;
    min-width: 0;
}

/*-------------------------------------| $Page-Header
*/
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3.2rem;
    flex-wrap: wrap;
    gap: 1.6rem;
}
.page-header__title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.page-header__actions {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
}

/*-------------------------------------| $Buttons
*/
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    font-size: 1.4rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn--primary {
    background: var(--accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}
.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--secondary:hover {
    background: var(--surface-hover);
    text-decoration: none;
    color: var(--text);
}
.btn--danger {
    background: var(--danger-subtle);
    color: var(--danger);
}
.btn--danger:hover {
    background: var(--danger);
    color: #fff;
    text-decoration: none;
}
.btn--small {
    padding: 0.6rem 1.2rem;
    font-size: 1.3rem;
}
.btn--icon {
    padding: 0.6rem;
}
.btn svg {
    width: 1.6rem;
    height: 1.6rem;
    flex-shrink: 0;
}
.btn--block {
    width: 100%;
    justify-content: center;
}

/*-------------------------------------| $Cards
*/
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.4rem;
}
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.card__title {
    font-size: 1.6rem;
    font-weight: 600;
}
.card__description {
    color: var(--text-muted);
    margin-bottom: 2.4rem;
    font-size: 1.4rem;
}

/*-------------------------------------| $Tables
*/
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.4rem;
}
.table th {
    text-align: left;
    padding: 1.2rem 1.6rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table tbody tr:hover {
    background: var(--surface-hover);
}
.table__actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/*-------------------------------------| $Sites-Table
*/
.table--sites {
    table-layout: fixed;
}
.table--sites th:nth-child(1),
.table--sites td:nth-child(1) { width: 4.8rem; }
.table--sites th:nth-child(2),
.table--sites td:nth-child(2) { width: 10%; }
.table--sites th:nth-child(3),
.table--sites td:nth-child(3) { width: 28%; }
.table--sites th:nth-child(4),
.table--sites td:nth-child(4) { width: 10%; }
.table--sites th:nth-child(5),
.table--sites td:nth-child(5) { width: 10%; }
.table--sites th:nth-child(6),
.table--sites td:nth-child(6) { width: 12%; }
.table--sites th:nth-child(7),
.table--sites td:nth-child(7) { width: 12%; }
.table--sites th:nth-child(8),
.table--sites td:nth-child(8) { width: 16%; }
.table--sites > tbody > tr:not(.table__detail-row):hover {
    background: var(--bg);
}

/*-------------------------------------| $Expandable-Rows
*/
.table__toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}
.table__toggle:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.table__toggle svg {
    width: 1.6rem;
    height: 1.6rem;
    transition: transform 0.2s ease;
}
.table__toggle--open svg {
    transform: rotate(90deg);
}
.table__detail-row {
    display: none;
}
.table__detail-row--open {
    display: table-row;
}
.table__detail-row td {
    padding: 0 0 0 4rem;
    background: var(--surface-hover);
}
.table__detail-row:hover {
    background: var(--surface-hover);
}
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.3rem;
    border-left: 3px solid var(--border);
    table-layout: fixed;
}
.detail-table th {
    background: var(--surface-hover);
}
.detail-table th:nth-child(1),
.detail-table td:nth-child(1) { width: 10%; }
.detail-table th:nth-child(2),
.detail-table td:nth-child(2) { width: 28%; }
.detail-table th:nth-child(3),
.detail-table td:nth-child(3) { width: 14%; }
.detail-table th:nth-child(4),
.detail-table td:nth-child(4) { width: 14%; }
.detail-table th:nth-child(5),
.detail-table td:nth-child(5) { width: 20%; }
.detail-table th:nth-child(6),
.detail-table td:nth-child(6) { width: 14%; }
.detail-table th {
    padding: 0.8rem 1.6rem 0.8rem 2.4rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.detail-table td {
    padding: 0.8rem 1.6rem 0.8rem 2.4rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.detail-table tbody tr:last-child td {
    border-bottom: none;
}

/*-------------------------------------| $Badges
*/
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}
.badge--active {
    background: var(--success-subtle);
    color: var(--success);
}
.badge--inactive {
    background: var(--danger-subtle);
    color: var(--danger);
}
.badge--match {
    background: var(--success-subtle);
    color: var(--success);
}
.badge--mismatch {
    background: var(--warning-subtle);
    color: var(--warning);
}
.badge--unknown {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

/*-------------------------------------| $Forms
*/
.form {
    max-width: 64rem;
}
.form--inline {
    display: inline;
}
.form__checkbox-label--flush {
    padding: 0;
}
.form__group {
    margin-bottom: 2rem;
}
.form__group--half {
    max-width: 50%;
}
.form__group--mt {
    margin-top: 2rem;
}
.form__label {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form__input,
.form__select,
.form__textarea {
    width: 100%;
    padding: 1rem 1.4rem;
    font-size: 1.5rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
    font-family: inherit;
}
.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form__textarea {
    min-height: 12rem;
    resize: vertical;
}
.form__hint {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
}
.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.form__checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 0.8rem;
    max-height: 24rem;
    overflow-y: auto;
    padding: 1.2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.form__checkbox-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: all 0.15s ease;
}
.form__checkbox-label:hover {
    color: var(--text);
}
.form__checkbox-label input[type="checkbox"] {
    width: 1.6rem;
    height: 1.6rem;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.form__file-input {
    padding: 1rem 1.4rem;
    font-size: 1.4rem;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    cursor: pointer;
}
.form__file-input::file-selector-button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 1.2rem;
}
.form__actions {
    display: flex;
    gap: 1.2rem;
    margin-top: 3.2rem;
    padding-top: 2.4rem;
    border-top: 1px solid var(--border);
}

/*-------------------------------------| $Flash-Messages
*/
.flash {
    padding: 1.2rem 2rem;
    border-radius: var(--radius);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 2.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.flash--success {
    background: var(--success-subtle);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.flash--error {
    background: var(--danger-subtle);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.flash--warning {
    background: var(--warning-subtle);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/*-------------------------------------| $Empty-State
*/
.empty {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-dim);
}
.empty__icon {
    width: 4.8rem;
    height: 4.8rem;
    margin: 0 auto 1.6rem;
    color: var(--text-dim);
}
.empty__text {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}
.empty__sub {
    font-size: 1.4rem;
}

/*-------------------------------------| $Defaults-Grid
*/
.defaults-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/*-------------------------------------| $Version-Display
*/
.version {
    font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    font-size: 1.3rem;
}

/*-------------------------------------| $Utility
*/
.text-muted {
    color: var(--text-muted);
}
.text-dim {
    color: var(--text-dim);
}
.text-success {
    color: var(--success);
}
.text-warning {
    color: var(--warning);
}
.text-danger {
    color: var(--danger);
}
.truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 24rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*-------------------------------------| $Profile
*/
.card--narrow {
    max-width: 48rem;
}
.profile__info {
    margin-bottom: 2.4rem;
    padding-bottom: 2.4rem;
    border-bottom: 1px solid var(--border);
}
.profile__label {
    font-size: 1.3rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.profile__value {
    font-size: 1.6rem;
    font-weight: 600;
}
.profile__meta {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-top: 0.6rem;
}
.profile__section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/*-------------------------------------| $Responsive
*/
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 22rem;
    }
    .dash__main {
        padding: 2.4rem;
    }
}
@media (max-width: 768px) {
    .dash {
        grid-template-columns: 1fr;
    }
    .dash__sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .dash__sidebar-inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1.6rem;
        padding: 1.6rem 2rem;
    }
    .dash__logo {
        margin-bottom: 0;
    }
    .dash__nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .dash__user {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        margin-left: auto;
    }
    .dash__main {
        grid-column: 1;
        padding: 2rem;
    }
    .form__row {
        grid-template-columns: 1fr;
    }
    .defaults-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
