/* =====================================================
   HADHRAMOUT PAY - Premium Banking UI
   Design System v2.0 - Agency Grade
   ===================================================== */

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
    /* Brand */
    --primary: #1a4f8b;
    --primary-hover: #15407a;
    --primary-active: #0f3366;
    --primary-50: #eef4fb;
    --primary-100: #d4e3f5;
    --primary-200: #a9c7eb;

    --gold: #b8941f;
    --gold-hover: #a07e15;
    --gold-50: #fdf8eb;
    --gold-100: #f5eacc;

    /* Neutrals */
    --white: #ffffff;
    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status */
    --success: #059669;
    --success-50: #ecfdf5;
    --warning: #d97706;
    --warning-50: #fffbeb;
    --danger: #dc2626;
    --danger-50: #fef2f2;
    --info: #0284c7;
    --info-50: #f0f9ff;

    /* Elevation */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --shadow-ring: 0 0 0 3px rgb(26 79 139 / 0.12);

    /* Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;

    /* Layout */
    --sidebar-width: 272px;
    --header-height: 60px;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f0f2f5;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-variant-numeric: tabular-nums;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; border: none; }
ul { list-style: none; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Focus ring */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    background: var(--gray-900);
}

.login-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(26, 79, 139, 0.3), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(184, 148, 31, 0.08), transparent),
        linear-gradient(180deg, #0c1929 0%, #132744 50%, #1a3a5c 100%);
}

.login-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.02) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px, 80px 80px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgb(255 255 255 / 0.05);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-hover));
    border-radius: 0 0 3px 3px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.main-logo-img {
    max-width: 210px;
    width: 100%;
    height: auto;
}

.welcome-message {
    font-size: 0.82rem;
    color: var(--gray-400);
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Login Form */
.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.input-icon {
    width: 14px;
    height: 14px;
    color: var(--primary);
    flex-shrink: 0;
    opacity: 0.7;
}

.login-form input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--white);
    color: var(--gray-800);
    transition: all var(--duration) var(--ease);
}

.login-form input::placeholder {
    color: var(--gray-400);
    font-size: 0.82rem;
}

.login-form input:hover {
    border-color: var(--gray-300);
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-ring);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-inline-end: 42px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: color var(--duration) var(--ease);
    border-radius: var(--radius-sm);
}

.password-toggle:hover { color: var(--primary); }
.password-toggle svg { width: 16px; height: 16px; }

/* Login Button */
.login-btn {
    width: 100%;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--duration) var(--ease);
    margin-top: 6px;
}

.login-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgb(26 79 139 / 0.3);
}

.login-btn:active {
    background: var(--primary-active);
    transform: scale(0.99);
}

.login-btn .btn-icon { width: 18px; height: 18px; }

.login-btn .btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.login-btn .spinner {
    width: 18px;
    height: 18px;
    animation: spin 0.7s linear infinite;
}

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

.login-btn.loading .btn-text,
.login-btn.loading .btn-icon { display: none; }

.login-btn.loading .btn-loading { display: flex; }

/* Error Message */
.error-message {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--danger-50);
    border: 1px solid rgb(220 38 38 / 0.15);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Lang Switch */
.lang-switch-login {
    display: block;
    margin: 20px auto 0;
    padding: 8px 20px;
    background: var(--gray-50);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}

.lang-switch-login:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

/* =====================================================
   DASHBOARD LAYOUT
   ===================================================== */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
    overflow-x: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
#sidebar {
    position: fixed !important;
    top: 40px !important;
    width: 272px !important;
    height: calc(100vh - 40px) !important;
    z-index: 40 !important;
    transition: right 0.3s var(--ease), left 0.3s var(--ease) !important;
    background: var(--white) !important;
}

@media (min-width: 1024px) {
    #sidebar {
        top: 0 !important;
        height: 100vh !important;
    }
}

html[dir="rtl"] #sidebar {
    right: -272px !important;
    left: auto !important;
    border-left: 1px solid var(--gray-200);
}
html[dir="rtl"] #sidebar[data-state="open"] { right: 0 !important; }

html[dir="ltr"] #sidebar {
    left: -272px !important;
    right: auto !important;
    border-right: 1px solid var(--gray-200);
}
html[dir="ltr"] #sidebar[data-state="open"] { left: 0 !important; }

@media (min-width: 1024px) {
    html[dir="rtl"] #sidebar { right: 0 !important; }
    html[dir="ltr"] #sidebar { left: 0 !important; }
    html[dir="rtl"] .main-content { margin-right: var(--sidebar-width); margin-left: 0; }
    html[dir="ltr"] .main-content { margin-left: var(--sidebar-width); margin-right: 0; }
}

/* Sidebar unified brand colors */
.sidebar-brand {
    background: linear-gradient(135deg, var(--primary-active) 0%, var(--primary) 100%) !important;
    border-bottom-color: rgba(255, 255, 255, 0.14) !important;
}

.sidebar-avatar {
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.sidebar-nav-link {
    color: var(--gray-700) !important;
    border: 1px solid transparent;
    background: transparent;
}

.sidebar-nav-icon {
    color: var(--gray-500) !important;
    transition: color var(--duration) var(--ease);
}

.sidebar-nav-link:hover {
    background: var(--primary-50) !important;
    color: var(--primary) !important;
    border-color: rgba(26, 79, 139, 0.14);
}

.sidebar-nav-link:hover .sidebar-nav-icon {
    color: var(--primary) !important;
}

.nav-item.active .sidebar-nav-link {
    background: var(--primary) !important;
    color: var(--white) !important;
    border-color: transparent;
    box-shadow: 0 2px 8px rgb(26 79 139 / 0.25);
}

.nav-item.active .sidebar-nav-link .sidebar-nav-icon,
.nav-item.active .sidebar-nav-link span {
    color: var(--white) !important;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
}

/* =====================================================
   TOP HEADER
   ===================================================== */
.top-header {
    height: var(--header-height);
    background: var(--white);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: box-shadow 0.3s var(--ease);
}

.top-header.scrolled {
    box-shadow: 0 1px 8px rgb(0 0 0 / 0.06);
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all var(--duration) var(--ease);
}
.menu-toggle:hover { background: var(--gray-100); }
.menu-toggle svg { width: 20px; height: 20px; }

.top-header h1 {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-switch {
    padding: 6px 14px;
    background: var(--gold);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}
.lang-switch:hover { background: var(--gold-hover); }

.quick-status-header-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}
.quick-status-header-btn svg { width: 16px; height: 16px; }
.quick-status-header-btn:hover { background: var(--primary); color: var(--white); }

/* Session Timer */
.session-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--success);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: background 0.5s var(--ease);
}
.session-timer svg { width: 14px; height: 14px; }
.session-timer.timer-warning { background: var(--warning); }
.session-timer.timer-danger { background: var(--danger); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* =====================================================
   PAGE CONTENT
   ===================================================== */
.page-content {
    display: none;
    padding: 20px 24px;
    flex: 1;
    overflow-x: hidden;
    max-width: 100%;
}
.page-content.active { display: block; }

/* =====================================================
   DASHBOARD HOME
   ===================================================== */
#dashboardHomePage {
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
}

.hp-dashboard-hero {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    min-height: 168px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(184, 148, 31, 0.26);
    background:
        radial-gradient(120% 110% at 100% 0%, rgba(26, 79, 139, 0.24) 0%, rgba(26, 79, 139, 0) 60%),
        linear-gradient(135deg, #0e2442 0%, #1a4f8b 64%, #2f6ea9 100%);
    color: #f8fbff;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hp-dashboard-hero::after {
    content: '';
    position: absolute;
    inset-inline-end: -35px;
    inset-block-end: -45px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    opacity: 0.7;
}

.hp-dashboard-hero-content {
    width: min(100%, 940px);
    max-width: 940px;
    position: relative;
    z-index: 2;
    display: grid;
    gap: 10px;
}

.hp-dashboard-kicker {
    display: inline-block;
    margin-bottom: 0;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.74rem;
    font-weight: 700;
}

.hp-dashboard-identity {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.07) 100%);
    max-width: 560px;
}

.hp-dashboard-user-label {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgba(229, 240, 255, 0.9);
}

.hp-dashboard-hero h2 {
    font-size: 1.28rem;
    line-height: 1.25;
    font-weight: 800;
    margin-bottom: 0;
    min-height: 1.35em;
    color: #ffffff;
}

.hp-dashboard-hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(164px, 1fr));
    gap: 8px;
    max-width: 860px;
    align-items: stretch;
}

.hp-hero-meta-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 34px;
    padding: 0 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.21);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.07) 100%);
    color: rgba(247, 251, 255, 0.96);
    font-size: 0.73rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(2px);
}

.hp-hero-session {
    justify-content: center;
    min-inline-size: 172px;
    font-variant-numeric: tabular-nums;
}

.hp-hero-session[data-state="warning"] {
    border-color: rgba(253, 186, 116, 0.75);
    background: rgba(245, 158, 11, 0.24);
    color: #fff7db;
}

.hp-hero-session[data-state="danger"] {
    border-color: rgba(254, 202, 202, 0.8);
    background: rgba(220, 38, 38, 0.26);
    color: #fff1f1;
}

.hp-dashboard-hero-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 860px;
}

.hp-dashboard-permissions-panel {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.05) 100%);
    max-width: 860px;
}

.hp-dashboard-permissions-label {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgba(229, 240, 255, 0.88);
}

.hp-hero-perm-chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(184, 148, 31, 0.42);
    background: linear-gradient(180deg, rgba(184, 148, 31, 0.28) 0%, rgba(184, 148, 31, 0.17) 100%);
    color: #fff4d4;
    font-size: 0.69rem;
    font-weight: 700;
}

.hp-hero-perm-chip::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    margin-inline-end: 6px;
}

.hp-hero-perm-empty {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(243, 248, 255, 0.86);
    font-size: 0.7rem;
    font-weight: 700;
}

.hp-dashboard-hero-brand-mark {
    position: absolute;
    inset-inline-end: 20px;
    inset-block-end: 18px;
    width: 86px;
    max-width: 18vw;
    height: auto;
    opacity: 0.24;
    filter: brightness(0) invert(1) contrast(1.12) drop-shadow(0 1px 3px rgba(255, 255, 255, 0.18));
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.hp-dashboard-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    z-index: 3;
}

.hp-dashboard-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

.hp-dashboard-badge[data-state="ready"] .hp-dashboard-badge-dot {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}

.hp-dashboard-badge[data-state="error"] .hp-dashboard-badge-dot {
    background: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
}

.hp-dashboard-badge[data-state="loading"] .hp-dashboard-badge-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
    animation: hpPulseDot 1.2s ease-in-out infinite;
}

@keyframes hpPulseDot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.72); }
}

.hp-dashboard-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.hp-dashboard-card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(180deg, #fcfdff 0%, #f7fafc 100%);
}

.hp-dashboard-card-head h3 {
    margin: 0 0 4px;
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--gray-800);
}

.hp-dashboard-card-head p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.hp-readiness-panel {
    margin: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid #dbe7f6;
    background:
        radial-gradient(120% 120% at 0% 100%, rgba(26, 79, 139, 0.08) 0%, rgba(26, 79, 139, 0) 70%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.hp-readiness-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #1a4f8b;
    font-size: 0.9rem;
    font-weight: 800;
}

.hp-readiness-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.2);
}

.hp-readiness-message {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.83rem;
    line-height: 1.75;
}

.hp-readiness-chips {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hp-readiness-actions {
    margin-top: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.hp-readiness-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(26, 79, 139, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    color: #1a4f8b;
    font-size: 0.76rem;
    font-weight: 800;
    transition: all var(--duration) var(--ease);
}

.hp-readiness-refresh-btn:hover:not(:disabled) {
    border-color: rgba(26, 79, 139, 0.45);
    background: linear-gradient(180deg, #ffffff 0%, #e5f0ff 100%);
    box-shadow: 0 10px 20px -16px rgba(26, 79, 139, 0.7);
    transform: translateY(-1px);
}

.hp-readiness-refresh-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.hp-readiness-refresh-note {
    font-size: 0.73rem;
    color: var(--gray-500);
    font-weight: 600;
}

.hp-readiness-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    background: #f1f6ff;
    border: 1px solid #d7e6fb;
    color: #325f9b;
    white-space: nowrap;
}

.hp-readiness-updated {
    color: var(--gray-600);
    background: #f8fafc;
    border-color: #e2e8f0;
}

.hp-readiness-panel[data-state="ready"] .hp-readiness-dot {
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.18);
}

.hp-readiness-panel[data-state="partial"] .hp-readiness-dot {
    background: #0ea5e9;
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.18);
}

.hp-readiness-panel[data-state="error"] .hp-readiness-dot {
    background: #ef4444;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.18);
}

.hp-readiness-panel[data-state="loading"] .hp-readiness-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18);
    animation: hpPulseDot 1.1s ease-in-out infinite;
}

/* Compact readiness card to reduce vertical footprint */
.hp-dashboard-data-card .hp-dashboard-card-head {
    padding: 6px 10px;
}

.hp-dashboard-data-card .hp-dashboard-card-head h3 {
    margin: 0;
    font-size: 0.8rem;
}

.hp-dashboard-data-card .hp-dashboard-card-head p {
    display: none;
}

.hp-dashboard-data-card .hp-readiness-panel {
    margin: 6px 8px;
    padding: 6px 8px;
    border-radius: 9px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 8px;
}

.hp-dashboard-data-card .hp-readiness-line {
    margin-bottom: 0;
    gap: 5px;
    font-size: 0.76rem;
    flex-shrink: 0;
}

.hp-dashboard-data-card .hp-readiness-dot {
    width: 8px;
    height: 8px;
}

.hp-dashboard-data-card .hp-readiness-message {
    display: none;
}

.hp-dashboard-data-card .hp-readiness-chips {
    margin-top: 0;
    gap: 5px;
    min-width: 0;
}

.hp-dashboard-data-card .hp-readiness-chip {
    padding: 2px 7px;
    font-size: 0.6rem;
    line-height: 1.2;
}

.hp-dashboard-data-card .hp-readiness-actions {
    margin-top: 0;
    gap: 6px;
    justify-content: flex-end;
    margin-inline-start: 0;
}

.hp-dashboard-data-card .hp-readiness-refresh-btn {
    width: auto;
    height: 26px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 0.63rem;
    min-width: 0;
}

.hp-dashboard-data-card .hp-readiness-refresh-note {
    display: none;
}

.hp-dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    background:
        linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

.hp-dashboard-action-card {
    --tone-rgb: 26, 79, 139;
    --tone-gold: #d8ab39;
    grid-column: span 4;
    position: relative;
    overflow: hidden;
    min-height: 158px;
    aspect-ratio: auto;
    text-align: start;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(216, 171, 57, 0.34);
    background:
        radial-gradient(130% 100% at 100% 0%, rgba(var(--tone-rgb), 0.38) 0%, rgba(var(--tone-rgb), 0) 56%),
        radial-gradient(120% 95% at 0% 100%, rgba(216, 171, 57, 0.26) 0%, rgba(216, 171, 57, 0) 66%),
        linear-gradient(160deg, #1a4f8b 0%, #123a66 52%, #0d2a4a 100%);
    color: #f2f8ff;
    box-shadow:
        0 20px 32px -24px rgba(8, 16, 28, 0.98),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform var(--duration) var(--ease), box-shadow 260ms var(--ease), border-color var(--duration) var(--ease);
    animation: hpDashboardLift 420ms var(--ease) both;
}

.hp-dashboard-action-card::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255, 232, 170, 0.25) 0%, var(--tone-gold) 52%, rgba(255, 232, 170, 0.15) 100%);
}

.hp-dashboard-action-card::after {
    content: '';
    position: absolute;
    inset-inline-end: -28px;
    inset-block-end: -36px;
    width: 128px;
    height: 128px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(216, 171, 57, 0.24) 0%, rgba(216, 171, 57, 0.02) 70%);
    transform: rotate(20deg);
    pointer-events: none;
}

.hp-dashboard-action-card:nth-child(2) { animation-delay: 40ms; }
.hp-dashboard-action-card:nth-child(3) { animation-delay: 80ms; }
.hp-dashboard-action-card:nth-child(4) { animation-delay: 120ms; }
.hp-dashboard-action-card:nth-child(5) { animation-delay: 160ms; }
.hp-dashboard-action-card:nth-child(6) { animation-delay: 200ms; }
.hp-dashboard-action-card:nth-child(7) { animation-delay: 240ms; }

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

.hp-dashboard-action-card:hover {
    border-color: rgba(224, 182, 76, 0.66);
    transform: translateY(-5px);
    box-shadow:
        0 30px 38px -20px rgba(var(--tone-rgb), 0.45),
        0 18px 24px -18px rgba(10, 21, 35, 0.98);
}

.hp-dashboard-action-card:active {
    transform: translateY(0);
}

.hp-action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hp-action-main {
    display: grid;
    gap: 8px;
    align-content: start;
}

.hp-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff9eb;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(224, 182, 76, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.hp-action-icon svg {
    width: 18px;
    height: 18px;
}

.hp-action-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f8fcff;
    line-height: 1.45;
}

.hp-action-desc {
    font-size: 0.8rem;
    line-height: 1.65;
    color: rgba(236, 245, 255, 0.84);
}

.hp-action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    color: #fff2c9;
    border: 1px solid rgba(224, 182, 76, 0.5);
    background: rgba(224, 182, 76, 0.18);
    white-space: nowrap;
}

.hp-action-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed rgba(224, 182, 76, 0.34);
}

.hp-action-link {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #eef5ff;
}

.hp-action-arrow {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffefc0;
    background: rgba(224, 182, 76, 0.16);
    border: 1px solid rgba(224, 182, 76, 0.45);
    transition: transform var(--duration) var(--ease);
}

.hp-action-arrow svg {
    width: 13px;
    height: 13px;
}

.hp-dashboard-action-card:hover .hp-action-arrow {
    transform: translateX(-2px);
}

html[dir="ltr"] .hp-dashboard-action-card:hover .hp-action-arrow {
    transform: translateX(2px);
}

.hp-dashboard-action-card[data-tone="send"] {
    --tone-rgb: 26, 79, 139;
    --tone-gold: #d8ab39;
}

.hp-dashboard-action-card[data-tone="pay"] {
    --tone-rgb: 20, 92, 123;
    --tone-gold: #dfb54a;
}

.hp-dashboard-action-card[data-tone="detailed"] {
    --tone-rgb: 17, 66, 122;
    --tone-gold: #d6a73a;
}

.hp-dashboard-action-card[data-tone="summary"] {
    --tone-rgb: 34, 93, 155;
    --tone-gold: #e3bb53;
}

.hp-dashboard-action-card[data-tone="statement"] {
    --tone-rgb: 18, 73, 128;
    --tone-gold: #dcb24a;
}

.hp-dashboard-action-card[data-tone="inbox"] {
    --tone-rgb: 27, 84, 139;
    --tone-gold: #dfb54d;
}

.hp-dashboard-action-card[data-tone="contact"] {
    --tone-rgb: 45, 79, 122;
    --tone-gold: #d7a93a;
}

/* =====================================================
   CARDS
   ===================================================== */
.search-card, .results-card, .contact-card, .placeholder-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-25);
}
.card-header svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.card-header h2 { font-size: 0.88rem; font-weight: 700; color: var(--gray-800); }

.card-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Active Filters Badge */
.active-filters-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 6px;
}

.results-count {
    margin-inline-start: auto;
    font-size: 0.78rem;
    color: var(--gray-500);
    padding: 4px 12px;
    background: var(--white);
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-200);
}
.results-count strong { color: var(--primary); font-weight: 700; }

/* =====================================================
   QUICK FILTERS
   ===================================================== */
.quick-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.quick-filters-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quick-filter-btn {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    transition: all var(--duration) var(--ease);
}
.quick-filter-btn:hover {
    border-color: var(--primary-200);
    color: var(--primary);
    background: var(--primary-50);
}
.quick-filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgb(26 79 139 / 0.2);
}

/* =====================================================
   SEARCH FORM
   ===================================================== */
.search-form {
    padding: 18px 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.form-row:last-child { margin-bottom: 0; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--white);
    color: var(--gray-800);
    transition: all var(--duration) var(--ease);
    width: 100%;
}

.form-group textarea {
    height: auto;
    padding: 10px 12px;
    line-height: 1.5;
}

.form-group input::placeholder {
    color: var(--gray-400);
    font-size: 0.8rem;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 14px;
    padding-inline-end: 32px;
}
html[dir="rtl"] .form-group select { background-position: left 10px center; }
html[dir="ltr"] .form-group select { background-position: right 10px center; }

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-ring);
}

.form-group input[type="date"] {
    font-size: 0.82rem;
    color: var(--gray-700);
}

/* Active Filter Indicator */
.form-group.field-active label {
    color: var(--primary);
    font-weight: 700;
}
.form-group.field-active label::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
    margin-inline-start: 6px;
    vertical-align: middle;
    animation: fieldActivePulse 1.5s ease-in-out 1;
}
.form-group.field-active input,
.form-group.field-active select {
    border-color: var(--primary);
    background: rgba(30, 87, 153, 0.03);
    box-shadow: 0 0 0 1px rgba(30, 87, 153, 0.08);
}
@keyframes fieldActivePulse {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* =====================================================
   ADVANCED SEARCH TOGGLE
   ===================================================== */
.advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    white-space: nowrap;
    margin-inline-start: auto;
}
.advanced-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
.advanced-toggle:hover {
    color: var(--primary);
    border-color: var(--primary-200);
    background: var(--primary-50);
}
.advanced-toggle.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-50);
}

.advanced-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.advanced-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                padding 0.3s ease;
    opacity: 0;
    padding: 0 20px;
    border-top: 0px solid transparent;
}
.advanced-fields.open {
    max-height: 250px;
    opacity: 1;
    padding: 14px 20px 4px;
    border-top: 1px solid var(--gray-100);
}

.form-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 8px;
}

.form-actions-inline {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-actions-inline > label { visibility: hidden; }
.form-actions-inline .form-actions { flex: 1; }
.form-actions-inline .btn { flex: 1; min-width: 0; }

.pay-search-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.pay-search-mode-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 700;
    transition: all var(--duration) var(--ease);
}

.pay-search-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pay-search-mode-option.active {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary);
}

.pay-name-results {
    padding: 12px 16px 16px;
    display: grid;
    gap: 10px;
}

.pay-search-result-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pay-search-result-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.pay-search-result-number {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

.pay-search-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
    font-size: 0.74rem;
    flex-wrap: wrap;
}

.pay-search-result-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pay-search-result-meta span:not(:last-child)::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gray-300);
}

.pay-search-result-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 0.74rem;
    flex-shrink: 0;
}

.account-statement-table .as-notes-cell {
    text-align: start;
    white-space: normal;
    line-height: 1.55;
}

.account-statement-table {
    min-width: 980px;
    table-layout: fixed;
}

.account-statement-table col.as-col-date { width: 11%; }
.account-statement-table col.as-col-document { width: 12%; }
.account-statement-table col.as-col-record { width: 7%; }
.account-statement-table col.as-col-notes { width: 34%; }
.account-statement-table col.as-col-debit { width: 11%; }
.account-statement-table col.as-col-credit { width: 11%; }
.account-statement-table col.as-col-balance { width: 14%; }

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

.account-statement-table th:not(:nth-child(4)):not(:last-child),
.account-statement-table td:not(.as-notes-cell):not(.as-balance-cell) {
    white-space: nowrap;
}

.account-statement-table .as-balance-cell {
    white-space: normal;
}

.as-balance-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: var(--radius-full);
    background: var(--primary-50);
    border: 1px solid rgba(26, 79, 139, 0.18);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

.account-statement-header-right {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.account-statement-header-right .results-count {
    margin-inline-start: 0;
}

.account-statement-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.account-statement-action-btn {
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.account-statement-action-btn svg {
    width: 14px;
    height: 14px;
}

.account-statement-action-btn:hover {
    color: var(--primary);
    border-color: rgba(26, 79, 139, 0.24);
    box-shadow: 0 2px 8px rgba(26, 79, 139, 0.12);
}

.inbox-filter-row {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.inbox-list {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.inbox-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    padding: 12px;
    display: grid;
    gap: 8px;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.inbox-item.is-unread {
    border-color: rgba(26, 79, 139, 0.28);
    box-shadow: 0 0 0 1px rgba(26, 79, 139, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.inbox-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.inbox-item-head h3 {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--gray-800);
}

.inbox-item-date {
    font-size: 0.7rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.inbox-item-body {
    margin: 0;
    font-size: 0.79rem;
    color: var(--gray-700);
    line-height: 1.7;
    white-space: pre-wrap;
}

.inbox-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--gray-500);
    font-size: 0.73rem;
    font-weight: 600;
}

.inbox-empty {
    padding: 22px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--gray-500);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 18px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled,
.btn.is-loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgb(26 79 139 / 0.25);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* =====================================================
   DETAILED STATS BAR
   ===================================================== */
.detailed-stats-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--white) 0%, #f8fafc 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), 0 0 0 1px rgba(30,87,153,0.04);
    margin-bottom: 16px;
    overflow: hidden;
}

/* Sections */
.dstat-section {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 20px;
    position: relative;
}
.dstat-section-count {
    min-width: 130px;
    background: linear-gradient(135deg, rgba(30,87,153,0.04) 0%, transparent 100%);
}
.dstat-section-amounts {
    flex: 1;
    min-width: 200px;
}
.dstat-section-status {
    flex: 1;
    min-width: 180px;
}
.dstat-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dstat-section-count .dstat-section-icon {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(30,87,153,0.25);
}
.dstat-section-amounts .dstat-section-icon {
    background: linear-gradient(135deg, var(--secondary), #f59e0b);
    color: white;
    box-shadow: 0 2px 8px rgba(212,164,34,0.25);
}
.dstat-section-icon svg {
    width: 18px;
    height: 18px;
}
.dstat-section-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.dstat-label {
    font-size: 0.7rem;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dstat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Vertical Divider */
.dstat-divider-v {
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gray-200) 20%, var(--gray-200) 80%, transparent);
    flex-shrink: 0;
}

/* Currency Breakdown Cards */
.dstat-currencies {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.dstat-currency-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all var(--duration) var(--ease);
}
.dstat-currency-card:hover {
    border-color: var(--primary-200);
    box-shadow: 0 2px 6px rgba(30,87,153,0.08);
}
.dstat-currency-flag {
    font-size: 1.3rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.dstat-currency-amount {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
}
.dstat-currency-count {
    font-size: 0.62rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* Status Chips */
.dstat-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.dstat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid;
    transition: all var(--duration) var(--ease);
}
.dstat-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.dstat-chip .dstat-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.dstat-chip-available { background: var(--info-50); color: var(--info); border-color: rgba(2,132,199,0.15); }
.dstat-chip-received { background: var(--success-50); color: var(--success); border-color: rgba(5,150,105,0.15); }
.dstat-chip-pending { background: var(--warning-50); color: var(--warning); border-color: rgba(217,119,6,0.15); }
.dstat-chip-stopped { background: var(--danger-50); color: var(--danger); border-color: rgba(220,38,38,0.15); }
.dstat-chip-closed { background: var(--gray-100); color: var(--gray-500); border-color: rgba(107,114,128,0.12); }
.dstat-chip-processing { background: #fef3c7; color: #92400e; border-color: rgba(146,64,14,0.12); }

/* =====================================================
   TABLE FILTER BAR
   ===================================================== */
.table-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
    flex-wrap: wrap;
}

.table-filter-search {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
    display: flex;
    align-items: center;
}
.table-filter-search > svg {
    position: absolute;
    inset-inline-start: 10px;
    width: 15px;
    height: 15px;
    color: var(--gray-400);
    pointer-events: none;
}
.table-filter-search input {
    width: 100%;
    height: 36px;
    padding: 0 32px;
    padding-inline-start: 34px;
    padding-inline-end: 32px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    background: var(--gray-50);
    color: var(--gray-800);
    transition: all var(--duration) var(--ease);
}
.table-filter-search input::placeholder { color: var(--gray-400); font-size: 0.78rem; }
.table-filter-search input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: var(--shadow-ring);
}
.table-filter-clear {
    position: absolute;
    inset-inline-end: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all var(--duration) var(--ease);
}
.table-filter-clear:hover { background: var(--gray-200); color: var(--gray-600); }
.table-filter-clear svg { width: 12px; height: 12px; }

.table-filter-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.table-chip {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--gray-50);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}
.table-chip:hover { border-color: var(--primary-200); color: var(--primary); background: var(--primary-50); }
.table-chip.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.table-filter-count {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 600;
    margin-inline-start: auto;
    white-space: nowrap;
    padding: 4px 10px;
    background: var(--gray-50);
    border-radius: var(--radius-full);
}
.table-filter-count span { color: var(--primary); font-weight: 700; }

/* =====================================================
   DATA TABLE
   ===================================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1060px;
    table-layout: fixed;
}

/* Column widths based on data analysis */
.data-table .col-row      { width: 50px; }     /* # */
.data-table .col-number   { width: 155px; }    /* رقم الحوالة - 17 char monospace */
.data-table .col-date     { width: 95px; }     /* التاريخ - 10 char */
.data-table .col-sender   { width: 165px; }    /* المرسل - avg 23 char */
.data-table .col-receiver { width: 190px; }    /* المستلم - avg 24, max 34 char */
.data-table .col-amount   { width: 95px; }     /* المبلغ - max 6 char */
.data-table .col-currency { width: 120px; }     /* العملة - علم + اسم */
.currency-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.currency-flag { font-size: 1.4rem; line-height: 1; }
.data-table .col-target   { width: 90px; }     /* الوجهة - max 9 char */
.data-table .col-status   { width: 115px; }    /* الحالة - max 12 char + badge */
.data-table .col-attach   { width: 80px; }     /* المرفقات */

.data-table thead th {
    background: var(--primary);
    color: var(--white);
    padding: 12px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th:first-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.data-table th:last-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
html[dir="ltr"] .data-table th:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
html[dir="ltr"] .data-table th:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.data-table td {
    padding: 12px 12px;
    text-align: center;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Name columns: right-align for RTL, allow wrapping */
.data-table td:nth-child(4),
.data-table td:nth-child(5) {
    text-align: start;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

/* Amount: bold, no wrap */
.data-table td:nth-child(6) {
    white-space: nowrap;
    font-weight: 700;
}

.data-table tbody tr {
    transition: background var(--duration) var(--ease);
}

/* Zebra */
.data-table tbody tr:nth-child(even):not(.empty-row):not(.expand-row) {
    background: var(--gray-25);
}

/* Clickable Row */
.data-table tbody tr.clickable-row {
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.data-table tbody tr.clickable-row:hover {
    background: var(--primary-50);
    box-shadow: inset 3px 0 0 var(--primary);
}
html[dir="ltr"] .data-table tbody tr.clickable-row:hover {
    box-shadow: inset -3px 0 0 var(--primary);
}
.data-table tbody tr.clickable-row.expanded {
    background: var(--primary-50);
    box-shadow: inset 3px 0 0 var(--gold);
}
html[dir="ltr"] .data-table tbody tr.clickable-row.expanded {
    box-shadow: inset -3px 0 0 var(--gold);
}
.data-table tbody tr.clickable-row:active {
    background: var(--primary-100);
}

/* Expand Icon */
.row-expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--gray-200);
    transition: all 0.25s var(--ease);
    color: var(--gray-400);
    margin-inline-end: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
.row-expand-icon svg { width: 11px; height: 11px; transition: transform 0.25s var(--ease); }
.clickable-row:hover .row-expand-icon {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}
.expanded .row-expand-icon {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgb(26 79 139 / 0.25);
}
.expanded .row-expand-icon svg { transform: rotate(90deg); }

/* Expand Row */
.expand-row { background: var(--gray-50) !important; }
.expand-row td { padding: 0 !important; border-bottom: 2px solid var(--primary-200) !important; }

.expand-content {
    padding: 16px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    border-inline-start: 3px solid var(--gold);
    margin-inline-start: 16px;
}
.expand-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}
.expand-label { font-size: 0.72rem; color: var(--gray-400); font-weight: 600; letter-spacing: 0.03em; }
.expand-value { font-size: 0.88rem; color: var(--gray-800); font-weight: 600; }

/* Row Animation */
@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.data-table tbody tr.row-animate {
    animation: fadeInRow 0.25s var(--ease) forwards;
    opacity: 0;
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    padding: 56px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.empty-state-icon svg { width: 32px; height: 32px; color: var(--gray-400); }
.empty-state p { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; color: var(--gray-600); }
.empty-state span {
    font-size: 0.82rem;
    color: var(--gray-400);
    display: block;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.5;
}

.empty-state-no-results .empty-state-icon { background: var(--warning-50); }
.empty-state-no-results .empty-state-icon svg { color: var(--warning); }

/* =====================================================
   STATUS BADGES
   ===================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1.5px solid transparent;
    position: relative;
}
.status-badge .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.status-badge .status-icon { width: 13px; height: 13px; }

.status-available { background: var(--info-50); color: var(--info); border-color: rgba(2, 132, 199, 0.15); }
.status-received { background: var(--success-50); color: var(--success); border-color: rgba(5, 150, 105, 0.15); }
.status-pending { background: var(--warning-50); color: var(--warning); border-color: rgba(217, 119, 6, 0.15); }
.status-stopped { background: var(--danger-50); color: var(--danger); border-color: rgba(220, 38, 38, 0.15); }
.status-closed { background: var(--gray-100); color: var(--gray-500); border-color: rgba(107, 114, 128, 0.12); }
.status-processing { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.12); }

/* Cell Styles */
.transfer-number {
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
}

.amount-cell {
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.target-name {
    font-size: 0.84rem;
    color: var(--gray-600);
}

.text-muted {
    color: var(--gray-400);
    font-size: 0.7rem;
    display: block;
    margin-top: 1px;
}

.phone-hint {
    color: var(--primary-600);
    font-size: 0.75rem;
    display: block;
    margin-top: 2px;
    direction: ltr;
    unicode-bidi: isolate;
}

.no-attachments { color: var(--gray-300); font-size: 0.8rem; }

/* Attachments Button */
.attachments-btn {
    padding: 6px 12px;
    background: var(--gold);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 0.73rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--duration) var(--ease);
}
.attachments-btn svg { width: 13px; height: 13px; }
.attachments-btn .attach-count {
    background: rgb(255 255 255 / 0.25);
    padding: 1px 5px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
}
.attachments-btn:hover {
    background: var(--gold-hover);
    box-shadow: 0 2px 8px rgb(184 148 31 / 0.3);
}

/* Skeleton Loading */
.skeleton-row td { padding: 12px 14px; }
.skeleton-cell {
    height: 14px;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    margin: 0 auto;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-cell.w-short { width: 36px; }
.skeleton-cell.w-medium { width: 72px; }
.skeleton-cell.w-long { width: 110px; }
.skeleton-cell.w-badge { width: 64px; height: 22px; border-radius: var(--radius-full); }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.page-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 14px;
    background: var(--white);
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    transition: all var(--duration) var(--ease);
}
.page-btn svg { width: 14px; height: 14px; }
.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.page-numbers { display: flex; gap: 4px; }
.page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    transition: all var(--duration) var(--ease);
}
.page-number:hover { background: var(--gray-100); border-color: var(--gray-300); }
.page-number.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* =====================================================
   SUMMARY REPORT
   ===================================================== */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: all var(--duration) var(--ease);
}
.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-total .stat-icon { background: var(--primary-50); color: var(--primary); }
.stat-amount .stat-icon { background: var(--gold-50); color: var(--gold); }
.stat-received .stat-icon { background: var(--success-50); color: var(--success); }
.stat-not-received .stat-icon { background: var(--danger-50); color: var(--danger); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { display: block; font-size: 0.72rem; color: var(--gray-400); font-weight: 600; margin-bottom: 2px; }
.stat-value { display: block; font-size: 1.35rem; font-weight: 800; color: var(--gray-800); line-height: 1.2; }
.stat-sub { font-size: 0.68rem; color: var(--gray-400); }

/* Status Breakdown Grid */
/* Summary Currency Cards */
.summary-currency-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.summary-currency-card {
    flex: 1;
    min-width: 180px;
    background: var(--white);
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}
.summary-currency-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30,87,153,0.1);
    border-color: rgba(30,87,153,0.15);
}
.summary-currency-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 4px 4px 0;
}
.summary-currency-card:nth-child(1)::before { background: linear-gradient(to bottom, #1e5799, #3b82f6); }
.summary-currency-card:nth-child(2)::before { background: linear-gradient(to bottom, #059669, #34d399); }
.summary-currency-card:nth-child(3)::before { background: linear-gradient(to bottom, #7c3aed, #a78bfa); }
.summary-currency-card:nth-child(4)::before { background: linear-gradient(to bottom, #dc2626, #f87171); }
.summary-currency-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid var(--gray-100);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05));
}
.summary-currency-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.summary-currency-name {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 500;
}
.summary-currency-amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.summary-currency-count {
    font-size: 0.68rem;
    color: var(--gray-400);
}

.summary-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
    flex: 1;
    min-width: 140px;
}
.stat-mini-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-mini-icon svg { width: 18px; height: 18px; }
.stat-mini-info { display: flex; flex-direction: column; gap: 1px; }
.stat-mini-label { font-size: 0.72rem; color: var(--gray-500); font-weight: 500; }
.stat-mini-value { font-size: 1.1rem; font-weight: 800; color: var(--gray-800); }

.stat-available .stat-mini-icon { background: var(--info-50); color: var(--info); }
.stat-received .stat-mini-icon { background: var(--success-50); color: var(--success); }
.stat-pending .stat-mini-icon { background: var(--warning-50); color: var(--warning); }
.stat-stopped .stat-mini-icon { background: var(--danger-50); color: var(--danger); }
.stat-closed .stat-mini-icon { background: var(--gray-100); color: var(--gray-500); }
.stat-processing .stat-mini-icon { background: #fef3c7; color: #92400e; }

.summary-placeholder { padding: 16px; }

/* =====================================================
   CONTACT FORM
   ===================================================== */
.contact-form {
    padding: 20px;
    max-width: 560px;
}

.contact-form .form-group { margin-bottom: 16px; }

.contact-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 5px;
}

.contact-form .input-icon {
    width: 14px;
    height: 14px;
    color: var(--primary);
    opacity: 0.7;
    flex-shrink: 0;
}

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

.char-counter {
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--gray-400);
    text-align: end;
}
.char-counter.near-limit { color: var(--warning); }
.char-counter.at-limit { color: var(--danger); }

/* Contact Success */
.contact-success {
    padding: 44px 20px;
    text-align: center;
}

.success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--success-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop 0.35s var(--ease);
}
@keyframes pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.success-icon svg { width: 28px; height: 28px; color: var(--success); }
.contact-success h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.contact-success p { font-size: 0.82rem; color: var(--gray-500); max-width: 320px; margin: 0 auto; }

/* =====================================================
   MODAL
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgb(17 24 39 / 0.6);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 14px 20px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
}
.modal-header h3 svg { width: 18px; height: 18px; color: var(--gold-100); }

.modal-transfer-info {
    font-size: 0.73rem;
    font-weight: 400;
    opacity: 0.8;
    margin-inline-start: 6px;
    padding: 2px 8px;
    background: rgb(255 255 255 / 0.15);
    border-radius: var(--radius);
}

.modal-close {
    width: 30px;
    height: 30px;
    background: rgb(255 255 255 / 0.12);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: background var(--duration) var(--ease);
}
.modal-close svg { width: 14px; height: 14px; }
.modal-close:hover { background: rgb(255 255 255 / 0.22); }

.modal-body {
    padding: 20px;
    max-height: calc(85vh - 56px);
    overflow-y: auto;
}

/* Attachment Controls */
.attachment-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
}
.control-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-500);
    transition: all var(--duration) var(--ease);
}
.control-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.control-btn svg { width: 16px; height: 16px; }

.attachment-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.attachment-tab {
    padding: 8px 16px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
    border: 1.5px solid transparent;
}
.attachment-tab:hover { background: var(--gray-200); }
.attachment-tab.active {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold-hover);
}

.attachment-viewer {
    min-height: 260px;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--gray-25);
}
.attachment-viewer img { max-width: 100%; max-height: 380px; object-fit: contain; }

.attachment-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
}
.attachment-image-wrapper img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    transition: transform 0.3s var(--ease);
}

.viewer-placeholder { text-align: center; color: var(--gray-400); padding: 36px; }
.viewer-placeholder svg { width: 48px; height: 48px; margin-bottom: 12px; color: var(--gray-300); }

.viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}
.viewer-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Fullscreen */
.fullscreen-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgb(0 0 0 / 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fullscreen-viewer img { max-width: 95%; max-height: 95vh; object-fit: contain; }

.fullscreen-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgb(255 255 255 / 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background var(--duration) var(--ease);
}
.fullscreen-close:hover { background: rgb(255 255 255 / 0.25); }
.fullscreen-close svg { width: 22px; height: 22px; }

/* =====================================================
   CONFIRM DIALOG
   ===================================================== */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgb(17 24 39 / 0.5);
    backdrop-filter: blur(4px);
}

.confirm-container {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.confirm-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    background: var(--danger-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}
.confirm-icon svg { width: 26px; height: 26px; }

.confirm-container h3 { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.confirm-container p { font-size: 0.82rem; color: var(--gray-500); margin-bottom: 20px; }

.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-yes {
    background: var(--danger) !important;
    min-width: 110px;
}
.confirm-yes:hover {
    background: #b91c1c !important;
    box-shadow: 0 2px 8px rgb(220 38 38 / 0.3) !important;
}
.confirm-no { min-width: 110px; }

/* =====================================================
   FOOTER
   ===================================================== */
.app-footer {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.73rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    margin-top: auto;
}
.footer-version { font-size: 0.68rem; color: var(--gray-300); }

/* =====================================================
   TOAST
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 260px;
    border: 1px solid var(--gray-100);
    animation: toastIn 0.3s var(--ease);
}

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

.toast.toast-success { border-right: 3px solid var(--success); }
.toast.toast-error { border-right: 3px solid var(--danger); }
.toast.toast-warning { border-right: 3px solid var(--warning); }
.toast.toast-info { border-right: 3px solid var(--info); }

html[dir="ltr"] .toast { border-right: none; }
html[dir="ltr"] .toast.toast-success { border-left: 3px solid var(--success); }
html[dir="ltr"] .toast.toast-error { border-left: 3px solid var(--danger); }
html[dir="ltr"] .toast.toast-warning { border-left: 3px solid var(--warning); }
html[dir="ltr"] .toast.toast-info { border-left: 3px solid var(--info); }

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-message { flex: 1; font-size: 0.82rem; color: var(--gray-700); font-weight: 500; }

/* Count-up */
@keyframes countPop {
    0% { transform: scale(0.85); opacity: 0; }
    60% { transform: scale(1.03); }
    100% { transform: scale(1); opacity: 1; }
}
.count-up-animated { animation: countPop 0.35s var(--ease) forwards; }

/* Placeholder Card */
.placeholder-card { padding: 60px 20px; text-align: center; }
.placeholder-card svg { width: 64px; height: 64px; color: var(--gray-300); margin-bottom: 16px; }
.placeholder-card h2 { font-size: 1.1rem; color: var(--gray-700); margin-bottom: 6px; }
.placeholder-card p { color: var(--gray-400); font-size: 0.88rem; }

/* Logout Button (Tailwind styled in HTML) */
.logout-btn {
    width: 100%;
    padding: 10px;
    background: var(--white);
    color: var(--danger);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    transition: all var(--duration) var(--ease);
}
.logout-btn svg { width: 16px; height: 16px; }
.logout-btn:hover { background: var(--danger-50); border-color: var(--danger); }

/* =====================================================
   CHARTS
   ===================================================== */
.charts-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    margin-top: 24px;
    overflow: hidden;
    position: relative;
}
.charts-section::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--primary) 100%);
}
.charts-section .card-header {
    background: linear-gradient(135deg, rgba(30,87,153,0.03) 0%, rgba(212,164,34,0.03) 100%);
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}
.charts-section .card-header svg {
    width: 22px;
    height: 22px;
    color: var(--secondary);
    filter: drop-shadow(0 1px 2px rgba(212,164,34,0.3));
}
.charts-section .card-header h2 {
    font-size: 0.95rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(30,87,153,0.01) 0%, transparent 100%);
}
.chart-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 2px 8px rgba(30,87,153,0.04);
    position: relative;
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}
.chart-card:hover {
    box-shadow: 0 4px 16px rgba(30,87,153,0.08);
    border-color: rgba(30,87,153,0.12);
    transform: translateY(-2px);
}
.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 3px;
    height: 100%;
    border-radius: 0 3px 3px 0;
}
.chart-card:nth-child(1)::before { background: linear-gradient(to bottom, var(--primary), #2563eb); }
.chart-card:nth-child(2)::before { background: linear-gradient(to bottom, var(--secondary), #f59e0b); }
.chart-card:nth-child(3)::before { background: linear-gradient(to bottom, var(--primary), var(--secondary)); }
.chart-card h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: 14px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.chart-card h3::before,
.chart-card h3::after {
    content: '';
    flex: 1;
    max-width: 40px;
    height: 1px;
}
.chart-card:nth-child(1) h3::before,
.chart-card:nth-child(1) h3::after { background: linear-gradient(90deg, transparent, rgba(30,87,153,0.2)); }
.chart-card:nth-child(2) h3::before,
.chart-card:nth-child(2) h3::after { background: linear-gradient(90deg, transparent, rgba(212,164,34,0.2)); }
.chart-card:nth-child(3) h3::before,
.chart-card:nth-child(3) h3::after { background: linear-gradient(90deg, transparent, rgba(30,87,153,0.15)); }
.chart-card h3::before { transform: rotate(180deg); }

.chart-card.chart-wide { grid-column: span 2; }
.chart-container { position: relative; height: 250px; width: 100%; }
.chart-card.chart-wide .chart-container { height: 290px; }

/* =====================================================
   SEND TRANSFER FORM
   ===================================================== */
.send-transfer-form .search-card { margin-bottom: 16px; }

.section-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    padding: 12px 0 8px;
    margin-top: 4px;
    border-top: 1px dashed var(--gray-200);
}

.commission-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--gold-50) 100%);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius);
    margin-top: 14px;
}
.commission-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.commission-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}
.commission-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.form-submit-bar {
    padding: 16px 0;
    display: flex;
    justify-content: center;
}
.btn-lg {
    height: 48px;
    padding: 0 32px;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
}
.btn-lg svg { width: 18px; height: 18px; }

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 2px 8px rgb(220 38 38 / 0.3);
}

/* =====================================================
   PAY TRANSFER PAGE
   ===================================================== */
.transfer-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.transfer-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}
.transfer-detail-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 600;
    letter-spacing: 0.03em;
}
.transfer-detail-value {
    font-size: 0.9rem;
    color: var(--gray-800);
    font-weight: 700;
}

/* =====================================================
   CONFIRM DIALOG VARIANTS
   ===================================================== */
.confirm-icon-send {
    background: var(--primary-50);
    color: var(--primary);
}
.confirm-icon-pay {
    background: var(--success-50);
    color: var(--success);
}
.confirm-icon-success {
    background: var(--success-50);
    color: var(--success);
}
.confirm-icon-danger {
    background: var(--danger-50);
    color: var(--danger);
}
.confirm-icon-info {
    background: var(--info-50);
    color: var(--info);
}

.confirm-summary {
    text-align: start;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    line-height: 1.7;
}
.confirm-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}
.confirm-summary .summary-label {
    color: var(--gray-500);
    font-weight: 500;
}
.confirm-summary .summary-value {
    color: var(--gray-800);
    font-weight: 700;
}

.result-container {
    max-width: 420px;
}
.result-details {
    text-align: start;
    background: var(--success-50);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.result-details .result-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.82rem;
    border-bottom: 1px dashed rgba(5, 150, 105, 0.1);
}
.result-details .result-row:last-child { border-bottom: none; }
.result-details .result-label {
    color: var(--gray-600);
    font-weight: 500;
}
.result-details .result-value {
    color: var(--gray-800);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Quick Status Result */
#quickStatusResult {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    text-align: start;
}
.quick-status-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.82rem;
}
.quick-status-label {
    color: var(--gray-500);
    font-weight: 500;
}
.quick-status-value {
    color: var(--gray-800);
    font-weight: 700;
}

/* Stop button in expanded row */
.stop-transfer-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--danger-50);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}
.stop-transfer-btn:hover {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 2px 6px rgb(220 38 38 / 0.25);
}
.stop-transfer-btn svg { width: 13px; height: 13px; }

/* =====================================================
   RESPONSIVE - Laptop (1280px)
   ===================================================== */
@media (min-width: 1400px) {
    :root { --sidebar-width: 288px; }
    .page-content { padding: 24px 32px; }
    .top-header { padding: 0 32px; }
    .search-form { padding: 20px 24px; }
    .form-row { gap: 18px; }
}

@media (max-width: 1280px) {
    .top-header h1 { font-size: 0.95rem; }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-value { font-size: 1.2rem; }
}

/* =====================================================
   RESPONSIVE - Tablet (1024px)
   ===================================================== */
@media (max-width: 1024px) {
    .main-content { margin: 0; }
    .menu-toggle { display: flex; }

    .top-header { padding: 0 14px; gap: 8px; }
    .top-header h1 { font-size: 0.9rem; }

    .page-content { padding: 14px; }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .search-form { padding: 14px 16px; }
    .card-header { padding: 12px 16px; }
    .card-header h2 { font-size: 0.85rem; }

    .summary-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .quick-filters { padding: 8px 16px; }
    .quick-filter-btn { padding: 4px 12px; font-size: 0.72rem; }

    .charts-grid { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
    .chart-card.chart-wide { grid-column: span 1; }
    .chart-card { padding: 14px; }
    .chart-container { height: 220px; }

    .hp-dashboard-actions-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 14px; }
    .hp-dashboard-action-card { grid-column: span 3; min-height: 152px; aspect-ratio: auto; }
    .hp-dashboard-action-card:nth-child(1),
    .hp-dashboard-action-card:nth-child(2) { grid-column: span 3; }
}

/* =====================================================
   RESPONSIVE - Mobile (768px)
   ===================================================== */
@media (max-width: 768px) {
    html { font-size: 14px; }

    /* Detailed Stats */
    .detailed-stats-bar { flex-direction: column; }
    .dstat-section { padding: 10px 14px; }
    .dstat-section-count { min-width: 0; }
    .dstat-divider-v { width: 100%; height: 1px; background: linear-gradient(to right, transparent, var(--gray-200) 20%, var(--gray-200) 80%, transparent); }
    .dstat-chips { width: 100%; }
    .dstat-chip { font-size: 0.68rem; padding: 3px 8px; }
    .dstat-currencies { gap: 6px; }
    .dstat-currency-card { padding: 4px 8px; }
    .dstat-currency-amount { font-size: 0.8rem; }

    /* Table Filter */
    .table-filter-bar { padding: 8px 12px; gap: 8px; }
    .table-filter-search { max-width: 100%; min-width: 0; }
    .table-filter-chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 4px; -webkit-overflow-scrolling: touch; }
    .table-chip { padding: 4px 10px; font-size: 0.7rem; flex-shrink: 0; }
    .table-filter-count { width: 100%; text-align: center; }

    /* Login */
    .login-container { padding: 14px; }
    .login-card { padding: 32px 22px 26px; }
    .main-logo-img { max-width: 180px; }
    .login-form input { height: 44px; }
    .login-btn { height: 46px; }

    /* Header */
    .top-header { height: 50px; padding: 0 12px; }
    .top-header h1 { font-size: 0.85rem; }
    .lang-switch { padding: 4px 10px; font-size: 0.68rem; }
    .quick-status-header-btn { width: 30px; height: 30px; }
    .quick-status-header-btn svg { width: 14px; height: 14px; }
    .session-timer { padding: 4px 8px; font-size: 0.72rem; }
    .session-timer svg { width: 12px; height: 12px; }

    /* Form */
    .form-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
    .search-form { padding: 12px 14px; }
    .form-group input, .form-group select { height: 40px; font-size: 0.82rem; }
    .form-group label { font-size: 0.72rem; }
    .form-group input::placeholder { font-size: 0.78rem; }
    .form-actions-inline > label { display: none; }
    .form-actions .btn { flex: 1; }
    .btn { height: 40px; font-size: 0.78rem; padding: 0 14px; }
    .inbox-filter-row { grid-template-columns: 1fr; }
    .pay-search-result-item { flex-direction: column; align-items: stretch; }
    .pay-search-result-btn { width: 100%; }

    /* Advanced Search */
    .advanced-toggle { height: 38px; font-size: 0.75rem; padding: 0 12px; width: 100%; justify-content: center; margin-top: 4px; }
    .form-actions-bar { flex-wrap: wrap; }
    .form-actions-bar .btn { flex: 1; }
    .form-actions-bar .advanced-toggle { flex-basis: 100%; margin-inline-start: 0; }
    .advanced-fields.open { max-height: 400px; padding: 10px 14px 4px; }

    /* Content */
    .page-content { padding: 10px; }
    .hp-dashboard-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 16px 14px 17px;
        min-height: auto;
    }
    .hp-dashboard-identity { padding: 8px 10px; border-radius: 10px; }
    .hp-dashboard-user-label { font-size: 0.65rem; }
    .hp-dashboard-hero h2 { font-size: 1.06rem; margin-bottom: 4px; }
    .hp-dashboard-hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .hp-hero-meta-item { height: 30px; padding: 0 8px; font-size: 0.67rem; border-radius: 8px; }
    .hp-hero-session { min-inline-size: 0; }
    .hp-dashboard-permissions-panel { padding: 8px 10px; gap: 6px; border-radius: 10px; }
    .hp-dashboard-permissions-label { font-size: 0.63rem; margin-top: 0; }
    .hp-dashboard-hero-permissions { margin-top: 0; gap: 5px; }
    .hp-dashboard-hero-brand-mark {
        width: 70px;
        max-width: 24vw;
        inset-inline-end: 14px;
        inset-block-end: 17px;
        opacity: 0.22;
    }
    .hp-hero-perm-chip,
    .hp-hero-perm-empty { height: 22px; padding: 0 8px; font-size: 0.64rem; }
    .hp-dashboard-badge { align-self: flex-start; }
    .hp-readiness-panel { margin: 12px; padding: 12px; }
    .hp-readiness-chips { gap: 6px; }
    .hp-readiness-chip { font-size: 0.68rem; padding: 4px 9px; }
    .hp-readiness-actions { gap: 8px; }
    .hp-readiness-refresh-btn { height: 32px; padding: 0 12px; font-size: 0.72rem; }
    .hp-readiness-refresh-note { font-size: 0.69rem; }
    .hp-dashboard-data-card .hp-readiness-panel {
        margin: 6px 8px;
        padding: 6px 8px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 5px 7px;
    }
    .hp-dashboard-data-card .hp-readiness-message { display: none; }
    .hp-dashboard-data-card .hp-readiness-line { font-size: 0.74rem; }
    .hp-dashboard-data-card .hp-readiness-chip { padding: 2px 6px; font-size: 0.58rem; }
    .hp-dashboard-data-card .hp-readiness-actions { margin-inline-start: 0; justify-content: flex-end; }
    .hp-dashboard-data-card .hp-readiness-refresh-btn { width: auto; height: 26px; padding: 0 8px; font-size: 0.62rem; }
    .hp-dashboard-actions-grid { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
    .hp-dashboard-action-card,
    .hp-dashboard-action-card:nth-child(1),
    .hp-dashboard-action-card:nth-child(2) {
        grid-column: 1 / -1;
        min-height: 144px;
        aspect-ratio: auto;
    }
    .card-header { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
    .card-header h2 { font-size: 0.82rem; }
    .card-header svg { width: 15px; height: 15px; }
    .results-count { width: 100%; text-align: center; margin: 4px 0 0; font-size: 0.75rem; }
    .account-statement-header-right {
        width: 100%;
        margin-inline-start: 0;
        justify-content: space-between;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 8px;
    }
    .account-statement-header-right .results-count {
        width: auto;
        margin: 0;
    }
    .account-statement-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .account-statement-action-btn {
        width: 100%;
        height: 34px;
        padding: 0 6px;
        font-size: 0.66rem;
    }

    /* Quick Filters */
    .quick-filters { padding: 8px 12px; gap: 4px; }
    .quick-filters-label { width: 100%; font-size: 0.68rem; }
    .quick-filter-btn { padding: 4px 10px; font-size: 0.7rem; }

    /* Table */
    .data-table { min-width: 860px; }
    .data-table thead th { padding: 10px 10px; font-size: 0.8rem; }
    .data-table td { padding: 10px 10px; font-size: 0.85rem; }

    /* Pagination */
    .pagination { flex-wrap: wrap; padding: 12px; gap: 6px; }
    .page-numbers { order: -1; width: 100%; justify-content: center; }
    .page-btn { height: 32px; padding: 0 10px; font-size: 0.72rem; }
    .page-number { width: 30px; height: 30px; font-size: 0.78rem; }

    /* Stats */
    .summary-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 14px; flex-direction: column; text-align: center; gap: 8px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-icon svg { width: 18px; height: 18px; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: 0.68rem; }

    /* Toast */
    .toast-container { left: 8px; right: 8px; bottom: 8px; }
    .toast { min-width: auto; padding: 10px 12px; }
    .toast-message { font-size: 0.78rem; }

    /* Modal */
    .modal { padding: 8px; }
    .modal-container { max-height: 92vh; }
    .modal-header { padding: 12px 14px; }
    .modal-header h3 { font-size: 0.82rem; }
    .modal-body { padding: 14px; }
    .attachment-tab { padding: 6px 12px; font-size: 0.75rem; }
    .attachment-viewer { min-height: 180px; }

    /* Contact */
    .contact-form { padding: 14px; }

    /* Footer */
    .app-footer { padding: 10px 12px; flex-direction: column; gap: 2px; text-align: center; font-size: 0.68rem; }
    .footer-version { font-size: 0.64rem; }

    /* Empty */
    .empty-state { padding: 36px 14px; }
    .empty-state-icon { width: 60px; height: 60px; }
    .empty-state-icon svg { width: 26px; height: 26px; }
    .empty-state p { font-size: 0.88rem; }
    .empty-state span { font-size: 0.78rem; }
}

/* =====================================================
   RESPONSIVE - Small Phone (480px)
   ===================================================== */
@media (max-width: 480px) {
    .login-card { padding: 24px 16px 20px; }
    .main-logo-img { max-width: 150px; }
    .login-form .form-group { margin-bottom: 14px; }
    .login-form label { font-size: 0.75rem; }
    .login-form input { height: 42px; }
    .login-btn { height: 44px; }

    .top-header { height: 46px; }
    .top-header h1 { font-size: 0.8rem; }
    .menu-toggle { width: 34px; height: 34px; }
    .menu-toggle svg { width: 18px; height: 18px; }
    .lang-switch { padding: 3px 8px; font-size: 0.62rem; }
    .quick-status-header-btn { width: 28px; height: 28px; }
    .quick-status-header-btn svg { width: 13px; height: 13px; }
    .session-timer { padding: 3px 6px; font-size: 0.68rem; }

    .form-group input, .form-group select { height: 38px; font-size: 0.8rem; }
    .btn { height: 38px; font-size: 0.75rem; }

    .data-table { min-width: 780px; }
    .data-table th, .data-table td { padding: 8px 8px; font-size: 0.78rem; }
    .status-badge { padding: 3px 8px; font-size: 0.65rem; }
    .attachments-btn { padding: 4px 7px; font-size: 0.65rem; }
    .attachments-btn svg { width: 11px; height: 11px; }

    .summary-stats { gap: 6px; }
    .stat-card { padding: 10px; }
    .stat-value { font-size: 0.95rem; }

    .confirm-container { padding: 22px 16px; }
    .hp-dashboard-identity { padding: 7px 8px; border-radius: 9px; }
    .hp-dashboard-user-label { font-size: 0.62rem; }
    .hp-dashboard-hero h2 { font-size: 0.98rem; }
    .hp-dashboard-hero-meta { grid-template-columns: 1fr; }
    .hp-hero-meta-item { height: 27px; padding: 0 7px; font-size: 0.62rem; }
    .hp-dashboard-permissions-panel { padding: 7px 8px; gap: 5px; border-radius: 9px; }
    .hp-dashboard-permissions-label { font-size: 0.6rem; margin-top: 0; }
    .hp-dashboard-hero-brand-mark {
        width: 62px;
        max-width: 28vw;
        inset-inline-end: 14px;
        inset-block-end: 17px;
        opacity: 0.2;
    }
    .hp-hero-perm-chip,
    .hp-hero-perm-empty { height: 21px; padding: 0 7px; font-size: 0.61rem; }
    .hp-readiness-panel { margin: 10px; padding: 10px; }
    .hp-readiness-line { font-size: 0.82rem; }
    .hp-readiness-message { font-size: 0.75rem; }
    .hp-readiness-chips { gap: 5px; }
    .hp-readiness-chip { font-size: 0.64rem; padding: 4px 8px; }
    .hp-readiness-actions { align-items: stretch; }
    .hp-readiness-refresh-btn { width: 100%; justify-content: center; }
    .hp-readiness-refresh-note { font-size: 0.65rem; }
    .hp-dashboard-data-card .hp-readiness-panel {
        margin: 5px 7px;
        padding: 5px 7px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 5px 6px;
    }
    .hp-dashboard-data-card .hp-readiness-message { display: none; }
    .hp-dashboard-data-card .hp-readiness-line { font-size: 0.71rem; }
    .hp-dashboard-data-card .hp-readiness-chip { font-size: 0.56rem; padding: 1px 6px; }
    .hp-dashboard-data-card .hp-readiness-actions { margin-inline-start: 0; justify-content: flex-end; }
    .hp-dashboard-data-card .hp-readiness-refresh-btn { width: auto; height: 25px; padding: 0 7px; font-size: 0.6rem; }
    .hp-dashboard-action-card,
    .hp-dashboard-action-card:nth-child(1),
    .hp-dashboard-action-card:nth-child(2) { min-height: 136px; aspect-ratio: auto; }
    .hp-action-pill { height: 22px; padding: 0 8px; font-size: 0.64rem; }
    .hp-action-link { font-size: 0.7rem; }
    .pay-search-mode { gap: 6px; }
    .pay-search-mode-option { flex: 1; justify-content: center; padding: 0 10px; }
}

/* =====================================================
   TRANSFER DETAILS MODAL
   ===================================================== */

/* Wide modal - start from top so header is always visible */
.modal-wide {
    align-items: flex-start;
    padding: 24px 20px;
    overflow-y: auto;
}

.modal-wide .modal-container {
    max-width: 960px;
    width: 95vw;
    margin: 0 auto;
}

.td-modal-container {
    max-height: none;
    display: flex;
    flex-direction: column;
}

.td-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0f3a6b 100%);
    padding: 16px 24px;
    flex-shrink: 0;
}

.td-modal-header h3 {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.td-modal-header h3 svg {
    color: var(--gold);
}

.td-modal-header .modal-close {
    color: rgba(255,255,255,0.7);
}

.td-modal-header .modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.td-public-number {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255,255,255,0.12);
    padding: 2px 10px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.td-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 100px;
    background: rgba(255,255,255,0.15);
}

.td-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

/* Financial bar at top */
.td-financial-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f7f9fd 0%, #eef3fb 60%, #faf8f0 100%);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.td-fin-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 24px;
    min-width: 100px;
}

.td-fin-item:not(:last-child) {
    border-inline-end: 1px solid var(--gray-200);
}

.td-fin-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.04em;
}

.td-fin-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-800);
}

.td-fin-value.td-fin-amount {
    font-size: 1.4rem;
    font-weight: 900;
    color: #0c2d52;
    font-variant-numeric: tabular-nums;
}

.td-fin-value.td-fin-gold {
    color: var(--gold);
    font-weight: 800;
}

/* Sections */
.td-section {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.td-section:last-child {
    border-bottom: none;
}

.td-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--gray-100);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--gray-800);
}

.td-section-title svg {
    width: 18px;
    height: 18px;
    color: var(--gold);
}

/* Info grid */
.td-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.td-info-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-50);
    border-inline-end: 1px solid var(--gray-50);
    transition: background 0.15s;
}

.td-info-item:hover {
    background: var(--gray-25);
}

.td-info-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.td-info-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
}

/* Two-column parties */
.td-parties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.td-party-card {
    background: var(--gray-25);
    border: 1px solid var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
}

.td-party-header {
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-party-header svg {
    width: 16px;
    height: 16px;
}

.td-party-card.sender .td-party-header {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary);
    border-bottom: 2px solid var(--primary-200);
}

.td-party-card.receiver .td-party-header {
    background: linear-gradient(135deg, var(--gold-50), var(--gold-100));
    color: var(--gold);
    border-bottom: 2px solid var(--gold-100);
}

.td-party-body {
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.td-party-field {
    padding: 6px 4px;
}

.td-party-field.full-width {
    grid-column: 1 / -1;
}

.td-party-field-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 1px;
}

.td-party-field-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
}

/* Attachment gallery */
.td-attach-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.td-attach-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 4/3;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.td-attach-thumb:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.td-attach-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.td-attach-thumb .td-attach-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
}

.td-attach-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.td-attach-loading svg {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* Footer actions */
.td-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: center;
    gap: 12px;
    background: var(--gray-25);
}

.td-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.td-btn svg {
    width: 16px;
    height: 16px;
}

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

.td-btn-primary:hover {
    background: var(--primary-hover);
}

/* Skeleton shimmer */
.td-skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    width: 80px;
    display: inline-block;
}

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

/* Actions column buttons */
.td-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.td-row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0;
    white-space: nowrap;
}

.td-row-btn:active {
    transform: scale(0.95);
}

.td-row-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* View details button */
.td-btn-view {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(26, 79, 139, 0.25);
}

.td-btn-view:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(26, 79, 139, 0.35);
    transform: translateY(-1px);
}

/* Print button */
.td-btn-print {
    background: var(--gold);
    color: #fff;
    box-shadow: 0 2px 6px rgba(184, 148, 31, 0.25);
}

.td-btn-print:hover {
    background: var(--gold-hover);
    box-shadow: 0 4px 12px rgba(184, 148, 31, 0.35);
    transform: translateY(-1px);
}

.col-actions {
    width: 170px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-wide {
        padding: 0;
    }
    .modal-wide .modal-container {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }
    .td-info-grid {
        grid-template-columns: 1fr 1fr;
    }
    .td-parties-grid {
        grid-template-columns: 1fr;
    }
    .td-financial-bar {
        padding: 10px 12px;
    }
    .td-fin-item {
        padding: 4px 14px;
        min-width: 80px;
    }
    .td-fin-value.td-fin-amount {
        font-size: 1.1rem;
    }
    .td-section {
        padding: 12px 16px;
    }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
    .sidebar, .top-header, .search-card, .pagination, .attachments-btn, .app-footer { display: none !important; }
    .main-content { margin: 0; }
    .page-content { padding: 0; }
    .dashboard { background: white; }
    .results-card { box-shadow: none; border: 1px solid #e5e7eb; }
    .data-table th {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
