/* --- Core System Variables & Reset --- */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(37, 99, 235, 0.15);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .brand, .balance-amount {
    font-family: 'Outfit', sans-serif;
}

/* --- Global Navbar Header --- */
.site-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-links .services-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.nav-links .services-btn:hover {
    background-color: var(--primary-hover);
}

/* --- Container Layout --- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* --- View Engine State (Toggled via JS class) --- */
.view-section {
    display: none;
}

.view-section.active-view {
    display: block;
}

/* --- Authentication Card UI --- */
.login-card {
    background: var(--surface);
    max-width: 450px;
    margin: 4rem auto;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* --- Form Fields & Structural Inputs --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Inter', monospace;
    text-transform: uppercase;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.hint-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.error-message {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

/* --- Interactive Action Buttons --- */
.btn-block {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: #eff6ff;
}

.btn-secondary {
    background-color: #e2e8f0;
    border: none;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

/* --- Dashboard Header & Matrix Elements --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.status-badge {
    background-color: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .login-card {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
    
    .meta-info-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .balance-amount {
        font-size: 2rem;
    }
}

/* --- Shared Structure Cards --- */
.card {
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.balance-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border: none;
    box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.5);
}

.balance-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0 1.5rem 0;
}

.meta-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.meta-item span {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

.meta-item strong {
    font-size: 0.95rem;
    font-weight: 600;
}

/* --- Withdrawal Panel Specifics --- */
.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bank-info {
    background-color: var(--bg-main);
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.quick-select-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

/* --- Log History Data Tables --- */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.tab-btn.active-tab {
    background-color: #e2e8f0;
    color: var(--text-dark);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

th {
    background-color: var(--bg-main);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

/* --- Badges & Micro Status Elements --- */
.badge-pending {
    background-color: #fffbeb;
    color: var(--warning);
    border: 1px solid #fef3c7;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-settled {
    background-color: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Overlays & Interaction Components (Modal) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none; /* Managed dynamically by software layer */
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: var(--surface);
    border-radius: 0.5rem;
    width: 100%;
    max-width: 450px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.2s ease-out;
}

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

.modal-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.925rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* --- Live Status Micro Alerts (Toast Notification) --- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    display: none;
    gap: 0.75rem;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 110;
}
/* Processing speed row display helper */
.modal-detail-row {
    transition: all 0.2s ease;
}
/* Interactive Withdrawal Destination Row */
.bank-info {
    transition: all 0.2s ease-in-out;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

/* Light up blue and shift slightly when hovered over */
.bank-info:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: translateY(-1px);
}
/* Add this to your CSS file so tables behave on phones */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}