:root {
    color-scheme: dark;
    --color-bg: #0b1120;
    --color-bg-soft: #0f172a;
    --color-surface: #151f32;
    --color-surface-strong: #1e293b;
    --color-surface-hover: #263449;
    --color-border: #2b3a50;
    --color-border-strong: #3b4c65;
    --color-text: #f8fafc;
    --color-text-soft: #cbd5e1;
    --color-muted: #94a3b8;
    --color-subtle: #64748b;
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-success: #34d399;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-danger: #f87171;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-warning: #fbbf24;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-panel: 0 18px 45px rgba(2, 6, 23, 0.2);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--color-bg);
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

a,
button,
input,
select {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    box-shadow: var(--shadow-focus);
}

.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;
}

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    color: var(--color-text);
    background:
        radial-gradient(circle at 88% 8%, rgba(37, 99, 235, 0.08), transparent 24rem),
        var(--color-bg);
}

.app-main {
    min-width: 0;
    flex: 1;
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.app-content {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
}

.app-sidebar {
    position: sticky;
    top: 0;
    width: 17rem;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    flex: 0 0 17rem;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.94);
    border-right: 1px solid rgba(51, 65, 85, 0.7);
    backdrop-filter: blur(16px);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
}

.app-brand-logo {
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    padding: 0.2rem;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.24);
}

.app-brand-copy {
    min-width: 0;
}

.app-brand-name {
    display: block;
    overflow: hidden;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-brand-description {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    overflow: hidden;
    color: var(--color-muted);
    font-size: 0.6875rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-brand-status {
    width: 0.4rem;
    height: 0.4rem;
    flex: 0 0 0.4rem;
    border-radius: 999px;
    background: var(--color-success);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.app-primary-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.35rem;
}

.app-nav-row,
.app-nav-link {
    min-height: 2.75rem;
    border-radius: var(--radius-md);
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: var(--color-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.app-nav-link:hover {
    color: var(--color-text);
    background: rgba(30, 41, 59, 0.8);
}

.app-nav-link.is-active {
    color: #dbeafe;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.08));
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.app-nav-link > i {
    width: 1rem;
    color: var(--color-subtle);
    text-align: center;
    transition: color 160ms ease;
}

.app-nav-link:hover > i,
.app-nav-link.is-active > i {
    color: #60a5fa;
}

.app-nav-row {
    display: flex;
    align-items: center;
    color: var(--color-muted);
    transition: background-color 160ms ease;
}

.app-nav-row:hover {
    background: rgba(30, 41, 59, 0.8);
}

.app-nav-row .app-nav-link {
    min-width: 0;
    flex: 1;
}

.app-nav-row .app-nav-link:hover {
    background: transparent;
}

.app-nav-add {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    margin-right: 0.2rem;
    place-items: center;
    color: var(--color-subtle);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
}

.app-nav-add:hover {
    color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
}

.app-sidebar-admin {
    margin-top: 1.25rem;
}

.app-sidebar-label {
    padding: 0 0.85rem 0.55rem;
    color: var(--color-subtle);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.app-account {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
}

.app-account-summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.25rem 0.6rem 0.8rem;
}

.app-account-icon {
    color: var(--color-muted);
    font-size: 1.85rem;
}

.app-account-copy {
    min-width: 0;
}

.app-account-name,
.app-account-role {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-account-name {
    color: var(--color-text);
    font-size: 0.75rem;
    font-weight: 600;
}

.app-account-role {
    margin-top: 0.15rem;
    color: var(--color-subtle);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-logout-button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    color: var(--color-danger);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 160ms ease, background-color 160ms ease;
}

.app-logout-button:hover {
    color: #fecaca;
    background: var(--color-danger-bg);
}

.app-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.app-page-eyebrow {
    margin: 0 0 0.45rem;
    color: #60a5fa;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-page-title {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.55rem, 2.6vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.app-page-description {
    max-width: 42rem;
    margin: 0.6rem 0 0;
    color: var(--color-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.app-tabs {
    display: flex;
    gap: 0.35rem;
    margin: 0 0 1.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--color-border);
    scrollbar-width: thin;
}

.app-tab {
    position: relative;
    flex: 0 0 auto;
    padding: 0.8rem 1rem;
    color: var(--color-muted);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
}

.app-tab:hover {
    color: var(--color-text);
    background: rgba(30, 41, 59, 0.55);
}

.app-tab.is-active {
    color: #bfdbfe;
    font-weight: 600;
}

.app-tab.is-active::after {
    position: absolute;
    right: 0.8rem;
    bottom: -1px;
    left: 0.8rem;
    height: 2px;
    content: "";
    background: var(--color-primary);
    border-radius: 99px 99px 0 0;
}

.ui-panel {
    overflow: hidden;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(21, 31, 50, 0.96));
    border: 1px solid rgba(59, 76, 101, 0.72);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
}

.dashboard-surface {
    min-height: 16rem;
}

.ui-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border-bottom: 1px solid rgba(59, 76, 101, 0.6);
}

.ui-panel-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
}

.ui-panel-description {
    margin: 0.3rem 0 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.ui-badge {
    display: inline-flex;
    min-height: 1.65rem;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    color: var(--color-text-soft);
    background: rgba(100, 116, 139, 0.14);
    border: 1px solid rgba(100, 116, 139, 0.26);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.ui-badge--pending {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.22);
}

.ui-badge--success {
    color: #a7f3d0;
    background: var(--color-success-bg);
    border-color: rgba(16, 185, 129, 0.24);
}

.ui-badge-dot {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: currentColor;
}

.table-scroll {
    overflow-x: auto;
    scrollbar-color: var(--color-border-strong) transparent;
    scrollbar-width: thin;
}

.ui-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
    text-align: left;
}

.ui-table th {
    padding: 0.85rem 1.4rem;
    color: var(--color-muted);
    background: rgba(15, 23, 42, 0.38);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ui-table td {
    padding: 1rem 1.4rem;
    color: var(--color-text-soft);
    border-top: 1px solid rgba(59, 76, 101, 0.5);
    font-size: 0.875rem;
    vertical-align: middle;
}

.ui-table tbody tr {
    transition: background-color 160ms ease;
}

.ui-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.32);
}

.ui-table-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 11rem;
}

.ui-table-avatar {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    place-items: center;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.13);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
}

.ui-table-user-name {
    display: block;
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.35;
}

.ui-table-user-state {
    display: block;
    margin-top: 0.2rem;
    color: var(--color-subtle);
    font-size: 0.6875rem;
}

.ui-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.ui-inline-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.ui-input,
.ui-select,
.ui-file {
    width: 100%;
    color: var(--color-text);
    background: rgba(11, 17, 32, 0.78);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ui-input,
.ui-select {
    min-height: 2.65rem;
    padding: 0.65rem 0.8rem;
}

.ui-select {
    min-width: 11.5rem;
    cursor: pointer;
}

.ui-input:hover,
.ui-select:hover,
.ui-file:hover {
    border-color: #52647e;
}

.ui-input:focus,
.ui-select:focus,
.ui-file:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.ui-input:disabled,
.ui-select:disabled,
.ui-file:disabled,
.ui-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ui-file {
    padding: 0.45rem;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 0.8125rem;
}

.ui-file::file-selector-button {
    padding: 0.55rem 0.75rem;
    margin-right: 0.75rem;
    color: var(--color-text-soft);
    background: var(--color-surface-strong);
    border: 0;
    border-radius: 0.4rem;
    cursor: pointer;
    font-weight: 500;
}

.ui-button {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    color: var(--color-text);
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ui-button:hover {
    transform: translateY(-1px);
}

.ui-button:active {
    transform: translateY(0);
}

.ui-button--primary {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.ui-button--primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.ui-button--success {
    color: #a7f3d0;
    background: var(--color-success-bg);
    border-color: rgba(16, 185, 129, 0.3);
}

.ui-button--success:hover {
    color: #ecfdf5;
    background: rgba(5, 150, 105, 0.3);
    border-color: rgba(52, 211, 153, 0.45);
}

.ui-button--danger {
    color: #fecaca;
    background: var(--color-danger-bg);
    border-color: rgba(239, 68, 68, 0.28);
}

.ui-button--danger:hover {
    color: #fff;
    background: rgba(220, 38, 38, 0.28);
    border-color: rgba(248, 113, 113, 0.46);
}

.ui-empty-state {
    padding: 3.5rem 1.5rem !important;
    color: var(--color-muted) !important;
    text-align: center;
}

.ui-empty-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.9rem;
    place-items: center;
    color: var(--color-subtle);
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.16);
    border-radius: 50%;
}

.ui-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.ui-alert--success {
    color: #a7f3d0;
    background: var(--color-success-bg);
    border-color: rgba(16, 185, 129, 0.28);
}

.settings-form {
    max-width: 68rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
}

.settings-section {
    padding: clamp(1.25rem, 3vw, 1.75rem);
}

.settings-section + .settings-section {
    border-left: 1px solid rgba(59, 76, 101, 0.6);
}

.settings-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.settings-section-icon {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    place-items: center;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
}

.settings-section-title {
    margin: 0;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 600;
}

.settings-section-description {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.ui-field + .ui-field {
    margin-top: 1.15rem;
}

.ui-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--color-text-soft);
    font-size: 0.75rem;
    font-weight: 500;
}

.ui-field-hint {
    margin: 0.45rem 0 0;
    color: var(--color-subtle);
    font-size: 0.6875rem;
    line-height: 1.5;
}

.settings-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem;
    margin-bottom: 1rem;
    background: rgba(11, 17, 32, 0.48);
    border: 1px solid rgba(59, 76, 101, 0.6);
    border-radius: var(--radius-md);
}

.settings-logo-preview {
    width: 4.5rem;
    height: 4.5rem;
    flex: 0 0 4.5rem;
    padding: 0.35rem;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-md);
}

.settings-logo-title {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 0.75rem;
    font-weight: 600;
}

.settings-logo-copy {
    margin: 0.25rem 0 0;
    color: var(--color-subtle);
    font-size: 0.6875rem;
    line-height: 1.45;
}

.settings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem clamp(1.25rem, 3vw, 1.75rem);
    background: rgba(11, 17, 32, 0.26);
    border-top: 1px solid rgba(59, 76, 101, 0.6);
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    padding: 1rem;
    place-items: center;
    color: var(--color-text);
    background:
        radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.12), transparent 23rem),
        radial-gradient(circle at 84% 88%, rgba(16, 185, 129, 0.06), transparent 20rem),
        var(--color-bg);
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    padding: clamp(1.35rem, 5vw, 2rem);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(59, 76, 101, 0.7);
    border-radius: 1.25rem;
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.38);
}

.auth-brand {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-logo {
    width: 4.25rem;
    height: 4.25rem;
    padding: 0.3rem;
    margin: 0 auto 1rem;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.28);
}

.auth-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.auth-description {
    margin: 0.55rem 0 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 1.1rem;
    border: 1px solid;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    line-height: 1.5;
}

.auth-alert--error {
    color: #fecaca;
    background: var(--color-danger-bg);
    border-color: rgba(239, 68, 68, 0.25);
}

.auth-alert--info {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.24);
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-field-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--color-text-soft);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    color: var(--color-subtle);
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.7rem 0.85rem;
    color: var(--color-text);
    background: rgba(2, 6, 23, 0.48);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-input--with-icon {
    padding-left: 2.55rem;
}

.auth-input--password {
    padding-right: 2.75rem;
}

.auth-input::placeholder {
    color: #526077;
}

.auth-input:hover {
    border-color: var(--color-border-strong);
}

.auth-input:focus {
    background: rgba(2, 6, 23, 0.66);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    color: var(--color-subtle);
    background: transparent;
    border: 0;
    border-radius: 0.4rem;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 160ms ease, background-color 160ms ease;
}

.auth-password-toggle:hover {
    color: var(--color-text-soft);
    background: rgba(100, 116, 139, 0.1);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 0.75rem;
}

.auth-check input {
    accent-color: var(--color-primary);
}

.auth-link {
    color: #60a5fa;
    border-radius: 0.25rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease;
}

.auth-link:hover {
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.auth-submit {
    width: 100%;
    min-height: 2.85rem;
    margin-top: 0.15rem;
}

.auth-footer {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: center;
}

.auth-card--message {
    text-align: center;
}

.auth-card--message .auth-description {
    margin-bottom: 1.4rem;
}

.auth-card--message .ui-button {
    width: 100%;
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        flex-basis: auto;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid rgba(51, 65, 85, 0.7);
    }

    .app-brand {
        margin-bottom: 0.65rem;
    }

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

    .app-sidebar-admin {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        margin-top: 0.75rem;
    }

    .app-sidebar-label {
        grid-column: 1 / -1;
        padding-top: 0.4rem;
    }

    .app-account {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }

    .app-account-summary {
        padding-bottom: 0.25rem;
    }

    .app-logout-button {
        width: auto;
    }

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

    .settings-section + .settings-section {
        border-top: 1px solid rgba(59, 76, 101, 0.6);
        border-left: 0;
    }
}

@media (max-width: 640px) {
    .app-main {
        padding: 1rem;
    }

    .app-sidebar {
        padding: 0.75rem;
    }

    .app-primary-nav {
        grid-template-columns: 1fr;
    }

    .app-sidebar-admin {
        grid-template-columns: 1fr;
    }

    .app-account {
        align-items: stretch;
        flex-direction: column;
        gap: 0.35rem;
    }

    .app-page-header,
    .ui-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-page-header {
        margin-bottom: 1.35rem;
    }

    .ui-panel-header {
        padding: 1rem;
    }

    .ui-table th,
    .ui-table td {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .settings-actions .ui-button {
        width: 100%;
    }

    .auth-card {
        border-radius: var(--radius-lg);
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
