:root {
    --portal-bg: #f4f7fb;
    --portal-card: #ffffff;
    --portal-text: #162033;
    --portal-muted: #6f7a88;
    --portal-primary: #171717;
    --portal-accent: #3e49b3;
    --portal-border: #e4e8ef;
    --portal-success: #198754;
    --portal-danger: #dc3545;
}

* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    margin: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
}

.portal-shell {
    min-height: 100vh;
    display: flex;
}

.portal-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #161f6b 0%, #1e2a8a 55%, #233aa6 100%);
    color: #fff;
    padding: 26px 18px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(15, 23, 80, 0.08);
}

.portal-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 22px;
}

.portal-sidebar-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.portal-sidebar-brand-text {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.portal-sidebar-brand-sub {
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 2px;
}

.portal-menu-block {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px;
}

.portal-menu-heading {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin: 4px 8px 12px;
}

.portal-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    position: relative;
}

.portal-menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.portal-menu-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.portal-menu-link.active::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: #fff;
}

.portal-menu-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0.85;
    flex-shrink: 0;
}

.portal-menu-link.active .portal-menu-icon {
    opacity: 1;
}

.portal-menu-dash {
    display: none;
}

.portal-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    margin-top: 14px;
}

.portal-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pt-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.portal-user-info {
    flex: 1;
    min-width: 0;
}

.portal-user-name {
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
}

.portal-user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.portal-sidebar-logout {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.portal-sidebar-logout:hover {
    background: #fff;
    color: var(--pt-primary);
}

.portal-main {
    flex: 1;
    padding: 0;
    background: #f5f7fc;
    min-width: 0;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 22px 32px;
    margin-bottom: 0;
    background: #fff;
    border-bottom: 1px solid #eaeef7;
    position: sticky;
    top: 0;
    z-index: 20;
}

.portal-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--pt-primary);
    letter-spacing: -0.01em;
}

.portal-page-subtitle {
    color: #6c7686;
    font-size: 13px;
    margin-top: 3px;
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-user-badge {
    background: var(--pt-soft-bg);
    border: 1px solid #dbe1f7;
    color: var(--pt-primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-logout-btn {
    text-decoration: none;
    background: var(--pt-gradient);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(30, 42, 138, 0.22);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.12s, box-shadow 0.15s;
}

.portal-logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(30, 42, 138, 0.3);
    color: #fff;
}

.portal-content {
    padding: 26px 32px 32px;
}

.portal-card {
    background: var(--portal-card);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(20, 27, 39, 0.06);
    border: 1px solid var(--portal-border);
    padding: 22px;
    margin-bottom: 20px;
}

.portal-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--pt-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-card-title i {
    color: var(--pt-accent);
}

/* Hero welcome card */
.portal-hero {
    background: var(--pt-gradient);
    color: #fff;
    border-radius: 22px;
    padding: 26px 28px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    box-shadow: 0 18px 40px rgba(30, 42, 138, 0.22);
}

.portal-hero::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
    top: -130px;
    right: -100px;
    pointer-events: none;
}

.portal-hero::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
    bottom: -120px;
    left: -60px;
    pointer-events: none;
}

.portal-hero-content {
    position: relative;
    z-index: 1;
    flex: 1 1 280px;
}

.portal-hero-greeting {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 8px;
    font-weight: 600;
}

.portal-hero-name {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.portal-hero-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
    max-width: 480px;
    line-height: 1.55;
    margin: 0;
}

.portal-hero-side {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.16);
    padding: 16px 22px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-coupon-label {
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 8px;
    font-weight: 600;
}

.portal-coupon-code {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.portal-copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 0;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s, transform 0.1s;
}

.portal-copy-btn:hover {
    background: rgba(255, 255, 255, 0.32);
}

.portal-copy-btn:active {
    transform: scale(0.94);
}

.portal-copy-btn.copied {
    background: #15825a;
}

/* KPI cards */
.portal-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.portal-kpi {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    padding: 22px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.portal-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(20, 27, 39, 0.08);
}

.portal-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.portal-kpi-icon.indigo { background: rgba(30, 42, 138, 0.10); color: var(--pt-primary); }
.portal-kpi-icon.blue   { background: rgba(59, 158, 238, 0.14); color: #1d7dc7; }
.portal-kpi-icon.green  { background: rgba(25, 135, 84, 0.12);  color: #15825a; }
.portal-kpi-icon.amber  { background: rgba(255, 193, 7, 0.18);  color: #997000; }
.portal-kpi-icon.purple { background: rgba(126, 87, 194, 0.14); color: #6a3fb5; }
.portal-kpi-icon.teal   { background: rgba(14, 159, 159, 0.14); color: #0b8585; }

.portal-kpi-label {
    color: #6c7686;
    font-size: 13px;
    margin-bottom: 4px;
}

.portal-kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--pt-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.portal-kpi-note {
    color: #909aab;
    font-size: 12px;
    margin-top: 6px;
}

/* Earnings flow / pipeline */
.portal-money-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.portal-flow-step {
    background: #fbfcff;
    border: 1px solid #eaeef7;
    border-radius: 14px;
    padding: 16px 18px;
    position: relative;
}

.portal-flow-step + .portal-flow-step::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    color: #c5cbd7;
    font-size: 12px;
    pointer-events: none;
    background: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eaeef7;
}

.portal-flow-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #6c7686;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.portal-flow-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--pt-primary);
}

.portal-flow-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cdd3df;
    flex-shrink: 0;
}

.portal-flow-dot.active  { background: var(--pt-accent); box-shadow: 0 0 0 4px rgba(59, 158, 238, 0.2); }
.portal-flow-dot.warning { background: #d49a00; box-shadow: 0 0 0 4px rgba(212, 154, 0, 0.18); }
.portal-flow-dot.success { background: #15825a; box-shadow: 0 0 0 4px rgba(21, 130, 90, 0.18); }

/* Empty state */
.portal-empty {
    text-align: center;
    padding: 56px 24px;
    color: #6c7686;
}

.portal-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--pt-soft-bg);
    color: var(--pt-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.portal-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--pt-primary);
    margin-bottom: 6px;
}

.portal-empty-text {
    font-size: 13.5px;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Page intro (small header above content) */
.portal-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.portal-section-head .left h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--pt-primary);
}

.portal-section-head .left p {
    margin: 4px 0 0;
    color: #6c7686;
    font-size: 13px;
}

.portal-section-head .right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-count-pill {
    background: var(--pt-soft-bg);
    color: var(--pt-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #dbe1f7;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Lead avatar + cell */
.portal-lead-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-lead-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pt-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.portal-lead-name {
    font-weight: 700;
    color: var(--pt-primary);
    font-size: 13.5px;
    line-height: 1.3;
}

.portal-lead-meta {
    color: #6c7686;
    font-size: 12.5px;
    margin-top: 3px;
    line-height: 1.45;
}

.portal-lead-meta i {
    width: 12px;
    text-align: center;
    margin-right: 4px;
    opacity: 0.7;
}

/* Chip / tag */
.portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--pt-soft-bg);
    color: var(--pt-primary);
    line-height: 1.2;
    white-space: nowrap;
}

.portal-chip-grey { background: #eef1f7; color: #4b5466; }
.portal-chip-blue { background: rgba(59, 158, 238, 0.14); color: #1d7dc7; }
.portal-chip-amber { background: rgba(212, 154, 0, 0.15); color: #8a6800; }

/* Toast */
.portal-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--pt-primary);
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 14px 30px rgba(30, 42, 138, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.25s;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modernize the table */
.portal-table thead th {
    background: #f8faff;
    color: #6c7686;
    font-weight: 700;
    border-bottom: 1px solid #e5ebf5;
}

.portal-table tbody tr {
    transition: background 0.12s;
}

.portal-table tbody tr:hover {
    background: #fafbff;
}

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

.portal-stat-box {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    padding: 20px;
}

.portal-stat-label {
    color: var(--portal-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.portal-stat-value {
    font-size: 30px;
    font-weight: 800;
}

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

.portal-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.portal-table th,
.portal-table td {
    border-bottom: 1px solid var(--portal-border);
    text-align: left;
    padding: 14px 12px;
    font-size: 14px;
    vertical-align: top;
}

.portal-table th {
    color: var(--portal-muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

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

.portal-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.portal-input,
.portal-select,
.portal-textarea {
    width: 100%;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
}

.portal-textarea {
    min-height: 120px;
    resize: vertical;
}

.portal-btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-btn-primary {
    background: var(--portal-accent);
    color: #fff;
}

.portal-btn-dark {
    background: #111;
    color: #fff;
}

.portal-btn-light {
    background: #eef2f8;
    color: #111;
}

.portal-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.portal-status-success {
    background: rgba(25, 135, 84, 0.12);
    color: var(--portal-success);
}

.portal-status-danger {
    background: rgba(220, 53, 69, 0.12);
    color: var(--portal-danger);
}

.portal-status-warning {
    background: rgba(255, 193, 7, 0.18);
    color: #996f00;
}

:root {
    --pt-primary: #1e2a8a;
    --pt-primary-dark: #161f6b;
    --pt-accent: #3b9eee;
    --pt-gradient: linear-gradient(135deg, #1e2a8a 0%, #2c54c8 55%, #3b9eee 100%);
    --pt-soft-bg: #eef2ff;
}

.portal-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(1100px 600px at 85% -10%, rgba(59, 158, 238, 0.18), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(30, 42, 138, 0.16), transparent 60%),
        #f5f7fc;
    position: relative;
    overflow: hidden;
}

.portal-login-card {
    width: 100%;
    max-width: 980px;
    background: #fff;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 30px 70px rgba(30, 41, 99, 0.18);
    border: 1px solid #e6ebf5;
    overflow: hidden;
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 580px;
}

.portal-login-aside {
    background: var(--pt-gradient);
    color: #fff;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portal-login-aside::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
    top: -160px;
    right: -160px;
    pointer-events: none;
}

.portal-login-aside::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
    bottom: -120px;
    left: -100px;
    pointer-events: none;
}

.portal-aside-content {
    position: relative;
    z-index: 1;
}

.portal-aside-eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 22px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.portal-aside-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.18;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}

.portal-aside-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
    margin: 0 0 30px;
    max-width: 360px;
}

.portal-aside-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.portal-aside-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 14px;
    line-height: 1.5;
}

.portal-aside-list li::before {
    content: '';
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M13.78 4.22a.75.75 0 0 1 0 1.06l-6.5 6.5a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 1.06-1.06l2.47 2.47 5.97-5.97a.75.75 0 0 1 1.06 0z'/></svg>") center/14px no-repeat;
    margin-top: 1px;
}

.portal-aside-footer {
    position: relative;
    z-index: 1;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-aside-footer::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
}

.portal-login-body {
    padding: 48px 48px 40px;
    display: flex;
    flex-direction: column;
}

.portal-login-logo {
    display: inline-block;
    margin-bottom: 32px;
    text-decoration: none;
    align-self: flex-start;
}

.portal-login-logo img {
    height: 44px;
    width: auto;
    max-width: 200px;
    display: block;
    object-fit: contain;
}

.portal-login-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--pt-primary);
    letter-spacing: -0.01em;
}

.portal-login-subtitle {
    color: #5b6478;
    font-size: 14px;
    margin-bottom: 22px;
    line-height: 1.55;
}

.portal-login-card .portal-label {
    color: var(--pt-primary);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-login-card .portal-input {
    border-radius: 12px;
    border: 1.5px solid #dde3ef;
    padding: 13px 16px;
    font-size: 14.5px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-login-card .portal-input:focus {
    outline: none;
    border-color: var(--pt-accent);
    box-shadow: 0 0 0 4px rgba(59, 158, 238, 0.18);
}

.portal-login-card .portal-btn-primary {
    background: var(--pt-gradient);
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(30, 42, 138, 0.28);
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s;
}

.portal-login-card .portal-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 14px 28px rgba(30, 42, 138, 0.34);
}

.portal-login-card .alert-danger {
    background: #fff1f3;
    color: #b42334;
    border: 1px solid #ffd6dc;
    border-radius: 12px;
    font-size: 13.5px;
    padding: 10px 14px;
}

.portal-login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 22px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pt-primary);
    text-decoration: none;
}

.portal-login-back:hover {
    color: var(--pt-accent);
}

.portal-login-footnote {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef1f7;
    font-size: 12.5px;
    color: #6c7686;
    text-align: center;
}

.portal-login-footnote a {
    color: var(--pt-primary);
    font-weight: 600;
    text-decoration: none;
}

.portal-login-footnote a:hover {
    color: var(--pt-accent);
}

@media (max-width: 860px) {
    .portal-login-card {
        grid-template-columns: 1fr;
        max-width: 500px;
        min-height: 0;
    }
    .portal-login-aside {
        padding: 36px 32px;
    }
    .portal-aside-title {
        font-size: 26px;
    }
    .portal-login-body {
        padding: 36px 32px 32px;
    }
}

.portal-small {
    font-size: 12px;
    color: var(--portal-muted);
}

.portal-action-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Large laptops / small desktops: tighten the stat grid */
@media (max-width: 1199px) {
    .portal-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .portal-money-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .portal-flow-step + .portal-flow-step::before {
        display: none;
    }
}

/* Tablet & below: sidebar collapses to a top nav bar */
@media (max-width: 991px) {
    .portal-shell {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 30;
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        flex-wrap: wrap;
        box-shadow: 0 4px 18px rgba(15, 23, 80, 0.12);
    }

    .portal-sidebar-brand {
        padding: 0;
        margin: 0;
        border-bottom: 0;
        flex-shrink: 0;
    }

    .portal-menu-block {
        flex: 1 1 100%;
        order: 3;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px 0 2px;
        margin: 0 -4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        display: flex;
        gap: 6px;
    }

    .portal-menu-block::-webkit-scrollbar {
        display: none;
    }

    .portal-menu-heading {
        display: none;
    }

    .portal-menu-link {
        margin: 0;
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .portal-menu-link.active::before {
        display: none;
    }

    .portal-user-card {
        margin: 0 0 0 auto;
        padding: 6px 10px 6px 6px;
        order: 2;
        gap: 8px;
    }

    .portal-user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .portal-user-name {
        font-size: 12.5px;
    }

    .portal-user-role {
        font-size: 10px;
    }

    .portal-sidebar-logout {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .portal-header {
        padding: 16px 20px;
        position: sticky;
        top: auto;
    }

    .portal-content {
        padding: 18px 20px 24px;
    }

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

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

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

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

    .portal-page-title {
        font-size: 20px;
    }

    .portal-hero {
        padding: 22px;
    }

    .portal-hero-name {
        font-size: 22px;
    }

    .portal-hero-side {
        flex: 1 1 100%;
    }
}

/* Phones: hide noise, single-column stats, condensed header */
@media (max-width: 575px) {
    .portal-sidebar {
        padding: 12px 14px;
    }

    .portal-sidebar-brand-text {
        font-size: 13.5px;
    }

    .portal-sidebar-brand-sub {
        font-size: 9.5px;
    }

    .portal-user-info {
        display: none;
    }

    .portal-user-card {
        padding: 4px;
    }

    .portal-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .portal-user-badge {
        display: none;
    }

    .portal-logout-btn {
        padding: 8px 14px;
        font-size: 12.5px;
    }

    .portal-page-title {
        font-size: 18px;
    }

    .portal-page-subtitle {
        font-size: 12px;
    }

    .portal-content {
        padding: 14px 16px 22px;
    }

    .portal-stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .portal-kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .portal-money-flow {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-stat-box {
        padding: 16px;
    }

    .portal-hero {
        padding: 20px;
    }

    .portal-hero-name {
        font-size: 20px;
    }

    .portal-coupon-code {
        font-size: 18px;
    }

    .portal-stat-value {
        font-size: 24px;
    }

    .portal-card {
        padding: 16px;
        border-radius: 16px;
    }

    .portal-table th,
    .portal-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
}
