/* ==========================================================================
   Connect Plus Customer Portal - Modern Hybrid Light & Dark Design System
   Matches Customer Reference UI + 100% Mobile Responsive Architecture
   ========================================================================== */

:root {
    /* --- Light Mode (Default, matching reference image) --- */
    --bg-canvas: #f4f6fa;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #ffffff;
    
    --border-subtle: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-focus: #4f46e5;

    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-bg: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --info: #0ea5e9;
    --info-bg: #f0f9ff;
    --purple: #8b5cf6;
    --purple-bg: #f5f3ff;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --sidebar-width: 270px;
    --mobile-nav-height: 64px;
}

/* --- Dark Mode Theme (User Toggleable) --- */
[data-theme="dark"] {
    --bg-canvas: #090d16;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-sidebar: #0f172a;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.16);
    --border-focus: #6366f1;

    --primary-bg: rgba(99, 102, 241, 0.15);
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info-bg: rgba(14, 165, 233, 0.15);
    --purple-bg: rgba(139, 92, 246, 0.15);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
}

/* --- Base Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Application Shell (Sidebar + Main Content) --- */
.portal-app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- Left Sidebar (Desktop Fixed, Mobile Drawer) --- */
.portal-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    padding: 1.5rem 1.15rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.portal-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portal-sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Sidebar Brand Header */
.portal-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
}

.portal-brand-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.portal-brand-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.portal-theme-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-theme-btn:hover {
    color: var(--primary);
    border-color: var(--primary-light);
    transform: rotate(15deg);
}

/* Sidebar Profile Card (Matching Reference Screenshot) */
.portal-profile-card {
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.15rem 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.portal-profile-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.portal-avatar-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
    flex-shrink: 0;
}

.portal-avatar-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
}

.portal-profile-name {
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    word-break: break-word;
}

.portal-profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-subtle);
    padding-top: 0.75rem;
}

.portal-profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-profile-row .label {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.portal-profile-row .val {
    font-weight: 600;
    color: var(--text-main);
}

.btn-copy-id {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 4px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-copy-id:hover {
    background: var(--primary-bg);
}

/* Sidebar Navigation Links */
.portal-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.portal-nav-item i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: var(--text-dim);
    transition: color 0.2s ease;
}

.portal-nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.portal-nav-item:hover i {
    color: var(--primary);
}

.portal-nav-item.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.portal-nav-item.active i {
    color: #ffffff;
}

.portal-nav-item.logout-item {
    margin-top: auto;
    color: var(--danger);
}

.portal-nav-item.logout-item:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.portal-nav-item.logout-item i {
    color: var(--danger);
}

/* --- Mobile Top Navigation Bar (< 992px) --- */
.portal-mobile-topbar {
    display: none;
    height: var(--mobile-nav-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.portal-mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- Main Content Area --- */
.portal-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - var(--sidebar-width));
}

.portal-main {
    flex: 1;
    width: 100%;
}

/* --- Global Cards --- */
.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* --- Notice Board / Bill Expiry Warning Banner (3-Day Alert Requirement) --- */
.portal-notice-banner {
    border-radius: var(--radius-md);
    padding: 1.15rem 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.portal-notice-urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(245, 158, 11, 0.12) 100%);
    border: 1.5px solid rgba(239, 68, 68, 0.35);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.08);
}

.portal-notice-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    border: 1.5px solid rgba(79, 70, 229, 0.25);
}

.portal-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    flex: 1;
}

.portal-notice-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-notice-urgent .portal-notice-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    animation: pulse 2s infinite;
}

.portal-notice-info .portal-notice-icon {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
}

.portal-notice-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-notice-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.portal-notice-action {
    flex-shrink: 0;
}

/* --- Top Hero / Package Banner (Matching Reference) --- */
.portal-hero-package-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.portal-hero-package-left .subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.portal-package-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1.15rem;
    border-radius: var(--radius-full);
    background: #6366f1;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.portal-hero-shortcuts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-shortcut-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.portal-shortcut-icon:hover {
    color: var(--primary);
    background: var(--primary-bg);
    border-color: var(--primary-light);
}

/* --- 4 Key Status Cards Grid (Matching Reference UI) --- */
.portal-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.portal-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.portal-metric-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

/* Metric Colors Matching Screenshot */
.portal-metric-icon-box.pink {
    background: #fdf2f8;
    color: #ec4899;
}
[data-theme="dark"] .portal-metric-icon-box.pink {
    background: rgba(236, 72, 153, 0.15);
}

.portal-metric-icon-box.teal {
    background: #f0fdfa;
    color: #0d9488;
}
[data-theme="dark"] .portal-metric-icon-box.teal {
    background: rgba(13, 148, 136, 0.15);
}

.portal-metric-icon-box.purple {
    background: #f5f3ff;
    color: #8b5cf6;
}
[data-theme="dark"] .portal-metric-icon-box.purple {
    background: rgba(139, 92, 246, 0.15);
}

.portal-metric-icon-box.amber {
    background: #fffbeb;
    color: #d97706;
}
[data-theme="dark"] .portal-metric-icon-box.amber {
    background: rgba(217, 119, 6, 0.15);
}

.portal-metric-meta {
    flex: 1;
    min-width: 0;
}

.portal-metric-label {
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.portal-metric-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 1.8s infinite;
}

/* --- Main Dashboard 2-Column Grid (Table + Chart/Tickets) --- */
.portal-main-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.portal-main-grid > * {
    min-width: 0;
    max-width: 100%;
}

/* --- Buttons --- */
.btn-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-portal-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-portal-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn-portal-success {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-portal-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-portal-outline {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-medium);
}

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

/* --- Tables & Data Grids --- */
.portal-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.portal-table th {
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1.5px solid var(--border-subtle);
    background: var(--bg-canvas);
}

.portal-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

.portal-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Table Pagination */
.portal-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.portal-pagination-btns {
    display: flex;
    gap: 0.4rem;
}

.portal-page-btn {
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.775rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.portal-page-btn.active, .portal-page-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* --- Badges --- */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

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

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

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

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

/* --- Forms & Inputs --- */
.portal-form-group {
    margin-bottom: 1.25rem;
}

.portal-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.portal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* --- Animations --- */
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Mobile App-Like Experience (Native App Bottom Bar, Quick Strips, Trx Cards)
   ========================================================================== */

/* --- Mobile Bottom App Navigation Bar --- */
.portal-mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    z-index: 1040;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.portal-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    gap: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.portal-bottom-nav-item i {
    font-size: 1.15rem;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portal-bottom-nav-item.active {
    color: var(--primary);
}

.portal-bottom-nav-item.active i {
    transform: translateY(-2px);
    color: var(--primary);
}

.portal-bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 6px;
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
}

/* Floating Elevated Center Pay Button */
.portal-bottom-nav-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    height: 100%;
}

.portal-bottom-nav-center-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45), 0 0 0 4px var(--bg-surface);
    font-size: 1.25rem;
    transform: translateY(-16px);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.portal-bottom-nav-center:active .portal-bottom-nav-center-btn {
    transform: translateY(-12px) scale(0.95);
}

.portal-bottom-nav-center-label {
    position: absolute;
    bottom: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--success);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45), 0 0 0 4px var(--bg-surface);
    }
    50% {
        box-shadow: 0 8px 24px rgba(16, 185, 129, 0.75), 0 0 0 6px rgba(16, 185, 129, 0.25);
    }
}

.portal-bottom-nav-center-btn {
    animation: pulse-glow 3s infinite;
}

/* --- Mobile App Quick Actions Strip --- */
.portal-app-quick-strip {
    display: none;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.65rem;
    padding: 0.25rem 0.25rem 0.75rem;
    margin-bottom: 1.25rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.portal-app-quick-strip::-webkit-scrollbar {
    display: none;
}

.portal-quick-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.portal-quick-action-chip i {
    font-size: 0.85rem;
    color: var(--primary);
}

.portal-quick-action-chip:active {
    transform: scale(0.95);
    background: var(--primary-bg);
    border-color: var(--primary-light);
}

/* --- Mobile App Transaction Cards --- */
.portal-app-trx-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.portal-app-trx-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.portal-app-trx-card:active {
    transform: scale(0.985);
    background: var(--bg-card-hover);
}

.portal-app-trx-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.portal-app-trx-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.portal-app-trx-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.portal-app-trx-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-app-trx-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.portal-app-trx-right {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding-left: 0.25rem;
}

.portal-app-trx-amount {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    line-height: 1.2;
}

/* ==========================================================================
   100% Mobile Responsive Breakpoints
   ========================================================================== */

/* Large Tablets / Laptops */
@media (max-width: 1200px) {
    .portal-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .portal-main-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile & Tablets (< 992px) */
@media (max-width: 992px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }

    .portal-sidebar.sidebar-open {
        transform: translateX(0);
    }

    .portal-mobile-topbar {
        display: flex;
    }

    .portal-mobile-bottom-bar {
        display: flex;
    }

    .portal-app-quick-strip {
        display: flex;
    }

    .portal-content-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 1.15rem 0.85rem calc(95px + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .portal-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .portal-metric-card {
        padding: 1rem 0.85rem;
    }

    .portal-hero-package-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        padding: 1rem 1.25rem;
    }

    .portal-hero-shortcuts {
        width: 100%;
        justify-content: flex-start;
    }

    .portal-notice-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .portal-notice-action {
        width: 100%;
    }

    .portal-notice-action .btn-portal {
        width: 100%;
    }
}

/* Mobile Devices (< 768px): Show App Trx List, Hide Complex Wide Tables */
@media (max-width: 768px) {
    .portal-app-trx-list {
        display: flex;
    }
    .portal-desktop-table-wrap {
        display: none !important;
    }
}

/* Small Smart Phones (< 576px) */
@media (max-width: 576px) {
    .portal-content-wrapper {
        padding: 1rem 0.75rem calc(95px + env(safe-area-inset-bottom, 0px)) !important;
    }

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

    .portal-card {
        padding: 1rem 0.85rem;
        border-radius: var(--radius-md);
    }

    .portal-table th, .portal-table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.775rem;
    }

    .portal-metric-val {
        font-size: 1.05rem;
    }

    .portal-app-trx-card {
        padding: 0.75rem 0.85rem;
        gap: 0.65rem;
    }

    .portal-app-trx-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .portal-app-trx-title {
        font-size: 0.825rem;
    }

    .portal-app-trx-sub {
        font-size: 0.7rem;
    }

    .portal-app-trx-amount {
        font-size: 0.875rem;
    }

    .portal-pagination {
        flex-wrap: wrap;
        gap: 0.65rem;
        justify-content: center;
        text-align: center;
    }
}

