:root {
    --ds-color-primary: #0f766e;
    --ds-color-primary-hover: #115e59;
    --ds-color-on-primary: #ffffff;
    --ds-color-text: #17202a;
    --ds-color-text-muted: #667085;
    --ds-color-background: #f5f7f8;
    --ds-color-surface: #ffffff;
    --ds-color-surface-hover: #f2f4f7;
    --ds-color-border: #dfe3e8;
    --ds-color-danger: #b42318;
    --ds-color-danger-bg: #fff3f2;
    --ds-color-success: #067647;
    --ds-color-success-bg: #ecfdf3;
    --ds-color-info-bg: #eff8ff;
}

* { box-sizing: border-box; }
html { background: var(--ds-color-background); }
body { margin: 0; min-width: 20rem; font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif; color: var(--ds-color-text); background: var(--ds-color-background); line-height: 1.55; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(15, 118, 110, 0.35); outline-offset: 2px; }

.up-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.up-shell__sidebar { position: sticky; inset-block-start: 0; z-index: 30; height: 100vh; overflow-y: auto; background: #fff; border-inline-end: 1px solid var(--ds-color-border); }
.up-shell__brand { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; padding-inline: 1.25rem; border-block-end: 1px solid var(--ds-color-border); }
.up-shell__brand a { color: var(--ds-color-text); font-size: 1.05rem; font-weight: 750; text-decoration: none; }
.up-shell__content { min-width: 0; }
.up-topbar { position: sticky; inset-block-start: 0; z-index: 20; display: flex; align-items: center; gap: 0.75rem; min-height: 4rem; padding-inline: clamp(1rem, 3vw, 2rem); background: rgba(255,255,255,.96); border-block-end: 1px solid var(--ds-color-border); }
.up-topbar__title { font-weight: 650; }
.up-topbar__culture { margin-inline-start: auto; padding: .2rem .55rem; color: var(--ds-color-text-muted); background: var(--ds-color-surface-hover); border: 1px solid var(--ds-color-border); border-radius: 999px; font-size: .75rem; }
.up-icon-button { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; color: inherit; background: transparent; border: 0; border-radius: .375rem; cursor: pointer; }
.up-icon-button:hover { background: var(--ds-color-surface-hover); }
.up-topbar__menu, .up-shell__close, .up-shell__backdrop { display: none; }
.up-menu-icon, .up-menu-icon::before, .up-menu-icon::after { display: block; width: 1.2rem; height: 2px; background: currentColor; content: ""; }
.up-menu-icon { position: relative; }
.up-menu-icon::before { position: absolute; inset-block-start: -.38rem; }
.up-menu-icon::after { position: absolute; inset-block-start: .38rem; }

.up-nav { display: flex; flex-direction: column; gap: .25rem; padding: 1rem .75rem; }
.up-nav__link { display: flex; align-items: center; min-height: 2.65rem; padding: .55rem .75rem; color: #475467; border-radius: .375rem; text-decoration: none; font-size: .92rem; font-weight: 550; }
.up-nav__link:hover { color: var(--ds-color-text); background: #f4f7f6; }
.up-nav__link.active { color: #0b5f58; background: #e9f5f3; font-weight: 700; }
.up-nav__logout { display: flex; align-items: center; width: 100%; min-height: 2.65rem; margin-block-start: .75rem; padding: .55rem .75rem; color: var(--ds-color-danger); background: transparent; border: 0; border-block-start: 1px solid var(--ds-color-border); border-radius: 0; cursor: pointer; font-size: .92rem; font-weight: 600; text-align: start; }
.up-nav__logout:hover { background: var(--ds-color-danger-bg); }
.up-nav__logout:disabled { opacity: .6; cursor: wait; }

.up-shell__main { width: 100%; max-width: 68rem; min-width: 0; margin-inline: auto; padding: clamp(1.25rem, 4vw, 3rem); }
.up-shell__main > h1:first-child { margin-block: 0 1.5rem; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.25; }
h2 { margin-block: 2.25rem 1rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--ds-color-border); font-size: 1.12rem; }
.up-section { max-width: 40rem; padding: 1.25rem; background: #fff; border: 1px solid var(--ds-color-border); border-radius: .5rem; }
.up-identifier { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; max-width: 40rem; padding: .75rem 1rem; background: #fff; border: 1px solid var(--ds-color-border); border-radius: .375rem; }
.up-badge { display: inline-flex; align-items: center; min-height: 1.45rem; padding: .1rem .5rem; color: #344054; background: #f2f4f7; border-radius: 999px; font-size: .73rem; font-weight: 650; }
.up-badge--success { color: #067647; background: #ecfdf3; }
.up-badge--warning { color: #93370d; background: #fffaeb; }
.up-session__detail { display: flex; min-width: 0; flex-direction: column; }
.up-session__detail strong { overflow: hidden; text-overflow: ellipsis; }
.up-session__detail span { color: var(--ds-color-text-muted); font-size: .8rem; }
.app-route-state, .app-error { max-width: 36rem; padding: 1.25rem; background: #fff; border: 1px solid var(--ds-color-border); border-radius: .5rem; }

.ds-field { display: flex; flex-direction: column; gap: .4rem; max-width: 34rem; margin-block-end: 1rem; text-align: start; }
.ds-field__label { color: #344054; font-size: .85rem; font-weight: 650; }
.ds-field__input { width: 100%; min-height: 2.7rem; padding: .58rem .75rem; color: var(--ds-color-text); background: #fff; border: 1px solid #cfd4dc; border-radius: .375rem; text-align: start; }
.ds-field__input:hover { border-color: #98a2b3; }
.ds-field__input:focus { border-color: var(--ds-color-primary); outline: 3px solid rgba(15,118,110,.14); }
.ds-field__error { margin: 0; color: var(--ds-color-danger); font-size: .8rem; }

.ds-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.55rem; margin-block: .15rem; margin-inline-end: .35rem; padding: .5rem 1rem; color: #fff; background: var(--ds-color-primary); border: 1px solid transparent; border-radius: .375rem; font-weight: 650; cursor: pointer; }
.ds-button:hover:not(:disabled) { background: var(--ds-color-primary-hover); }
.ds-button--secondary { color: #344054; background: #fff; border-color: #cfd4dc; }
.ds-button--secondary:hover:not(:disabled) { background: #f9fafb; }
.ds-button--danger { color: #fff; background: var(--ds-color-danger); }
.ds-button--danger:hover:not(:disabled) { background: #912018; }
.ds-button:disabled { cursor: not-allowed; opacity: .55; }
.ds-button__spinner { width: .9rem; height: .9rem; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: up-spin .7s linear infinite; }
@keyframes up-spin { to { transform: rotate(360deg); } }

.ds-alert { max-width: 46rem; margin-block-end: 1rem; padding: .75rem 1rem; border: 1px solid transparent; border-radius: .375rem; }
.ds-alert p { margin: 0; }
.ds-alert--error { color: var(--ds-color-danger); background: var(--ds-color-danger-bg); border-color: #fecdca; }
.ds-alert--success { color: var(--ds-color-success); background: var(--ds-color-success-bg); border-color: #abefc6; }
.ds-alert--info { color: #175cd3; background: var(--ds-color-info-bg); border-color: #b2ddff; }

.ds-confirm__backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(16,24,40,.58); }
.ds-confirm { width: min(100%, 28rem); padding: 1.25rem; color: var(--ds-color-text); background: #fff; border: 1px solid var(--ds-color-border); border-radius: .5rem; box-shadow: 0 20px 40px rgba(16,24,40,.18); }
.ds-confirm h2 { margin: 0; padding: 0; border: 0; font-size: 1.1rem; }
.ds-confirm p { margin-block: .65rem 1.25rem; color: var(--ds-color-text-muted); }
.ds-confirm__actions { display: flex; justify-content: flex-end; gap: .5rem; }

.up-shell__main ul { max-width: 46rem; margin: 0; padding: 0; list-style: none; }
.up-shell__main li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-block-end: 1px solid var(--ds-color-border); }

@media (max-width: 52rem) {
    .up-shell { display: block; }
    .up-shell__sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(17rem, 86vw); height: 100dvh; transform: translateX(-105%); transition: transform 180ms ease; }
    [dir="rtl"] .up-shell__sidebar { transform: translateX(105%); }
    .up-shell--nav-open .up-shell__sidebar { transform: translateX(0); }
    .up-shell__close, .up-topbar__menu { display: inline-grid; }
    .up-shell__backdrop { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; padding: 0; background: rgba(16,24,40,.52); border: 0; }
    .up-shell--nav-open .up-shell__backdrop { display: block; }
}

@media (max-width: 38rem) {
    .up-shell__main { padding: 1.15rem 1rem 2rem; }
    .ds-field { max-width: none; }
    .up-shell__main li { align-items: flex-start; flex-direction: column; }
}

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