:root {
    --font-sans: "Inter", "Segoe UI", sans-serif;
    --font-display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --topbar-offset: 148px;
    --brand-orange: #f47a20;
    --brand-orange-strong: #de5b1f;
    --brand-amber: #ff9d1f;
    --brand-amber-soft: #ffe1b3;
    --brand-ink: #080808;
    --brand-ink-soft: #312116;
    --brand-cream: #fff9f3;
    --brand-sand: #f7e7d1;
    --brand-sand-strong: #ebd3ae;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-strong: #ffffff;
    --surface-alt: rgba(255, 244, 229, 0.84);
    --line: rgba(83, 47, 18, 0.12);
    --line-strong: rgba(222, 91, 31, 0.24);
    --text: #151515;
    --muted: #6d5a47;
    --accent: #f47a20;
    --accent-strong: #de5b1f;
    --accent-dark: #24160d;
    --accent-soft: rgba(244, 122, 32, 0.12);
    --warning: #b77714;
    --danger: #b33d1f;
    --shadow: 0 22px 48px rgba(44, 23, 9, 0.12);
    --shadow-soft: 0 12px 28px rgba(44, 23, 9, 0.08);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(244, 122, 32, 0.12), transparent 24%),
        radial-gradient(circle at left center, rgba(36, 22, 13, 0.06), transparent 20%),
        linear-gradient(180deg, #fff6ea 0%, #fffaf4 42%, #f8ecdd 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(10px);
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -90px;
    right: -120px;
    width: 320px;
    height: 320px;
    background:
        radial-gradient(circle at center, rgba(245, 179, 76, 0.26), rgba(245, 179, 76, 0) 70%);
    animation: drift 16s ease-in-out infinite;
}

body::after {
    bottom: -110px;
    left: -120px;
    width: 340px;
    height: 340px;
    background:
        radial-gradient(circle at center, rgba(217, 95, 18, 0.16), rgba(217, 95, 18, 0) 72%);
    animation: drift 18s ease-in-out infinite reverse;
}

img {
    display: block;
    max-width: 100%;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 64px;
}

.app-shell {
    padding-top: 0;
}

.shell-narrow {
    width: min(720px, calc(100% - 24px));
}

[id] {
    scroll-margin-top: 32px;
}

.portal-header {
    display: grid;
    gap: 18px;
    margin-bottom: 26px;
}

.portal-summary {
    display: grid;
    gap: 18px;
    padding: 24px 26px 26px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 238, 216, 0.95) 56%, rgba(255, 255, 255, 0.94) 100%);
    border: 1px solid rgba(222, 91, 31, 0.1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.portal-summary::before {
    content: "";
    position: absolute;
    top: -64px;
    right: -46px;
    width: 210px;
    height: 210px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, rgba(242, 138, 27, 0.24), rgba(242, 138, 27, 0) 68%);
}

.portal-summary::after {
    content: "";
    position: absolute;
    inset: auto auto -30px -24px;
    width: 170px;
    height: 170px;
    border-radius: 44% 56% 52% 48%;
    background:
        linear-gradient(135deg, rgba(255, 227, 184, 0.42), rgba(242, 138, 27, 0.08));
    transform: rotate(10deg);
}

.portal-summary-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.portal-menu-button {
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(83, 47, 18, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 18px rgba(36, 22, 13, 0.05);
    color: var(--accent-dark);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.portal-menu-button:hover {
    background: rgba(255, 246, 236, 0.94);
    border-color: rgba(222, 91, 31, 0.18);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.portal-menu-button:focus-visible {
    outline: 3px solid rgba(242, 138, 27, 0.22);
    outline-offset: 2px;
}

.portal-menu-icon {
    display: inline-grid;
    gap: 4px;
}

.portal-menu-icon span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 140ms ease, opacity 140ms ease;
}

.portal-summary-logo {
    width: min(128px, 100%);
    height: auto;
}

.portal-summary-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
}

.portal-summary-nav {
    display: grid;
    gap: 12px;
}

.portal-summary .section-nav,
.portal-summary .stats,
.portal-summary .portal-sections {
    margin-top: 0;
}

.portal-summary .portal-sections {
    justify-content: stretch;
}

.portal-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 12px;
}

.portal-section-link {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 78px;
    padding: 18px 18px 16px;
    border-radius: 20px;
    border: 1px solid rgba(83, 47, 18, 0.1);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 22px rgba(36, 22, 13, 0.05);
    color: var(--accent-dark);
    overflow: hidden;
    text-decoration: none;
    isolation: isolate;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.portal-section-link::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, rgba(255, 208, 145, 0.9), rgba(244, 122, 32, 0.9));
    transition: background 140ms ease, transform 140ms ease;
    z-index: 0;
}

.portal-section-label {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.portal-section-link:hover {
    background: rgba(255, 247, 237, 0.92);
    border-color: rgba(222, 91, 31, 0.14);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(36, 22, 13, 0.08);
}

.portal-section-link.is-active {
    background:
        linear-gradient(135deg, rgba(28, 18, 11, 0.98), rgba(53, 31, 15, 0.96) 52%, rgba(222, 91, 31, 0.94) 100%);
    border-color: rgba(53, 31, 15, 0.2);
    color: #fff7ed;
    box-shadow: 0 12px 24px rgba(36, 22, 13, 0.18);
}

.portal-section-link.is-active::before {
    background: linear-gradient(90deg, rgba(255, 214, 152, 1), rgba(255, 157, 31, 1));
    transform: scaleY(1);
}

.portal-session {
    display: flex;
    justify-content: flex-end;
}

.portal-session-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(83, 47, 18, 0.1);
    box-shadow: 0 8px 18px rgba(36, 22, 13, 0.05);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.portal-session-link:hover {
    background: rgba(255, 246, 236, 0.94);
    border-color: rgba(222, 91, 31, 0.18);
    color: var(--accent-strong);
    text-decoration: none;
    transform: translateY(-1px);
}

.topbar,
.portal-summary,
.hero,
.panel,
.card,
.login-card,
.notice,
.table-wrap {
    animation: rise-in 520ms ease both;
}

.topbar {
    display: grid;
    gap: 18px;
    padding: 20px 24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: linear-gradient(118deg, #1a110c 0%, #312014 56%, #de5b1f 100%);
    border: 1px solid rgba(255, 196, 119, 0.18);
    box-shadow: 0 14px 28px rgba(36, 22, 13, 0.18);
    position: fixed;
    top: 0;
    left: 50%;
    width: min(1180px, calc(100vw - 32px));
    transform: translateX(-50%);
    z-index: 12;
    overflow: visible;
    backdrop-filter: blur(16px);
}

.topbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 226, 174, 0.65) 0%, rgba(255, 157, 31, 0.95) 48%, rgba(244, 122, 32, 0.98) 100%);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-brand {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.brand-caption {
    display: grid;
    gap: 8px;
}

.brand-logo {
    width: auto;
    height: auto;
}

.brand-logo-topbar {
    width: min(280px, 42vw);
}

.brand-logo-login {
    width: min(460px, 100%);
}

.hero-wordmark {
    width: min(360px, 100%);
    height: auto;
    margin-bottom: 4px;
}

.brand-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.topbar .brand-note {
    color: rgba(255, 245, 233, 0.82);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.05);
    border: 1px solid rgba(87, 54, 18, 0.08);
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff6ea;
}

.topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 213, 153, 0.16);
    backdrop-filter: blur(10px);
}

.topbar-user strong {
    color: #fff8ef;
}

.topbar-user span {
    color: rgba(255, 245, 233, 0.72);
}

.topbar-nav {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
    gap: 12px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 221, 179, 0.16);
}

.topbar.is-menu-open .topbar-nav {
    display: grid;
}

.topbar-nav-heading {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    color: rgba(255, 240, 220, 0.76);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.topbar-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 100%;
    padding: 10px 15px;
    border-radius: 999px;
    border: 1px solid rgba(255, 213, 153, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff6ea;
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.topbar-nav-link:hover {
    background: rgba(255, 214, 152, 0.14);
    border-color: rgba(255, 214, 152, 0.28);
    text-decoration: none;
    transform: translateY(-1px);
}

.topbar-nav-link.is-active {
    background: linear-gradient(135deg, rgba(255, 157, 31, 0.96), rgba(244, 122, 32, 0.88));
    border-color: transparent;
    color: #1b120d;
}

.topbar-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    min-width: 122px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 213, 153, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff8ef;
    box-shadow: none;
}

.topbar-menu-button:hover {
    background: rgba(255, 214, 152, 0.14);
    filter: none;
    transform: translateY(-1px);
}

.topbar.is-menu-open .topbar-menu-button {
    background: rgba(255, 214, 152, 0.18);
    border-color: rgba(255, 214, 152, 0.32);
    color: #fff8ef;
}

.topbar-menu-icon {
    display: grid;
    gap: 4px;
}

.topbar-menu-icon span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
}

.topbar.is-menu-open .topbar-menu-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.topbar.is-menu-open .topbar-menu-icon span:nth-child(2) {
    opacity: 0;
}

.topbar.is-menu-open .topbar-menu-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.topbar .logout-link {
    color: #fff6ea;
}

.topbar .logout-link:hover {
    color: #ffd8ab;
}

.logout-link,
a {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(242, 138, 27, 0.32);
    outline-offset: 2px;
}

.hero {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 238, 216, 0.94) 58%, rgba(255, 255, 255, 0.94) 100%);
    border: 1px solid rgba(222, 91, 31, 0.1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 360px);
    gap: 22px;
    align-items: start;
}

.hero-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.dashboard-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding: 20px 22px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(36, 22, 13, 0.96), rgba(68, 40, 18, 0.94) 54%, rgba(222, 91, 31, 0.9) 100%);
    border: 1px solid rgba(255, 201, 132, 0.22);
    box-shadow: 0 18px 34px rgba(24, 15, 9, 0.16);
}

.dashboard-overview .eyebrow,
.dashboard-overview .dashboard-overview-title {
    color: #fff2dd;
}

.dashboard-overview .eyebrow {
    background: rgba(255, 189, 103, 0.14);
}

.dashboard-overview-title {
    margin-top: 12px;
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    line-height: 1.15;
}

.dashboard-overview-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-overview .nav-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 189, 103, 0.18);
    color: #fff2dd;
}

.dashboard-overview .nav-pill:hover {
    background: rgba(255, 189, 103, 0.14);
    border-color: rgba(255, 189, 103, 0.32);
}

.dashboard-overview .nav-pill-primary {
    background: linear-gradient(135deg, rgba(255, 157, 31, 0.96), rgba(244, 122, 32, 0.88));
    color: #1a120d;
}

.hero-aside {
    display: grid;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.hero-aside-card {
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 240, 0.96));
    border: 1px solid rgba(83, 47, 18, 0.08);
    box-shadow: var(--shadow-soft);
}

.hero-aside-card-dark {
    background:
        linear-gradient(145deg, rgba(26, 18, 12, 0.96), rgba(55, 35, 18, 0.92));
    border-color: rgba(255, 214, 152, 0.16);
    color: #fff0d8;
}

.hero-aside-card-dark .eyebrow,
.hero-aside-card-dark .hero-aside-title,
.hero-aside-card-dark .quick-note,
.hero-aside-card-dark .quick-note strong,
.hero-aside-card-dark .brand-note {
    color: #fff0d8;
}

.hero-aside-card-dark .eyebrow {
    background: rgba(255, 217, 164, 0.12);
}

.hero-aside-title {
    margin-top: 14px;
    font-size: 1.25rem;
    line-height: 1.15;
}

.quick-note-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.quick-note {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(87, 54, 18, 0.08);
    color: var(--muted);
}

.quick-note strong {
    color: var(--accent-dark);
}

.quick-note-link {
    text-decoration: none;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.quick-note-link:hover {
    background: rgba(244, 122, 32, 0.08);
    border-color: rgba(222, 91, 31, 0.18);
    text-decoration: none;
    transform: translateY(-1px);
}

.hero-aside-card-dark .quick-note {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 217, 164, 0.1);
}

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0;
    position: relative;
    z-index: 1;
    padding: 8px;
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(83, 47, 18, 0.08);
    box-shadow: 0 10px 24px rgba(36, 22, 13, 0.06);
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-pill:hover {
    background: rgba(244, 122, 32, 0.08);
    border-color: rgba(222, 91, 31, 0.12);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-pill-primary {
    background: linear-gradient(135deg, rgba(255, 157, 31, 0.22), rgba(244, 122, 32, 0.16));
    border-color: rgba(222, 91, 31, 0.12);
}

.hero::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -55px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, rgba(242, 138, 27, 0.28), rgba(242, 138, 27, 0) 68%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto auto -26px -26px;
    width: 180px;
    height: 180px;
    border-radius: 46% 54% 58% 42%;
    background:
        linear-gradient(135deg, rgba(255, 227, 184, 0.44), rgba(242, 138, 27, 0.08));
    transform: rotate(12deg);
}

.brand-chip,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(244, 122, 32, 0.1);
    color: var(--accent-strong);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    margin: 0;
    letter-spacing: -0.03em;
    color: var(--brand-ink);
}

h1 {
    font-size: clamp(2.1rem, 5vw, 4rem);
    margin-top: 18px;
    max-width: 760px;
}

.lead {
    max-width: 760px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    margin: 16px 0 0;
}

.grid {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card,
.panel,
.table-wrap,
.notice {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--brand-amber) 0%, var(--brand-orange) 55%, var(--brand-orange-strong) 100%);
}

.card span {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 12px;
}

.metric {
    font-size: clamp(1.85rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--accent-dark);
}

.layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 20px;
    margin-top: 24px;
}

.page-grid-single {
    grid-template-columns: 1fr;
}

.panel-section {
    display: grid;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(83, 47, 18, 0.08);
}

.panel-section-title {
    margin: 0;
    font-size: 1.1rem;
}

.panel-section-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.action-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

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

.panel {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 189, 103, 0.7), rgba(244, 122, 32, 0.92), rgba(222, 91, 31, 0.68));
    opacity: 0.95;
}

.panel-header {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.panel-header::before {
    content: "";
    display: block;
    width: min(280px, 100%);
    height: 66px;
    background: url("ingesolar-logo.jpg") left center / contain no-repeat;
}

.panel-header > div {
    display: grid;
    gap: 6px;
}

.panel-header p,
.mini-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.panel-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(242, 138, 27, 0.12);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-toolbar {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent-dark);
}

input,
select,
textarea,
button {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(87, 54, 18, 0.16);
    padding: 12px 14px;
    font: inherit;
}

input,
select,
textarea {
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
    background: rgba(255, 255, 255, 0.92);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(242, 138, 27, 0.52);
    box-shadow: 0 0 0 4px rgba(242, 138, 27, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button {
    background: linear-gradient(135deg, var(--brand-amber) 0%, var(--brand-orange) 52%, var(--brand-orange-strong) 100%);
    color: #1b120d;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
    box-shadow: 0 10px 22px rgba(222, 91, 31, 0.18);
}

button:hover {
    transform: translateY(-1px);
    filter: saturate(1.04);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.98);
    color: var(--accent-dark);
    border: 1px solid var(--line);
    box-shadow: none;
}

.filters {
    display: grid;
    grid-template-columns: 1.2fr repeat(2, minmax(0, 1fr)) auto;
    gap: 12px;
    margin-bottom: 20px;
}

.filters-compact {
    grid-template-columns: 1.5fr minmax(0, 1fr) auto;
}

.stack {
    display: grid;
    gap: 14px;
}

.form-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

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

.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(87, 54, 18, 0.08);
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.choice-card:hover {
    background: rgba(255, 248, 238, 0.94);
    border-color: rgba(222, 91, 31, 0.16);
    transform: translateY(-1px);
}

.choice-card input[type="checkbox"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(87, 54, 18, 0.2);
    box-shadow: none;
    accent-color: var(--brand-orange);
}

.choice-copy {
    display: grid;
    gap: 4px;
    color: var(--muted);
}

.choice-copy strong {
    color: var(--accent-dark);
}

.proposal-quote {
    margin: 0;
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(255, 249, 241, 0.92);
    border: 1px solid rgba(222, 91, 31, 0.12);
    color: var(--accent-dark);
    line-height: 1.7;
    box-shadow: var(--shadow-soft);
}

.upload-box {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-alt);
    border: 1px dashed rgba(217, 95, 18, 0.32);
}

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

.mini-stat {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(87, 54, 18, 0.08);
}

.mini-stat span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mini-stat strong {
    font-size: 1.3rem;
    color: var(--accent-dark);
}

.table-wrap {
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compact-table th,
.compact-table td {
    padding: 12px 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

th,
td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 247, 237, 0.96);
}

tbody tr:hover {
    background: rgba(255, 249, 241, 0.92);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.badge-draft,
.badge-submitted,
.badge-validated,
.badge-in_review {
    background: rgba(245, 179, 76, 0.18);
    color: #8a5b0f;
}

.badge-active,
.badge-won {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.96), rgba(74, 48, 22, 0.92));
    color: #fff2dc;
}

.badge-rejected,
.badge-cancelled,
.badge-lost {
    background: rgba(179, 61, 31, 0.12);
    color: var(--danger);
}

.badge-sent {
    background: rgba(36, 22, 13, 0.08);
    color: var(--accent-dark);
}

.contract-media-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(242, 138, 27, 0.12);
    color: var(--accent-strong);
    text-decoration: none;
}

.contract-media-link:hover {
    background: rgba(242, 138, 27, 0.18);
    text-decoration: none;
}

.status-form {
    display: grid;
    gap: 8px;
}

.notice {
    padding: 18px 20px;
    margin-top: 20px;
    line-height: 1.6;
}

.notice-warning {
    border-color: rgba(245, 179, 76, 0.34);
    background: rgba(255, 247, 231, 0.96);
}

.notice-danger {
    border-color: rgba(179, 61, 31, 0.22);
    background: rgba(254, 242, 242, 0.94);
}

.notice-success {
    border-color: rgba(217, 95, 18, 0.26);
    background: rgba(255, 246, 236, 0.96);
}

.split {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-top: 24px;
}

.rank-list {
    display: grid;
    gap: 12px;
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(87, 54, 18, 0.08);
}

.rank-item strong {
    display: block;
}

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

.empty {
    padding: 28px;
    color: var(--muted);
}

.login-card {
    padding: 34px;
    margin-top: 56px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 238, 216, 0.94) 58%, rgba(255, 255, 255, 0.94) 100%);
    border: 1px solid rgba(222, 91, 31, 0.1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.login-card::after {
    content: "";
    position: absolute;
    top: -58px;
    right: -54px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(242, 138, 27, 0.2), rgba(242, 138, 27, 0) 70%);
}

.login-header {
    display: grid;
    gap: 18px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.login-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.login-role-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(83, 47, 18, 0.08);
}

.login-role-label {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-role-card strong {
    display: block;
    color: var(--accent-dark);
}

.login-role-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.login-help {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(242, 138, 27, 0.1);
    color: var(--accent-dark);
    line-height: 1.7;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(0, 12px, 0) scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 980px) {
    .hero-layout,
    .hero-layout-single,
    .action-grid,
    .layout,
    .page-grid,
    .split {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

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

    .dashboard-overview-actions {
        justify-content: flex-start;
    }

    .table-wrap {
        overflow: visible;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody {
        display: block;
        width: 100%;
    }

    .table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .table-wrap tbody {
        display: grid;
        gap: 14px;
    }

    .table-wrap tbody tr {
        display: grid;
        gap: 0;
        padding: 14px 16px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 10px 24px rgba(36, 22, 13, 0.06);
    }

    .table-wrap tbody tr:hover {
        background: rgba(255, 249, 241, 0.96);
    }

    .table-wrap td {
        display: grid;
        grid-template-columns: minmax(108px, 132px) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 11px 0;
        border-bottom: 1px solid rgba(83, 47, 18, 0.08);
    }

    .table-wrap td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .table-wrap td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .table-wrap td[colspan] {
        display: block;
        padding: 4px 0 0;
        border-bottom: none;
    }

    .table-wrap td[colspan]::before {
        content: none;
    }

    .table-wrap .status-form,
    .table-wrap .contract-media-link,
    .table-wrap .button-secondary {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 20px, 1200px);
        margin-top: 20px;
    }

    .app-shell {
        padding-top: 0;
    }

    .portal-summary {
        padding: 20px;
    }

    .portal-summary-top {
        justify-content: space-between;
        gap: 12px;
    }

    .portal-section-link {
        width: 100%;
        min-height: 66px;
        padding: 16px 14px 14px;
    }

    .portal-menu-button {
        display: inline-flex;
        flex-shrink: 0;
    }

    .portal-summary-nav {
        display: none;
        padding: 6px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.76);
        border: 1px solid rgba(83, 47, 18, 0.08);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 30px rgba(36, 22, 13, 0.08);
    }

    .portal-summary.is-menu-open .portal-summary-nav {
        display: grid;
    }

    .portal-summary.is-menu-open .portal-menu-button {
        background: linear-gradient(135deg, rgba(28, 18, 11, 0.96), rgba(53, 31, 15, 0.94) 52%, rgba(222, 91, 31, 0.92) 100%);
        border-color: rgba(53, 31, 15, 0.18);
        color: #fff7ed;
        box-shadow: 0 12px 24px rgba(36, 22, 13, 0.16);
    }

    .portal-summary.is-menu-open .portal-menu-icon span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .portal-summary.is-menu-open .portal-menu-icon span:nth-child(2) {
        opacity: 0;
    }

    .portal-summary.is-menu-open .portal-menu-icon span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .portal-sections {
        grid-template-columns: 1fr;
    }

    .portal-session {
        width: auto;
        justify-content: flex-end;
    }

    .topbar {
        padding: 18px;
        top: 0;
        width: min(1180px, calc(100vw - 20px));
    }

    .topbar-main,
    .topbar-brand {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-controls {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .brand-logo-topbar {
        width: min(260px, 100%);
    }

    .topbar-user {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    .topbar-nav {
        grid-template-columns: 1fr;
    }

    .topbar-menu-button,
    .topbar-nav-link {
        width: 100%;
    }

    .hero,
    .panel,
    .card,
    .login-card {
        padding: 20px;
    }

    .panel-header::before {
        width: min(240px, 100%);
        height: 56px;
    }

    .hero-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .section-nav {
        width: 100%;
        border-radius: 24px;
    }

    .nav-pill {
        width: 100%;
    }

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

    .choice-grid {
        grid-template-columns: 1fr;
    }

    .mini-stats {
        grid-template-columns: 1fr;
    }

    .login-role-grid {
        grid-template-columns: 1fr;
    }

    .rank-item {
        align-items: flex-start;
        flex-direction: column;
    }

    th,
    td {
        padding: 14px;
    }
}

@media (max-width: 560px) {
    .portal-summary {
        padding: 18px;
    }

    .portal-menu-button,
    .portal-session-link {
        width: 100%;
        justify-content: center;
    }

    .portal-summary-top {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-session {
        width: 100%;
    }

    .portal-section-link {
        min-height: 62px;
        justify-content: flex-start;
        padding-left: 16px;
        text-align: left;
    }

    .dashboard-overview-actions,
    .section-nav {
        display: grid;
        grid-template-columns: 1fr;
    }

    .table-wrap td {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .table-wrap td::before {
        margin-bottom: 2px;
    }
}

/* Portal redesign overrides */

body.portal-redesign {
    --portal-font: "DM Sans", "Segoe UI", sans-serif;
    --portal-mono: "DM Mono", ui-monospace, monospace;
    --portal-bg: #061824;
    --portal-sidebar: rgba(4, 24, 37, 0.97);
    --portal-surface: #0d2232;
    --portal-surface-alt: #123047;
    --portal-surface-hover: #173b55;
    --portal-border: rgba(194, 215, 224, 0.1);
    --portal-border-strong: rgba(235, 244, 247, 0.17);
    --portal-text: #edf5f7;
    --portal-text-muted: #afc0c8;
    --portal-text-dim: #728794;
    --portal-ink: #03283f;
    --portal-ink-soft: #0d435b;
    --portal-accent: #f47a20;
    --portal-accent-strong: #ffae2a;
    --portal-accent-soft: rgba(244, 122, 32, 0.18);
    --portal-green: #3fb950;
    --portal-green-soft: rgba(63, 185, 80, 0.14);
    --portal-blue: #0f4f68;
    --portal-blue-soft: rgba(15, 79, 104, 0.18);
    --portal-yellow: #d29922;
    --portal-yellow-soft: rgba(210, 153, 34, 0.14);
    --portal-red: #f85149;
    --portal-red-soft: rgba(248, 81, 73, 0.14);
    --portal-radius-xl: 28px;
    --portal-radius-lg: 22px;
    --portal-radius-md: 16px;
    --app-sidebar-width: 256px;
    font-family: var(--portal-font);
    color: var(--portal-text);
    background:
        radial-gradient(circle at top right, rgba(255, 174, 42, 0.22), transparent 25%),
        radial-gradient(circle at left center, rgba(13, 67, 91, 0.24), transparent 22%),
        linear-gradient(180deg, #04121b 0%, #061a28 46%, #082131 100%);
}

body.portal-redesign::before {
    top: -90px;
    right: -120px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(255, 174, 42, 0.22), rgba(255, 174, 42, 0) 72%);
}

body.portal-redesign::after {
    bottom: -120px;
    left: -120px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle at center, rgba(13, 67, 91, 0.2), rgba(13, 67, 91, 0) 74%);
}

body.portal-redesign a {
    color: #ffc251;
    font-weight: 600;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.portal-redesign .app-layout {
    min-height: 100vh;
}

body.portal-redesign .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--app-sidebar-width);
    background: var(--portal-sidebar);
    border-right: 1px solid var(--portal-border);
    backdrop-filter: blur(20px);
    box-shadow: 18px 0 40px rgba(3, 15, 23, 0.34);
}

body.portal-redesign .app-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
    padding: 22px 14px 18px;
    overflow-y: auto;
}

body.portal-redesign .app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 18px;
    border-bottom: 1px solid var(--portal-border);
    color: var(--portal-text);
    text-decoration: none;
}

body.portal-redesign .app-sidebar-brand:hover {
    color: #ffffff;
    text-decoration: none;
}

body.portal-redesign .app-sidebar-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffae2a 0%, var(--portal-accent) 54%, #d95e21 100%);
    box-shadow: 0 0 26px rgba(244, 122, 32, 0.3);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

body.portal-redesign .app-sidebar-brand-copy {
    display: grid;
    gap: 2px;
}

body.portal-redesign .app-sidebar-brand-copy strong {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
}

body.portal-redesign .app-sidebar-brand-copy span {
    color: var(--portal-text-muted);
    font-size: 0.8rem;
}

body.portal-redesign .app-sidebar-section {
    display: grid;
    gap: 8px;
}

body.portal-redesign .app-sidebar-section-label {
    padding: 0 12px;
    color: var(--portal-text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.portal-redesign .app-sidebar-nav {
    display: grid;
    gap: 6px;
}

body.portal-redesign .app-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: var(--portal-text-muted);
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

body.portal-redesign .app-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--portal-border);
    color: var(--portal-text);
    text-decoration: none;
    transform: translateY(-1px);
}

body.portal-redesign .app-nav-item.is-active {
    background: linear-gradient(135deg, rgba(255, 174, 42, 0.2), rgba(244, 122, 32, 0.1));
    border-color: rgba(255, 174, 42, 0.24);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(244, 122, 32, 0.16);
}

body.portal-redesign .app-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
}

body.portal-redesign .app-nav-icon svg {
    width: 18px;
    height: 18px;
}

body.portal-redesign .app-nav-svg {
    display: block;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex: 0 0 18px;
}

body.portal-redesign .app-nav-text {
    line-height: 1.2;
}

body.portal-redesign .app-sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--portal-border);
}

body.portal-redesign .app-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--portal-border);
}

body.portal-redesign .app-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f4f68 0%, #03283f 100%);
    border: 1px solid rgba(255, 174, 42, 0.18);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

body.portal-redesign .app-user-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

body.portal-redesign .app-user-copy strong {
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 700;
}

body.portal-redesign .app-user-copy span {
    color: var(--portal-text-muted);
    font-size: 0.8rem;
}

body.portal-redesign .app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(4, 8, 15, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

body.portal-redesign.is-nav-open .app-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.portal-redesign .app-main {
    min-height: 100vh;
    margin-left: var(--app-sidebar-width);
    display: flex;
    flex-direction: column;
}

body.portal-redesign .app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px 16px;
    background: linear-gradient(180deg, rgba(4, 18, 27, 0.98) 0%, rgba(4, 18, 27, 0.84) 72%, rgba(4, 18, 27, 0) 100%);
    backdrop-filter: blur(18px);
}

body.portal-redesign .app-topbar-left {
    min-width: 0;
    display: grid;
    gap: 12px;
}

body.portal-redesign .app-topbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.portal-redesign .app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--portal-text-dim);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.portal-redesign .app-breadcrumb strong {
    color: var(--portal-text-muted);
}

body.portal-redesign .app-topbar-copy {
    display: grid;
    gap: 6px;
}

body.portal-redesign .app-topbar-title {
    margin: 0;
    color: #ffffff;
    font-family: var(--portal-font);
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

body.portal-redesign .app-topbar-copy p {
    margin: 0;
    max-width: 72ch;
    color: var(--portal-text-muted);
    line-height: 1.65;
}

body.portal-redesign .app-topbar-right {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-left: auto;
}

body.portal-redesign .app-topbar-user {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--portal-border);
    background: rgba(255, 255, 255, 0.04);
    text-align: right;
}

body.portal-redesign .app-topbar-user span {
    color: var(--portal-text-dim);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.portal-redesign .app-topbar-user strong {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

body.portal-redesign .app-topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    color: var(--portal-text);
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

body.portal-redesign .app-topbar-link:hover {
    background: var(--portal-surface-hover);
    border-color: var(--portal-border-strong);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

body.portal-redesign .app-menu-button {
    display: none;
    align-items: center;
    gap: 10px;
    width: auto;
    min-width: 112px;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    color: var(--portal-text);
    font-weight: 700;
}

body.portal-redesign .app-menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
    filter: none;
}

body.portal-redesign .app-menu-icon {
    display: grid;
    gap: 4px;
}

body.portal-redesign .app-menu-icon span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
}

body.portal-redesign.is-nav-open .app-menu-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.portal-redesign.is-nav-open .app-menu-icon span:nth-child(2) {
    opacity: 0;
}

body.portal-redesign.is-nav-open .app-menu-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

body.portal-redesign .app-content {
    display: grid;
    gap: 18px;
    padding: 0 28px 36px;
}

body.portal-redesign .page-hero {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 28px;
    border-radius: var(--portal-radius-xl);
    background: linear-gradient(135deg, rgba(13, 34, 50, 0.98), rgba(8, 27, 40, 0.96) 54%, rgba(11, 41, 57, 0.94) 100%);
    border: 1px solid var(--portal-border);
    box-shadow: 0 22px 48px rgba(3, 15, 23, 0.38);
    overflow: hidden;
}

body.portal-redesign .page-hero.has-stats {
    grid-template-columns: minmax(0, 1.24fr) minmax(280px, 360px);
}

body.portal-redesign .page-hero::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(255, 174, 42, 0.24), rgba(255, 174, 42, 0) 68%);
}

body.portal-redesign .page-hero::after {
    content: "";
    position: absolute;
    inset: auto auto -42px -34px;
    width: 190px;
    height: 190px;
    border-radius: 44% 56% 52% 48%;
    background: linear-gradient(135deg, rgba(255, 174, 42, 0.16), rgba(3, 40, 63, 0.28));
    transform: rotate(12deg);
}

body.portal-redesign .page-hero-main {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
}

body.portal-redesign .page-hero-tagline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

body.portal-redesign .page-hero-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--portal-accent-soft);
    color: var(--portal-accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.portal-redesign .page-hero-note {
    color: var(--portal-text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

body.portal-redesign .page-hero-copy-block {
    display: grid;
    gap: 12px;
}

body.portal-redesign .page-hero-heading {
    margin: 0;
    color: #ffffff;
    font-family: var(--portal-font);
    font-size: clamp(1.7rem, 3.4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

body.portal-redesign .page-hero-copy {
    margin: 0;
    max-width: 70ch;
    color: var(--portal-text-muted);
    line-height: 1.72;
}

body.portal-redesign .page-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.portal-redesign .page-hero-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    font-size: 0.84rem;
    font-weight: 500;
}

body.portal-redesign .section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.portal-redesign .nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--portal-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--portal-text);
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

body.portal-redesign .nav-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--portal-border-strong);
    color: #ffffff;
    text-decoration: none;
}

body.portal-redesign .nav-pill-primary {
    background: linear-gradient(135deg, #ffae2a 0%, var(--portal-accent) 58%, #d95e21 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(244, 122, 32, 0.24);
}

body.portal-redesign .grid.stats {
    margin-top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
    position: relative;
    z-index: 1;
}

body.portal-redesign .card,
body.portal-redesign .panel,
body.portal-redesign .table-wrap,
body.portal-redesign .notice {
    animation: rise-in 520ms ease both;
}

body.portal-redesign .card,
body.portal-redesign .panel,
body.portal-redesign .table-wrap,
body.portal-redesign .notice {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    box-shadow: 0 18px 38px rgba(3, 15, 23, 0.3);
}

body.portal-redesign .card {
    padding: 18px;
    border-radius: 20px;
    overflow: hidden;
}

body.portal-redesign .card::before {
    display: none;
}

body.portal-redesign .card span {
    color: var(--portal-text-dim);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

body.portal-redesign .metric {
    color: #ffffff;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.05;
}

body.portal-redesign .notice {
    margin-top: 0;
    padding: 16px 18px;
    border-radius: 18px;
    color: var(--portal-text);
    line-height: 1.65;
}

body.portal-redesign .notice-warning {
    border-color: rgba(210, 153, 34, 0.24);
    background: rgba(210, 153, 34, 0.1);
}

body.portal-redesign .notice-danger {
    border-color: rgba(248, 81, 73, 0.24);
    background: rgba(248, 81, 73, 0.1);
}

body.portal-redesign .notice-success {
    border-color: rgba(63, 185, 80, 0.24);
    background: rgba(63, 185, 80, 0.1);
}

body.portal-redesign .page-grid {
    margin-top: 0;
    grid-template-columns: 1fr;
    gap: 18px;
}

body.portal-redesign .panel {
    position: relative;
    padding: 24px;
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
}

body.portal-redesign .panel::before {
    height: 4px;
    background: linear-gradient(90deg, rgba(255, 174, 42, 0.95), rgba(244, 122, 32, 0.95), rgba(15, 79, 104, 0.6));
    opacity: 1;
}

body.portal-redesign .panel-header {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

body.portal-redesign .panel-header::before {
    display: none;
}

body.portal-redesign .panel-header > div {
    gap: 8px;
}

body.portal-redesign h1,
body.portal-redesign h2,
body.portal-redesign h3 {
    color: #ffffff;
    font-family: var(--portal-font);
}

body.portal-redesign .panel-kicker,
body.portal-redesign .eyebrow {
    background: rgba(244, 122, 32, 0.14);
    color: var(--portal-accent-strong);
}

body.portal-redesign .panel-header p,
body.portal-redesign .panel-section-copy,
body.portal-redesign .mini-copy,
body.portal-redesign .muted,
body.portal-redesign .filter-note,
body.portal-redesign .form-note,
body.portal-redesign .proposal-quote,
body.portal-redesign .lead {
    color: var(--portal-text-muted);
}

body.portal-redesign .panel-section {
    gap: 14px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

body.portal-redesign .proposal-section-tight {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

body.portal-redesign .form-section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--portal-accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.portal-redesign .form-section-label span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(255, 174, 42, 0.14);
    color: #ffffff;
    font-size: 0.74rem;
    letter-spacing: 0;
}

body.portal-redesign .tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 174, 42, 0.1);
    border: 1px solid rgba(255, 174, 42, 0.18);
    color: var(--portal-text);
}

body.portal-redesign .tip-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--portal-accent-strong);
}

body.portal-redesign .tip-text {
    color: var(--portal-text-muted);
    line-height: 1.65;
}

body.portal-redesign .tip-text strong {
    color: #ffffff;
}

body.portal-redesign .proposal-period-block {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

body.portal-redesign .proposal-period-caption {
    color: var(--portal-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.portal-redesign .period-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

body.portal-redesign .period-item {
    display: grid;
    gap: 8px;
}

body.portal-redesign .period-item input {
    text-align: center;
    padding-inline: 8px;
}

body.portal-redesign .period-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 800;
}

body.portal-redesign .period-p1 {
    background: rgba(248, 81, 73, 0.16);
    color: #ff8a84;
}

body.portal-redesign .period-p2 {
    background: rgba(244, 122, 32, 0.16);
    color: #ffb15a;
}

body.portal-redesign .period-p3 {
    background: rgba(210, 153, 34, 0.16);
    color: #f4c96b;
}

body.portal-redesign .period-p4 {
    background: rgba(63, 185, 80, 0.16);
    color: #6be381;
}

body.portal-redesign .period-p5 {
    background: rgba(15, 79, 104, 0.2);
    color: #8ed3e3;
}

body.portal-redesign .period-p6 {
    background: rgba(3, 40, 63, 0.24);
    color: #c1ecf6;
}

body.portal-redesign .proposal-upload-label {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 0;
    cursor: pointer;
    text-align: center;
}

body.portal-redesign .proposal-upload-label svg {
    width: 32px;
    height: 32px;
    color: var(--portal-accent-strong);
}

body.portal-redesign .proposal-upload-label strong {
    color: #ffffff;
    font-size: 1rem;
}

body.portal-redesign .proposal-upload-label span {
    color: var(--portal-text-muted);
}

body.portal-redesign .proposal-ocr-box {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--portal-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.portal-redesign .proposal-ocr-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

body.portal-redesign .proposal-ocr-head strong {
    display: block;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.3;
}

body.portal-redesign .proposal-ocr-head p {
    margin: 8px 0 0;
    color: var(--portal-text-muted);
    line-height: 1.6;
}

body.portal-redesign .proposal-ocr-button {
    width: auto;
    min-width: 152px;
    white-space: nowrap;
}

body.portal-redesign .proposal-ocr-button[disabled] {
    opacity: 0.56;
    cursor: not-allowed;
}

body.portal-redesign .proposal-ocr-label {
    min-height: 0;
    padding: 20px;
    border-style: dashed;
}

body.portal-redesign .proposal-ocr-status {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--portal-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

body.portal-redesign .proposal-ocr-status[data-tone="running"] {
    color: #ffe5b3;
    border-color: rgba(255, 177, 90, 0.22);
    background: rgba(244, 122, 32, 0.08);
}

body.portal-redesign .proposal-ocr-status[data-tone="success"] {
    color: #dcffe2;
    border-color: rgba(107, 227, 129, 0.2);
    background: rgba(63, 185, 80, 0.12);
}

body.portal-redesign .proposal-ocr-status[data-tone="error"] {
    color: #ffd1d1;
    border-color: rgba(248, 81, 73, 0.22);
    background: rgba(248, 81, 73, 0.12);
}

body.portal-redesign .is-ocr-running .proposal-ocr-label {
    border-color: rgba(255, 177, 90, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

body.portal-redesign input.is-autofilled,
body.portal-redesign select.is-autofilled,
body.portal-redesign textarea.is-autofilled {
    border-color: rgba(107, 227, 129, 0.46);
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.14);
    background: rgba(107, 227, 129, 0.08);
}

body.portal-redesign .proposal-goal-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.portal-redesign .proposal-goal-chip {
    position: relative;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.portal-redesign .proposal-goal-chip:hover {
    background: transparent;
    border-color: transparent;
}

body.portal-redesign .proposal-goal-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.portal-redesign .proposal-goal-copy {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--portal-border);
    color: var(--portal-text-muted);
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

body.portal-redesign .proposal-goal-copy::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--portal-text-dim);
    flex-shrink: 0;
}

body.portal-redesign .proposal-goal-copy strong {
    color: inherit;
    font-size: 0.88rem;
}

body.portal-redesign .proposal-goal-chip:hover .proposal-goal-copy {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--portal-border-strong);
    color: #ffffff;
    transform: translateY(-1px);
}

body.portal-redesign .proposal-goal-chip input[type="checkbox"]:checked + .proposal-goal-copy {
    background: rgba(244, 122, 32, 0.14);
    border-color: rgba(255, 174, 42, 0.34);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(244, 122, 32, 0.12);
}

body.portal-redesign .proposal-goal-chip input[type="checkbox"]:checked + .proposal-goal-copy::before {
    background: var(--portal-accent-strong);
    box-shadow: 0 0 0 4px rgba(244, 122, 32, 0.14);
}

body.portal-redesign label {
    color: var(--portal-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.portal-redesign input,
body.portal-redesign select,
body.portal-redesign textarea,
body.portal-redesign button {
    border-radius: 14px;
}

body.portal-redesign input,
body.portal-redesign select,
body.portal-redesign textarea {
    background: var(--portal-surface-alt);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
}

body.portal-redesign input:hover,
body.portal-redesign select:hover,
body.portal-redesign textarea:hover {
    background: var(--portal-surface-hover);
}

body.portal-redesign input:focus,
body.portal-redesign select:focus,
body.portal-redesign textarea:focus {
    border-color: rgba(255, 174, 42, 0.72);
    box-shadow: 0 0 0 4px rgba(244, 122, 32, 0.16);
}

body.portal-redesign input::placeholder,
body.portal-redesign textarea::placeholder {
    color: var(--portal-text-dim);
}

body.portal-redesign button {
    color: #ffffff;
    background: linear-gradient(135deg, #ffae2a 0%, var(--portal-accent) 58%, #d95e21 100%);
    box-shadow: 0 14px 30px rgba(244, 122, 32, 0.24);
}

body.portal-redesign button:hover {
    filter: brightness(1.02);
}

body.portal-redesign .button-secondary,
body.portal-redesign button.button-secondary {
    background: rgba(13, 67, 91, 0.16);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    box-shadow: none;
}

body.portal-redesign .button-secondary:hover,
body.portal-redesign button.button-secondary:hover {
    background: rgba(13, 67, 91, 0.26);
    border-color: var(--portal-border-strong);
}

body.portal-redesign .filters {
    grid-template-columns: 1.45fr repeat(2, minmax(0, 1fr)) auto;
}

body.portal-redesign .filters-compact {
    grid-template-columns: 1.5fr minmax(0, 1fr) auto;
}

body.portal-redesign .filters button,
body.portal-redesign .status-form button {
    width: auto;
    min-width: 124px;
}

body.portal-redesign .stack {
    gap: 18px;
}

body.portal-redesign .table-wrap {
    border-radius: var(--portal-radius-lg);
}

body.portal-redesign table {
    width: 100%;
}

body.portal-redesign th,
body.portal-redesign td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.portal-redesign th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--portal-text-dim);
    font-size: 0.74rem;
}

body.portal-redesign td {
    color: var(--portal-text);
}

body.portal-redesign tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

body.portal-redesign .badge {
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
}

body.portal-redesign .badge-draft,
body.portal-redesign .badge-submitted,
body.portal-redesign .badge-validated,
body.portal-redesign .badge-in_review {
    background: var(--portal-yellow-soft);
    color: #f4c96b;
}

body.portal-redesign .badge-active,
body.portal-redesign .badge-won {
    background: var(--portal-green-soft);
    color: #6be381;
}

body.portal-redesign .badge-rejected,
body.portal-redesign .badge-cancelled,
body.portal-redesign .badge-lost {
    background: var(--portal-red-soft);
    color: #ff8a84;
}

body.portal-redesign .badge-sent {
    background: var(--portal-blue-soft);
    color: #8ed3e3;
}

body.portal-redesign .contract-media-link {
    background: rgba(15, 79, 104, 0.16);
    color: #93d4e3;
}

body.portal-redesign .contract-media-link:hover {
    background: rgba(15, 79, 104, 0.24);
    color: #c1ecf6;
}

body.portal-redesign .quick-note,
body.portal-redesign .rank-item,
body.portal-redesign .choice-card,
body.portal-redesign .mini-stat,
body.portal-redesign .proposal-quote,
body.portal-redesign .upload-box {
    background: var(--portal-surface-alt);
    border: 1px solid var(--portal-border);
    box-shadow: none;
}

body.portal-redesign .quick-note,
body.portal-redesign .rank-item,
body.portal-redesign .choice-copy,
body.portal-redesign .proposal-quote {
    color: var(--portal-text-muted);
}

body.portal-redesign .quick-note strong,
body.portal-redesign .rank-item strong,
body.portal-redesign .choice-copy strong,
body.portal-redesign .mini-stat strong {
    color: #ffffff;
}

body.portal-redesign .quick-note-link:hover,
body.portal-redesign .choice-card:hover {
    background: var(--portal-surface-hover);
    border-color: var(--portal-border-strong);
    text-decoration: none;
}

body.portal-redesign .choice-card input[type="checkbox"] {
    accent-color: var(--portal-accent);
    background: #0f141b;
    border-color: var(--portal-border-strong);
}

body.portal-redesign .proposal-goal-chip {
    background: transparent;
    border: 0;
}

body.portal-redesign .proposal-goal-chip:hover {
    background: transparent;
    border-color: transparent;
}

body.portal-redesign .proposal-goal-copy strong {
    color: inherit;
}

body.portal-redesign .mini-stat span {
    color: var(--portal-text-dim);
}

body.portal-redesign .proposal-quote {
    line-height: 1.75;
}

body.portal-redesign .upload-box {
    background: rgba(244, 122, 32, 0.08);
    border-style: dashed;
    border-color: rgba(244, 122, 32, 0.32);
}

body.portal-redesign .empty {
    color: var(--portal-text-muted);
}

@media (max-width: 1180px) {
    body.portal-redesign {
        --app-sidebar-width: 228px;
    }

    body.portal-redesign .app-topbar {
        padding: 22px 24px 14px;
    }

    body.portal-redesign .app-content {
        padding: 0 24px 32px;
    }

    body.portal-redesign .page-hero.has-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    body.portal-redesign .app-sidebar {
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    body.portal-redesign.is-nav-open .app-sidebar {
        transform: translateX(0);
    }

    body.portal-redesign .app-sidebar-overlay {
        display: block;
    }

    body.portal-redesign .app-main {
        margin-left: 0;
    }

    body.portal-redesign .app-menu-button {
        display: inline-flex;
    }

    body.portal-redesign .app-topbar {
        gap: 18px;
        padding: 22px 20px 14px;
        flex-wrap: wrap;
    }

    body.portal-redesign .app-topbar-left,
    body.portal-redesign .app-topbar-right {
        width: 100%;
    }

    body.portal-redesign .app-topbar-right {
        justify-content: space-between;
        align-items: stretch;
        margin-left: 0;
    }

    body.portal-redesign .app-topbar-user {
        text-align: left;
    }

    body.portal-redesign .app-content {
        padding: 0 20px 28px;
    }

    body.portal-redesign .page-hero,
    body.portal-redesign .panel {
        padding: 22px;
    }

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

    body.portal-redesign .filters,
    body.portal-redesign .filters-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.portal-redesign .filters > *,
    body.portal-redesign .filters-compact > * {
        width: 100%;
    }

    body.portal-redesign .table-wrap tbody tr {
        background: var(--portal-surface);
        border-color: var(--portal-border);
        box-shadow: none;
    }

    body.portal-redesign .table-wrap tbody tr:hover {
        background: var(--portal-surface-hover);
    }

    body.portal-redesign .table-wrap td {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    body.portal-redesign .table-wrap td::before {
        color: var(--portal-text-dim);
    }

    body.portal-redesign .table-wrap table,
    body.portal-redesign .table-wrap thead,
    body.portal-redesign .table-wrap tbody {
        display: block;
        width: 100%;
    }

    body.portal-redesign .table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body.portal-redesign .table-wrap tbody {
        display: grid;
        gap: 14px;
    }

    body.portal-redesign .table-wrap tbody tr {
        display: grid;
        gap: 0;
        padding: 14px 16px;
        border: 1px solid var(--portal-border);
        border-radius: 20px;
        background: var(--portal-surface);
    }

    body.portal-redesign .table-wrap tbody tr:hover {
        background: var(--portal-surface-hover);
    }

    body.portal-redesign .table-wrap td {
        display: grid;
        grid-template-columns: minmax(112px, 136px) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 11px 0;
    }

    body.portal-redesign .table-wrap td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    body.portal-redesign .table-wrap td::before {
        content: attr(data-label);
        color: var(--portal-text-dim);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    body.portal-redesign .table-wrap td[colspan] {
        display: block;
        padding: 4px 0 0;
        border-bottom: none;
    }

    body.portal-redesign .table-wrap td[colspan]::before {
        content: none;
    }

    body.portal-redesign .table-wrap .status-form,
    body.portal-redesign .table-wrap .contract-media-link,
    body.portal-redesign .table-wrap .button-secondary {
        width: 100%;
    }
}

@media (max-width: 820px) {
    body.portal-redesign .app-topbar {
        gap: 10px;
        padding: 14px 16px 10px;
        align-items: center;
        flex-wrap: nowrap;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        background: linear-gradient(180deg, rgba(4, 18, 27, 0.99) 0%, rgba(4, 18, 27, 0.95) 100%);
    }

    body.portal-redesign .app-topbar-left,
    body.portal-redesign .app-topbar-right {
        width: auto;
    }

    body.portal-redesign .app-topbar-left {
        flex: 1 1 auto;
        min-width: 0;
        gap: 0;
    }

    body.portal-redesign .app-topbar-row {
        flex-wrap: nowrap;
        min-width: 0;
    }

    body.portal-redesign .app-topbar-copy,
    body.portal-redesign .app-topbar-user,
    body.portal-redesign .app-breadcrumb-sep,
    body.portal-redesign .app-breadcrumb span:first-child {
        display: none;
    }

    body.portal-redesign .app-breadcrumb {
        min-width: 0;
        flex-wrap: nowrap;
        overflow: hidden;
        font-size: 0.72rem;
        letter-spacing: 0.1em;
    }

    body.portal-redesign .app-breadcrumb strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.portal-redesign .app-topbar-right {
        flex-shrink: 0;
        align-items: center;
        justify-content: flex-end;
        margin-left: 0;
    }

    body.portal-redesign .app-menu-button,
    body.portal-redesign .app-topbar-link {
        width: auto;
        min-width: 0;
        min-height: 40px;
        padding: 10px 12px;
        border-radius: 12px;
        white-space: nowrap;
    }

    body.portal-redesign .app-content {
        gap: 14px;
        padding: 8px 16px 24px;
    }

    body.portal-redesign .page-hero {
        gap: 14px;
        padding: 16px;
    }

    body.portal-redesign .page-hero::before,
    body.portal-redesign .page-hero::after,
    body.portal-redesign .page-hero-note,
    body.portal-redesign .page-hero-copy,
    body.portal-redesign .page-hero-meta {
        display: none;
    }

    body.portal-redesign .page-hero-tagline {
        gap: 8px;
    }

    body.portal-redesign .page-hero-chip {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    body.portal-redesign .page-hero-heading {
        font-size: clamp(1.24rem, 5.4vw, 1.7rem);
    }

    body.portal-redesign .section-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.portal-redesign .nav-pill {
        width: auto;
        min-height: 40px;
        padding: 10px 12px;
        flex: 1 1 140px;
    }

    body.portal-redesign .grid.stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.portal-redesign .card {
        padding: 14px;
    }

    body.portal-redesign .card span {
        margin-bottom: 8px;
        font-size: 0.7rem;
    }

    body.portal-redesign .metric {
        font-size: clamp(1.45rem, 5vw, 1.9rem);
    }

    body.portal-redesign .grid.stats,
    body.portal-redesign .form-grid,
    body.portal-redesign .choice-grid,
    body.portal-redesign .filters,
    body.portal-redesign .filters-compact {
        grid-template-columns: 1fr;
    }

    body.portal-redesign .section-nav {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.portal-redesign .nav-pill,
    body.portal-redesign .filters button,
    body.portal-redesign .filters-compact button,
    body.portal-redesign .status-form button {
        width: 100%;
    }

    body.portal-redesign .panel,
    body.portal-redesign .page-hero {
        padding: 20px;
    }

    body.portal-redesign .rank-item {
        align-items: flex-start;
        flex-direction: column;
    }

    body.portal-redesign .page-hero-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.portal-redesign .page-hero-meta-pill {
        justify-content: flex-start;
    }

    body.portal-redesign .period-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.portal-redesign .proposal-ocr-head {
        flex-direction: column;
    }

    body.portal-redesign .proposal-ocr-button {
        width: 100%;
    }

    body.portal-redesign .grid.stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.portal-redesign .section-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.portal-redesign .nav-pill {
        width: auto;
        flex: 1 1 140px;
    }

    body.portal-redesign .page-hero {
        padding: 16px;
    }

    body.portal-redesign .page-hero-meta {
        display: none;
    }
}

@media (max-width: 640px) {
    body.portal-redesign .app-topbar {
        gap: 8px;
        padding: 12px 14px 8px;
    }

    body.portal-redesign .app-topbar-right {
        width: auto;
    }

    body.portal-redesign .app-topbar-link,
    body.portal-redesign .app-menu-button {
        font-size: 0.84rem;
    }

    body.portal-redesign .app-content {
        padding: 6px 14px 22px;
    }

    body.portal-redesign .page-hero {
        padding: 14px;
        gap: 12px;
    }

    body.portal-redesign .page-hero-heading {
        font-size: clamp(1.12rem, 6vw, 1.45rem);
    }

    body.portal-redesign .app-breadcrumb {
        font-size: 0.68rem;
    }

    body.portal-redesign .table-wrap td {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.portal-redesign .table-wrap td::before {
        margin-bottom: 2px;
    }

    body.portal-redesign .period-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
