:root {
    --brand-red: #e30613;
    --brand-red-deep: #9f0b17;
    --brand-navy: #0b1f3a;
    --brand-blue: #17365d;
    --ink: #142033;
    --muted: #607086;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --line: rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 70px rgba(11, 31, 58, 0.16);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.09);
    --success-bg: #dcfce7;
    --success-text: #166534;
    --warning-bg: #fef3c7;
    --warning-text: #9a3412;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --info-bg: #dbeafe;
    --info-text: #1d4ed8;
}

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

body.portal-body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(227, 6, 19, 0.12), transparent 24%),
        radial-gradient(circle at top right, rgba(23, 54, 93, 0.20), transparent 28%),
        linear-gradient(180deg, #f5f7fb 0%, #edf2f7 45%, #e3ebf4 100%);
}

.portal-shell {
    max-width: 1360px;
    margin: 0 auto;
    padding: 32px 18px 48px;
}

.portal-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    padding: 30px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(11, 31, 58, 0.98), rgba(23, 54, 93, 0.95) 58%, rgba(227, 6, 19, 0.88));
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.portal-hero::before,
.portal-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.portal-hero::before {
    width: 280px;
    height: 280px;
    top: -140px;
    right: -70px;
    background: rgba(255, 255, 255, 0.11);
}

.portal-hero::after {
    width: 220px;
    height: 220px;
    bottom: -120px;
    left: -80px;
    background: rgba(255, 255, 255, 0.06);
}

.portal-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 24px;
    align-items: center;
}

.portal-hero-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
}

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

.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-hero h1,
.portal-hero h2 {
    margin: 14px 0 10px;
    line-height: 1.06;
    font-weight: 800;
}

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

.portal-hero h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.7rem);
}

.portal-hero p {
    margin: 0;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1rem;
}

.portal-panel {
    position: relative;
    z-index: 1;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.portal-panel h3,
.portal-panel h4 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.portal-metric-card,
.portal-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.portal-metric-card {
    padding: 22px 20px;
}

.portal-metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.portal-metric-value {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
}

.portal-metric-hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.portal-card {
    padding: 24px;
}

.portal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.portal-section-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-navy);
}

.portal-section-copy {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
}

.portal-chip-light {
    background: #fff;
    border-color: var(--line);
    color: var(--brand-blue);
}

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

.portal-col-4 {
    grid-column: span 4;
}

.portal-col-6 {
    grid-column: span 6;
}

.portal-col-8 {
    grid-column: span 8;
}

.portal-col-12 {
    grid-column: span 12;
}

.portal-soft-section {
    padding: 18px;
    border-radius: 22px;
    background: rgba(245, 248, 252, 0.88);
    border: 1px solid var(--line);
}

.portal-soft-section h4,
.portal-soft-section h5 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--brand-navy);
}

.portal-table-wrap {
    overflow-x: auto;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--line);
}

.portal-table {
    margin: 0;
}

.portal-table thead th {
    border: none;
    background: var(--brand-navy);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.portal-table > :not(caption) > * > * {
    padding: 14px 16px;
    vertical-align: middle;
}

.portal-table tbody tr {
    border-color: rgba(15, 23, 42, 0.05);
}

.portal-table tbody tr:hover {
    background: rgba(227, 238, 250, 0.45);
}

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

.portal-badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.portal-badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.portal-badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.portal-badge-info {
    background: var(--info-bg);
    color: var(--info-text);
}

.portal-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-btn {
    border: none;
    border-radius: 14px;
    padding: 11px 18px;
    font-weight: 700;
}

.portal-btn-primary {
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
    color: #fff;
}

.portal-btn-danger {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-deep));
    color: #fff;
}

.portal-btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
}

.portal-btn-light {
    background: #fff;
    color: var(--brand-blue);
    border: 1px solid var(--line);
}

.portal-empty {
    padding: 30px 18px;
    border-radius: 22px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
}

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

.portal-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(245, 248, 252, 0.92);
    border: 1px solid var(--line);
}

.portal-media {
    width: 100%;
    max-width: 180px;
    max-height: 160px;
    object-fit: contain;
}

.portal-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.portal-preview-card {
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.portal-preview-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.portal-footer-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    padding: 12px 18px;
    border-radius: 18px;
    background: rgba(11, 31, 58, 0.94);
    color: #fff;
    box-shadow: var(--shadow-md);
}

@media (max-width: 991.98px) {
    .portal-hero-grid,
    .portal-metric-grid {
        grid-template-columns: 1fr;
    }

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

    .portal-col-4,
    .portal-col-6,
    .portal-col-8 {
        grid-column: span 12;
    }
}

@media (max-width: 767.98px) {
    .portal-shell {
        padding: 18px 14px 34px;
    }

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

    .portal-card,
    .portal-metric-card {
        border-radius: 20px;
    }

    .portal-footer-bar {
        position: static;
        margin-top: 18px;
    }
}
