:root {
    color-scheme: light;
    --navy-950: #111a3f;
    --navy-900: #182956;
    --navy-800: #70101a;
    --navy-700: #b20d18;
    --cyan-500: #e10d18;
    --cyan-400: #f13b43;
    --cyan-100: #ffe0e3;
    --page: #eef0f6;
    --surface: #ffffff;
    --surface-soft: #f4f5f9;
    --text: #17203f;
    --muted: #66708a;
    --border: #d7dbe7;
    --shadow: 0 20px 60px rgba(17, 26, 63, 0.14);
    --header-shadow: 0 8px 30px rgba(17, 26, 63, 0.1);
    --danger: #c70d15;
    --success: #16855b;
    --page-gradient-mid: #f7f7fa;
    --page-gradient-end: #dfe3ee;
    --page-glow-primary: rgba(225, 13, 24, 0.3);
    --page-glow-secondary: rgba(178, 13, 24, 0.2);
    --page-glow-tertiary: rgba(241, 59, 67, 0.2);
    --sidebar-width: 282px;
    --header-height: 82px;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #26324f;
    --surface: #303e5e;
    --surface-soft: #394968;
    --text: #f8f9fc;
    --muted: #c5cddd;
    --border: #53627e;
    --shadow: 0 20px 55px rgba(10, 18, 38, 0.24);
    --header-shadow: 0 8px 26px rgba(10, 18, 38, 0.2);
    --cyan-100: #71323d;
    --page-gradient-mid: #303e5e;
    --page-gradient-end: #202b47;
    --page-glow-primary: rgba(225, 13, 24, 0.3);
    --page-glow-secondary: rgba(178, 13, 24, 0.22);
    --page-glow-tertiary: rgba(241, 59, 67, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(ellipse at 4% 5%, var(--page-glow-primary), transparent 27rem),
        radial-gradient(ellipse at 96% 22%, var(--page-glow-secondary), transparent 31rem),
        radial-gradient(ellipse at 52% 105%, var(--page-glow-tertiary), transparent 34rem),
        linear-gradient(135deg, var(--page) 0%, var(--page-gradient-mid) 48%, var(--page-gradient-end) 100%);
    background-attachment: fixed;
    transition: color 180ms ease, background-color 180ms ease;
}

body.modal-open {
    overflow: hidden;
}

/* Keep desktop portal pages at the requested compact 75%-zoom density. */
@media (min-width: 901px) {
    body.portal-body {
        zoom: 75%;
    }
}

a {
    color: var(--navy-700);
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button,
.button {
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan-400), #99111b);
    box-shadow: 0 9px 22px rgba(0, 145, 216, 0.2);
    font-weight: 800;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 145, 216, 0.28);
    filter: brightness(1.03);
}

.portal-header {
    position: sticky;
    z-index: 50;
    top: 0;
    height: var(--header-height);
    padding: 12px clamp(20px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--header-shadow);
    backdrop-filter: blur(18px);
}

.portal-header-start {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.portal-header-actions,
.drive-ribbon {
    min-width: 0;
    display: flex;
    align-items: center;
}

.portal-header-actions {
    gap: 12px;
}

.drive-ribbon {
    gap: 7px;
}

.drive-ribbon-link {
    min-height: 42px;
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--cyan-500) 22%, var(--border));
    border-radius: 12px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
    box-shadow: 0 6px 16px rgba(3, 54, 82, 0.06);
    font-size: 0.73rem;
    font-weight: 850;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.drive-ribbon-link svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    display: block;
    stroke: var(--cyan-500);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.drive-ribbon-link:hover,
.drive-ribbon-link.is-active {
    color: var(--navy-700);
    border-color: color-mix(in srgb, var(--cyan-500) 55%, var(--border));
    background: linear-gradient(145deg, color-mix(in srgb, var(--cyan-100) 76%, var(--surface)), var(--surface));
    box-shadow: 0 9px 22px rgba(0, 145, 216, 0.16);
    transform: translateY(-1px);
}

:root[data-theme="dark"] .drive-ribbon-link,
:root[data-theme="dark"] .drive-ribbon-link:hover,
:root[data-theme="dark"] .drive-ribbon-link.is-active {
    color: var(--cyan-400);
}

.sidebar-header-toggle {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface-soft);
    box-shadow: none;
}

.sidebar-header-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    padding: 11px;
    align-content: center;
    gap: 5px;
    border-radius: 13px;
}

.sidebar-header-toggle span {
    width: 100%;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--navy-700), var(--cyan-500));
    transition: width 180ms ease, transform 180ms ease;
}

.sidebar-header-toggle span:nth-child(2) {
    width: 72%;
}

:root[data-sidebar="open"] .sidebar-header-toggle span:nth-child(1) {
    width: 72%;
}

:root[data-sidebar="open"] .sidebar-header-toggle span:nth-child(2) {
    width: 100%;
}

.sidebar-header-toggle:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--cyan-500) 55%, var(--border));
    background: var(--cyan-100);
    box-shadow: 0 8px 20px rgba(0, 145, 216, 0.14);
    filter: none;
}

.brand-link {
    display: flex;
    align-items: center;
}

.brand-link img {
    width: 220px;
    max-height: 56px;
    object-fit: contain;
}

.theme-logo-dark {
    display: none !important;
}

:root[data-theme="dark"] .theme-logo-light {
    display: none !important;
}

:root[data-theme="dark"] .theme-logo-dark {
    display: block !important;
}

.portal-sidebar {
    position: fixed;
    z-index: 45;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    padding: 23px 18px 18px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background:
        radial-gradient(circle at 0 0, rgba(225, 13, 24, 0.18), transparent 16rem),
        color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 15px 0 40px rgba(5, 42, 94, 0.09);
    backdrop-filter: blur(20px);
    transform: translateX(calc(-100% - 18px));
    visibility: hidden;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 240ms;
}

:root[data-sidebar="open"] .portal-sidebar {
    transform: translateX(0);
    visibility: visible;
}

.sidebar-heading {
    min-height: 52px;
    padding: 0 4px 17px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-heading > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.sidebar-heading strong {
    overflow: hidden;
    font-size: 1.02rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-kicker {
    color: var(--cyan-500);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sidebar-nav-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-nav {
    padding-top: 20px;
    display: grid;
    align-content: start;
    gap: 8px;
}

.sidebar-nav-link,
.sidebar-group-toggle,
.sidebar-submenu-link {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--text);
    background: transparent;
    box-shadow: none;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: left;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.sidebar-nav-link,
.sidebar-group-toggle {
    padding: 10px 12px;
}

.sidebar-nav-link:hover,
.sidebar-group-toggle:hover,
.sidebar-submenu-link:hover {
    border-color: color-mix(in srgb, var(--cyan-500) 22%, transparent);
    color: var(--navy-700);
    background: color-mix(in srgb, var(--cyan-100) 68%, var(--surface));
    box-shadow: none;
    filter: none;
    transform: translateX(2px);
}

:root[data-theme="dark"] .sidebar-nav-link:hover,
:root[data-theme="dark"] .sidebar-group-toggle:hover,
:root[data-theme="dark"] .sidebar-submenu-link:hover {
    color: var(--cyan-400);
}

.sidebar-nav-link.is-active,
.sidebar-submenu-link.is-active {
    border-color: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy-700), var(--cyan-500));
    box-shadow: 0 10px 23px rgba(0, 145, 216, 0.22);
}

.sidebar-nav-link.is-active:hover,
.sidebar-submenu-link.is-active:hover {
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-nav-icon {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}

.sidebar-nav-group {
    display: grid;
}

.sidebar-group-toggle {
    cursor: pointer;
}

.sidebar-nav-group:has(.sidebar-submenu-link.is-active) > .sidebar-group-toggle {
    color: var(--navy-700);
    background: color-mix(in srgb, var(--cyan-100) 45%, transparent);
}

:root[data-theme="dark"] .sidebar-nav-group:has(.sidebar-submenu-link.is-active) > .sidebar-group-toggle {
    color: var(--cyan-400);
}

.sidebar-chevron {
    width: 8px;
    height: 8px;
    margin: -4px 3px 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 180ms ease, margin 180ms ease;
}

.sidebar-nav-group.is-expanded .sidebar-chevron {
    margin-top: 4px;
    transform: rotate(225deg);
}

.sidebar-submenu {
    max-height: 0;
    margin-left: 23px;
    padding-left: 17px;
    overflow: hidden;
    border-left: 1px solid transparent;
    opacity: 0;
    transform: translateY(-5px);
    transition: max-height 220ms ease, opacity 160ms ease, transform 180ms ease, padding 180ms ease, border-color 180ms ease;
}

.sidebar-nav-group.is-expanded .sidebar-submenu {
    max-height: 480px;
    padding-top: 5px;
    padding-bottom: 3px;
    border-left-color: color-mix(in srgb, var(--cyan-500) 38%, var(--border));
    opacity: 1;
    transform: translateY(0);
}

.sidebar-submenu-link {
    position: relative;
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.84rem;
}

.sidebar-nested-link {
    width: calc(100% - 20px);
    min-height: 38px;
    margin-left: 20px;
    padding-top: 7px;
    padding-bottom: 7px;
    color: var(--muted);
    font-size: 0.78rem;
}

.sidebar-nested-link::before {
    position: absolute;
    top: -6px;
    left: -11px;
    width: 12px;
    height: 24px;
    border-bottom: 1px solid color-mix(in srgb, var(--cyan-500) 45%, var(--border));
    border-left: 1px solid color-mix(in srgb, var(--cyan-500) 45%, var(--border));
    border-radius: 0 0 0 8px;
    content: "";
}

.sidebar-nested-link .sidebar-submenu-dot {
    width: 6px;
    height: 6px;
}

.sidebar-submenu-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border: 2px solid var(--cyan-500);
    border-radius: 50%;
    background: var(--surface);
}

.sidebar-submenu-link.is-active .sidebar-submenu-dot {
    border-color: #ffffff;
    background: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    min-height: 70px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid color-mix(in srgb, var(--cyan-500) 25%, var(--border));
    border-radius: 16px;
    background:
        radial-gradient(circle at 0 0, var(--page-glow-primary), transparent 7rem),
        var(--surface-soft);
    box-shadow: 0 10px 25px rgba(5, 42, 94, 0.08);
}

.profile-avatar {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid color-mix(in srgb, var(--cyan-400) 75%, #ffffff);
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(145deg, var(--navy-700), var(--cyan-500));
    box-shadow: 0 8px 20px rgba(0, 145, 216, 0.24);
    font-weight: 900;
    letter-spacing: 0.04em;
}

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

.profile-avatar [hidden] {
    display: none;
}

.sidebar-profile-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    font-size: 0.78rem;
}

.sidebar-profile-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.sidebar-profile-copy strong,
.sidebar-profile-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-copy strong {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 850;
}

.sidebar-profile-copy small {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--cyan-500);
    background: var(--cyan-100);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-backdrop {
    display: none;
}

.portal-shell {
    width: min(1180px, 92%);
    margin: 44px auto 70px;
    transition: width 240ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 901px) {
    :root[data-sidebar="open"] .portal-shell {
        width: min(1180px, calc(92% - var(--sidebar-width)));
        transform: translateX(calc(var(--sidebar-width) / 2));
    }
}

.dashboard-hero,
.page-hero {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    color: #ffffff;
    background:
        linear-gradient(120deg, rgba(3, 21, 47, 0.98), rgba(6, 65, 124, 0.95) 63%, rgba(225, 13, 24, 0.9));
    box-shadow: 0 28px 70px rgba(4, 42, 91, 0.25);
}

.dashboard-hero {
    min-height: 0;
    padding: clamp(24px, 3.5vw, 38px) clamp(28px, 5vw, 58px);
    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 860px;
}

.hero-badge,
.section-chip,
.record-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-badge {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

.dashboard-hero h1,
.page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.dashboard-hero p,
.page-hero p {
    max-width: 650px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.04rem;
    line-height: 1.7;
}

.dashboard-hero h1 {
    margin: 10px 0 8px;
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.dashboard-hero p {
    max-width: 850px;
    font-size: 0.98rem;
    line-height: 1.5;
}

.hero-mark {
    position: absolute;
    inset: 0 0 0 auto;
    width: 42%;
    opacity: 0.5;
}

.hero-mark span {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
}

.hero-mark span:nth-child(1) {
    width: 300px;
    height: 300px;
    right: -30px;
    top: -90px;
}

.hero-mark span:nth-child(2) {
    width: 210px;
    height: 210px;
    right: 100px;
    bottom: -105px;
}

.hero-mark span:nth-child(3) {
    width: 90px;
    height: 90px;
    right: 235px;
    top: 45px;
    background: rgba(34, 211, 238, 0.18);
}

.dashboard-section {
    margin-top: 38px;
}

.section-heading,
.panel-heading {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading h2,
.panel-heading h2 {
    margin: 4px 0 0;
    font-size: 1.75rem;
}

.eyebrow {
    margin: 0;
    color: var(--cyan-500);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.section-chip,
.record-count {
    color: var(--navy-700);
    background: var(--cyan-100);
}

:root[data-theme="dark"] .section-chip,
:root[data-theme="dark"] .record-count,
:root[data-theme="dark"] a {
    color: var(--cyan-400);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    min-height: 92px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    transition: transform 170ms ease, border-color 170ms ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan-500);
}

.tool-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--cyan-100), rgba(225, 13, 24, 0.24));
    font-size: 1.55rem;
}

.magenta-tool-card:hover {
    border-color: #e20074;
}

.magenta-tool-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #9b0050, #e20074 64%, #ff4daf);
    box-shadow: 0 10px 24px rgba(226, 0, 116, 0.2);
    font-size: 1.15rem;
    font-weight: 950;
}

.supplies-tool-card:hover {
    border-color: #f59e0b;
}

.supplies-tool-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #b45309, #f59e0b 58%, #22c55e);
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.2);
}

.sales-report-tool-card:hover {
    border-color: #22c55e;
}

.sales-report-tool-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #07516f, #0091d8 55%, #22c55e);
    box-shadow: 0 10px 24px rgba(0, 145, 216, 0.22);
    font-size: 1.4rem;
    font-weight: 950;
}

.quota-report-tool-card:hover {
    border-color: #7c3aed;
}

.quota-report-tool-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #2563eb, #7c3aed 56%, #ec4899);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.22);
    font-size: 0.98rem;
    font-weight: 950;
}

.commission-tool-card:hover,
.commission-master-tool-card:hover {
    border-color: #7c3aed;
}

.commission-tool-icon,
.commission-master-tool-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #70101a, #7c3aed 56%, #df1017);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.22);
    font-size: 1.1rem;
    font-weight: 950;
}

.tool-copy {
    display: grid;
    gap: 4px;
}

.tool-copy strong {
    font-size: 1.08rem;
}

.tool-copy small {
    color: var(--muted);
    line-height: 1.45;
}

.tool-arrow {
    color: var(--cyan-500);
    font-size: 1.5rem;
}

.market-visibility-panel {
    padding: 22px;
    display: grid;
    gap: 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0, rgba(225, 13, 24, 0.14), transparent 36%),
        color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.market-visibility-intro {
    display: flex;
    align-items: center;
    gap: 15px;
}

.market-visibility-intro p {
    max-width: 900px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.market-visibility-shield {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(145deg, #073c55, #00aeea);
    box-shadow: 0 10px 23px rgba(0, 145, 216, 0.22);
}

.market-visibility-shield svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.market-visibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 12px;
}

.market-visibility-card {
    min-height: 78px;
    padding: 14px 15px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 11px;
    border: 1px solid color-mix(in srgb, #22c55e 34%, var(--border));
    border-radius: 16px;
    background: color-mix(in srgb, #22c55e 6%, var(--surface));
}

.market-visibility-card.is-disabled {
    border-color: color-mix(in srgb, #ef4444 38%, var(--border));
    background: color-mix(in srgb, #ef4444 7%, var(--surface));
}

.market-state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.market-visibility-card.is-disabled .market-state-dot {
    background: #ef4444;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
}

.market-visibility-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.market-visibility-copy strong {
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-visibility-copy small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.market-visibility-toggle {
    min-width: 78px;
    min-height: 36px;
    padding: 7px 12px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    box-shadow: 0 7px 16px rgba(185, 28, 28, 0.2);
    font-size: 0.72rem;
    font-weight: 850;
}

.market-visibility-toggle.enable-market {
    background: linear-gradient(135deg, #087443, #22c55e);
    box-shadow: 0 7px 16px rgba(8, 116, 67, 0.2);
}

.market-visibility-empty {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 560px) {
    .market-visibility-panel {
        padding: 16px;
    }

    .market-visibility-intro {
        align-items: flex-start;
    }

    .market-visibility-card {
        grid-template-columns: auto 1fr;
    }

    .market-visibility-card form {
        grid-column: 1 / -1;
    }

    .market-visibility-toggle {
        width: 100%;
    }
}

.page-hero {
    padding: 36px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.page-hero .eyebrow {
    color: var(--cyan-400);
}

.button-download {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: none;
}

.panel {
    margin-top: 28px;
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--surface) 88%, var(--cyan-100)),
        color-mix(in srgb, var(--surface) 88%, transparent)
    );
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

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

.user-form button {
    align-self: end;
}

.page-access-fieldset {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.page-access-fieldset legend {
    padding: 0 8px;
    color: var(--text);
    font-weight: 850;
}

.page-access-fieldset > p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.83rem;
}

.page-access-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.page-access-options label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.page-access-options input {
    width: 18px;
    min-height: 18px;
}

.page-access-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--cyan-500) 35%, var(--border));
    border-radius: 999px;
    color: var(--cyan-700);
    background: color-mix(in srgb, var(--cyan-500) 10%, var(--surface));
    font-size: 0.76rem;
    font-weight: 850;
    cursor: help;
}

.page-access-tooltip {
    position: absolute;
    z-index: 30;
    bottom: calc(100% + 9px);
    left: 50%;
    width: max-content;
    max-width: min(330px, 80vw);
    padding: 10px 12px;
    border-radius: 9px;
    color: #fff;
    background: #10233f;
    box-shadow: 0 10px 28px rgba(2, 8, 23, 0.28);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.45;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 5px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.page-access-pill:hover .page-access-tooltip,
.page-access-pill:focus .page-access-tooltip,
.page-access-pill:focus-visible .page-access-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 0.87rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: var(--surface-soft);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 0 3px rgba(225, 13, 24, 0.15);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: color-mix(in srgb, var(--cyan-100) 34%, var(--surface));
}

.username-cell,
.password-value {
    color: var(--navy-700);
    font-weight: 800;
}

:root[data-theme="dark"] .username-cell,
:root[data-theme="dark"] .password-value {
    color: var(--cyan-400);
}

.password-value {
    padding: 5px 9px;
    border-radius: 7px;
    background: var(--cyan-100);
    letter-spacing: 0.05em;
}

.role-pill,
.status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.role-pill {
    color: var(--navy-700);
    background: var(--cyan-100);
}

.drive-access-pill {
    min-width: 88px;
    padding: 6px 10px;
    display: inline-grid;
    gap: 2px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 0.7rem;
    line-height: 1.2;
}

.drive-access-pill strong {
    font-size: 0.73rem;
    font-weight: 900;
}

.drive-access-pill small {
    font-size: 0.62rem;
    font-weight: 750;
}

.drive-access-pill.has-access {
    border-color: rgba(0, 174, 218, 0.24);
    color: #087ca4;
    background: linear-gradient(135deg, rgba(225, 13, 24, 0.13), rgba(34, 197, 94, 0.1));
}

.drive-access-pill.no-access {
    border-color: rgba(98, 117, 141, 0.18);
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
}

.button-drive-access {
    color: #ffffff;
    background: linear-gradient(135deg, #6753d7, #00aeda);
}

.drive-access-admin-modal {
    width: min(560px, calc(100vw - 28px));
}

.drive-access-user-card {
    margin: 18px 0;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid color-mix(in srgb, var(--cyan-500) 28%, var(--border));
    border-radius: 15px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--cyan-100) 60%, var(--surface)), var(--surface-soft));
}

.drive-access-user-card > span {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(145deg, #6753d7, #00aeda);
    font-weight: 950;
}

.drive-access-user-card > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.drive-access-user-card strong,
.drive-access-user-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-access-user-card small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}

.drive-quota-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 13px;
}

.drive-quota-fields[hidden] {
    display: none;
}

.drive-quota-presets {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.drive-quota-presets > span {
    margin-right: 3px;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.drive-quota-presets button {
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, #6753d7 30%, var(--border));
    border-radius: 999px;
    color: color-mix(in srgb, #6753d7 78%, var(--text));
    background: color-mix(in srgb, #6753d7 8%, var(--surface));
    box-shadow: none;
    font-size: 0.67rem;
    font-weight: 850;
}

.drive-quota-presets button:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #6753d7, #00aeda);
    box-shadow: 0 8px 18px rgba(103, 83, 215, 0.2);
}

.drive-access-note {
    padding: 12px 14px;
    display: grid;
    gap: 4px;
    border: 1px solid color-mix(in srgb, #6753d7 22%, var(--border));
    border-radius: 13px;
    color: var(--muted);
    background: color-mix(in srgb, #6753d7 7%, var(--surface));
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.5;
}

.drive-access-note strong {
    color: var(--text);
    font-size: 0.77rem;
    font-weight: 900;
}

.drive-access-save {
    width: 100%;
    margin-top: 2px;
    background: linear-gradient(135deg, #052f68, #6753d7 54%, #00aeda);
}

@media (max-width: 560px) {
    .drive-quota-fields {
        grid-template-columns: 1fr;
    }
}

.status-pill.active {
    color: var(--success);
    background: rgba(22, 133, 91, 0.12);
}

.status-pill.blocked {
    color: var(--danger);
    background: rgba(196, 58, 71, 0.12);
}

.inline-form {
    display: inline;
}

.button-small {
    padding: 8px 12px;
    background: linear-gradient(135deg, #62758d, #3b5069);
    box-shadow: none;
    font-size: 0.78rem;
}

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

.alert {
    margin: 18px 0;
    padding: 13px 16px;
    border: 1px solid rgba(225, 13, 24, 0.22);
    border-radius: 11px;
    color: var(--navy-700);
    background: var(--cyan-100);
}

.alert.error {
    border-color: rgba(196, 58, 71, 0.25);
    color: var(--danger);
    background: rgba(196, 58, 71, 0.1);
}

.account-menu {
    position: relative;
}

.menu-trigger {
    width: 46px;
    height: 46px;
    padding: 11px;
    display: grid;
    align-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
    box-shadow: none;
}

.menu-trigger span {
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}

.menu-panel {
    position: absolute;
    z-index: 70;
    top: calc(100% + 12px);
    right: 0;
    width: 290px;
    overflow: hidden;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.menu-panel[hidden],
.modal-backdrop[hidden] {
    display: none;
}

.menu-panel form {
    margin: 0;
}

.menu-option {
    width: 100%;
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 11px;
    color: var(--text);
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.menu-option:hover {
    transform: none;
    background: var(--surface-soft);
    box-shadow: none;
}

.menu-option-text {
    flex: 1;
    display: grid;
    gap: 3px;
}

.menu-option-text small {
    color: var(--muted);
}

.menu-option-icon {
    width: 28px;
    text-align: center;
}

.menu-option-danger strong,
.menu-option-danger .menu-option-icon {
    color: var(--danger);
}

.theme-switch {
    width: 42px;
    height: 24px;
    padding: 3px;
    border-radius: 999px;
    background: #a8b8c7;
}

.theme-switch span {
    width: 18px;
    height: 18px;
    display: block;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.24);
    transition: transform 180ms ease;
}

:root[data-theme="dark"] .theme-switch {
    background: var(--cyan-500);
}

:root[data-theme="dark"] .theme-switch span {
    transform: translateX(18px);
}

.modal-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    padding: clamp(10px, 2vw, 22px);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(2, 13, 30, 0.7);
    backdrop-filter: blur(8px);
}

.profile-modal {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: clamp(22px, 3vw, 32px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 22px;
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0, var(--page-glow-primary), transparent 15rem),
        var(--surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
    scrollbar-color: var(--cyan-500) transparent;
    scrollbar-width: thin;
}

.profile-modal h2 {
    margin: 6px 0 8px;
    font-size: 1.8rem;
}

.profile-modal > p:not(.eyebrow) {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.55;
}

.profile-modal form {
    display: grid;
    gap: 16px;
}

.profile-modal::-webkit-scrollbar {
    width: 8px;
}

.profile-modal::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: linear-gradient(var(--cyan-500), var(--navy-700)) padding-box;
}

.profile-preview-row {
    margin: 14px 0 18px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--cyan-500) 26%, var(--border));
    border-radius: 16px;
    background: color-mix(in srgb, var(--cyan-100) 45%, var(--surface));
}

.profile-avatar-large {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.profile-preview-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.profile-preview-copy strong,
.profile-preview-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-preview-copy strong {
    font-size: 1rem;
}

.profile-preview-copy small,
.field-help {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

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

.profile-picture-field {
    grid-column: 1 / -1;
}

.profile-security-heading {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--cyan-500) 25%, var(--border));
    border-radius: 14px;
    background: linear-gradient(135deg, var(--surface-soft), color-mix(in srgb, var(--cyan-100) 55%, var(--surface)));
}

.profile-security-heading > span:first-child {
    display: grid;
    gap: 3px;
}

.profile-security-heading small,
.profile-form-actions small {
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 600;
}

.security-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy-700), var(--cyan-500));
    box-shadow: 0 8px 18px rgba(0, 145, 216, 0.18);
}

.profile-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-password-grid label {
    min-width: 0;
}

.profile-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.profile-form-actions small {
    margin-right: auto;
}

.profile-form-actions button {
    flex: 0 0 auto;
}

.profile-file-input {
    padding: 6px;
    cursor: pointer;
}

.profile-file-input::file-selector-button {
    margin-right: 11px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy-700), var(--cyan-500));
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface-soft);
    box-shadow: none;
    font-size: 1.5rem;
}

.login-page {
    position: relative;
    isolation: isolate;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(rgba(7, 46, 82, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(7, 46, 82, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 11% 5%, rgba(225, 13, 24, 0.27), transparent 30rem),
        radial-gradient(circle at 91% 90%, rgba(7, 90, 167, 0.19), transparent 34rem),
        linear-gradient(135deg, #d9e8f1 0%, #eef5f8 48%, #c5dce8 100%);
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

.login-ambient {
    position: fixed;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    opacity: 0.62;
    filter: blur(3px);
    animation: login-float 10s ease-in-out infinite alternate;
}

.login-orb-one {
    top: 9%;
    left: -5rem;
    width: 19rem;
    height: 19rem;
    background: rgba(34, 211, 238, 0.18);
}

.login-orb-two {
    right: 3%;
    bottom: -9rem;
    width: 28rem;
    height: 28rem;
    background: rgba(7, 90, 167, 0.14);
    animation-delay: -3s;
}

.login-orb-three {
    top: 39%;
    left: 51%;
    width: 8rem;
    height: 8rem;
    background: rgba(225, 13, 24, 0.13);
    animation-delay: -6s;
}

.login-topbar {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
    width: min(1480px, calc(100% - 48px));
    height: 94px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-brand {
    display: inline-flex;
    align-items: center;
}

.login-brand img {
    width: clamp(188px, 16vw, 238px);
    height: 66px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 8px 15px rgba(0, 50, 101, 0.09));
}

.login-theme-toggle {
    min-height: 44px;
    padding: 8px 14px 8px 9px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(82, 127, 157, 0.25);
    border-radius: 999px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    box-shadow: 0 10px 30px rgba(7, 53, 93, 0.09);
    font-size: 0.78rem;
    font-weight: 800;
    backdrop-filter: blur(18px);
}

.login-theme-toggle:hover {
    color: var(--navy-700);
    border-color: rgba(225, 13, 24, 0.45);
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    box-shadow: 0 13px 35px rgba(7, 53, 93, 0.14);
    filter: none;
}

.login-theme-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy-700), var(--cyan-500));
}

.login-theme-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-theme-icon-sun {
    display: none;
}

:root[data-theme="dark"] .login-theme-icon-moon {
    display: none;
}

:root[data-theme="dark"] .login-theme-icon-sun {
    display: grid;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(1480px, calc(100% - 48px));
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0 auto;
    padding: 96px 0 46px;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
    gap: clamp(28px, 4.5vw, 78px);
    align-items: stretch;
}

.login-showcase {
    position: relative;
    min-height: 0;
    overflow: hidden;
    padding: clamp(48px, 6vw, 86px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(93, 220, 255, 0.19);
    border-radius: 38px;
    color: #ffffff;
    background:
        radial-gradient(circle at 76% 64%, rgba(0, 210, 255, 0.22), transparent 24rem),
        radial-gradient(circle at 10% 8%, rgba(34, 211, 238, 0.18), transparent 20rem),
        linear-gradient(145deg, #111a3f 0%, #47101a 48%, #70101a 100%);
    box-shadow:
        0 38px 85px rgba(3, 33, 71, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.login-showcase::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(105deg, rgba(255, 255, 255, 0.035), transparent 30%),
        radial-gradient(circle at 50% 115%, rgba(225, 13, 24, 0.24), transparent 49%);
    pointer-events: none;
}

.login-showcase-grid {
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(93, 220, 255, 0.19) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 220, 255, 0.19) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(115deg, black, transparent 70%);
}

.login-showcase-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    transform: translateY(-24px);
    animation: login-rise 650ms ease-out both;
}

.login-kicker {
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #86e8ff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-kicker > span {
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: #24d8fa;
    box-shadow: 0 0 14px rgba(36, 216, 250, 0.8);
}

.login-showcase h1 {
    max-width: 690px;
    margin: 0;
    font-size: clamp(3.3rem, 5.3vw, 6.6rem);
    font-weight: 900;
    letter-spacing: -0.065em;
    line-height: 0.95;
}

.login-showcase h1 > span {
    display: block;
    color: transparent;
    background: linear-gradient(100deg, #ffffff 5%, #ff9da3 48%, #e10d18 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

.login-showcase-copy {
    max-width: 560px;
    margin: 27px 0 0;
    color: rgba(226, 246, 255, 0.76);
    font-size: clamp(1rem, 1.2vw, 1.14rem);
    line-height: 1.75;
}

.login-feature-grid {
    max-width: 610px;
    margin-top: 38px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.login-feature {
    min-width: 0;
    padding: 14px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(124, 224, 255, 0.18);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.065);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

.login-feature-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #9af0ff;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.25), rgba(0, 99, 176, 0.2));
}

.login-feature-icon svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-feature strong,
.login-feature small {
    display: block;
}

.login-feature strong {
    font-size: 0.87rem;
}

.login-feature small {
    margin-top: 3px;
    color: rgba(211, 240, 251, 0.6);
    font-size: 0.72rem;
}

.login-network {
    position: absolute;
    z-index: 1;
    right: -8rem;
    bottom: -9rem;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    opacity: 0.82;
    pointer-events: none;
}

.login-network::before {
    position: absolute;
    inset: 19%;
    content: "";
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225, 13, 24, 0.18), transparent 68%);
    filter: blur(16px);
}

.login-network-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    border: 1px solid rgba(92, 227, 255, 0.26);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.login-network-orbit-one {
    width: 36%;
    height: 36%;
}

.login-network-orbit-two {
    width: 64%;
    height: 64%;
    border-style: dashed;
    animation: login-orbit-spin 22s linear infinite;
}

.login-network-orbit-three {
    width: 91%;
    height: 91%;
    border-color: rgba(92, 227, 255, 0.14);
}

.login-network-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 104px;
    height: 104px;
    display: grid;
    place-content: center;
    border: 1px solid rgba(144, 238, 255, 0.47);
    border-radius: 50%;
    text-align: center;
    background: linear-gradient(145deg, rgba(12, 102, 162, 0.86), rgba(1, 31, 71, 0.95));
    box-shadow:
        0 0 0 13px rgba(225, 13, 24, 0.07),
        0 0 44px rgba(0, 207, 255, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.23);
    transform: translate(-50%, -50%);
    animation: login-core-pulse 4s ease-in-out infinite;
}

.login-network-core strong {
    color: #ffffff;
    font-size: 1.75rem;
    letter-spacing: -0.06em;
}

.login-network-core small {
    margin-top: 2px;
    color: #76eaff;
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 0.25em;
}

.login-network-node {
    position: absolute;
    width: 15px;
    height: 15px;
    display: block;
    border: 3px solid #063c70;
    border-radius: 50%;
    background: #5ee7ff;
    box-shadow: 0 0 19px rgba(94, 231, 255, 0.78);
}

.login-network-node-one {
    top: 14%;
    left: 47%;
}

.login-network-node-two {
    top: 54%;
    left: 8%;
}

.login-network-node-three {
    top: 31%;
    right: 8%;
}

.login-network-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 43%;
    height: 1px;
    display: block;
    background: linear-gradient(90deg, rgba(94, 231, 255, 0.65), transparent);
    transform-origin: left center;
}

.login-network-line-one {
    transform: rotate(211deg);
}

.login-network-line-two {
    transform: rotate(323deg);
}

.login-showcase-footer {
    position: absolute;
    z-index: 3;
    bottom: 27px;
    left: clamp(48px, 6vw, 86px);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(210, 242, 252, 0.52);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-showcase-footer > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #42df9a;
    box-shadow: 0 0 10px rgba(66, 223, 154, 0.9);
}

.login-auth-panel {
    display: grid;
    place-items: center;
}

.login-card {
    position: relative;
    width: min(500px, 100%);
    overflow: hidden;
    padding: clamp(34px, 4vw, 48px);
    border: 1px solid rgba(100, 144, 171, 0.26);
    border-radius: 30px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow:
        0 30px 80px rgba(5, 45, 82, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(24px) saturate(130%);
    animation: login-rise 600ms 120ms ease-out both;
}

.login-card::before {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 15%;
    left: 15%;
    height: 2px;
    content: "";
    background: linear-gradient(90deg, transparent, #0cccf3, transparent);
    box-shadow: 0 0 22px rgba(12, 204, 243, 0.65);
}

.login-card-glow {
    position: absolute;
    top: -7rem;
    right: -7rem;
    width: 15rem;
    height: 15rem;
    border-radius: 50%;
    background: rgba(225, 13, 24, 0.12);
    filter: blur(10px);
    pointer-events: none;
}

.login-eyebrow {
    position: relative;
    z-index: 1;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--navy-700);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.login-eyebrow > span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--navy-700);
    background: var(--cyan-100);
}

.login-eyebrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-card h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(2.45rem, 4vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 1;
}

.login-card h2 > span {
    color: var(--cyan-500);
}

.login-intro {
    position: relative;
    z-index: 1;
    margin: 13px 0 31px;
    color: var(--muted);
    font-size: 0.96rem;
}

.login-card .alert {
    position: relative;
    z-index: 1;
    margin: -10px 0 22px;
}

.login-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 20px;
}

.login-field {
    display: grid;
    gap: 9px;
}

.login-field-label {
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.login-input-wrap {
    position: relative;
    display: block;
}

.login-input-wrap input {
    min-height: 57px;
    padding: 14px 50px;
    border: 1px solid color-mix(in srgb, var(--border) 87%, transparent);
    border-radius: 15px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
    box-shadow: inset 0 1px 1px rgba(5, 45, 82, 0.035);
    font-weight: 650;
    transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.login-input-wrap input::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
    font-weight: 500;
}

.login-input-wrap input:focus {
    border-color: rgba(225, 13, 24, 0.7);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow:
        0 0 0 4px rgba(225, 13, 24, 0.11),
        0 10px 30px rgba(0, 122, 183, 0.08);
}

.login-input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 17px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 170ms ease;
}

.login-input-icon svg,
.login-password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-input-wrap:focus-within .login-input-icon {
    color: var(--cyan-500);
}

.login-password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 9px;
    width: 39px;
    height: 39px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    transform: translateY(-50%);
}

.login-password-toggle:hover {
    color: var(--navy-700);
    background: var(--cyan-100);
    box-shadow: none;
    transform: translateY(-50%);
    filter: none;
}

.login-eye-closed,
.login-password-toggle.is-visible .login-eye-open {
    display: none;
}

.login-password-toggle.is-visible .login-eye-closed {
    display: block;
}

.login-submit {
    min-height: 58px;
    margin-top: 6px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 15px;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.15), transparent 27%),
        linear-gradient(110deg, #70101a, #b20d18 54%, #e10d18);
    box-shadow:
        0 18px 36px rgba(0, 104, 176, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    font-size: 0.91rem;
    letter-spacing: 0.035em;
}

.login-submit svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 170ms ease;
}

.login-submit:hover {
    box-shadow:
        0 22px 44px rgba(0, 104, 176, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.login-submit:hover svg {
    transform: translateX(4px);
}

.login-submit.is-loading {
    cursor: wait;
    filter: saturate(0.8);
}

.login-submit.is-loading svg {
    animation: login-arrow-wait 850ms ease-in-out infinite alternate;
}

.login-trust-line {
    position: relative;
    z-index: 1;
    margin: 26px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
}

.login-trust-line > span {
    width: 17px;
    height: 17px;
    color: var(--success);
}

.login-trust-line svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="dark"] .login-page {
    background:
        linear-gradient(rgba(109, 197, 231, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(109, 197, 231, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 11% 5%, rgba(225, 13, 24, 0.23), transparent 31rem),
        radial-gradient(circle at 91% 90%, rgba(56, 132, 210, 0.19), transparent 35rem),
        linear-gradient(135deg, #0f293d 0%, #193a50 48%, #0c263a 100%);
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

:root[data-theme="dark"] .login-theme-toggle {
    border-color: rgba(132, 193, 220, 0.19);
    background: rgba(29, 59, 84, 0.74);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.17);
}

:root[data-theme="dark"] .login-theme-toggle:hover {
    color: var(--cyan-400);
    border-color: rgba(225, 13, 24, 0.43);
    background: rgba(36, 70, 95, 0.94);
}

:root[data-theme="dark"] .login-card {
    border-color: rgba(117, 181, 211, 0.2);
    background: rgba(24, 54, 76, 0.79);
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] .login-eyebrow,
:root[data-theme="dark"] .login-eyebrow > span {
    color: var(--cyan-400);
}

:root[data-theme="dark"] .login-input-wrap input {
    border-color: rgba(117, 181, 211, 0.18);
    background: rgba(18, 45, 65, 0.76);
}

:root[data-theme="dark"] .login-input-wrap input:focus {
    border-color: rgba(34, 211, 238, 0.59);
    background: rgba(25, 58, 80, 0.95);
}

@keyframes login-float {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(1.5rem, -1.1rem, 0) scale(1.08);
    }
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes login-orbit-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes login-core-pulse {
    0%,
    100% {
        box-shadow:
            0 0 0 13px rgba(225, 13, 24, 0.07),
            0 0 38px rgba(0, 207, 255, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.23);
    }
    50% {
        box-shadow:
            0 0 0 19px rgba(225, 13, 24, 0.025),
            0 0 58px rgba(0, 207, 255, 0.41),
            inset 0 1px 0 rgba(255, 255, 255, 0.23);
    }
}

@keyframes login-arrow-wait {
    from {
        transform: translateX(0);
        opacity: 0.65;
    }
    to {
        transform: translateX(5px);
        opacity: 1;
    }
}

@media (max-width: 1180px) {
    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(400px, 0.82fr);
        gap: 30px;
    }

    .login-showcase {
        padding: 52px;
    }

    .login-showcase h1 {
        font-size: clamp(3rem, 5.7vw, 5.1rem);
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
        max-width: 310px;
    }

    .login-showcase-footer {
        left: 52px;
    }
}

@media (min-width: 961px) and (max-height: 820px) {
    .login-topbar {
        height: 78px;
    }

    .login-brand img {
        height: 54px;
    }

    .login-shell {
        padding-top: 78px;
        padding-bottom: 22px;
    }

    .login-showcase {
        padding: clamp(34px, 4.5vw, 56px);
    }

    .login-showcase-content {
        transform: none;
    }

    .login-kicker {
        margin-bottom: 18px;
    }

    .login-showcase h1 {
        font-size: clamp(3rem, 4.5vw, 4.6rem);
    }

    .login-showcase-copy {
        margin-top: 18px;
        line-height: 1.55;
    }

    .login-feature-grid {
        margin-top: 24px;
    }

    .login-feature {
        padding-top: 11px;
        padding-bottom: 11px;
    }

    .login-feature-icon {
        width: 36px;
        height: 36px;
    }

    .login-showcase-footer {
        bottom: 18px;
        left: clamp(34px, 4.5vw, 56px);
    }

    .login-card {
        padding: 32px 36px;
    }

    .login-card h2 {
        font-size: 2.65rem;
    }

    .login-intro {
        margin-top: 10px;
        margin-bottom: 23px;
    }

    .login-form {
        gap: 15px;
    }

    .login-input-wrap input {
        min-height: 51px;
    }

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

    .login-trust-line {
        margin-top: 20px;
    }
}

@media (min-width: 961px) and (max-height: 650px) {
    .login-showcase-copy,
    .login-feature-grid {
        display: none;
    }

    .login-showcase h1 {
        font-size: clamp(2.8rem, 4.2vw, 4rem);
    }

    .login-card {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .login-eyebrow {
        margin-bottom: 10px;
    }

    .login-intro {
        margin-bottom: 18px;
    }

    .login-trust-line {
        margin-top: 14px;
    }
}

@media (max-width: 960px) {
    .login-page {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-shell {
        height: auto;
        min-height: auto;
        padding-bottom: 34px;
        grid-template-columns: 1fr;
        gap: 0;
    }

    .login-showcase {
        min-height: 510px;
        padding: 82px 44px 108px;
        justify-content: flex-start;
        border-radius: 32px;
    }

    .login-showcase-content {
        max-width: 610px;
        transform: none;
    }

    .login-showcase h1 {
        max-width: 590px;
        font-size: clamp(3.1rem, 9vw, 5.8rem);
    }

    .login-showcase-copy {
        max-width: 510px;
    }

    .login-feature-grid {
        max-width: 600px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-network {
        right: -5rem;
        bottom: -11rem;
    }

    .login-auth-panel {
        position: relative;
        z-index: 4;
        margin-top: -74px;
        padding: 0 30px 25px;
    }

    .login-card {
        width: min(540px, 100%);
    }
}

@media (max-width: 900px) {
    :root[data-sidebar="open"] body.portal-body {
        overflow: hidden;
    }

    .portal-sidebar {
        width: min(300px, 86vw);
        box-shadow: 18px 0 55px rgba(2, 13, 30, 0.3);
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 44;
        top: var(--header-height);
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        background: rgba(2, 13, 30, 0.52);
        opacity: 0;
        pointer-events: none;
        backdrop-filter: blur(3px);
        transition: opacity 220ms ease;
    }

    :root[data-sidebar="open"] .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 720px) {
    :root {
        --header-height: 72px;
    }

    .portal-header {
        height: var(--header-height);
        padding-right: 16px;
        padding-left: 16px;
    }

    .brand-link img {
        width: 155px;
    }

    .portal-header-actions {
        position: fixed;
        z-index: 52;
        top: 16px;
        right: 16px;
        width: 132px;
        min-width: 132px;
        display: grid;
        grid-template-columns: 85px 40px;
        gap: 7px;
        transform: none;
    }

    .drive-ribbon {
        width: 85px;
        min-width: 85px;
        display: grid;
        grid-template-columns: repeat(2, 40px);
        gap: 5px;
    }

    .account-menu {
        flex: 0 0 auto;
    }

    .drive-ribbon-link {
        width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 9px;
        justify-content: center;
    }

    .drive-ribbon-link span {
        display: none;
    }

    .portal-shell {
        margin-top: 26px;
    }

    .profile-modal {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        padding: 20px 16px;
        border-radius: 18px;
    }

    .profile-details-grid,
    .profile-password-grid {
        grid-template-columns: 1fr;
    }

    .profile-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-form-actions button {
        width: 100%;
    }

    .dashboard-hero {
        padding: 24px;
        border-radius: 20px;
    }

    .page-hero {
        padding: 30px 24px;
        border-radius: 20px;
    }

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

    .hero-mark {
        display: none;
    }

    .user-form {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-topbar {
        width: calc(100% - 30px);
        height: 78px;
    }

    .login-brand img {
        width: 172px;
        height: 52px;
    }

    .login-theme-toggle {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 7px;
        justify-content: center;
    }

    .login-theme-toggle > [data-theme-label] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .login-shell {
        width: calc(100% - 24px);
        padding-top: 82px;
    }

    .login-showcase {
        min-height: 420px;
        padding: 45px 26px 82px;
        border-radius: 27px;
    }

    .login-showcase-content {
        max-width: 100%;
    }

    .login-kicker {
        margin-bottom: 20px;
        font-size: 0.62rem;
        letter-spacing: 0.12em;
    }

    .login-showcase h1 {
        font-size: clamp(2.7rem, 11vw, 3.55rem);
        line-height: 0.98;
    }

    .login-showcase-copy {
        margin-top: 18px;
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .login-feature-grid {
        display: none;
    }

    .login-network {
        right: -12rem;
        bottom: -10rem;
        width: 29rem;
        height: 29rem;
        opacity: 0.66;
    }

    .login-showcase-footer {
        bottom: 24px;
        left: 26px;
        font-size: 0.58rem;
    }

    .login-auth-panel {
        margin-top: -48px;
        padding: 0 12px 24px;
    }

    .login-card {
        padding: 32px 23px;
        border-radius: 25px;
    }

    .login-card h2 {
        font-size: clamp(2.3rem, 11vw, 3rem);
    }

    .login-intro {
        margin-bottom: 26px;
    }

    .login-input-wrap input {
        min-height: 55px;
    }

    .login-trust-line {
        text-align: center;
        line-height: 1.4;
    }
}

@media (max-width: 520px) {
    .portal-header {
        padding-right: 10px;
        padding-left: 10px;
    }

    .portal-header-start {
        gap: 5px;
    }

    .brand-link img {
        width: 82px;
    }

    .sidebar-header-toggle,
    .menu-trigger {
        width: 36px;
        height: 36px;
        padding: 9px;
    }

    .portal-header-actions {
        top: 18px;
        right: 10px;
        width: 115px;
        min-width: 115px;
        grid-template-columns: 75px 36px;
        gap: 4px;
    }

    .drive-ribbon {
        width: 75px;
        min-width: 75px;
        grid-template-columns: repeat(2, 36px);
        gap: 3px;
    }

    .drive-ribbon-link {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 8px;
    }

    .drive-ribbon-link svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 390px) {
    .login-showcase {
        padding-right: 21px;
        padding-left: 21px;
    }

    .login-kicker {
        max-width: 230px;
        line-height: 1.4;
    }

    .login-kicker > span {
        display: none;
    }

    .login-showcase h1 {
        font-size: 2.65rem;
    }

    .login-showcase-footer {
        left: 21px;
    }

    .login-card {
        padding-right: 19px;
        padding-left: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-orb,
    .login-showcase-content,
    .login-card,
    .login-network-orbit-two,
    .login-network-core,
    .login-submit.is-loading svg {
        animation: none;
    }

    .login-submit svg {
        transition: none;
    }
}
