/* ==========================================================================
   Portal CSS — cashgranthelpdesk
   Shared styles for all portal pages.
   ========================================================================== */

:root {
    --portal-primary: #DC2626;
    --portal-primary-light: #EF4444;
    --portal-primary-bg: rgba(220, 38, 38, 0.06);
    --portal-primary-bg-strong: rgba(220, 38, 38, 0.1);
    --portal-text: #1A1A1A;
    --portal-text-secondary: #6B7280;
    --portal-text-muted: #9CA3AF;
    --portal-border: #E5E7EB;
    --portal-border-light: #F3F4F6;
    --portal-bg: #F9FAFB;
    --portal-white: #FFFFFF;
    --portal-coral: #FF7E70;
    --portal-gold: #FCD116;
    --portal-success: #16A34A;
    --portal-success-bg: #DCFCE7;
    --portal-warning: #D97706;
    --portal-warning-bg: #FEF3C7;
    --portal-danger: #DC2626;
    --portal-danger-bg: #FEE2E2;
    --portal-info: #2563EB;
    --portal-info-bg: #DBEAFE;
    --portal-radius-sm: 8px;
    --portal-radius: 12px;
    --portal-radius-lg: 16px;
    --portal-radius-xl: 20px;
    --portal-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --portal-shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    --portal-shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
    --portal-shadow-clay: 6px 6px 16px rgba(0,0,0,0.08), -6px -6px 16px rgba(255,255,255,0.9);
    --portal-transition: 0.2s ease;
    --portal-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base overrides for portal pages — .portal-page set by portal.js */
body.portal-page {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    font-family: var(--portal-font);
    background-color: var(--portal-bg);
    background-image:
        radial-gradient(ellipse at 0% 50%, rgba(134, 239, 172, 0.18) 0%, transparent 40%),
        radial-gradient(ellipse at 35% 40%, rgba(196, 181, 253, 0.18) 0%, transparent 40%),
        radial-gradient(ellipse at 65% 50%, rgba(249, 168, 212, 0.16) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 50%, rgba(253, 224, 71, 0.16) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='120' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 5 Q15 0 30 5 T60 5 T90 5 T120 5' fill='none' stroke='%239ca3af' stroke-opacity='0.18' stroke-width='0.5'/%3E%3Cpath d='M0 11 Q15 6 30 11 T60 11 T90 11 T120 11' fill='none' stroke='%239ca3af' stroke-opacity='0.15' stroke-width='0.5'/%3E%3Cpath d='M0 17 Q15 12 30 17 T60 17 T90 17 T120 17' fill='none' stroke='%239ca3af' stroke-opacity='0.18' stroke-width='0.5'/%3E%3Cpath d='M0 23 Q15 18 30 23 T60 23 T90 23 T120 23' fill='none' stroke='%239ca3af' stroke-opacity='0.15' stroke-width='0.5'/%3E%3Cpath d='M0 29 Q15 24 30 29 T60 29 T90 29 T120 29' fill='none' stroke='%239ca3af' stroke-opacity='0.18' stroke-width='0.5'/%3E%3Cpath d='M0 35 Q15 30 30 35 T60 35 T90 35 T120 35' fill='none' stroke='%239ca3af' stroke-opacity='0.15' stroke-width='0.5'/%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--portal-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.portal-page a {
    text-decoration: none;
}

body.portal-page a:hover {
    text-decoration: none;
}

/* Reset Frappe web template wrapper spacing on portal pages */
body.portal-page .page-content-wrapper,
body.portal-page .page-header-wrapper,
body.portal-page .page-header,
body.portal-page .page_content,
body.portal-page .page-breadcrumbs,
body.portal-page .page-footer {
    padding: 0;
    margin: 0;
}

/* ---------- Portal Navigation ---------- */
.portal-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.portal-nav.scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.portal-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.portal-logo-wrapper {
    width: 38px;
    height: 38px;
    background: var(--portal-white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--portal-shadow);
}

.portal-brand-logo {
    width: 26px;
    height: 26px;
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
}

.portal-brand-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--portal-text);
    line-height: 1.2;
}

.portal-brand-subtitle {
    font-size: 11px;
    color: var(--portal-text-muted);
    font-weight: 500;
    line-height: 1.2;
}

/* Nav links */
.portal-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.portal-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--portal-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--portal-text-secondary);
    text-decoration: none;
    transition: all var(--portal-transition);
    white-space: nowrap;
    position: relative;
}

.portal-nav-link:hover {
    background: var(--portal-primary-bg);
    color: var(--portal-primary);
}

.portal-nav-link.active {
    background: var(--portal-primary-bg-strong);
    color: #1a1a1a;
    font-weight: 600;
}

.portal-nav-link--locked {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--portal-text-muted);
}

.portal-nav-link--locked:hover {
    background: none;
    color: var(--portal-text-muted);
}

.portal-mobile-link--locked {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--portal-text-muted);
    border-left-color: transparent;
}

.portal-mobile-link--locked:hover {
    background: none;
    color: var(--portal-text-muted);
    border-left-color: transparent;
}

.portal-nav-link svg {
    flex-shrink: 0;
    opacity: 0.7;
    width: 16px;
    height: 16px;
}

.portal-nav-link.active svg,
.portal-nav-link:hover svg {
    opacity: 1;
}

/* User section */
.portal-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.portal-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--portal-text);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--portal-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--portal-text-secondary);
    text-decoration: none;
    transition: all var(--portal-transition);
}

.portal-logout-btn:hover {
    background: var(--portal-primary-bg);
    color: var(--portal-primary);
}

/* Hamburger */
.portal-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
}

.portal-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--portal-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile overlay */
.portal-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portal-mobile-overlay.open {
    display: block;
    opacity: 1;
}

/* Mobile menu */
.portal-mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: var(--portal-white);
    z-index: 300;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.portal-mobile-menu.open {
    right: 0;
}

.portal-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--portal-border-light);
}

.portal-mobile-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--portal-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--portal-radius-sm);
    transition: background var(--portal-transition);
}

.portal-mobile-close:hover {
    background: var(--portal-border-light);
}

.portal-mobile-links {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.portal-mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--portal-text);
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.portal-mobile-link:hover {
    background: var(--portal-primary-bg);
    color: var(--portal-primary);
}

.portal-mobile-link.active {
    background: var(--portal-primary-bg);
    color: var(--portal-primary);
    border-left-color: var(--portal-primary);
    font-weight: 600;
}

.portal-mobile-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--portal-border-light);
}

.portal-user-name-mobile {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--portal-text);
    margin-bottom: 8px;
}

.portal-mobile-logout {
    color: var(--portal-primary) !important;
}

/* ---------- Portal Content Layout ---------- */
.portal-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px 80px;
    flex: 1 0 auto;
}

.portal-page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--portal-text);
    margin-top: 0 !important;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.portal-page-subtitle {
    font-size: 14px;
    color: var(--portal-text-secondary);
    margin-top: -16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ---------- Portal Cards ---------- */
.portal-card {
    background: var(--portal-white);
    border-radius: var(--portal-radius-xl);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--portal-shadow-md);
    border-color: #D1D5DB;
}

/* ---------- Welcome Banner ---------- */
.portal-welcome {
    background: linear-gradient(135deg, #1E293B 0%, #334155 60%, #475569 100%);
    border-radius: var(--portal-radius-xl);
    padding: 36px 40px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 8px 32px rgba(30, 41, 59, 0.25), 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}


.portal-welcome-left {
    position: relative;
    z-index: 1;
}

.portal-welcome-greeting {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.portal-welcome-name {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    line-height: 1.2;
}

.portal-welcome-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* ---------- Status Cards Row ---------- */
.portal-status-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.portal-status-card {
    background: var(--portal-white);
    border-radius: var(--portal-radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.portal-status-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.portal-status-card:hover {
    box-shadow: var(--portal-shadow-md);
    transform: translateY(-2px);
}

.portal-status-card--kyc::before { background: var(--portal-primary); }
.portal-status-card--bank::before { background: var(--portal-warning); }
.portal-status-card--progress::before { background: var(--portal-info); }
.portal-status-card--payment::before { background: var(--portal-warning); }

.portal-status-card--ok::before { background: var(--portal-success) !important; }

.portal-status-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--portal-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-status-card--kyc .portal-status-card-icon {
    background: var(--portal-danger-bg);
    color: var(--portal-primary);
}

.portal-status-card--bank .portal-status-card-icon {
    background: var(--portal-warning-bg);
    color: var(--portal-warning);
}

.portal-status-card--progress .portal-status-card-icon {
    background: var(--portal-info-bg);
    color: var(--portal-info);
}

.portal-status-card--payment .portal-status-card-icon {
    background: var(--portal-warning-bg);
    color: var(--portal-warning);
}

.portal-status-card--ok .portal-status-card-icon {
    background: var(--portal-success-bg) !important;
    color: var(--portal-success) !important;
}

.portal-status-card-body {
    flex: 1;
    min-width: 0;
}

.portal-status-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.portal-status-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--portal-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.portal-status-card-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-white);
    background: var(--portal-primary);
    border-radius: 6px;
    text-decoration: none;
    transition: all var(--portal-transition);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.portal-status-card-btn:hover {
    background: var(--portal-primary-light);
    transform: translateY(-1px);
}

.portal-status-card-btn.is-disabled,
.portal-status-card-btn[aria-disabled="true"] {
    background: #9ca3af;
    color: #f3f4f6;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
    opacity: 0.85;
}

/* Lodge Payment Query card — sits in its own row under Payment Status */
.portal-card--lodge-query {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--portal-white);
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-border-light);
    box-shadow: var(--portal-shadow);
}

.portal-lodge-query-body {
    flex: 1;
    min-width: 0;
}

.portal-lodge-query-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--portal-text);
    margin-bottom: 4px;
}

.portal-lodge-query-hint {
    font-size: 12px;
    color: var(--portal-text-secondary);
    line-height: 1.4;
}

.portal-lodge-query-btn {
    flex-shrink: 0;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: var(--portal-white);
    background: var(--portal-primary);
    border: none;
    border-radius: var(--portal-radius-sm);
    cursor: pointer;
    transition: all var(--portal-transition);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.portal-lodge-query-btn:hover {
    background: var(--portal-primary-light);
    transform: translateY(-1px);
}

.portal-lodge-query-btn.is-disabled,
.portal-lodge-query-btn[aria-disabled="true"],
.portal-lodge-query-btn:disabled {
    background: #9ca3af;
    color: #f3f4f6;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
    opacity: 0.85;
}

@media (max-width: 600px) {
    .portal-card--lodge-query {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    .portal-lodge-query-btn {
        width: 100%;
    }
}

.portal-status-card-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--portal-text-muted);
    margin-top: 4px;
}

/* Progress bar */
.portal-progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--portal-border-light);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.portal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--portal-info), #60A5FA);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Quick Actions ---------- */
.portal-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.portal-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.portal-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--portal-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.portal-action-card:hover .portal-action-icon {
    transform: scale(1.08);
}

.portal-action-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.portal-action-icon.coral {
    background: linear-gradient(135deg, #FF7E70, #FF6B6B);
    box-shadow: 0 4px 12px rgba(255, 126, 112, 0.35);
}

.portal-action-icon.gold {
    background: linear-gradient(135deg, #FCD116, #E5A800);
    box-shadow: 0 4px 12px rgba(252, 209, 22, 0.35);
}

.portal-action-icon.indigo {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.portal-action-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--portal-text);
    margin: 0 0 3px 0;
}

.portal-action-text p {
    font-size: 13px;
    color: var(--portal-text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* ---------- Section Headers ---------- */
.portal-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.portal-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--portal-text);
    letter-spacing: -0.01em;
}

/* ---------- Filter Buttons ---------- */
.portal-filter-btns {
    display: flex;
    gap: 4px;
    background: var(--portal-border-light);
    border-radius: var(--portal-radius-sm);
    padding: 3px;
}

.portal-filter-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--portal-text-secondary);
    cursor: pointer;
    transition: all var(--portal-transition);
}

.portal-filter-btn.active {
    background: var(--portal-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

/* ---------- Notice Board ---------- */
.portal-notice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.portal-notice {
    padding: 16px 20px;
    cursor: pointer;
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-border-light);
    background: var(--portal-white);
    transition: all var(--portal-transition);
}

.portal-notice:hover {
    border-color: var(--portal-border);
    box-shadow: var(--portal-shadow);
}

.portal-notice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.portal-notice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--portal-text);
    flex: 1;
}

.portal-priority-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

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

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

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

.portal-notice-preview {
    font-size: 13px;
    color: var(--portal-text-secondary);
    line-height: 1.5;
    max-height: 40px;
    overflow: hidden;
    margin-top: 4px;
}

/* ---------- Records List ---------- */
.portal-records-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-record-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
}

.portal-record-field {
    flex: 1;
    min-width: 0;
}

.portal-record-field-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.portal-record-field-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Status Badges ---------- */
.portal-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--portal-radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.portal-status.verified,
.portal-status.active {
    background: var(--portal-success-bg);
    color: var(--portal-success);
}

.portal-status.pending {
    background: var(--portal-warning-bg);
    color: var(--portal-warning);
}

.portal-status.processing {
    background: var(--portal-info-bg);
    color: var(--portal-info);
}

.portal-status.rejected,
.portal-status.expired {
    background: var(--portal-danger-bg);
    color: var(--portal-danger);
}

.portal-status.suspended {
    background: var(--portal-warning-bg);
    color: var(--portal-warning);
}

/* ---------- Portal Forms (Frappe-like) ---------- */
.portal-form {
    max-width: 100%;
}

.portal-form-section {
    margin-bottom: 28px;
}

.portal-form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--portal-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--portal-border);
}

.portal-form-group {
    margin-bottom: 20px;
    position: relative;
}

.portal-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-form-label .required {
    color: var(--portal-primary);
}

.portal-form-input,
.portal-form-select,
.portal-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    font-size: 14px;
    font-family: var(--portal-font);
    background: var(--portal-white);
    color: var(--portal-text);
    transition: border-color var(--portal-transition), box-shadow var(--portal-transition);
    outline: none;
    line-height: 1.5;
}

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

.portal-form-input:focus,
.portal-form-select:focus,
.portal-form-textarea:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.portal-form-input:read-only,
.portal-form-input:disabled,
.portal-form-select:disabled {
    background: var(--portal-bg);
    color: var(--portal-text-secondary);
    cursor: not-allowed;
}

.portal-form-input::placeholder {
    color: var(--portal-text-muted);
}

/* Frappe-like validation states */
.portal-form-group.has-error .portal-form-input,
.portal-form-group.has-error .portal-form-select,
.portal-form-group.has-error .portal-form-textarea {
    border-color: var(--portal-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.portal-form-group.has-error .portal-form-label {
    color: var(--portal-danger);
}

.portal-form-group.has-success .portal-form-input,
.portal-form-group.has-success .portal-form-select {
    border-color: var(--portal-success);
}

.portal-form-error {
    display: none;
    font-size: 12px;
    color: var(--portal-danger);
    margin-top: 4px;
    font-weight: 500;
    align-items: center;
    gap: 4px;
}

.portal-form-group.has-error .portal-form-error {
    display: flex;
}

.portal-form-help {
    font-size: 12px;
    color: var(--portal-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.portal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.portal-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--portal-border-light);
}

/* Alert / Info box (Frappe-like) */
.portal-alert {
    padding: 12px 16px;
    border-radius: var(--portal-radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.portal-alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.portal-alert-warning {
    background: var(--portal-warning-bg);
    border: 1px solid #FDE68A;
    color: #92400E;
}

.portal-alert-info {
    background: var(--portal-info-bg);
    border: 1px solid #93C5FD;
    color: #1E40AF;
}

.portal-alert-success {
    background: var(--portal-success-bg);
    border: 1px solid #86EFAC;
    color: #166534;
}

.portal-alert-danger {
    background: var(--portal-danger-bg);
    border: 1px solid #FCA5A5;
    color: #991B1B;
}

/* ---------- Buttons ---------- */
.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--portal-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--portal-font);
    cursor: pointer;
    transition: all var(--portal-transition);
    border: none;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.portal-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.portal-btn-primary {
    background: var(--portal-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.portal-btn-primary:hover:not(:disabled) {
    background: var(--portal-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.portal-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.portal-btn-secondary {
    background: var(--portal-white);
    color: var(--portal-text-secondary);
    border: 1px solid var(--portal-border);
}

.portal-btn-secondary:hover:not(:disabled) {
    background: var(--portal-bg);
    border-color: #D1D5DB;
}

.portal-btn-danger {
    background: var(--portal-white);
    color: var(--portal-danger);
    border: 1px solid #FCA5A5;
}

.portal-btn-danger:hover:not(:disabled) {
    background: var(--portal-danger-bg);
}

.portal-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.portal-btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

/* Button loading spinner */
.portal-btn.loading {
    color: transparent;
    pointer-events: none;
}

.portal-btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: portal-spin 0.6s linear infinite;
}

.portal-btn-secondary.loading::after,
.portal-btn-danger.loading::after {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--portal-text-secondary);
}

@keyframes portal-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Empty / Loading States ---------- */
.portal-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--portal-text-muted);
}

.portal-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.portal-empty-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--portal-text-secondary);
}

.portal-empty-sub {
    font-size: 14px;
    margin-bottom: 20px;
    color: var(--portal-text-muted);
    line-height: 1.5;
}

.portal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--portal-text-muted);
    font-size: 14px;
    gap: 10px;
}

.portal-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--portal-border);
    border-top-color: var(--portal-primary);
    border-radius: 50%;
    animation: portal-spin 0.7s linear infinite;
}

/* Skeleton loading */
.portal-skeleton {
    background: linear-gradient(90deg, var(--portal-border-light) 25%, #E8E8E8 50%, var(--portal-border-light) 75%);
    background-size: 200% 100%;
    animation: portal-shimmer 1.5s infinite;
    border-radius: var(--portal-radius-sm);
}

@keyframes portal-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Detail Grid (Dashboard profile/preference display) ---------- */
.portal-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.portal-detail-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--portal-border-light);
    border-right: 1px solid var(--portal-border-light);
}

.portal-detail-item:nth-child(4n) {
    border-right: none;
}

.portal-detail-item:nth-last-child(-n+4) {
    border-bottom: none;
}

.portal-detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-text-muted);
    margin-bottom: 4px;
}

.portal-detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-text);
    word-break: break-word;
}

/* ---------- Profile Summary Card ---------- */
.portal-profile-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
}

.portal-profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--portal-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
}

.portal-avatar--blue {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1D4ED8;
}

.portal-avatar--gold {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.portal-avatar--red {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #B91C1C;
}

.portal-avatar--green {
    background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
    color: #15803D;
}

.portal-avatar-initials {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}

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

.portal-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--portal-text);
    margin-bottom: 6px;
}

.portal-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--portal-text-secondary);
}

.portal-profile-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.portal-profile-meta svg {
    color: var(--portal-text-muted);
}

.portal-section-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--portal-primary);
    text-decoration: none;
    transition: opacity var(--portal-transition);
}

.portal-section-action:hover {
    opacity: 0.8;
}

/* ---------- Dashboard Grid (two-column layout) ---------- */
.portal-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

/* Card accent variants */
.portal-card--accent-blue {
    border-top: 3px solid var(--portal-info);
}

.portal-card--accent-gold {
    border-top: 3px solid var(--portal-warning);
}

.portal-card--accent-red {
    border-top: 3px solid var(--portal-primary);
}

.portal-card--accent-green {
    border-top: 3px solid var(--portal-success);
}

/* ---------- Info Card (profile & bank detail cards) ---------- */
.portal-info-card {
    display: flex;
    flex-direction: column;
}

.portal-info-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--portal-border-light);
}

.portal-info-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--portal-text);
    line-height: 1.3;
}

.portal-info-email {
    font-size: 13px;
    color: var(--portal-text-muted);
    margin-top: 2px;
}

.portal-info-rows {
    display: flex;
    flex-direction: column;
}

.portal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--portal-border-light);
    gap: 12px;
}

.portal-info-row:last-child {
    border-bottom: none;
}

.portal-info-row-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--portal-text-muted);
    flex-shrink: 0;
}

.portal-info-row-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-text);
    text-align: right;
    word-break: break-word;
}

.portal-info-divider {
    height: 1px;
    background: var(--portal-border);
    margin: 4px 0;
}

/* ---------- Badges ---------- */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

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

.portal-badge-muted {
    background: var(--portal-border-light);
    color: var(--portal-text-muted);
}

/* ---------- Setup Progress Tracker ---------- */
.portal-setup-progress {
    margin-bottom: 28px;
}

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

.portal-setup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--portal-text);
}

.portal-setup-title svg {
    color: var(--portal-primary);
}

.portal-setup-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--portal-text-muted);
}

.portal-setup-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portal-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--portal-radius-sm);
    text-decoration: none;
    transition: all var(--portal-transition);
}

.portal-step.pending {
    color: var(--portal-text);
    background: var(--portal-bg);
}

.portal-step.pending:hover {
    background: var(--portal-primary-bg);
    color: var(--portal-primary);
}

.portal-step.done {
    color: var(--portal-success);
    pointer-events: none;
}

.portal-step.locked {
    color: var(--portal-text-muted);
    background: var(--portal-bg);
    opacity: 0.55;
    cursor: not-allowed;
}

.portal-step.locked .portal-step-icon {
    color: var(--portal-text-muted);
}

.portal-step-locked-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--portal-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.portal-step-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-step.done .portal-step-icon {
    color: var(--portal-success);
}

.portal-step.pending .portal-step-icon {
    color: var(--portal-text-muted);
}

.portal-step-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--portal-border);
    background: var(--portal-white);
}

.portal-step-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--portal-border-light);
    color: var(--portal-text-muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--portal-transition);
}

.portal-step.pending:hover .portal-step-number {
    background: var(--portal-primary-bg-strong);
    color: var(--portal-primary);
}

.portal-step-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.portal-step.done .portal-step-label {
    text-decoration: line-through;
    opacity: 0.7;
}

.portal-step-arrow {
    flex-shrink: 0;
    color: var(--portal-text-muted);
    opacity: 0;
    transition: opacity var(--portal-transition), transform var(--portal-transition);
}

.portal-step.pending:hover .portal-step-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* ---------- Portal Footer ---------- */
.portal-footer {
    margin-top: 48px;
    padding: 40px 0 28px;
    background: #1e293b;
    color: #cbd5e1;
    width: 100%;
}

.portal-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.portal-footer-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.portal-footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.portal-footer-logo {
    width: 44px;
    height: 44px;
}

.portal-footer-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.portal-footer-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.portal-footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.portal-footer-links a {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.portal-footer-links a:hover {
    color: #ffffff;
}

.portal-footer-divider {
    height: 1px;
    background: #334155;
    margin: 24px 0 16px;
}

.portal-footer-powered {
    margin-left: auto;
}

.portal-footer-powered img {
    max-width: 180px;
    height: auto;
}

.portal-footer-bottom {
    font-size: 12px;
    color: #64748b;
}

/* ---------- KYC Profile Display ---------- */
.portal-profile-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: start;
}

/* ---------- Password Field with Toggle ---------- */
.portal-password-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.portal-password-field .portal-form-input {
    flex: 1;
    width: 100%;
    padding-right: 44px;
}

.portal-password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--portal-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--portal-transition);
}

.portal-password-toggle:hover {
    color: var(--portal-text-secondary);
}

.portal-password-toggle svg {
    width: 20px;
    height: 20px;
}

.portal-profile-photo {
    width: 120px;
    height: 120px;
    border-radius: var(--portal-radius-lg);
    object-fit: cover;
    box-shadow: var(--portal-shadow-md);
    border: 3px solid var(--portal-white);
}

.portal-profile-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.portal-profile-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-profile-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-profile-field-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-text);
}

/* ---------- Dialog / Modal ---------- */
.portal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: portal-fade-in 0.2s ease;
}

@keyframes portal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.portal-modal {
    background: var(--portal-white);
    border-radius: var(--portal-radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: portal-slide-up 0.25s ease;
}

@keyframes portal-slide-up {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.portal-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--portal-text);
}

.portal-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--portal-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--portal-radius-sm);
    transition: background var(--portal-transition);
}

.portal-modal-close:hover {
    background: var(--portal-border-light);
}

.portal-modal-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--portal-text-secondary);
}

/* ---------- Stats Cards ---------- */
.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.portal-stat-card {
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    display: block;
}

.portal-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.portal-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--portal-text);
    line-height: 1;
    margin-bottom: 8px;
}

.portal-stat-link {
    font-size: 13px;
    color: var(--portal-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Toast / Notification ---------- */
.portal-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 600;
    background: var(--portal-white);
    border-radius: var(--portal-radius);
    padding: 14px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    animation: portal-toast-in 0.3s ease;
    border-left: 4px solid var(--portal-success);
}

.portal-toast.error {
    border-left-color: var(--portal-danger);
}

.portal-toast-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-text);
}

@keyframes portal-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .portal-nav-links {
        display: none;
    }

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

    .portal-hamburger {
        display: flex;
    }

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

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

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

    .portal-profile-photo {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .portal-content {
        padding: 12px 16px 60px;
    }

    .portal-welcome {
        padding: 24px 20px;
        border-radius: var(--portal-radius-lg);
    }

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

    .portal-welcome {
        padding: 28px 24px;
    }

    .portal-welcome-name {
        font-size: 24px;
    }

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

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

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

    .portal-detail-item:nth-child(4n) {
        border-right: 1px solid var(--portal-border-light);
    }

    .portal-detail-item:nth-child(2n) {
        border-right: none;
    }

    .portal-detail-item:nth-last-child(-n+4) {
        border-bottom: 1px solid var(--portal-border-light);
    }

    .portal-detail-item:nth-last-child(-n+2) {
        border-bottom: none;
    }

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

    .portal-footer-top {
        flex-direction: column;
        align-items: center;
    }

    .portal-footer-powered {
        margin-left: 0;
    }

    .portal-footer-powered img {
        max-width: 150px;
    }

    .portal-footer-links {
        flex-wrap: wrap;
        gap: 16px;
    }

    .portal-card {
        padding: 20px;
        border-radius: var(--portal-radius-lg);
    }

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

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

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

    .portal-record-field {
        min-width: calc(50% - 6px);
        flex: none;
    }

    .portal-form-actions {
        flex-direction: column;
    }

    .portal-form-actions .portal-btn {
        width: 100%;
    }

    .portal-toast {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .portal-content {
        padding: 10px 12px 48px;
    }

    .portal-nav-inner {
        padding: 10px 16px;
    }

    .portal-brand-title {
        font-size: 13px;
    }

    .portal-brand-subtitle {
        display: none;
    }

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

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

    .portal-record-field {
        min-width: 100%;
    }
}

/* ---------- Session Expired Overlay ---------- */
.portal-session-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
}

.portal-session-card {
    background: var(--portal-white);
    border-radius: var(--portal-radius-xl);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--portal-shadow-lg);
}

.portal-session-icon {
    margin-bottom: 16px;
}

.portal-session-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--portal-text);
    margin: 0 0 8px;
}

.portal-session-card p {
    font-size: 14px;
    color: var(--portal-text-secondary);
    line-height: 1.6;
    margin: 0 0 24px;
}

.portal-session-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--portal-primary);
    color: #fff !important;
    border-radius: var(--portal-radius);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: background var(--portal-transition);
}

.portal-session-btn:hover {
    background: var(--portal-primary-light);
}

/* ============================================================================
   Payment Query modal (Lodge Query on Payment)
   ============================================================================ */
.pq-modal[hidden] { display: none; }
.pq-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pq-modal-dialog {
    position: relative;
    z-index: 1;
    max-width: 520px;
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 26px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.pq-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
.pq-modal-close:hover { background: rgba(0, 0, 0, 0.06); color: #111827; }
.pq-modal-title {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}
.pq-modal-subtitle {
    margin: 0 0 16px;
    color: #4b5563;
    font-size: 0.9rem;
}
.pq-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #111827;
    font-size: 0.9rem;
}
.pq-modal-dialog textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 110px;
    background: rgba(255, 255, 255, 0.9);
}
.pq-modal-dialog textarea:focus {
    outline: none;
    border-color: var(--portal-primary, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.pq-char-count {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.78rem;
    text-align: right;
}
.pq-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.pq-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.pq-btn--primary { background: var(--portal-primary, #dc2626); color: #fff; }
.pq-btn--primary:hover { background: var(--portal-primary-light, #ef4444); transform: translateY(-1px); }
.pq-btn--primary:disabled { opacity: 0.7; cursor: wait; transform: none; }
.pq-btn--secondary {
    background: transparent;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.pq-btn--secondary:hover { background: rgba(0, 0, 0, 0.04); }
.pq-modal-message {
    margin-top: 14px;
    padding: 0;
    font-size: 0.88rem;
    color: #4b5563;
}
.pq-modal-message--err { color: #b91c1c; }
.pq-success {
    text-align: center;
    padding: 16px 4px 4px;
}
.pq-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 30px;
    margin-bottom: 12px;
}
.pq-success-title { margin: 0 0 6px; font-size: 1.15rem; color: #111827; }
.pq-success-text { margin: 0 auto 18px; color: #4b5563; max-width: 380px; }
body.pq-modal-open { overflow: hidden; }
