/* UNICREDIT COLOR SYSTEM & DESIGN TOKENS */
:root {
    --monza-red: #D31027;         /* UniCredit Primary Red (Debit) */
    --monza-red-hover: #B20D20;   /* Darkened Red on Hover */
    --chart-credit: #FFFFFF;      /* White for Credit */
    --bg-dark: #12161A;          /* Charcoal base */
    --bg-card: #1C2228;          /* Card Slate */
    --bg-input: #161B20;         /* Deep Gray Input */
    --border-color: #2D363F;     /* Professional Crisp Border */
    --text-main: #FFFFFF;        /* Clean White */
    --text-muted: #8A99A8;       /* Slate Gray Subtext */
    --success: #10B981;          /* Emerald Green */
    --hold-yellow: #EAB308;      /* Warning Gold */
    --card-blue: linear-gradient(135deg, #1E3C72 0%, #2A5298 100%); /* Bank Blue Card */
}

body, html { 
    margin: 0; 
    padding: 0; 
    background: var(--bg-dark); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    color: var(--text-main); 
    height: 100vh; 
    overflow-x: hidden; 
}

/* VIEWPORT LAYERS */
.auth-viewport { 
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.app-viewport {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 100vw;
    background: var(--bg-dark); 
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

/* HEADER & RESPONSIVE METADATA STYLING (Optimized Header Width Constraint) */
.dash-header {
    height: auto;
    min-height: 50px;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    background: #ffffff; 
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center; 
    justify-content: space-between; 
    padding: 6px 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
    box-sizing: border-box;
}

.brand-logo {  
    display: flex;
    align-items: center;
}

.site-logo {
	height: 32px;
	width: auto;
	object-fit: contain;
	display: block;
}

/* Modern Professional Banking Header Display for System Date */
.header-system-meta-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-system-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #475569;
}

.meta-item {
    display: flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}

.meta-label-lbl {
    color: #64748B;
    font-weight: 600;
}

.header-system-meta .meta-item span:last-child {
    color: #0F172A;
    font-weight: 600;
}

.meta-divider {
    display: none;
}

.header-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-status { 
    color: var(--text-muted); 
    font-size: 0.75rem; 
    white-space: nowrap;
}
.status-active { color: var(--success); font-weight: 600; }
.status-hold { color: var(--hold-yellow); font-weight: 600; }

.btn-signout-custom {
    width: auto !important; 
    padding: 4px 10px !important; 
    font-weight: 600 !important; 
    background: rgba(211, 16, 39, 0.1) !important; 
    border-color: rgba(211, 16, 39, 0.3) !important; 
    color: #F87171 !important;
    font-size: 0.75rem !important;
}

.secure-tag {
    font-size: 0.7rem;
    color: var(--success); 
    font-weight: 600; 
    background: rgba(16, 185, 129, 0.08);
    padding: 4px 8px;
    border-radius: 20px; 
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

/* PORTAL NOTIFICATION */
.portal-notification {
    background: rgba(234, 179, 8, 0.12);
    border-bottom: 2px solid var(--hold-yellow);
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: space-between; 
    align-items: flex-start;
}

.notification-content strong { color: var(--hold-yellow); font-size: 0.95rem; display: block; margin-bottom: 4px; }
.notification-content p { margin: 0; color: var(--text-main); font-size: 0.85rem; }

.btn-close-notify {
    background: var(--hold-yellow); 
    color: #000; 
    border: none;
    padding: 8px 16px;
    border-radius: 6px; 
    font-weight: 700; 
    cursor: pointer;
    align-self: flex-end;
}

/* AUTH WORKSPACE */
.auth-split-workspace { display: flex; flex-direction: column; flex-grow: 1; min-height: calc(100vh - 50px); }

.auth-promo-panel {
    display: none; 
    position: relative; 
    overflow: hidden; 
    padding: 40px; 
}

.promo-media-element { 
    position: absolute; 
    top: 0; left: 0;
    width: 100%; height: 100%; 
    object-fit: cover;
    z-index: 1; 
}

.promo-image-overlay {
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(18, 22, 26, 0.3) 0%, rgba(18, 22, 26, 0.95) 100%);
    z-index: 2;
}

.promo-content-wrapper { position: relative; z-index: 3; max-width: 600px; }
.promo-content-wrapper h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 15px; color: var(--text-main); }
.promo-content-wrapper p { font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); }

.auth-action-panel { 
    flex: 1; 
    background: var(--bg-card);
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    padding: 30px 20px; 
    box-sizing: border-box;
    overflow-y: auto; 
}

.form-title-area { margin-bottom: 25px; }
.form-title-area h1 { font-size: 1.5rem; margin: 0 0 8px 0; font-weight: 700; }
.form-title-area p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* INPUTS & BUTTONS */
.input-group { margin-bottom: 16px; width: 100%; }
.input-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

.input-group input, .input-group select { 
    width: 100%;
    padding: 12px 14px; 
    background: var(--bg-input); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    color: var(--text-main); 
    box-sizing: border-box;
    font-size: 1rem; 
    transition: border-color 0.2s;
}

.input-group input:focus, .input-group select:focus {
    outline: none; 
    border-color: var(--monza-red); 
}

.auth-options { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 20px; align-items: center; flex-wrap: wrap; gap: 10px; }
.remember-me { display: flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; }

.forgot-link { 
    color: var(--monza-red); 
    text-decoration: none; 
    font-weight: 600; 
}

.btn-auth, .btn-transfer { 
    width: 100%;
    background: var(--monza-red); 
    color: var(--text-main); 
    border: none; 
    padding: 14px;
    border-radius: 8px; 
    font-weight: 600; 
    font-size: 1rem; 
    cursor: pointer;
    transition: background 0.2s; 
    box-sizing: border-box;
}

.btn-auth:hover, .btn-transfer:hover { background: var(--monza-red-hover); }

.btn-secondary { 
    background: var(--bg-input); 
    color: var(--text-main);
    border: 1px solid var(--border-color); 
    padding: 10px 14px; 
    border-radius: 6px;
    width: 100%; 
    font-size: 0.85rem; 
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
}

.btn-secondary:hover { background: var(--border-color); }

.auth-error-banner { 
    display: flex; 
    gap: 12px; 
    background: rgba(211, 16, 39, 0.1); 
    border: 1px solid rgba(211, 16, 39, 0.3);
    border-radius: 6px; 
    padding: 12px; 
    margin-top: 20px; 
}

.auth-error-banner strong { color: #F87171; font-size: 0.85rem; }
.auth-error-banner p { margin: 4px 0 0 0; font-size: 0.75rem; color: #FCA5A5; }

/* SIDEBAR & CONTAINER */
.dash-container { 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
    height: calc(100vh - 50px); 
    overflow: hidden; 
}

.dash-sidebar { 
    width: 100%; 
    background: #161B20;
    border-bottom: 1px solid var(--border-color); 
    padding: 10px 15px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: row; 
    overflow-x: auto; 
    gap: 8px; 
    flex-shrink: 0;
}

.sidebar-section-title { 
    display: none;
}

.nav-item { 
    padding: 8px 12px; 
    border-radius: 6px; 
    color: var(--text-muted); 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 0.8rem;
    font-weight: 500; 
    white-space: nowrap;
    border-left: none !important;
}

.nav-item.active, .nav-item:hover { 
    background: rgba(211, 16, 39, 0.12); 
    color: var(--text-main); 
    font-weight: 600; 
    border-bottom: 2px solid var(--monza-red);
}

/* MAIN DASHBOARD CONTENT */
.dash-main { flex-grow: 1; padding: 20px; overflow-y: auto; background: var(--bg-dark); box-sizing: border-box; }
.panel-header-flex { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.panel-title { margin: 0; font-size: 1.3rem; font-weight: 700; }

.currency-badge { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px; 
    color: var(--text-muted);
}

/* ACCOUNT META GRID */
.account-meta-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }
.meta-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 14px; }
.meta-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; display: block; margin-bottom: 4px; font-weight: 600; }
.meta-value { font-size: 0.95rem; font-weight: 700; color: var(--text-main); word-break: break-all; }
.status-active-text { color: var(--success); }

.balance-hero-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 10px; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    margin-bottom: 20px; 
}

.balance-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.balance-amount { font-size: 1.8rem; margin: 6px 0 0 0; font-weight: 800; color: var(--text-main); }

.hold-mini-alert { 
    background: rgba(16, 185, 129, 0.08); 
    border: 1px solid rgba(16, 185, 129, 0.2); 
    border-radius: 8px; 
    padding: 12px 15px; 
    width: 100%;
    box-sizing: border-box;
}

.hold-mini-alert strong { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.hold-mini-alert p { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

/* CHART GRAPHIC */
.chart-container-wrapper { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 15px; margin-bottom: 20px; }
.chart-header-flex { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.chart-header-flex h3 { margin: 0; font-size: 0.95rem; color: var(--text-main); }

.chart-legend { display: flex; gap: 10px; font-size: 0.75rem; color: var(--text-muted); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-box { width: 10px; height: 10px; border-radius: 2px; }
.legend-box.credit { background: var(--chart-credit); }
.legend-box.debit { background: var(--monza-red); }

.mock-chart-graphic { display: flex; align-items: flex-end; gap: 12px; height: 100px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.chart-bar { flex: 1; border-radius: 4px 4px 0 0; position: relative; transition: height 0.3s; }

.chart-bar.bar-credit { background: var(--chart-credit); box-shadow: 0 0 8px rgba(255, 255, 255, 0.2); }
.chart-bar.bar-debit { background: var(--monza-red); box-shadow: 0 0 8px rgba(211, 16, 39, 0.3); }

.bar-date { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }

/* LEDGER TABLE */
.ledger-wrapper { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 15px; overflow-x: auto; }
.ledger-wrapper h3 { margin: 0 0 15px 0; font-size: 0.95rem; }
.ledger-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.8rem; min-width: 600px; }
.ledger-table th { padding: 10px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.7rem; }
.ledger-table td { padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); white-space: nowrap; }
.amt-credit { color: #FFFFFF; font-weight: 700; }
.amt-debit { color: #F87171; font-weight: 700; }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.7rem; }

/* FORM CONTAINERS */
.form-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 20px; width: 100%; box-sizing: border-box; }
.form-row { display: flex; flex-direction: column; gap: 0; }

.rejection-box { background: rgba(211, 16, 39, 0.1); border: 1px solid rgba(211, 16, 39, 0.3); border-radius: 8px; padding: 15px; margin-top: 20px; width: 100%; box-sizing: border-box; }
.rejection-box h3 { margin: 0 0 6px 0; color: #F87171; font-size: 0.95rem; }
.rejection-box p { margin: 0; font-size: 0.8rem; color: #FCA5A5; line-height: 1.5; }

/* RECTANGULAR TILES */
.reports-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.report-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.doc-icon { font-size: 1.5rem; margin-bottom: 5px; }
.report-card h3 { margin: 0 0 4px 0; font-size: 1rem; }
.report-card p { margin: 0 0 10px 0; font-size: 0.75rem; color: var(--text-muted); }

/* FOREIGN EXCHANGE DESK */
.fx-rates-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fx-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.fx-pair { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; }
.fx-rate { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.fx-change { font-size: 0.75rem; font-weight: 700; }
.fx-change.pos { color: var(--success); }
.fx-change.neg { color: #F87171; }

/* COMMERCIAL CARD HUB */
.cards-wrapper { display: flex; flex-direction: column; gap: 20px; align-items: center; }

.blue-commercial-card { 
    background: var(--card-blue); 
    width: 100%; 
    max-width: 360px;
    height: 200px; 
    border-radius: 12px; 
    padding: 20px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-brand-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.5px; color: #FFFFFF; text-transform: uppercase; }
.card-chip-symbol { font-size: 1.3rem; }

.card-number-display { font-size: 1.1rem; font-weight: 700; letter-spacing: 1.5px; color: #FFFFFF; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.card-info-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.card-sub-label { font-size: 0.55rem; color: rgba(255, 255, 255, 0.7); font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.card-sub-val { font-size: 0.75rem; font-weight: 700; color: #FFFFFF; }

.card-actions-grid { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; max-width: 800px; }

/* LOGS CONSOLE */
.logs-console { background: #0A0D0F; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; font-family: monospace; font-size: 0.75rem; line-height: 1.6; color: #A0AEC0; max-height: 350px; overflow-y: auto; box-sizing: border-box; }
.log-entry { margin-bottom: 6px; word-break: break-all; }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 15px; box-sizing: border-box; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; width: 100%; max-width: 450px; padding: 25px; text-align: center; box-sizing: border-box; }
.modal-card h2 { margin: 12px 0 8px 0; font-size: 1.3rem; }
.success-subtitle { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 15px; line-height: 1.4; }

.timer-card { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; margin-bottom: 20px; }
.timer-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; display: block; margin-bottom: 4px; }
.timer-display { font-size: 1.5rem; font-weight: 800; color: var(--monza-red); font-family: monospace; }
.timer-footnote { font-size: 0.65rem; color: var(--text-muted); display: block; margin-top: 4px; }

/* 3D AVATAR ANIMATION */
.avatar-3d-scene { position: relative; width: 80px; height: 80px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.avatar-3d-body { position: relative; z-index: 2; font-size: 2.5rem; }
.sparkle { position: absolute; font-size: 1rem; animation: float 2s infinite ease-in-out; }
.sp-1 { top: 0; left: 5px; animation-delay: 0s; }
.sp-2 { top: 5px; right: 5px; animation-delay: 0.4s; }
.sp-3 { bottom: 5px; left: 2px; animation-delay: 0.8s; }
.sp-4 { bottom: 0; right: 10px; animation-delay: 1.2s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ==========================================
   TABLET & LAPTOP MEDIA QUERY BREAKPOINTS
   ========================================== */

/* Tablet View (Min-width: 768px) */
@media (min-width: 768px) {
    .dash-header { padding: 8px 24px; }
    .site-logo { height: 38px; }
    .portal-notification { flex-direction: row; padding: 15px 30px; }
    .btn-close-notify { align-self: center; }
    
    .auth-split-workspace { flex-direction: row; }
    .auth-promo-panel { display: flex; flex: 1.1; padding: 40px; }
    .auth-action-panel { flex: 0.9; padding: 0 40px; }
    .form-title-area h1 { font-size: 1.7rem; }
    
    .dash-container { flex-direction: row; }
    .dash-sidebar { 
        width: 240px; 
        height: 100%;
        flex-direction: column; 
        overflow-x: visible; 
        overflow-y: auto; 
        padding: 20px 12px;
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
    .sidebar-section-title { display: block; }
    .nav-item { padding: 10px 14px; font-size: 0.85rem; border-left: 3px solid transparent; white-space: normal; border-bottom: none; }
    .nav-item.active, .nav-item:hover { border-bottom: none; border-left: 3px solid var(--monza-red); }
    
    .dash-main { padding: 30px; }
    .panel-header-flex { flex-direction: row; align-items: center; }
    .account-meta-grid { grid-template-columns: repeat(2, 1fr); }
    .balance-hero-card { flex-direction: row; align-items: center; padding: 25px; }
    .hold-mini-alert { width: auto; max-width: 350px; }
    
    .chart-header-flex { flex-direction: row; align-items: center; }
    .form-row { flex-direction: row; gap: 20px; }
    .form-container { padding: 25px; max-width: 650px; }
    .rejection-box { max-width: 650px; }
    
    .reports-grid { grid-template-columns: repeat(2, 1fr); }
    .fx-rates-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .card-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .logs-console { font-size: 0.8rem; }
}

/* Laptop & Desktop View (Min-width: 1024px) */
@media (min-width: 1024px) {
    .dash-header { padding: 8px 32px; }
    .site-logo { height: 42px; }
    .portal-notification { padding: 15px 40px; }
    .auth-promo-panel { flex: 1.2; padding: 60px; }
    .auth-action-panel { padding: 0 60px; }
    .form-title-area h1 { font-size: 1.8rem; }
    
    .dash-sidebar { width: 260px; padding: 25px 15px; }
    .dash-main { padding: 40px; }
    .account-meta-grid { grid-template-columns: repeat(4, 1fr); }
    .reports-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .fx-rates-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .card-actions-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-width: 800px; }
    .logs-console { font-size: 0.85rem; max-height: 400px; }
}
