:root {
    --accent: #73958E;
    --accent-strong: #557670;
    --accent-surface: #EEF4F2;
    --accent-surface-strong: #E1EBE8;
    --accent-ring: rgba(115, 149, 142, 0.28);

    --bg: #FFFFFF;
    --bg-page: #FAFBFB;
    --surface: #F3F6F6;
    --surface-hover: #EDF1F1;
    --border: #E7ECEC;
    --border-strong: #D9E0E0;

    --text: #0F1B2A;
    --text-secondary: #5D6B79;
    --text-muted: #8A96A2;

    --action: #14212F;
    --action-hover: #22303F;

    --danger: #C4574F;
    --danger-surface: #FBF0EF;
    --success: #4F8A6A;
    --warning: #B8873A;

    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;

    --shadow-soft: 0 1px 2px rgba(15, 27, 42, 0.04);
    --shadow-float: 0 24px 60px -24px rgba(15, 27, 42, 0.22), 0 2px 8px rgba(15, 27, 42, 0.04);

    --sidebar-collapsed: 80px;
    --sidebar-expanded: 260px;
    --header-height: 70px;

    --ease-out: cubic-bezier(0.2, 0, 0, 1);
    --app-font-size: 0.9375rem;
}

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

html,
body {
    margin: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--app-font-size);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-page);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input {
    font: inherit;
    color: inherit;
}

h1, h2, h3 {
    margin: 0;
    color: var(--text);
}

.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-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Layout ---------- */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
    width: var(--sidebar-collapsed);
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow: hidden;
    transition: width 240ms var(--ease-out), transform 240ms var(--ease-out);
}

.sidebar-expanded .sidebar {
    width: var(--sidebar-expanded);
}

.sidebar-header {
    height: auto;
    min-height: var(--header-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px 10px 6px;
}

.sidebar-expanded .sidebar-header {
    flex-direction: row;
    height: var(--header-height);
    min-height: var(--header-height);
    justify-content: flex-start;
    padding: 0 12px 0 20px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: none;
    flex-direction: column;
    line-height: 1.15;
    white-space: nowrap;
}

.sidebar-expanded .sidebar-brand-text {
    display: flex;
}

.sidebar-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sidebar-brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.sidebar-toggle-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-toggle-btn .app-icon {
    width: 26px;
    height: 26px;
}

.sidebar-expanded .sidebar-toggle-btn {
    margin-left: auto;
}

.sidebar-toggle-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.sidebar-toggle-icon {
    display: inline-flex;
}

.sidebar-toggle-icon--collapse,
.sidebar-expanded .sidebar-toggle-icon--expand {
    display: none;
}

.sidebar-expanded .sidebar-toggle-icon--collapse {
    display: inline-flex;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 14px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 48px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-expanded .sidebar-nav-item {
    justify-content: flex-start;
}

.sidebar-nav-item:hover {
    background: var(--surface);
    color: var(--text);
}

.sidebar-nav-item.active {
    background: var(--accent-surface);
    color: var(--text);
    font-weight: 700;
}

.sidebar-nav-item.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.sidebar-nav-item.active .sidebar-nav-icon {
    color: var(--accent-strong);
}

.sidebar-nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar-nav-text {
    display: none;
    font-size: 0.95rem;
}

.sidebar-expanded .sidebar-nav-text {
    display: inline;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 14px 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface);
    white-space: nowrap;
}

.sidebar-expanded .sidebar-footer {
    justify-content: flex-start;
}

.sidebar-footer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted);
}

.sidebar-footer[data-state="ok"] .sidebar-footer-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.sidebar-footer[data-state="error"] .sidebar-footer-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(196, 87, 79, 0.18);
}

.sidebar-footer-text {
    display: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.sidebar-expanded .sidebar-footer-text {
    display: inline;
}

.sidebar-scrim,
.mobile-nav-btn {
    display: none;
}

/* ---------- Main content ---------- */

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-collapsed);
    padding: 40px 48px 64px;
    transition: margin-left 240ms var(--ease-out);
}

.sidebar-expanded .main-content {
    margin-left: var(--sidebar-expanded);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto 32px;
}

.page-heading h1 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

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

.btn-primary {
    background: var(--action);
    color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
    background: var(--action-hover);
}

.btn-accent {
    background: var(--accent);
    color: #FFFFFF;
}

.btn-accent:hover:not(:disabled) {
    background: var(--accent-strong);
}

.btn-secondary {
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--accent-surface);
    color: var(--accent-strong);
}

.btn-sm {
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.btn-icon-only {
    width: 44px;
    padding: 0;
}

.btn.is-loading .app-icon {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Panel ---------- */

.panel {
    max-width: 1280px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 28px;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(360px, 100%);
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid transparent;
    color: var(--text-muted);
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.search-field:focus-within {
    background: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
}

.search-field input::placeholder {
    color: var(--text-muted);
}

/* ---------- Machine list ---------- */

.machine-list {
    --machine-cols: minmax(200px, 1.3fr) minmax(140px, 1fr) minmax(220px, 1.6fr) 170px 96px;
    padding: 0 16px 16px;
}

.machine-list-head,
.machine-row {
    display: grid;
    grid-template-columns: var(--machine-cols);
    align-items: center;
    gap: 20px;
    padding: 0 16px;
}

.machine-list-head {
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.machine-row {
    position: relative;
    min-height: 72px;
    border-radius: var(--radius-lg);
    transition: background-color 150ms ease;
}

.machine-row + .machine-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: var(--border);
    transition: opacity 150ms ease;
}

.machine-row:not(.machine-row--skeleton):hover {
    background: var(--bg-page);
}

.machine-row:not(.machine-row--skeleton):hover::before,
.machine-row:not(.machine-row--skeleton):hover + .machine-row::before {
    opacity: 0;
}

.machine-row.is-highlighted {
    animation: row-highlight 1.6s var(--ease-out);
}

@keyframes row-highlight {
    0%, 30% { background: var(--accent-surface); }
    100% { background: transparent; }
}

.machine-cell {
    min-width: 0;
    display: flex;
    align-items: center;
}

.machine-cell--location {
    gap: 12px;
}

.machine-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-surface);
    color: var(--accent-strong);
}

.machine-location {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.machine-url {
    color: var(--text-secondary);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.is-empty {
    color: var(--text-muted);
    background: transparent;
    padding-left: 0;
    font-style: normal;
}

.machine-id {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 6px 10px;
    margin-left: -10px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.machine-id span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.machine-id .app-icon {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 150ms ease;
}

.machine-id:hover {
    background: var(--surface);
    color: var(--text);
}

.machine-id:hover .app-icon,
.machine-id:focus-visible .app-icon {
    opacity: 1;
}

.machine-cell--actions {
    justify-content: flex-end;
}

.skeleton {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* ---------- Empty & error states ---------- */

.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 24px 64px;
}

.empty-state[hidden],
.error-state[hidden] {
    display: none;
}

.empty-state-icon,
.error-state-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    background: var(--accent-surface);
    color: var(--accent-strong);
}

.error-state-icon {
    background: var(--danger-surface);
    color: var(--danger);
}

.empty-state-icon .app-icon,
.error-state-icon .app-icon {
    width: 28px;
    height: 28px;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.empty-state p,
.error-state p {
    max-width: 380px;
    margin: 8px 0 24px;
    color: var(--text-secondary);
}

/* ---------- Modal ---------- */

.modal {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-float);
    overflow: auto;
}

.modal::backdrop {
    background: rgba(15, 27, 42, 0.32);
    backdrop-filter: blur(3px);
}

.modal[open] {
    animation: modal-in 200ms var(--ease-out);
}

.modal[open]::backdrop {
    animation: fade-in 200ms ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 28px 8px;
}

.modal-header .btn {
    margin: -6px -10px 0 0;
}

.modal-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.modal-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 28px 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 28px 28px;
}

.form-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--danger-surface);
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 500;
}

.form-error[hidden] {
    display: none;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.field-required {
    color: var(--accent-strong);
}

.field-control {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid transparent;
    color: var(--text-muted);
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.field-control:focus-within {
    background: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
    color: var(--accent-strong);
}

.field-control input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
}

.field-control input::placeholder {
    color: var(--text-muted);
}

.field.has-error .field-control {
    border-color: var(--danger);
    background: var(--bg);
}

.field-error {
    display: none;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 500;
}

.field.has-error .field-error {
    display: block;
}

.field-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--accent-surface);
}

.field-meta[hidden] {
    display: none;
}

.field-meta code {
    font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    font-size: 0.82rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* ---------- Sign in ---------- */

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

.auth-card {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px 28px 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand .sidebar-brand-text {
    display: flex;
}

.auth-heading h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-heading .page-subtitle {
    margin-top: 4px;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.sidebar-logout {
    margin: 0 14px 16px;
}

.sidebar-logout .sidebar-nav-item {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
}

/* ---------- Toasts ---------- */

.toast-region {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--action);
    color: #FFFFFF;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-float);
    animation: toast-in 220ms var(--ease-out);
    pointer-events: auto;
}

.toast .app-icon {
    color: #A9C4BE;
}

.toast--error .app-icon {
    color: #F1A8A2;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
    .main-content {
        padding: 32px 28px 56px;
    }

    .machine-list {
        padding: 0 12px 12px;
    }

    .machine-list-head {
        display: none;
    }

    .machine-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "location actions"
            "provider provider"
            "url url"
            "id id";
        gap: 8px 16px;
        padding: 18px 16px;
    }

    .machine-cell--location { grid-area: location; }
    .machine-cell--actions { grid-area: actions; }
    .machine-cell[data-label="Provider"] { grid-area: provider; }
    .machine-cell--url { grid-area: url; }
    .machine-cell[data-label="Machine ID"] { grid-area: id; }

    .machine-cell[data-label] {
        padding-left: 52px;
    }

    .machine-row--skeleton {
        grid-template-columns: 1fr;
        grid-template-areas: none;
    }
}

@media (max-width: 768px) {
    .sidebar-expanded .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar-expanded .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    /* Tablet: fixed folded rail showing the logo mark instead of the toggle */
    .sidebar-expanded .sidebar-header {
        justify-content: center;
        padding: 0 16px;
    }

    .sidebar-brand,
    .sidebar-expanded .sidebar-brand {
        display: flex;
    }

    .sidebar-brand-text,
    .sidebar-toggle-btn,
    .sidebar-expanded .sidebar-toggle-btn,
    .sidebar-expanded .sidebar-nav-text,
    .sidebar-expanded .sidebar-footer-text {
        display: none;
    }

    .sidebar-expanded .sidebar-nav-item,
    .sidebar-expanded .sidebar-footer {
        justify-content: center;
    }

    .main-content {
        padding: 28px 20px 48px;
    }

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

    .panel-toolbar {
        padding: 20px;
    }

    .search-field {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar,
    .sidebar-expanded .sidebar {
        width: var(--sidebar-expanded);
        transform: translateX(-100%);
    }

    .sidebar-open .sidebar {
        transform: none;
        box-shadow: var(--shadow-float);
    }

    .sidebar-open .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(15, 27, 42, 0.28);
        animation: fade-in 200ms ease-out;
    }

    .sidebar-header,
    .sidebar-expanded .sidebar-header {
        flex-direction: row;
        height: var(--header-height);
        min-height: var(--header-height);
        justify-content: flex-start;
        padding: 0 20px;
    }

    .sidebar-brand-text,
    .sidebar-expanded .sidebar-nav-text,
    .sidebar-expanded .sidebar-footer-text,
    .sidebar-nav-text,
    .sidebar-footer-text {
        display: inline;
    }

    .sidebar-brand-text {
        display: flex;
    }

    .sidebar-nav-item,
    .sidebar-footer,
    .sidebar-expanded .sidebar-nav-item,
    .sidebar-expanded .sidebar-footer {
        justify-content: flex-start;
    }

    .main-content,
    .sidebar-expanded .main-content {
        margin-left: 0;
        padding: 20px 16px 40px;
    }

    .mobile-nav-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-bottom: 20px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--bg);
        color: var(--text);
        cursor: pointer;
    }

    .page-header {
        align-items: stretch;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn-primary {
        flex: 1;
    }

    .machine-cell[data-label] {
        padding-left: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .modal-footer .btn {
        flex: 1;
    }

    .toast-region {
        left: 16px;
        right: 16px;
        bottom: 16px;
        align-items: stretch;
    }
}

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