body {
    font-family: "Inter", sans-serif;
}

.portal-body {
    margin: 0;
    background: #f4f7fb;
    color: #132238;
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
}

.portal-sidebar {
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    color: #fff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
}

.portal-brand {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.portal-brand:hover {
    color: #fff;
}

.portal-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffd54a 0%, #ffb400 100%);
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

.portal-brand-copy {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
}

.portal-role-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.portal-role-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.portal-role-user {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.portal-nav .nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 12px;
    margin-bottom: 0.35rem;
    padding: 0.8rem 1rem;
}

.portal-nav .nav-link:hover,
.portal-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-main {
    padding: 2rem;
}

.btn-shell-primary {
    background: linear-gradient(135deg, #ffd54a 0%, #ffb400 100%);
    border: 0;
    color: #111827;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.22);
}

.btn-shell-primary:hover,
.btn-shell-primary:focus {
    background: linear-gradient(135deg, #ffcd2f 0%, #f59e0b 100%);
    color: #111827;
}

.btn-shell-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-weight: 600;
}

.btn-shell-secondary:hover,
.btn-shell-secondary:focus {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-shell-ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
}

.btn-shell-ghost:hover,
.btn-shell-ghost:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
}

.portal-topbar {
    margin-bottom: 1.5rem;
}

.portal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.portal-subtitle {
    color: #64748b;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
}

.portal-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.35rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.portal-dashboard.is-loading .portal-panel {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.portal-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.portal-metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.25rem;
}

.portal-metric-card .label {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.55rem;
}

.portal-metric-card .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-metric-card .hint {
    font-size: 0.85rem;
    color: #64748b;
}

.portal-chart-wrap {
    position: relative;
    height: 320px;
    max-height: 320px;
}

.portal-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.portal-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0.92));
    border-radius: 16px;
    padding: 1rem;
}

.portal-focus-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.portal-focus-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    min-width: 180px;
}

.portal-focus-item .label {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.portal-focus-item .value {
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.list-group-item.portal-activity {
    border: 0;
    padding: 0.9rem 0;
    border-bottom: 1px solid #edf2f7;
}

.portal-activity:last-child {
    border-bottom: 0;
}

.portal-login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, rgba(255, 196, 0, 0.15), transparent 40%), #0f172a;
    padding: 1.5rem;
}

.portal-login-wrap {
    width: min(100%, 440px);
}

.portal-login-card {
    background: #fff;
    border-radius: 24px;
    padding: 2rem;
}

.portal-login-brand {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.portal-login-brand h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.portal-login-brand p {
    margin: 0;
    color: #64748b;
}

.portal-inline-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
}

.portal-panel .form-text {
    color: #64748b;
}

.portal-table td,
.portal-table th,
.table td,
.table th {
    vertical-align: middle;
}

.portal-empty-state {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}

.portal-table .btn {
    white-space: nowrap;
}

.portal-card-3d-panel {
    overflow: hidden;
}

.portal-card-3d-mount {
    width: 100%;
    min-height: 320px;
    border-radius: 20px;
    background: linear-gradient(160deg, #dbeafe 0%, #e8eef5 45%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    position: relative;
}

.portal-card-3d-mount canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    border-radius: 18px;
}

.portal-card-preview-aside {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: center;
    min-height: 100%;
}

.portal-card-preview-lead {
    padding-right: 0.25rem;
}

.portal-card-preview-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 0.4rem;
}

.portal-card-preview-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.portal-card-preview-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.55;
    max-width: 38ch;
}

.portal-landing-stack {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.1rem 1.15rem 0.9rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 10px 32px rgba(15, 23, 42, 0.06);
}

.portal-landing-stack-head {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.portal-landing-stack-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffd54a 0%, #ffb400 100%);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}

.portal-landing-stack-head-text {
    min-width: 0;
}

.portal-landing-stack-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.portal-landing-stack-intro {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.portal-landing-url-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: min(50vh, 400px);
    overflow-y: auto;
    padding-right: 0.15rem;
    margin-bottom: 0.65rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.portal-landing-url-card {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-landing-url-card:hover {
    border-color: #dbeafe;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.portal-landing-url-card-head {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin-bottom: 0.7rem;
}

.portal-landing-url-card-badge {
    flex-shrink: 0;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 9px;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.portal-landing-url-card-titles {
    min-width: 0;
}

.portal-landing-url-card-title {
    font-size: 0.93rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.2rem;
    line-height: 1.3;
    word-break: break-word;
}

.portal-landing-url-card-sub {
    font-size: 0.76rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.portal-landing-url-field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.portal-landing-url-input {
    flex: 1 1 12rem;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #334155;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    padding: 0.55rem 0.7rem;
    outline: none;
    box-sizing: border-box;
}

.portal-landing-url-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.portal-landing-url-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.portal-landing-url-btn {
    min-width: 4.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.portal-landing-more-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0 0 0.65rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.45;
}

.portal-landing-more-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 0.72rem;
}

.portal-landing-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 1.05rem 1.1rem;
    margin-bottom: 0.65rem;
    background: rgba(255, 255, 255, 0.65);
}

.portal-landing-empty-text {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.portal-landing-stack-foot {
    padding-top: 0.7rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.portal-landing-manage-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    border-radius: 10px;
    padding: 0.25rem 0;
}

.portal-landing-manage-link:hover {
    color: #b45309;
}

.portal-landing-manage-chevron {
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-top: -0.05rem;
    opacity: 0.85;
}

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

    .portal-sidebar {
        border-radius: 0 0 24px 24px;
    }

    .portal-main {
        padding: 1.25rem;
    }

    .portal-chart-wrap {
        height: 260px;
        max-height: 260px;
    }

    .portal-card-3d-mount {
        min-height: 280px;
    }

    .portal-landing-url-cards {
        max-height: none;
    }
}
