:root {
    --bg: #f3f8fc;
    --surface: #ffffff;
    --surface-soft: #f5fbff;
    --border: #d8e7f2;
    --text: #17233d;
    --muted: #5d6e86;
    --primary: #259dd2;
    --primary-dark: #2c3159;
    --accent: #45b4df;
    --success: #0f8a63;
    --danger: #b42335;
    --warning: #a96713;
    --sidebar: #2c3159;
    --shadow-sm: 0 8px 24px rgba(44, 49, 89, 0.1);
    --shadow-md: 0 18px 44px rgba(44, 49, 89, 0.16);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background:
        linear-gradient(135deg, rgba(37, 157, 210, 0.12), transparent 34%),
        linear-gradient(315deg, rgba(44, 49, 89, 0.08), transparent 36%),
        var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    text-rendering: optimizeLegibility;
    animation: appFadeIn 420ms var(--ease);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 12%, rgba(69, 180, 223, 0.22), transparent 24%),
        radial-gradient(circle at 86% 18%, rgba(44, 49, 89, 0.14), transparent 24%),
        linear-gradient(115deg, transparent 0%, rgba(69, 180, 223, 0.08) 48%, transparent 54%),
        linear-gradient(rgba(44, 49, 89, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 49, 89, 0.05) 1px, transparent 1px);
    background-size: auto, auto, 280px 100%, 44px 44px, 44px 44px;
    animation: backgroundDrift 18s linear infinite, backgroundScan 7s ease-in-out infinite;
    opacity: 0.58;
    z-index: 0;
}

body::after {
    content: "0101  DATA  ACCESS  CLOUD  SECURITY  1100  NETWORK";
    position: fixed;
    left: 260px;
    right: 0;
    top: 0;
    height: 100vh;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(69, 180, 223, 0.08), transparent);
    color: rgba(37, 157, 210, 0.07);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 34px;
    font-size: 46px;
    font-weight: 900;
    letter-spacing: 0.16em;
    white-space: nowrap;
    text-transform: uppercase;
    transform: translateY(0);
    animation: codeFloat 12s ease-in-out infinite;
    z-index: 0;
}

a {
    color: inherit;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #303966 0%, var(--sidebar) 56%, #171d3d 100%);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    padding: 22px 16px;
    box-shadow: 12px 0 36px rgba(44, 49, 89, 0.22);
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 420ms var(--ease);
}

.brand-mark {
    width: 58px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #dff6ff);
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 12px 28px rgba(37, 157, 210, 0.28);
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: #aeb7c7;
    font-size: 12px;
}

.sidebar-nav {
    padding-top: 20px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin-bottom: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #cdd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(3px);
}

.sidebar-nav a.active::before {
    content: "";
    width: 3px;
    height: 22px;
    border-radius: 999px;
    background: #45b4df;
    position: absolute;
    left: 0;
}

.main {
    margin-left: 260px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.topbar {
    min-height: 86px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: 0;
    color: #17233d;
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 600;
    padding: 6px 8px 6px 14px;
    border: 1px solid rgba(96, 112, 138, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.content-shell {
    padding: 28px 32px 40px;
    animation: riseIn 520ms var(--ease);
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(37, 157, 210, 0.36), transparent 32%),
        linear-gradient(315deg, rgba(69, 180, 223, 0.22), transparent 38%),
        linear-gradient(180deg, #303966, #2c3159 62%, #171d3d);
}

.login-card {
    width: min(420px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    animation: riseIn 560ms var(--ease);
    position: relative;
    z-index: 1;
}

.login-brand {
    padding: 22px;
    border-bottom-color: rgba(15, 23, 42, 0.08);
    color: var(--text);
    background: linear-gradient(180deg, #ffffff, #f3fbff);
}

.login-brand small {
    color: var(--muted);
}

.login-card-body {
    padding: 28px;
}

.remote-session-page {
    min-height: 100vh;
    overflow: hidden;
    background: #f5fbff;
}

.remote-session-frame {
    height: 100vh;
}

.remote-session-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #ffffff;
}

.remote-ended {
    max-width: 420px;
    margin: 72px auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.join-approval-panel {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    display: grid;
    gap: 10px;
    width: min(430px, calc(100vw - 36px));
}

.join-approval-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(37, 157, 210, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    animation: riseIn 240ms var(--ease);
}

.join-approval-card strong,
.join-approval-card span {
    display: block;
}

.join-approval-card strong {
    color: var(--text);
    font-weight: 850;
}

.join-approval-card span {
    color: var(--muted);
    font-size: 14px;
}

.join-approval-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.remote-participant-panel {
    position: fixed;
    bottom: 14px;
    left: 14px;
    z-index: 19;
    pointer-events: none;
}

.participant-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(37, 157, 210, 0.28);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    font-size: 12px;
    font-weight: 850;
    pointer-events: auto;
}

.participant-toggle span {
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.participant-popover {
    width: min(300px, calc(100vw - 28px));
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid rgba(37, 157, 210, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}

.participant-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.participant-popover-header .eyebrow {
    margin: 0 !important;
}

.participant-popover-header button {
    border: 0;
    color: var(--primary-dark);
    background: transparent;
    font-size: 12px;
    font-weight: 850;
}

.participant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.participant-row.owner {
    border-top: 0;
}

.participant-row span {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-row small {
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #e8f8fc;
    font-weight: 800;
    text-transform: capitalize;
}

.participant-empty {
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--muted);
    font-size: 13px;
}

.join-wait-card {
    text-align: left;
}

.join-wait-pulse {
    width: 100%;
    height: 8px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6f4fa;
}

.join-wait-pulse::before {
    content: "";
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #41c7d7);
    animation: waitPulse 1300ms var(--ease) infinite;
}

@keyframes waitPulse {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(260%);
    }
}

.login-title {
    margin: 0 0 22px;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
}

.overview-hero {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 30px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(44, 49, 89, 0.96), rgba(37, 124, 174, 0.93) 48%, rgba(69, 180, 223, 0.94)),
        linear-gradient(90deg, #2c3159, #45b4df);
    color: #fff;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    isolation: isolate;
}

.overview-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.18) 42%, transparent 62%);
    transform: translateX(-120%);
    animation: heroSheen 5200ms ease-in-out infinite;
    z-index: -1;
}

.overview-hero .eyebrow,
.overview-hero .muted {
    color: rgba(255, 255, 255, 0.76);
}

.overview-hero h2 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 760;
    letter-spacing: 0;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms ease;
}

.metric-card {
    min-height: 142px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    animation: riseIn 520ms var(--ease) both;
}

.metric-grid .metric-card:nth-child(2),
.dashboard-grid .panel:nth-child(2),
.split-layout .panel:nth-child(2) {
    animation-delay: 80ms;
}

.metric-grid .metric-card:nth-child(3) {
    animation-delay: 140ms;
}

.metric-grid .metric-card:nth-child(4) {
    animation-delay: 200ms;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0.85;
}

.metric-card:hover,
.panel:hover {
    border-color: rgba(37, 157, 210, 0.28);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card span,
.metric-card small {
    color: var(--muted);
    font-weight: 650;
}

.metric-card strong {
    display: block;
    margin: 8px 0 12px;
    font-size: 26px;
    line-height: 1.2;
}

.meter {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e0eef7;
}

.meter div {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 420ms var(--ease);
}

.dashboard-grid,
.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 16px;
}

.users-layout {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
}

.users-layout > .panel:first-child {
    max-width: none;
}

.user-create-panel {
    border-top: 3px solid var(--accent);
}

.user-create-form,
.user-edit-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 18px 16px;
}

.user-create-form .create-user-submit {
    min-height: 42px;
}

.users-table-panel,
.user-edit-panel,
.vm-access-panel {
    width: 100%;
}

.user-edit-panel {
    border-top: 3px solid var(--primary);
}

.panel {
    overflow: hidden;
    animation: riseIn 520ms var(--ease) both;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: 0;
}

.status-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 22px;
}

.status-pill {
    min-height: 138px;
    border-radius: 8px;
    padding: 22px;
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
    border: 1px solid var(--border);
    transition: transform 180ms var(--ease), border-color 180ms ease;
}

.status-pill:hover {
    border-color: rgba(37, 157, 210, 0.28);
    transform: translateY(-2px);
}

.status-pill span {
    display: block;
    font-size: 42px;
    font-weight: 800;
}

.status-pill small {
    color: var(--muted);
    font-weight: 700;
}

.status-pill.running span {
    color: var(--success);
}

.status-pill.stopped span {
    color: var(--danger);
}

.simple-list {
    padding: 10px;
}

.list-row {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms var(--ease), color 160ms ease;
}

.list-row:hover {
    background: var(--surface-soft);
    color: var(--primary);
    transform: translateX(3px);
}

.list-row span {
    font-weight: 650;
}

.list-row strong {
    color: var(--muted);
}

.remote-collab-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(37, 157, 210, 0.22);
    border-radius: 8px;
    background: linear-gradient(180deg, #f4fbff, #ffffff);
}

.remote-collab-panel h5 {
    margin: 0 0 6px;
    font-weight: 800;
}

.remote-collab-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.empty-state {
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

.table-tools {
    align-items: flex-end;
}

.table-search {
    min-width: 280px;
    display: grid;
    gap: 8px;
    justify-items: end;
}

.app-table {
    --bs-table-bg: transparent;
}

.app-table thead th {
    background: linear-gradient(180deg, #fbfdff, #eef7fc);
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.app-table tbody td {
    padding: 14px 12px;
    border-color: var(--border);
    transition: background 150ms ease;
}

.app-table tbody tr:hover td {
    background: #f5fbff;
}

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

.users-layout .app-table {
    min-width: 980px;
}

.user-name-cell {
    min-width: 90px;
    font-weight: 650;
}

.user-email-cell {
    min-width: 210px;
    white-space: nowrap;
}

.assigned-vms-cell {
    min-width: 220px;
    max-width: 330px;
}

.vm-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vm-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    max-width: 150px;
    padding: 4px 9px;
    border: 1px solid rgba(37, 157, 210, 0.2);
    border-radius: 999px;
    color: var(--primary-dark);
    background: #eef8fc;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-cell {
    min-width: 230px;
    white-space: nowrap;
}

.action-cell .btn,
.action-cell .inline-form {
    margin-left: 6px;
}

.action-cell .text-muted {
    display: inline-block;
    min-width: 94px;
    text-align: right;
}

.user-edit-actions {
    align-self: end;
    margin-top: 0;
}

.user-force-password {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.user-force-password input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.user-force-password span {
    display: grid;
    gap: 2px;
}

.user-force-password strong {
    color: var(--text);
    font-size: 14px;
}

.user-force-password small {
    color: var(--muted);
    font-size: 12px;
}

.assignment-form {
    gap: 20px;
}

.assignment-form > div:first-of-type {
    max-width: 720px;
}

.assignment-form .checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.assignment-form > .btn {
    justify-self: start;
    min-width: 190px;
}

.table-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 160ms ease;
}

.table-link.strong {
    color: var(--text);
}

.table-link:hover {
    color: var(--accent);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
    gap: 6px;
}

.status-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.status-badge.success {
    color: #0f684d;
    background: #dff7ed;
}

.status-badge.danger {
    color: #9f312c;
    background: #fde7e5;
}

.action-buttons button,
.action-buttons a {
    margin-left: 4px;
    margin-bottom: 4px;
}

.stacked-form {
    display: grid;
    gap: 16px;
    padding: 22px;
}

.stacked-form label {
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}

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

.check-card {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: transform 160ms var(--ease), border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.check-card:hover {
    background: #ffffff;
    border-color: rgba(37, 157, 210, 0.3);
    box-shadow: 0 12px 26px rgba(44, 49, 89, 0.1);
    transform: translateY(-1px);
}

.check-card input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.check-card span {
    display: grid;
    gap: 2px;
}

.check-card strong {
    color: var(--text);
    font-size: 14px;
}

.check-card small {
    color: var(--muted);
    font-size: 12px;
}

.form-control,
.form-select {
    border-radius: 8px;
    border-color: #d0d5dd;
    min-height: 42px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 157, 210, 0.72);
    box-shadow: 0 0 0 4px rgba(37, 157, 210, 0.14);
}

.btn {
    border-radius: 8px;
    font-weight: 700;
    transition: transform 160ms var(--ease), box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(37, 157, 210, 0.24);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(37, 157, 210, 0.44);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.btn-light {
    color: var(--primary-dark);
    background: #f0fbff;
    border-color: rgba(255, 255, 255, 0.65);
}

.btn-light:hover,
.btn-light:focus {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.card {
    border-radius: 8px;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.inline-form {
    display: inline;
}

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

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.service-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
}

.service-action strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}

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

@keyframes appFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes heroSheen {
    0%,
    52% {
        transform: translateX(-120%);
    }
    76%,
    100% {
        transform: translateX(120%);
    }
}

@keyframes backgroundDrift {
    from {
        background-position: 0 0, 0 0, -280px 0, 0 0, 0 0;
    }
    to {
        background-position: 0 0, 0 0, 280px 0, 44px 44px, -44px 44px;
    }
}

@keyframes backgroundScan {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.72;
    }
}

@keyframes codeFloat {
    0%,
    100% {
        opacity: 0.42;
        transform: translateY(0);
    }
    50% {
        opacity: 0.68;
        transform: translateY(-14px);
    }
}

@media (max-width: 1100px) {
    .metric-grid,
    .dashboard-grid,
    .split-layout,
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-layout {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 820px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

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

    .sidebar-nav a {
        margin-bottom: 0;
    }

    .main {
        margin-left: 0;
    }

    body::after {
        left: 0;
        font-size: 24px;
        padding-bottom: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .content-shell {
        padding: 20px;
    }

    .overview-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid,
    .dashboard-grid,
    .split-layout,
    .settings-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .users-layout,
    .user-create-form,
    .user-edit-form {
        grid-template-columns: 1fr;
    }

    .assignment-form > .btn {
        width: 100%;
    }

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

    .table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .table-search {
        min-width: 0;
        justify-items: stretch;
    }

    .service-action {
        align-items: stretch;
        flex-direction: column;
    }

    .remote-collab-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .remote-collab-actions {
        width: 100%;
        justify-content: space-between;
    }
}
