:root {
    --bg: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --line: #d7e0ec;
    --text: #122033;
    --muted: #60718d;
    --primary: #ff6a00;
    --primary-strong: #df5800;
    --secondary: #13b7ff;
    --success: #1ca36f;
    --warning: #ffb62d;
    --danger: #ff624f;
    --navy: #07111f;
    --navy-soft: #101d31;
    --shadow: 0 24px 60px rgba(8, 18, 35, 0.12);
    --radius: 26px;
    --radius-sm: 18px;
    --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

:root[data-theme="dark"] {
    --bg: #060c15;
    --surface: rgba(13, 22, 36, 0.88);
    --surface-strong: #101b2d;
    --line: #203149;
    --text: #edf2fc;
    --muted: #96a7c5;
    --navy: #03070f;
    --navy-soft: #0c1727;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 106, 0, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(19, 183, 255, 0.12), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 40%),
        var(--bg);
}

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

button,
input,
select,
textarea {
    font: inherit;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-page {
    background:
        radial-gradient(circle at top left, rgba(255, 122, 24, 0.16), transparent 24%),
        radial-gradient(circle at bottom right, rgba(255, 122, 24, 0.08), transparent 22%),
        #eef2f8;
}

.login-card,
.panel,
.stat-card,
.notification-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-card {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    padding: 24px;
    align-items: stretch;
}

.compact-card {
    width: min(960px, 100%);
}

.portal-login {
    width: min(1180px, 100%);
    min-height: min(700px, 86vh);
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(420px, 460px);
    background: #ffffff;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(8, 18, 35, 0.22);
}

.portal-stage {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 48px;
    background: linear-gradient(140deg, #d65a00, #b34700 68%);
}

.portal-orb {
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.orb-top {
    width: 360px;
    height: 360px;
    top: -80px;
    right: -40px;
}

.orb-bottom {
    width: 300px;
    height: 300px;
    left: -120px;
    bottom: -140px;
}

.portal-stage-inner {
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 14px;
    color: #fff;
}

.portal-mark {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(83, 28, 0, 0.22);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.portal-mark span {
    color: var(--primary);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    transform: skew(-8deg);
}

.portal-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-stage-inner h1 {
    margin: 4px 0 0;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.portal-stage-inner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.08rem;
}

.portal-feature-list {
    margin-top: 24px;
    display: grid;
    gap: 14px;
}

.portal-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.portal-feature-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    display: grid;
    place-items: center;
}

.portal-feature strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: 1rem;
}

.portal-feature span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.92rem;
}

.portal-auth-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 40px 32px;
    background: #ffffff;
}

.portal-theme-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid #e7edf6;
    background: #f8fafc;
    color: #1b2740;
    cursor: pointer;
}

.portal-auth-head {
    margin-bottom: 28px;
}

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

.portal-auth-brand-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff944d);
    color: #fff;
    font-weight: 900;
    overflow: hidden;
}

.portal-auth-brand-icon span {
    transform: skew(-8deg);
}

.portal-auth-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-auth-brand strong {
    display: block;
    font-size: 0.95rem;
    color: #1d2740;
}

.portal-auth-brand span {
    display: block;
    margin-top: 3px;
    font-size: 0.82rem;
    color: #7f8da6;
}

.portal-auth-head h2 {
    margin: 0 0 6px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: #1b2740;
}

.portal-auth-head p {
    margin: 0;
    color: #7b8aa5;
    font-size: 1rem;
}

.portal-auth-form {
    display: grid;
    gap: 18px;
}

.portal-field {
    display: grid;
    gap: 8px;
}

.portal-field > span {
    font-size: 0.92rem;
    font-weight: 700;
    color: #4b5c79;
}

.portal-input-shell {
    position: relative;
}

.portal-input-shell > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a7b4c9;
}

.portal-input-shell input {
    padding-left: 46px;
    padding-right: 46px;
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid #d9e3f0;
    background: #f7faff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.portal-input-shell input:focus {
    outline: none;
    border-color: #f58b46;
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.08);
}

.portal-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #94a3ba;
    cursor: pointer;
}

.portal-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.portal-remember {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #54657f;
    font-weight: 700;
}

.portal-switch {
    position: relative;
    width: 44px;
    height: 26px;
}

.portal-switch input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
}

.portal-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d9e1ee;
    transition: 0.2s ease;
}

.portal-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
    transition: 0.2s ease;
}

.portal-switch input:checked ~ .portal-switch-track {
    background: rgba(255, 106, 0, 0.25);
}

.portal-switch input:checked ~ .portal-switch-thumb {
    transform: translateX(18px);
}

.portal-forgot-link {
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 800;
}

.portal-submit {
    min-height: 56px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #ff7f32);
    color: #fff;
    font-size: 1.06rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(255, 106, 0, 0.22);
}

.portal-footnote {
    margin: -2px 0 0;
    text-align: center;
    color: #9aa8bc;
    font-size: 0.84rem;
}

.login-copy {
    padding: 40px;
    border-radius: 28px;
    background:
        linear-gradient(140deg, rgba(7, 17, 31, 0.96), rgba(16, 29, 49, 0.92)),
        var(--navy);
    color: #fff;
}

.login-form,
.panel,
.stat-card,
.notification-panel {
    padding: 24px;
}

.login-form {
    justify-content: center;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 106, 0, 0.14);
    color: var(--primary-strong);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-copy .eyebrow {
    color: #ffd2b2;
    background: rgba(255, 255, 255, 0.12);
}

.login-copy h1 {
    margin: 16px 0;
    font-size: clamp(2rem, 4vw, 4.4rem);
    line-height: 0.98;
    max-width: 10ch;
}

.login-copy p,
.page-header p,
.panel p,
.empty-copy {
    color: var(--muted);
}

.login-copy p {
    color: rgba(255, 255, 255, 0.82);
}

.feature-grid,
.quick-actions,
.stack,
.stack-list,
.donut-list,
.settings-grid {
    display: grid;
    gap: 14px;
}

.feature-grid {
    margin-top: 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid article,
.credential-card,
.setting-card,
.quick-action {
    padding: 18px;
    border-radius: 20px;
}

.setting-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-card small {
    color: var(--muted);
}

.feature-grid article {
    background: rgba(255, 255, 255, 0.08);
}

.auth-meta,
.auth-links,
.page-header,
.panel-head,
.toolbar,
.comment-box,
.form-actions,
.detail-strip,
.metric-line,
.list-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-meta,
.auth-links {
    margin-top: 18px;
    flex-wrap: wrap;
}

.auth-meta span,
.auth-links a {
    color: rgba(255, 255, 255, 0.78);
}

.auth-links a {
    color: var(--muted);
}

.login-form,
.inner-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand-line {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-pill {
    display: inline-flex;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #ff9042);
    color: #fff;
    font-weight: 700;
}

.login-form h2,
.page-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.login-form label,
.field-grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .button.ghost,
:root[data-theme="dark"] .menu-button,
:root[data-theme="dark"] .notification-button {
    background: rgba(16, 27, 45, 0.96);
    color: var(--text);
    border-color: var(--line);
}

:root[data-theme="dark"] .portal-theme-btn {
    background: rgba(16, 27, 45, 0.96);
    color: var(--text);
    border-color: var(--line);
}

:root[data-theme="dark"] .auth-page {
    background:
        radial-gradient(circle at top left, rgba(255, 122, 24, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(255, 122, 24, 0.08), transparent 22%),
        #060c15;
}

:root[data-theme="dark"] .portal-auth-card {
    background: #0b1321;
}

:root[data-theme="dark"] .portal-auth-head h2,
:root[data-theme="dark"] .portal-auth-brand strong {
    color: #eef3ff;
}

:root[data-theme="dark"] .portal-auth-head p,
:root[data-theme="dark"] .portal-auth-brand span,
:root[data-theme="dark"] .portal-field > span,
:root[data-theme="dark"] .portal-remember,
:root[data-theme="dark"] .portal-footnote {
    color: #9cadc8;
}

:root[data-theme="dark"] .portal-input-shell input {
    background: #101b2d;
    border-color: #203149;
    color: #edf2fc;
}

:root[data-theme="dark"] .portal-input-shell > svg,
:root[data-theme="dark"] .portal-password-toggle {
    color: #6f84a3;
}

select[multiple] {
    min-height: 140px;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.button,
.notification-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
}

.button.small-button {
    min-height: 40px;
    padding: 10px 14px;
}

.button.primary {
    background: linear-gradient(135deg, var(--primary), #ff8a38);
    color: #fff;
}

.button.danger {
    background: linear-gradient(135deg, var(--danger), #ff8577);
    color: #fff;
}

.button.ghost,
.notification-button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    color: var(--text);
}

.theme-inline {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: auto;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 600;
}

.alert.success {
    background: rgba(28, 163, 111, 0.14);
    color: var(--success);
}

.alert.warning {
    background: rgba(255, 182, 45, 0.16);
    color: #a15f00;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    transition: grid-template-columns 0.2s ease;
}

html.sidebar-collapsed .shell {
    grid-template-columns: 88px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at top right, rgba(255, 106, 0, 0.16), transparent 26%),
        radial-gradient(circle at 8% 20%, rgba(255, 106, 0, 0.1), transparent 34%),
        linear-gradient(180deg, #0c1526, #08111f 55%, #070d18);
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: padding 0.2s ease;
}

.sidebar-collapse-btn {
    position: absolute;
    top: 28px;
    right: -14px;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 5;
}

.sidebar-collapse-btn svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

html.sidebar-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.sidebar-inner {
    display: grid;
    gap: 26px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.brand-mark {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #ff9042);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(255, 106, 0, 0.3);
    overflow: hidden;
}

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

.brand strong {
    display: block;
}

.brand small,
.table-note,
.list-line small {
    color: var(--muted);
}

.nav {
    display: grid;
    gap: 4px;
}

.nav-group {
    display: grid;
    gap: 10px;
}

.nav-group-label {
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 10px;
    min-height: 54px;
    border-radius: 18px;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(180deg, rgba(255, 106, 0, 0.32), rgba(223, 88, 0, 0.16));
    border-color: rgba(255, 106, 0, 0.5);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--primary), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 26px rgba(255, 106, 0, 0.2);
}

.nav-copy {
    flex: 1 1 auto;
    display: grid;
    gap: 1px;
    min-width: 0;
}

.nav-label {
    font-size: 0.86rem;
    line-height: 1.15;
}

.nav-description {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link.active .nav-description {
    color: rgba(255, 255, 255, 0.75);
}

.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 800;
    flex-shrink: 0;
}

.nav-link.active .nav-count {
    background: rgba(255, 255, 255, 0.28);
}

.nav-link .nav-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-link.active .nav-icon {
    background: linear-gradient(180deg, rgba(255, 148, 66, 0.9), rgba(223, 88, 0, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 16px rgba(255, 106, 0, 0.24);
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user-card-avatar {
    border: 1px solid rgba(255, 106, 0, 0.5);
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.user-card-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.user-card-meta strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-meta small {
    color: rgba(255, 255, 255, 0.6);
}

.user-card-chevron {
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(4, 9, 18, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Collapsed desktop rail mode */
@media (min-width: 901px) {
    .sidebar-collapse-btn {
        display: flex;
    }

    html.sidebar-collapsed .brand {
        justify-content: center;
    }

    html.sidebar-collapsed .brand-text,
    html.sidebar-collapsed .nav-copy,
    html.sidebar-collapsed .nav-count,
    html.sidebar-collapsed .nav-group-label,
    html.sidebar-collapsed .user-card-meta,
    html.sidebar-collapsed .user-card-chevron {
        display: none;
    }

    html.sidebar-collapsed .nav-link {
        justify-content: center;
        padding: 6px;
        box-shadow: none;
    }

    html.sidebar-collapsed .nav-link.active {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 20px rgba(255, 106, 0, 0.2);
    }

    html.sidebar-collapsed .user-card {
        justify-content: center;
        padding: 8px;
    }
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    row-gap: 12px;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: rgba(243, 246, 251, 0.76);
    border-bottom: 1px solid rgba(215, 224, 236, 0.8);
    backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .topbar {
    background: rgba(6, 12, 21, 0.82);
    border-bottom-color: var(--line);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-weight: 700;
}

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

.breadcrumb-current {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.menu-button {
    display: none;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    padding: 10px;
    min-height: 42px;
    border-radius: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--primary));
    color: #fff;
    font-weight: 800;
}

.notification-button {
    position: relative;
    padding: 10px 12px;
    min-height: 42px;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.notification-panel {
    width: min(420px, calc(100% - 32px));
    margin: 18px 28px 0 auto;
}

.content {
    padding: 28px;
    display: grid;
    gap: 24px;
    padding-bottom: 48px;
}

.page-header {
    flex-wrap: wrap;
}

.stats-grid,
.dashboard-grid,
.details-grid,
.form-grid {
    display: grid;
    gap: 20px;
}

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

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

.details-grid,
.form-grid {
    grid-template-columns: 1.45fr 0.95fr;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 106, 0, 0.14);
    color: var(--primary-strong);
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon-info {
    background: rgba(19, 183, 255, 0.14);
    color: var(--secondary);
}

.stat-icon-warning {
    background: rgba(255, 182, 45, 0.18);
    color: #a15f00;
}

.stat-icon-success {
    background: rgba(28, 163, 111, 0.14);
    color: var(--success);
}

.stat-icon-danger {
    background: rgba(255, 98, 79, 0.14);
    color: var(--danger);
}

:root[data-theme="dark"] .stat-icon-warning {
    color: var(--warning);
}

.stat-card strong {
    display: block;
    font-size: 2rem;
}

.wide {
    min-width: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.icon-action-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--primary-strong);
    cursor: pointer;
}

.icon-action-btn:hover {
    background: rgba(255, 106, 0, 0.1);
}

.icon-action-btn svg {
    width: 16px;
    height: 16px;
}

.icon-action-btn-danger:hover {
    background: rgba(255, 98, 79, 0.12);
    border-color: rgba(255, 98, 79, 0.4);
    color: var(--danger);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 106, 0, 0.12);
    color: var(--primary-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

.badge.subtle {
    background: rgba(19, 183, 255, 0.12);
    color: var(--secondary);
}

.badge.badge-danger {
    background: rgba(255, 98, 79, 0.14);
    color: var(--danger);
}

.badge.badge-warning {
    background: rgba(255, 182, 45, 0.18);
    color: #a15f00;
}

.badge.badge-info {
    background: rgba(19, 183, 255, 0.14);
    color: var(--secondary);
}

.badge.badge-success {
    background: rgba(28, 163, 111, 0.14);
    color: var(--success);
}

:root[data-theme="dark"] .badge.badge-warning {
    color: var(--warning);
}

.timeline {
    display: grid;
    gap: 16px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 14px;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.quick-action,
.credential-card,
.setting-card {
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.08), rgba(19, 183, 255, 0.08));
    border: 1px solid var(--line);
}

.toolbar {
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.toolbar > * {
    flex: 1 1 160px;
}

.search-input {
    flex: 2 1 260px;
}

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

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

.span-2 {
    grid-column: span 2;
}

.upload-box input {
    border-style: dashed;
}

.brand-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0 20px;
}

.brand-preview-mark {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #ff9042);
    color: #fff;
    font-weight: 800;
    overflow: hidden;
}

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

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

.simple-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.comment-box input {
    flex: 1 1 auto;
}

.detail-strip {
    flex-wrap: wrap;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.detail-strip div {
    min-width: 140px;
}

.detail-strip small {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
}

.list-line {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.list-line strong {
    display: block;
    margin-bottom: 2px;
}

.list-line:last-child {
    border-bottom: 0;
}

.empty-copy {
    padding: 16px 0 4px;
}

.login-card .alert {
    margin: 0;
}

.mobile-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 20;
    display: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 24px;
    background: rgba(7, 17, 31, 0.94);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

.mobile-nav-link {
    padding: 10px 8px;
    flex-direction: column;
    justify-content: center;
    color: rgba(255, 255, 255, 0.82);
}

.mobile-nav-link.active {
    color: var(--primary);
    background: rgba(255, 106, 0, 0.16);
}

.mobile-nav-link small {
    font-size: 0.72rem;
}

@media (max-width: 1180px) {
    .portal-login {
        grid-template-columns: 1fr;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .portal-stage {
        min-height: 48vh;
    }

    .portal-auth-card {
        max-width: 720px;
        width: calc(100% - 24px);
        margin: -48px auto 0;
        border-radius: 30px 30px 0 0;
        box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.12);
    }

    .login-card,
    .dashboard-grid,
    .details-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .login-copy h1 {
        max-width: 100%;
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 82vw);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 30;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-backdrop {
        display: block;
    }

    body.no-scroll {
        overflow: hidden;
    }

    .menu-button {
        display: inline-flex;
    }

    .mobile-nav {
        display: grid;
    }

    .content {
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .portal-stage {
        min-height: 42vh;
        padding: 36px 22px 84px;
    }

    .portal-stage-inner h1 {
        font-size: clamp(1.9rem, 8vw, 3rem);
    }
}

@media (max-width: 720px) {
    .content,
    .topbar,
    .notification-panel {
        margin-right: 0;
        padding-left: 18px;
        padding-right: 18px;
    }

    .page-header,
    .panel-head,
    .comment-box,
    .form-actions,
    .detail-strip,
    .metric-line,
    .list-line {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .auth-layout {
        padding: 0;
    }

    .portal-stage {
        padding: 28px 18px 96px;
    }

    .portal-mark {
        width: 86px;
        height: 86px;
        border-radius: 24px;
    }

    .portal-mark span {
        font-size: 3rem;
    }

    .portal-stage-inner h1 {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .portal-stage-inner p {
        font-size: 0.96rem;
    }

    .portal-feature-list {
        display: none;
    }

    .portal-auth-card {
        width: 100%;
        margin: -34px 0 0;
        border-radius: 28px 28px 0 0;
        padding: 22px 22px 30px;
    }

    .portal-auth-head {
        margin-bottom: 22px;
    }

    .portal-auth-brand {
        margin-bottom: 20px;
    }

    .portal-auth-head h2 {
        font-size: 2.25rem;
    }

    .portal-auth-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-submit {
        min-height: 54px;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 9, 18, 0.55);
}

.modal-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(720px, 90vh);
    display: flex;
    flex-direction: column;
    background: var(--surface-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: modal-pop 0.18s ease;
}

.modal-dialog.size-sm {
    width: min(460px, 100%);
}

.modal-dialog.size-md {
    width: min(640px, 100%);
}

.modal-dialog.size-lg {
    width: min(880px, 100%);
}

@keyframes modal-pop {
    from {
        transform: scale(0.96);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes modal-sheet-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-drag-handle {
    display: none;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.modal-head h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

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

.modal-body .panel {
    box-shadow: none;
    backdrop-filter: none;
}

.modal-copy {
    margin: 0 0 18px;
    color: var(--muted);
}

.confirm-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 16px;
}

[data-modal-fragment]:has(.confirm-icon) .modal-copy {
    text-align: center;
}

[data-modal-fragment]:has(.confirm-icon) .form-actions {
    justify-content: center;
}

[data-modal-fragment]:has(.confirm-icon) .form-actions .button {
    width: 100%;
}

.confirm-icon svg {
    width: 26px;
    height: 26px;
}

.confirm-icon-danger {
    background: rgba(255, 98, 79, 0.14);
    color: var(--danger);
}

.confirm-icon-warning {
    background: rgba(255, 182, 45, 0.18);
    color: #a15f00;
}

:root[data-theme="dark"] .confirm-icon-warning {
    color: var(--warning);
}

.modal-loading {
    padding: 40px 0;
    text-align: center;
    color: var(--muted);
}

.user-menu-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.user-menu-head > div {
    flex: 1 1 auto;
    min-width: 0;
}

.user-menu-head strong {
    display: block;
}

.user-menu-head small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.user-menu-list {
    display: grid;
    gap: 4px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(255, 106, 0, 0.08);
}

.user-menu-item strong {
    display: block;
    font-size: 0.95rem;
}

.user-menu-item small {
    color: var(--muted);
}

.user-menu-item.danger {
    color: var(--danger);
}

.user-menu-item.danger:hover {
    background: rgba(255, 98, 79, 0.1);
}

@media (max-width: 720px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-dialog,
    .modal-dialog.size-sm,
    .modal-dialog.size-md,
    .modal-dialog.size-lg {
        width: 100%;
        max-height: 88vh;
        border-radius: 24px 24px 0 0;
        animation: modal-sheet-up 0.22s ease;
    }

    .modal-drag-handle {
        display: block;
        width: 40px;
        height: 4px;
        margin: 10px auto 0;
        border-radius: 999px;
        background: var(--line);
        flex-shrink: 0;
    }

    .modal-head {
        padding: 12px 20px 16px;
    }

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