/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- LIGHT THEME (DEFAULT) --- */
    --bg-body: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-input: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;
    
    --border: #E2E8F0;
    
    /* BRAND COLORS */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-soft: rgba(79, 70, 229, 0.1);
    
    --accent: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    
    /* SHADOWS & RADIUS */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius: 24px;
    --radius-sm: 12px;
}

/* --- DARK THEME OVERRIDES --- */
[data-theme="dark"] {
    --bg-body: #020617;
    --bg-card: #0F172A;
    --bg-input: #1E293B;
    --bg-sidebar: #0F172A;
    
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    
    --border: #334155;
    
    --primary: #6366F1;
    --primary-soft: rgba(99, 102, 241, 0.15);
    
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. GLOBAL RESET & BASE STYLES
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

/* FIX: ჰორიზონტალური სქროლის აკრძალვა მობილურზე */
html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* UTILS */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* ANIMATIONS */
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   3. UI COMPONENTS
   ========================================= */

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 700; cursor: pointer; border: 1px solid transparent;
    transition: all 0.2s ease; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background-color: var(--primary); color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }

.btn-outline {
    background-color: transparent; border-color: var(--border); color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background-color: var(--primary-soft); }

.btn-success { background-color: var(--accent); color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-gold { background-color: #FFD700; color: black; box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3); }

/* INPUTS & FORMS */
.form-section-title {
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary);
    margin: 25px 0 15px; font-weight: 800; border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.form-section-title:first-child { margin-top: 0; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-wrapper { margin-bottom: 20px; width: 100%; }
.label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }

.input, .select {
    width: 100%; padding: 14px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem; font-family: inherit;
    transition: all 0.2s;
}
.input:focus, .select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background-color: var(--bg-card);
}

/* ADDED: Date Grid (3 columns for Day/Month/Year) */
.date-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.2fr;
    gap: 10px;
}

/* Custom Checkbox */
.legal-box {
    background: var(--bg-input); padding: 20px; border-radius: 12px;
    margin: 30px 0; border: 1px solid var(--border);
}
.chk-row {
    display: flex; gap: 15px; margin-bottom: 15px; cursor: pointer; align-items: flex-start;
}
.chk-row input {
    margin-top: 4px; min-width: 18px; min-height: 18px; accent-color: var(--primary); cursor: pointer;
}
.chk-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.chk-text a { color: var(--primary); font-weight: 700; border-bottom: 1px dashed; }

/* RANGE SLIDER */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; cursor: pointer; margin: 20px 0; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 8px; background: var(--bg-input); border-radius: 5px; border: 1px solid var(--border); }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%;
    background: var(--primary); margin-top: -9px; border: 3px solid var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* =========================================
   4. SECTIONS (Header, Hero, Footer)
   ========================================= */

/* HEADER */
header {
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000; height: 70px; display: flex; align-items: center;
}
.nav { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.logo { font-size: 1.4rem; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 10px; z-index: 1001; }
.brand-logo-img { height: 40px; width: auto; } /* ლოგოს ზომა გასწორებულია */

/* Desktop Menu */
.nav-menu { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-input); color: var(--text-main); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s;
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); }

.mobile-toggle { display: none; font-size: 1.5rem; background: none; border: none; color: var(--text-main); cursor: pointer; z-index: 1002; }

/* HERO & CARDS */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; padding: 80px 0; align-items: center; }
.hero-text h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.1; margin-bottom: 25px; color: var(--text-main); }
.hero-text span { color: var(--primary); }
.hero-text p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; }

.calc-card, .card, .glass-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
    transition: 0.3s;
}

.calc-amount { font-size: 3.5rem; font-weight: 800; color: var(--primary); margin-bottom: 20px; line-height: 1; text-align: center; }
.calc-info {
    display: flex; justify-content: space-between; background: var(--bg-input);
    padding: 20px; border-radius: var(--radius-sm); margin-bottom: 30px; border: 1px solid var(--border);
}

/* ADDED: INFO SECTION (როგორ მუშაობს) */
.info-section { padding: 80px 0; background: var(--bg-body); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.info-box { 
    background: var(--bg-card); padding: 40px; border-radius: var(--radius); 
    border: 1px solid var(--border); box-shadow: var(--shadow-sm); 
}
.info-box h3 { font-size: 1.5rem; margin-bottom: 15px; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.info-box p { color: var(--text-muted); font-size: 1rem; line-height: 1.7; }

/* TIERS */
.tiers-section { padding: 80px 0; background: var(--bg-input); border-top: 1px solid var(--border); text-align: center; }
.tiers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 30px; }

.tier-card {
    background: var(--bg-card); padding: 35px 25px; border-radius: 20px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: 0.3s;
}
.tier-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.tier-card.active { border: 2px solid var(--primary); transform: translateY(-5px); }
.tier-card.locked { opacity: 0.7; }
.tier-val { font-size: 2rem; font-weight: 800; color: var(--text-main); }

/* FOOTER */
footer { background: #0F172A; color: #94A3B8; padding: 60px 0 30px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.footer-logo { color: white; font-weight: 800; font-size: 1.5rem; margin-bottom: 20px; display: block; }
.footer-link { display: block; margin-bottom: 12px; color: inherit; transition: 0.2s; }
.footer-link:hover { color: white; }
.soc-icon {
    width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: white; transition: 0.2s;
}
.soc-icon:hover { background: var(--primary); }

/* =========================================
   5. DASHBOARD LAYOUT & WIDGETS
   ========================================= */

/* SIDEBAR */
.app-layout { display: flex; min-height: 100vh; width: 100%; }
.sidebar {
    width: 280px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
    padding: 30px 20px; display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 999;
    transition: transform 0.3s ease;
}
.main-content {
    flex: 1; padding: 40px; background: var(--bg-body);
    margin-left: 280px; width: calc(100% - 280px);
}
.nav-item {
    padding: 14px 20px; margin-bottom: 8px; border-radius: 12px; cursor: pointer;
    color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 12px; transition: 0.2s; text-decoration: none;
}
.nav-item:hover { background: var(--bg-input); color: var(--text-main); }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }

/* DASHBOARD GRID (BENTO) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}
.grid-item {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 30px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); position: relative;
}

/* CREDIT CARD WIDGET */
.credit-card-widget {
    background: linear-gradient(135deg, var(--primary), #312e81);
    color: white; border: none;
    display: flex; flex-direction: column; justify-content: space-between;
    min-height: 250px; overflow: hidden;
}
.credit-card-widget::before {
    content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 60%); border-radius: 50%;
}
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; z-index: 1; }
.cc-chip { width: 50px; opacity: 0.8; }
.cc-balance { z-index: 1; margin-top: 20px; }
.cc-balance label { font-size: 0.85rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }
.cc-balance h2 { font-size: 3rem; font-weight: 800; margin: 5px 0; }
.cc-bottom { display: flex; justify-content: space-between; align-items: flex-end; z-index: 1; }
.cc-info span { display: block; font-size: 0.8rem; opacity: 0.7; }
.cc-info strong { font-size: 1.1rem; }

/* ACTIONS GRID */
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; background: var(--bg-input); border-radius: var(--radius-sm);
    border: 1px solid var(--border); cursor: pointer; transition: 0.2s; text-align: center;
    color: var(--text-main); gap: 10px; height: 100%; text-decoration: none;
}
.action-btn i { font-size: 1.5rem; color: var(--primary); }
.action-btn:hover { background: var(--bg-card); border-color: var(--primary); transform: translateY(-2px); }

/* LIMIT CIRCLE */
.limit-widget { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.progress-circle {
    width: 140px; height: 140px; border-radius: 50%;
    background: conic-gradient(var(--primary) 0% 0%, var(--border) 0% 100%); /* JS Updates this */
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.progress-inner {
    width: 120px; height: 120px; background: var(--bg-card); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.progress-inner span { font-size: 0.8rem; color: var(--text-muted); }
.progress-inner strong { font-size: 1.5rem; color: var(--text-main); }

/* SPECIAL OFFER BANNER */
.offer-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border: 1px solid rgba(255, 215, 0, 0.3); color: white;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15);
}
.offer-content h3 { color: #FFD700; margin-bottom: 5px; }
.offer-content p { opacity: 0.8; font-size: 0.95rem; }

/* STATUS BADGES */
.status-badge { padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; }
.status-active { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status-rejected { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* LOAN LIST ITEMS */
.loan-list-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-card); border: 1px solid var(--border);
    padding: 25px; border-radius: 16px; margin-bottom: 15px;
    transition: 0.3s; box-shadow: var(--shadow-sm);
}
.loan-list-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.loan-info h4 { margin: 0 0 5px 0; font-size: 1.1rem; color: var(--text-main); }
.loan-info p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.loan-actions { display: flex; gap: 10px; }

/* TIMELINE */
.timeline-modern { position: relative; padding-left: 30px; margin-top: 30px; text-align: left; }
.timeline-modern::before {
    content: ''; position: absolute; left: 14px; top: 10px; bottom: 10px; width: 2px; background: var(--border);
}
.tm-step { position: relative; padding-bottom: 30px; padding-left: 20px; }
.tm-dot {
    position: absolute; left: -21px; top: 0; width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-body); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: var(--text-muted); transition: 0.3s; z-index: 2;
}
.tm-step.active .tm-dot { border-color: var(--primary); color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 4px var(--primary-soft); }
.tm-step.done .tm-dot { background: var(--accent); border-color: var(--accent); color: white; }
.tm-step.process .tm-dot { border-color: var(--warning); color: var(--warning); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }

/* =========================================
   6. MODALS & OVERLAYS
   ========================================= */
   
/* FULLSCREEN MODAL */
.fs-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(10px);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.fs-modal.active { opacity: 1; visibility: visible; }
.fs-content {
    width: 90%; max-width: 600px; background: var(--bg-card);
    padding: 40px; border-radius: 24px; border: 1px solid var(--border);
    position: relative; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.close-fs {
    position: absolute; top: 20px; right: 20px; font-size: 1.5rem;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
}

/* SMS MODAL */
.sms-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.sms-overlay.active { opacity: 1; visibility: visible; }
.sms-box { background: var(--bg-card); padding: 40px; border-radius: 24px; width: 90%; max-width: 400px; text-align: center; box-shadow: var(--shadow-card); border: 1px solid var(--border); transform: scale(0.9); transition: 0.3s; }
.sms-overlay.active .sms-box { transform: scale(1); }
.otp-input { letter-spacing: 8px; text-align: center; font-size: 1.5rem; font-weight: 700; }

/* BANK CARDS */
.bank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.bank-card {
    background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px;
    padding: 25px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.bank-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.bank-card.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* TOAST */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--bg-card); color: var(--text-main); padding: 16px 20px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    font-weight: 600; display: flex; align-items: center; gap: 12px; min-width: 300px;
    animation: slideIn 0.4s ease;
}
.toast.error { border-left-color: var(--danger); } .toast.success { border-left-color: var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- HISTORY PAGE SPECIFIC --- */

/* Summary Widgets */
.history-summary {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px;
}
.summary-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 25px;
    display: flex; align-items: center; gap: 20px; transition: 0.3s;
}
.summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.sum-icon {
    width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; background: var(--bg-body); border: 1px solid var(--border);
}
.sum-val { font-size: 1.5rem; font-weight: 800; color: var(--text-main); line-height: 1.2; }
.sum-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Filters Bar */
.history-controls {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
    background: var(--bg-card); padding: 10px; border-radius: 16px; border: 1px solid var(--border);
}
.search-box {
    display: flex; align-items: center; gap: 10px; padding: 0 15px; background: var(--bg-input); border-radius: 10px; flex: 1;
}
.search-box input {
    border: none; background: transparent; outline: none; padding: 12px 0; width: 100%; color: var(--text-main);
}
.filter-btn {
    padding: 10px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-body);
    color: var(--text-muted); cursor: pointer; transition: 0.2s; margin-left: 10px;
}
.filter-btn:hover { color: var(--primary); border-color: var(--primary); }

/* Transaction List Item */
.history-item {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
    background: var(--bg-card); border: 1px solid var(--border); padding: 20px;
    border-radius: 18px; margin-bottom: 15px; transition: 0.2s; position: relative; overflow: hidden;
}
.history-item::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0%; height: 3px;
    background: var(--primary); transition: 0.3s;
}
.history-item:hover { transform: translateX(5px); box-shadow: var(--shadow-soft); }
.history-item:hover::after { width: 100%; }

.h-icon {
    width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.h-icon.in { background: rgba(16, 185, 129, 0.1); color: var(--accent); } /* შემოსავალი */
.h-icon.out { background: rgba(239, 68, 68, 0.1); color: var(--danger); } /* გასავალი */
.h-icon.wait { background: rgba(245, 158, 11, 0.1); color: var(--warning); } /* ლოდინი */

.h-info h4 { margin: 0 0 4px 0; font-size: 1rem; color: var(--text-main); }
.h-info span { font-size: 0.8rem; color: var(--text-muted); display: block; }

.h-meta { text-align: right; }
.h-amount { font-size: 1.1rem; font-weight: 800; display: block; margin-bottom: 4px; }
.h-status { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--bg-input); }


/* --- DASHBOARD STATS GRID --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 სვეტი */
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px; /* მომრგვალებული კუთხეები */
    padding: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

/* ფერები აიკონებისთვის */
.stat-blue { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.stat-green { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.stat-red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.stat-orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* ტექსტები ბარათში */
.stat-info h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: var(--text-main);
}
.stat-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* --- TABLE STYLES (ცხრილები) --- */
.table-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden; /* რომ კუთხეები არ გაფუჭდეს */
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 15px 20px;
    text-align: left;
    font-weight: 700;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover { background: var(--bg-body); }

/* Utility Classes for Dashboard */
.bg-input { background: var(--bg-input); }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-15 { margin-bottom: 15px; }
.r-12 { border-radius: 12px; }
.w-100 { width: 100%; }
.font-mono { font-family: monospace; }
.block { display: block; }
.text-accent { color: var(--accent); }
.text-xl { font-size: 1.5rem; }
.flex-1 { flex: 1; }
.icon-circle { width: 60px; height: 60px; background: var(--primary-soft); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 1.5rem; }


/* =========================================
   8. MOBILE RESPONSIVE (UPDATED)
   ========================================= */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; display: none; backdrop-filter: blur(4px); }
.sidebar-overlay.active { display: block; }

@media (max-width: 900px) {
    /* HEADER MOBILE */
    .mobile-toggle { display: block; }
    
    /* MOBILE MENU DRAWER */
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 85%; height: 100vh;
        background: var(--bg-card); flex-direction: column; justify-content: center;
        padding: 40px; box-shadow: -10px 0 30px rgba(0,0,0,0.2); 
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        display: flex; /* Ensure it's flex for column layout */
    }
    .nav-menu.active { right: 0; }
    
    .nav-links { flex-direction: column; font-size: 1.2rem; text-align: center; width: 100%; margin-bottom: 30px; gap: 20px; }
    .header-actions { flex-direction: column; width: 100%; gap: 15px; }
    .header-actions .btn { width: 100%; }

    /* LAYOUT & GRIDS */
    .container { padding: 0 15px; }
    .hero { grid-template-columns: 1fr; text-align: center; gap: 40px; padding: 40px 0; }
    .hero-text h1 { font-size: 2.5rem; } /* Font size fix for mobile */

    .input-grid, .footer-grid, .tiers-grid, .info-grid, .bank-grid, .stat-grid { grid-template-columns: 1fr; gap: 20px; }
    
    /* DASHBOARD */
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .actions-grid { grid-template-columns: 1fr 1fr; } 
    .offer-card { flex-direction: column; text-align: center; gap: 20px; }
    
    /* HISTORY */
    .history-summary { grid-template-columns: 1fr; }
    .history-item { grid-template-columns: auto 1fr; gap: 15px; }
    .h-meta { grid-column: 2 / -1; text-align: left; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 5px; }

    /* DATE GRID MOBILE */
    .date-grid { grid-template-columns: 1fr 1fr 1fr; gap: 5px; } 

    /* TOAST */
    #toast-container { left: 15px; right: 15px; width: auto; }
    .toast { min-width: auto; }
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
/* =========================================
   CMS & ADMIN STYLES (NEW)
   ========================================= */

/* ტაბების ნავიგაცია (ადმინში) */
.cms-tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 25px; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 10px; 
    overflow-x: auto; 
    white-space: nowrap; /* მობილურზე რომ არ გადავიდეს ხაზზე */
}

.cms-tab-btn { 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    padding: 12px 24px; 
    border-radius: 10px; 
    cursor: pointer; 
    color: var(--text-muted); 
    font-weight: 600; 
    white-space: nowrap; 
    transition: 0.3s; 
}

.cms-tab-btn:hover { 
    background: var(--bg-card); 
    color: var(--primary); 
    border-color: var(--primary);
}

.cms-tab-btn.active { 
    background: var(--primary); 
    color: white; 
    border-color: var(--primary); 
}

/* სექციების გამოჩენა/დამალვა */
.cms-section { 
    display: none; 
    animation: fadeIn 0.3s ease; 
}

.cms-section.active { 
    display: block; 
}

/* შორტკოდების სტილი (მაგ: {amount}) */
.variable-tag { 
    background: rgba(79, 70, 229, 0.1); 
    border: 1px dashed var(--primary); 
    padding: 4px 8px; 
    border-radius: 6px; 
    font-family: monospace; 
    color: var(--primary); 
    cursor: pointer; 
    font-size: 0.85rem; 
    margin-right: 5px; 
    display: inline-block; 
    margin-bottom: 5px; 
    transition: 0.2s;
}

.variable-tag:hover {
    background: var(--primary);
    color: white;
}

/* დოკუმენტების ბარათები */
.doc-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    transition: 0.2s;
}

.doc-card:hover { 
    border-color: var(--primary); 
    transform: translateY(-2px);
}


/* =========================================
   FRONTEND STYLES (INDEX PAGE)
   ========================================= */

/* ინფო ბლოკი კალკულატორის ქვეშ */
.admin-info-block {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1); /* მომწვანო ფონი */
    border: 1px dashed #10b981;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

/* პოპაპის სურათი */
.popup-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    object-fit: cover;
}
/* --- INFO BLOCK (Updated) --- */
.admin-info-block {
    margin-top: 25px;
    padding: 20px;
    border-radius: 20px;
    background: var(--bg-card); /* თეთრი ფონი */
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}
.admin-info-icon {
    font-size: 1.5rem;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* --- SPLIT MODAL STYLES --- */
.modal-split {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* სურათი ნაკლები, ტექსტი მეტი */
    padding: 0 !important; /* ძველი padding-ის გაუქმება */
    overflow: hidden;
    max-width: 850px !important;
    border: none;
}

.modal-img-col {
    background-color: #f0f0f0;
    position: relative;
    min-height: 300px;
}

.modal-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* თუ სურათი არ არის, აიკონი გამოჩნდეს */
.modal-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 5rem;
    color: var(--border);
    background: var(--bg-input);
}

.modal-txt-col {
    padding: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.close-modal-x {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
}
.close-modal-x:hover { color: var(--danger); transform: rotate(90deg); }

/* მობილური ვერსია მოდალისთვის */
@media (max-width: 768px) {
    .modal-split { grid-template-columns: 1fr; }
    .modal-img-col { height: 200px; min-height: auto; }
    .modal-txt-col { padding: 25px; }
}