* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --background: #070b14;
    --surface: #0d131f;
    --surface-soft: #111926;
    --surface-raised: #151e2d;
    --border: #202b3d;
    --border-soft: #182233;
    --text: #f3f7fb;
    --text-soft: #9aa9bd;
    --text-muted: #8494a9;
    --cyan: #21c7e8;
    --cyan-soft: rgba(33, 199, 232, 0.12);
    --violet: #9c7cff;
    --amber: #f5ad45;
    --green: #35d39a;
    --danger: #f06a7a;
    --sidebar-width: 258px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 3px;
}

.mobile-menu-toggle {
    display: none;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 78% -10%, rgba(33, 199, 232, 0.08), transparent 34rem),
        var(--background);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.ui-icon {
    display: block;
    flex: 0 0 auto;
}

/* ---------- login ---------- */

.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(13, 19, 31, 0.96);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.brand {
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.24em;
}

.login-card h1 {
    margin: 14px 0 0;
    font-size: 30px;
}

.subtitle {
    margin: 8px 0 28px;
    color: var(--text-soft);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 20px;
    color: var(--text-soft);
    font-size: 14px;
}

.primary-button {
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--cyan);
    color: #062933;
    font-weight: 800;
}

.primary-button:hover {
    filter: brightness(1.08);
}

html[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 30px 90px rgba(48, 67, 88, 0.15);
}

/* ---------- Application shell ---------- */

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    border-right: 1px solid var(--border-soft);
    overflow-y: auto;
    background: rgba(9, 14, 24, 0.98);
}

.sidebar-brand {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(33, 199, 232, 0.38);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(33, 199, 232, 0.18), rgba(33, 199, 232, 0.04));
    color: var(--cyan);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.brand-description {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.sidebar-section-label {
    padding: 24px 24px 9px;
    color: #526176;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    padding: 0 12px;
}

.sidebar-link {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: 10px;
    color: #8797ab;
    font-size: 13px;
    font-weight: 600;
    transition: 160ms ease;
}

.sidebar-link:hover:not(.is-disabled) {
    background: var(--surface-soft);
    color: var(--text);
}

.sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(33, 199, 232, 0.15), rgba(33, 199, 232, 0.05));
    color: var(--cyan);
}

.sidebar-link.is-active::before {
    position: absolute;
    left: -12px;
    width: 3px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background: var(--cyan);
    content: "";
}

.sidebar-link-icon {
    display: grid;
    width: 23px;
    place-items: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px;
}

.environment-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
}

.environment-status .status-dot {
    margin-top: 5px;
}

.environment-status strong,
.environment-status span {
    display: block;
}

.environment-status strong {
    font-size: 11px;
}

.environment-status span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(53, 211, 154, 0.1);
}

.app-content {
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(7, 11, 20, 0.9);
    backdrop-filter: blur(18px);
}

.topbar-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 16px;
}

.topbar-icon-button {
    position: relative;
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-soft);
}

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

.user-avatar {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border: 1px solid rgba(33, 199, 232, 0.35);
    border-radius: 10px;
    background: var(--cyan-soft);
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
}

.user-details {
    min-width: 112px;
}

.user-details strong,
.user-details span {
    display: block;
}

.user-details strong {
    font-size: 12px;
}

.user-details span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.account-menu {
    position: relative;
}

.account-menu-toggle {
    padding: 3px 5px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.account-menu-toggle:hover,
.account-menu-toggle[aria-expanded="true"] {
    border-color: var(--border-soft);
    background: var(--surface);
}

.account-menu-chevron {
    margin-left: 2px;
    color: var(--text-muted);
    font-size: 10px;
    transition: transform 150ms ease;
}

.account-menu-toggle[aria-expanded="true"] .account-menu-chevron {
    transform: rotate(180deg);
}

.account-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: 230px;
    padding: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.account-menu-dropdown[hidden] {
    display: none;
}

.account-menu-header {
    padding: 9px 10px 11px;
    border-bottom: 1px solid var(--border-soft);
}

.account-menu-header strong,
.account-menu-header span {
    display: block;
}

.account-menu-header strong {
    font-size: 12px;
}

.account-menu-header span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.account-menu-item {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    text-align: left;
    text-decoration: none;
}

.account-menu-item:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.account-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--border-soft);
}

.account-menu-logout {
    color: var(--danger);
}

.user-avatar-large {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 17px;
}

.user-avatar.has-symbol {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 42%),
        var(--cyan-soft);
}

.user-avatar-symbol {
    font-size: 1.45em;
    line-height: 1;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.avatar-option {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    padding: 12px 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-soft);
    cursor: pointer;
    text-align: center;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.avatar-option:hover {
    transform: translateY(-2px);
    border-color: rgba(33, 199, 232, 0.38);
}

.avatar-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.avatar-option:has(input:checked) {
    border-color: var(--cyan);
    background: var(--cyan-soft);
    box-shadow: 0 0 0 2px rgba(33, 199, 232, 0.12);
}

.avatar-option-label {
    overflow: hidden;
    width: 100%;
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-option:has(input:checked) .avatar-option-label {
    color: var(--cyan);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(250px, 0.34fr) minmax(0, 1fr);
    gap: 18px;
}

.profile-sidebar {
    display: grid;
    align-self: start;
    gap: 18px;
}

.profile-summary-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    align-self: start;
}

.profile-summary-card h2 {
    margin: 3px 0 5px;
    font-size: 18px;
}

.profile-summary-card > div {
    min-width: 0;
}

.profile-account-card {
    min-width: 0;
}

.profile-account-value {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="light"] .avatar-option {
    background: #f7fafc;
}

html[data-theme="light"] .avatar-option:has(input:checked) {
    background: rgba(19, 185, 214, 0.1);
}

@media (max-width: 1100px) {
    .avatar-picker {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

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

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

.theme-toggle {
    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

.theme-toggle:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* ---------- page content / heading ---------- */

.page-content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 30px;
}

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

.page-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--cyan);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-heading h1 {
    margin: 9px 0 7px;
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -0.035em;
}

.page-heading p {
    max-width: 720px;
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

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

.metric-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.012), transparent),
        var(--surface);
}

.metric-card-header,
.metric-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
}

.metric-icon.cyan {
    background: rgba(33, 199, 232, 0.12);
    color: var(--cyan);
}

.metric-icon.violet {
    background: rgba(156, 124, 255, 0.12);
    color: var(--violet);
}

.metric-icon.amber {
    background: rgba(245, 173, 69, 0.12);
    color: var(--amber);
}

.metric-icon.green {
    background: rgba(53, 211, 154, 0.12);
    color: var(--green);
}

.metric-state {
    padding: 4px 7px;
    border: 1px solid rgba(53, 211, 154, 0.18);
    border-radius: 20px;
    background: rgba(53, 211, 154, 0.06);
    color: var(--green);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 19px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-label {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
}

.metric-footer {
    gap: 8px;
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 9px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    gap: 14px;
    margin-top: 14px;
}

.panel-wide {
    grid-column: 1 / -1;
}

/* ---------- panel ---------- */

.panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface);
}

.panel + .panel {
    margin-top: 14px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 16px;
}

.panel-header h2 {
    margin: 4px 0 0;
    font-size: 14px;
}

.panel-eyebrow {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- buttons ---------- */

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 750;
    transition: 150ms ease;
}

.button-primary {
    background: var(--cyan);
    color: #052a34;
}

.button-primary:hover {
    filter: brightness(1.08);
}

.button-secondary {
    border-color: var(--border);
    background: var(--surface-raised);
    color: var(--text-soft);
}

.button-secondary:hover,
.button-ghost:hover {
    color: var(--text);
}

.button-ghost {
    background: transparent;
    color: var(--text-muted);
}

.alert-success {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(53, 211, 154, 0.24);
    border-radius: 10px;
    background: rgba(53, 211, 154, 0.08);
    color: #8cf0cb;
    font-size: 11px;
}

.alert-error {
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid rgba(240, 106, 122, 0.35);
    border-radius: 12px;
    background: rgba(240, 106, 122, 0.1);
    color: #fecaca;
    font-size: 14px;
}

/* ---------- table ---------- */

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.data-table th {
    padding: 14px 12px;
    color: var(--text-muted);
    font-size: 8px;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 14px 12px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-soft);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.012);
}

.table-primary-link {
    color: var(--text);
    font-weight: 700;
}

.table-primary-link:hover,
.table-action-link:hover,
.inline-link:hover {
    color: var(--cyan);
}

.table-secondary-text {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
}

.table-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-actions-column {
    text-align: right !important;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.table-action-link,
.inline-link {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
}

/* ---------- status pill ---------- */

.status-pill {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-pill.is-active {
    background: rgba(53, 211, 154, 0.09);
    color: var(--green);
}

.status-pill.is-inactive {
    background: rgba(240, 106, 122, 0.09);
    color: var(--danger);
}

.status-pill.is-warning {
    background: rgba(245, 173, 69, 0.12);
    color: var(--amber);
}

.status-pill.is-info {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.status-pill.is-muted {
    background: var(--surface-soft);
    color: var(--text-muted);
}

.pagination-simple {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 10px;
}

.pagination-simple a {
    color: var(--cyan);
}

.pagination-disabled {
    opacity: 0.45;
}

/* ---------- forms ---------- */

.form-control {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #334155;
    border-radius: 12px;
    outline: none;
    background: #080d17;
    color: var(--text);
}

.form-control:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(33, 199, 232, 0.12);
}

.form-panel {
    max-width: 980px;
}

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

.field-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
}

.field-group > label:not(.checkbox-label) > span {
    color: var(--danger);
}

.field-group textarea {
    resize: vertical;
}

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

.field-error {
    margin-top: 6px;
    color: #ff94a1;
    font-size: 9px;
}

.checkbox-label {
    display: flex !important;
    width: 100%;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #090f19;
}

.checkbox-label input {
    width: 15px;
    height: 15px;
}

.checkbox-label strong,
.checkbox-label small {
    display: block;
}

.checkbox-label strong {
    font-size: 10px;
}

.checkbox-label small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 8px;
}

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

/* ---------- details list (show pages) ---------- */

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

.details-card-wide {
    grid-column: 1 / -1;
}

.details-list {
    margin: 0;
}

.details-list > div {
    display: grid;
    grid-template-columns: minmax(120px, 0.5fr) minmax(0, 1.5fr);
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-soft);
}

.details-list > div:last-child {
    border-bottom: 0;
}

.details-list dt {
    color: var(--text-muted);
    font-size: 9px;
}

.details-list dd {
    margin: 0;
    color: var(--text-soft);
    font-size: 10px;
    text-align: right;
    word-break: break-word;
}

/* ---------- empty state ---------- */

.empty-state {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-muted);
    text-align: left;
}

.empty-state-large {
    min-height: 270px;
}

.empty-state-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--cyan);
}

.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state strong {
    color: var(--text-soft);
    font-size: 11px;
}

.empty-state span {
    max-width: 520px;
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.6;
}

/* ---------- light theme ---------- */

html[data-theme="light"] {
    color-scheme: light;

    --background: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f4f7fa;
    --surface-raised: #eaf0f6;
    --border: #cbd6e2;
    --border-soft: #dce4ec;
    --text: #172235;
    --text-soft: #52647a;
    --text-muted: #52647a;
    --cyan: #0786a3;
    --cyan-soft: rgba(7, 134, 163, 0.11);
    --violet: #7256d9;
    --amber: #b97413;
    --green: #16845f;
    --danger: #c43f52;
}

.theme-icon {
    display: none;
}

html[data-theme="dark"] .theme-icon-sun,
html[data-theme="light"] .theme-icon-moon {
    display: block;
}

html[data-theme="light"] body {
    background:
        radial-gradient(
            circle at 78% -10%,
            rgba(7, 134, 163, 0.09),
            transparent 34rem
        ),
        var(--background);
}

html[data-theme="light"] .sidebar {
    background: rgba(246, 249, 252, 0.98);
}

html[data-theme="light"] .app-topbar {
    background: rgba(238, 243, 248, 0.91);
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .checkbox-label {
    background: #ffffff;
    color: var(--text);
}

html[data-theme="light"] .panel,
html[data-theme="light"] .topbar-icon-button,
html[data-theme="light"] .environment-status {
    box-shadow: 0 8px 24px rgba(49, 69, 91, 0.045);
}

html[data-theme="light"] .sidebar-link.is-active {
    background: linear-gradient(
        90deg,
        rgba(7, 134, 163, 0.14),
        rgba(7, 134, 163, 0.045)
    );
}

html[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(22, 45, 70, 0.025);
}

html[data-theme="light"] .button-primary {
    border-color: #13b9d6;
    background: #13b9d6;
    color: #052a34;
    box-shadow: 0 6px 16px rgba(7, 134, 163, 0.16);
}

html[data-theme="light"] .button-primary:hover {
    border-color: #0da7c2;
    background: #0da7c2;
    color: #031f27;
    filter: none;
}

html[data-theme="light"] .button-primary:focus-visible {
    outline: 3px solid rgba(19, 185, 214, 0.22);
    outline-offset: 2px;
}

html[data-theme="light"] .button-secondary {
    border-color: #bfd0df;
    background: #eef4f8;
    color: #334a62;
}

html[data-theme="light"] .button-secondary:hover {
    border-color: #9eb5c8;
    background: #e3edf4;
    color: #172235;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    :root {
        --sidebar-width: 224px;
    }

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

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

    .panel-wide {
        grid-column: auto;
    }
}

@media (max-width: 800px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .sidebar-brand {
        min-height: 70px;
    }

    #sidebar-navigation {
        display: none;
    }

    #sidebar-navigation.is-open {
        display: block;
        padding-bottom: 16px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        margin-left: auto;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface-raised);
        color: var(--text);
        font-size: 20px;
    }

    .app-content {
        margin-left: 0;
    }

    .app-topbar {
        min-height: auto;
        padding: 12px 18px;
    }

    .page-content {
        padding: 22px 18px;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}

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

    .logout-button span {
        display: none;
    }
}
