/* LUXURY GOLD & OBSIDIAN VARIABLES */
:root {
  --bg-main: #0a0d14;         
  --bg-sidebar: #050608;      
  --bg-card: #12161f;         
  --primary: #d4af37;         
  --primary-dark: #aa8c2c;    
  --primary-light: #f3e5ab;   
  --success: #2ea043;         
  --danger: #e03a3a;          
  --warning: #f59e0b;         
  --text-main: #fdfbf7;       
  --text-muted: #9ca3af;      
  --text-dark: #000000;       
  --border-color: rgba(212, 175, 55, 0.15); 
  --border-strong: rgba(212, 175, 55, 0.4);
  --shadow-glow: 0 4px 20px rgba(212, 175, 55, 0.08);
  --border-radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
  font-family: 'Montserrat', sans-serif; background-color: var(--bg-main); 
  color: var(--text-main); height: 100vh; overflow: hidden; display: flex; flex-direction: column;
}

/* FRESH LOGIN SCREEN & VIDEO BACKGROUND */
#login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: hidden;
}

.video-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: 1;
}

.login-glass-box {
    position: relative;
    z-index: 10;
    background: rgba(10, 14, 23, 0.85);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

/* GENERAL UI */
.al-noor-logo { width: 100%; height: auto; display: block; margin: 0 auto; }
.logo-text-fill { fill: var(--primary); transition: fill 0.3s; }
.language-control { margin-right: auto; display: flex; align-items: center; }
.language-control select { min-width: 125px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 12px; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html[dir="rtl"] body { font-family: 'Noto Nastaliq Urdu', 'Montserrat', sans-serif; }
html[dir="rtl"] .topbar, html[dir="rtl"] .form-container { direction: rtl; }
html[dir="rtl"] .language-control { margin-left: auto; margin-right: 0; }

#login-screen .al-noor-logo { max-width: 250px; margin-bottom: 10px; }

#main-app { display: none; height: 100vh; width: 100vw; overflow: hidden; background-color: var(--bg-main); }

/* Sidebar Updated with Scroll */
.sidebar { 
    width: 260px; 
    background-color: var(--bg-sidebar); 
    border-right: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
    flex-shrink: 0; 
    z-index: 10; 
    overflow-y: auto; /* 🔥 YEH SCROLL ON KAREGA */
}

/* 🔥 VIP Golden Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.sidebar-logo { margin-bottom: 40px; display: flex; align-items: center; justify-content: center; }
.sidebar-logo .al-noor-logo { max-width: 180px; margin: 0; }

.nav-item { padding: 14px 15px; margin-bottom: 8px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 14px; transition: all 0.3s ease; color: var(--text-muted); display: flex; align-items: center; gap: 10px; letter-spacing: 0.5px; }
.nav-item:hover { background-color: rgba(212, 175, 55, 0.05); color: var(--primary-light); }
.nav-item.active { font-weight: 700; background-color: rgba(212, 175, 55, 0.1); color: var(--primary); border-left: 3px solid var(--primary); }

.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 70px; background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: flex-end; padding: 0 30px; flex-shrink: 0; }
.profile-area { display: flex; align-items: center; gap: 15px; }
.profile-pic { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--text-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; box-shadow: 0 0 10px rgba(212,175,55,0.2); }

.content { flex: 1; overflow-y: auto; padding: 30px; -webkit-overflow-scrolling: touch; }
.tab-content { display: none; }
.tab-content.active-tab { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* CONTAINERS & FORMS */
.print-container, .form-container, #admin-dashboard-screen, #client-dashboard-screen { 
  background-color: var(--bg-card); max-width: 1000px; margin: 0 auto; padding: 45px; 
  box-shadow: var(--shadow-glow); border-radius: var(--border-radius); border: 1px solid var(--border-color);
}
.form-container { max-width: 700px; }
.header-title { text-align: center; border-bottom: 1px solid var(--border-strong); padding-bottom: 25px; margin-bottom: 30px; }
.header-title h2 { margin: 12px 0 0 0; font-size: 14px; color: var(--primary-light); letter-spacing: 5px; font-weight: 600; text-transform: uppercase;}
.header-title p { margin: 8px 0 0 0; font-size: 12px; color: var(--text-muted); letter-spacing: 3px; font-weight: 400; text-transform: uppercase;}
.header-title .al-noor-logo { max-width: 260px; margin: 0 auto 15px auto; }

.form-group { margin-bottom: 22px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--primary-light); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.form-group input, .form-group select { width: 100%; padding: 15px; font-size: 15px; font-family: 'Montserrat', sans-serif; font-weight: 500; color: var(--text-main); border: 1px solid var(--border-strong); border-radius: 6px; box-sizing: border-box; background-color: var(--bg-main); transition: all 0.3s ease; }
.form-group input:focus, .form-group select:focus { border-color: var(--primary); background-color: #000; box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2); outline: none; }
.input-disabled { background-color: #1a1f2b !important; color: #6b7280 !important; border-color: #374151 !important; cursor: not-allowed; }

.controls { display: flex; justify-content: flex-start; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; }
.controls input { flex: 1; min-width: 250px; padding: 14px; font-size: 15px; border-radius: 6px; border: 1px solid var(--border-strong); font-family: 'Montserrat'; color: white; background-color: var(--bg-main);}
.controls button { padding: 14px 24px; background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: 'Montserrat'; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s ease; }
.controls button:hover { background: var(--primary); color: var(--text-dark); box-shadow: 0 0 15px rgba(212, 175, 55, 0.3); }
.btn-submit { width: 100%; padding: 18px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--text-dark); border: none; border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; margin-top: 15px; font-family: 'Montserrat'; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2); }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4); }
.btn-submit:disabled { background: #374151; color: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }
.bank-details-group { background-color: rgba(212, 175, 55, 0.03); padding: 20px; border-left: 3px solid var(--primary); margin-bottom: 20px; border-radius: 6px; border: 1px solid var(--border-color); }
hr { border: 0; border-top: 1px solid var(--border-color); margin: 35px 0; }

/* TABLES & NASTALIQ */
.rtl-table { font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif !important; font-size: 15px !important; line-height: 1.8; }
.rtl-table th { font-size: 13px !important; padding: 12px !important; }
.rtl-table td { font-size: 15px !important; }
.table-responsive { width: 100%; overflow-x: auto; margin-bottom: 30px; border-radius: 6px; border: 1px solid var(--border-color); }
table { width: 100%; border-collapse: collapse; min-width: 600px; font-size: 14px; font-weight: 500; }
th { background-color: rgba(212, 175, 55, 0.05); color: var(--primary); padding: 16px 14px; font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; border-bottom: 1px solid var(--border-strong); text-align: left; }
td { border-bottom: 1px solid var(--border-color); padding: 16px 14px; text-align: left; vertical-align: middle; color: var(--text-main); }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(255, 255, 255, 0.02); }
.rtl-table th, .rtl-table td { text-align: right; border-left: 1px solid var(--border-color); border-right: none;}
.rtl-table td:last-child, .rtl-table th:last-child { border-left: none; }
.bg-light { background-color: rgba(212, 175, 55, 0.03); color: var(--primary-light); font-weight: 600; }

/* ADMIN DASHBOARD CARDS */
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.admin-card { background: var(--bg-card); padding: 25px; border-radius: 8px; box-shadow: var(--shadow-glow); text-align: left; border: 1px solid var(--border-color); border-top: 3px solid var(--primary); }
.admin-card h3 { margin: 0 0 12px 0; color: var(--text-muted); font-size: 12px; text-transform: uppercase; font-weight: 600; letter-spacing: 1px; }
.admin-card .val { font-size: 30px; font-weight: 300; color: var(--primary-light); letter-spacing: 1px;}
.client-plot-card { background: rgba(212, 175, 55, 0.03); border: 1px solid var(--border-color); padding: 25px; border-radius: 8px; text-align: center; transition: all 0.3s; }
.client-plot-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.client-plot-card h3 { color: var(--primary); font-size: 24px; font-weight: 800; margin: 0 0 5px 0; }
.client-plot-card p { color: var(--text-muted); font-size: 13px; font-weight: 500; margin: 0 0 20px 0; text-transform: uppercase; letter-spacing: 1px; }
.client-plot-card button { background: transparent; border: 1px solid var(--primary); color: var(--primary); padding: 10px 20px; border-radius: 4px; font-weight: 600; font-family: 'Montserrat'; cursor: pointer; transition: 0.3s; width: 100%; text-transform: uppercase; letter-spacing: 1px; font-size: 12px;}
.client-plot-card button:hover { background: var(--primary); color: var(--bg-main); }

@media screen and (max-width: 900px) {
  #main-app { flex-direction: column; }
  .sidebar { width: 100%; padding: 15px; flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--border-color); }
  .sidebar-logo { display: none; }
  .nav-item { white-space: nowrap; margin-bottom: 0; margin-right: 10px; padding: 10px 15px; border-left: none; border-bottom: 2px solid transparent; border-radius: 4px;}
  .nav-item.active { border-left: none; border-bottom: 2px solid var(--primary); background: transparent; color: var(--primary); }
  .topbar { display: none; } .content { padding: 15px; }
  .print-container, .form-container, #admin-dashboard-screen, #client-dashboard-screen { padding: 25px; }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  body { background-color: #ffffff !important; color: #1e293b !important; display: block; height: auto; overflow: visible;}
  .sidebar, .topbar, .no-print, .login-bg-container, .login-bg-overlay { display: none !important; }
  /* When NOT in printReport() mode: allow the app shell to print (legacy Ctrl+P on statement). */
  body:not(.is-printing) .main-wrapper,
  body:not(.is-printing) #main-app,
  body:not(.is-printing) .content { display: block !important; overflow: visible !important; height: auto !important; padding: 0 !important; background-color: #ffffff !important; }

  /* When printReport() is active: hide the entire app shell so only the target prints. */
  body.is-printing #main-app,
  body.is-printing #login-screen,
  body.is-printing #premium-splash,
  body.is-printing .main-wrapper,
  body.is-printing .content,
  body.is-printing .sidebar,
  body.is-printing .topbar,
  body.is-printing .mobile-navbar,
  body.is-printing #ai-assistant-container,
  body.is-printing #vault-content,
  body.is-printing #client-plots-breakdown {
      display: none !important;
      visibility: hidden !important;
  }
  .tab-content:not(.active-tab) { display: none !important; }
  .logo-text-fill { fill: #000000 !important; } 
  .print-container { box-shadow: none !important; border: none !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; background-color: #ffffff !important; }
  .table-responsive { overflow: visible !important; box-shadow: none !important; border: none !important; margin-bottom: 25px !important;} 
  .header-title { border-bottom: 2px solid #d4af37 !important; padding-bottom: 15px !important; margin-bottom: 25px !important;}
  .header-title h2 { color: #aa8c2c !important; } .header-title p { color: #64748b !important; }
  table { width: 100% !important; border-collapse: collapse !important; font-size: 13px !important; border: 1px solid #cbd5e1 !important; }
  th { background-color: #f8fafc !important; color: #334155 !important; font-weight: 800 !important; border: 1px solid #cbd5e1 !important; padding: 10px 12px !important; text-transform: uppercase;}
  td { border: 1px solid #cbd5e1 !important; padding: 10px 12px !important; color: #1e293b !important; font-weight: 600 !important; background-color: #ffffff !important;}
  .bg-light { background-color: #f1f5f9 !important; color: #475569 !important; font-weight: 700 !important; }
  h3 { color: #0f172a !important; border-left-color: #d4af37 !important; background-color: #f8fafc !important; }
  td[style*="color: var(--danger)"], span[style*="color: var(--danger)"] { color: #dc2626 !important; }
  td[style*="color: var(--success)"], span[style*="color: var(--success)"] { color: #16a34a !important; }
  td[style*="color: var(--warning)"], span[style*="color: var(--warning)"] { color: #d97706 !important; }
  td[style*="color: var(--primary)"], span[style*="color: var(--primary)"] { color: #0f172a !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* MAP FIXES */
#svg-map-container {
  width: 100%; 
  height: 650px; 
  background-color: #ffffff; 
  border: 1px solid var(--border-strong); 
  border-radius: 8px; 
  overflow: hidden; 
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#society-map { width: 100% !important; height: 100% !important; display: block; }
/* =========================================
   INTERNATIONAL PREMIUM STANDARD OVERRIDES
   ========================================= */
:root {
  --bg-main: #080b12; 
  --bg-card: #121826; 
  --primary-hover: #f1c40f;
  --border-strong: rgba(212, 175, 55, 0.25);
  --shadow-glow: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 8px 25px -5px rgba(212, 175, 55, 0.15);
}

body {
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
}

.form-container, .print-container, .client-plot-card, .admin-card, #login-screen > div {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 16px !important; 
  box-shadow: var(--shadow-glow) !important;
  transition: all 0.3s ease;
}

.client-plot-card:hover, .admin-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-gold) !important;
  border-color: var(--primary) !important;
}

input, select {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid #2d3748 !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  transition: 0.3s !important;
  font-size: 14px;
}

input:focus, select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
  outline: none;
  background: #000 !important;
}

.btn-submit, button {
  border-radius: 10px !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
}

.btn-submit:hover {
  background: var(--primary-hover) !important;
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* MOBILE MAP SMOOTHNESS & CLEAN WHITE BACKGROUND */
#svg-map-container {
  width: 100%;
  height: 60vh; 
  overflow: hidden; 
  touch-action: none; 
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #ffffff !important;
  position: relative;
}
/* =========================================
   PROFESSIONAL CLIENT STATEMENT / INVOICE UI
   ========================================= */

/* Print Container ko White A4 Paper jaisa banayein */
.print-container {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-radius: 8px !important;
    padding: 40px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    max-width: 900px;
    margin: 20px auto;
    font-family: 'Arial', sans-serif !important;
}

/* Header aur Logo Setting */
.print-container h2 {
    color: #1a237e !important;
    border-bottom: 2px solid #d4af37 !important;
    padding-bottom: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Client Info ke peechay jo ajeeb white dabbe aa rahe thay, unhe hatana */
.print-container div, 
.print-container span, 
.print-container p {
    background: transparent !important;
    color: #222222 !important;
}

/* Summary Box (Total aur Balance) */
.print-container > div[style*="background"] {
    background: #f8f9fa !important;
    border: 1px solid #e0e0e0 !important;
    border-left: 5px solid #d4af37 !important;
    border-radius: 6px !important;
    padding: 20px !important;
    box-shadow: none !important;
    color: #000 !important;
    margin: 20px 0 !important;
}

.print-container h1, .print-container h3 {
    color: #1a237e !important;
}

.print-container h1[style*="red"] {
    color: #d32f2f !important;
}

/* Tables ko Bank Ledger jaisa banayein */
.print-container table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
    background: #ffffff !important;
}

.print-container th {
    background: #1a237e !important;
    color: #ffffff !important;
    padding: 12px 10px !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #1a237e !important;
}

.print-container td {
    padding: 10px !important;
    border: 1px solid #dddddd !important;
    font-size: 13px !important;
    color: #333333 !important;
}

.print-container tr:nth-child(even) {
    background: #f9f9f9 !important;
}

.print-container tr:hover td {
    background: #f1f5f9 !important;
}

/* Print Command */
@media print {
    body { background: #fff !important; }
    .print-container { box-shadow: none !important; padding: 0 !important; }
    .sidebar, .top-nav, button { display: none !important; }
}

/* =========================================
   🔥 MOBILE RESPONSIVE FIX FOR STATEMENT 🔥
   ========================================= */
@media screen and (max-width: 768px) {
    .content {
        padding: 10px;
    }

    .print-container, .form-container, #admin-dashboard-screen, #client-dashboard-screen {
        width: 100%;
        max-width: none;
        padding: 15px !important;
        margin: 0 auto;
    }

    .header-title h2 {
        font-size: 13px;
        letter-spacing: 2px;
    }

    .vip-modal-overlay, .modal-overlay {
        padding: 10px;
    }

    .vip-modal-content {
        max-height: 92vh;
    }

    .vip-modal-content [style*="grid-template-columns: 1fr 1fr 1fr"],
    [style*="grid-template-columns: repeat(2, 1fr)"],
    [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .controls {
        gap: 8px;
    }

    .controls input {
        min-width: 0;
        width: 100%;
        flex-basis: 100%;
    }

    .controls button {
        flex: 1;
        min-width: 0;
        padding: 12px 10px;
    }

    #ai-panel {
        width: auto !important;
        max-width: calc(100vw - 30px);
        right: 15px !important;
    }

    a[href^="https://wa.me/"] {
        left: auto !important;
        right: 15px !important;
        bottom: 15px !important;
    }

    .print-container {
        padding: 15px !important;
        margin: 10px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .print-container table {
        min-width: 700px !important;
    }
    .print-container button {
        padding: 8px 15px !important;
        font-size: 12px !important;
    }
}

/* =========================================
   SPLASH SCREEN ANIMATIONS
   ========================================= */
@keyframes splashPulse {
    0% { transform: scale(0.95); opacity: 0.8; filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.1)); }
    100% { transform: scale(1.05); opacity: 1; filter: drop-shadow(0 0 35px rgba(212, 175, 55, 0.5)); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   🔥 NEW MOBILE MENU FIX (SMART GRID) 🔥
   ========================================= */
@media screen and (max-width: 768px) {
    /* Main app ko upar-neeche (vertical) stack karein */
    #main-app { 
        flex-direction: column !important; 
    }

    /* Sidebar ko top par le aayen */
    .sidebar {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        border-right: none !important;
        border-bottom: 2px solid var(--border-strong) !important;
        padding: 15px 10px !important;
        flex-direction: column !important;
    }

    /* Logo ko mobile par chota kar dein */
    .sidebar-logo {
        display: block !important;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .sidebar-logo svg {
        width: 120px !important;
        margin: 0 auto;
    }

    /* Tabs ko 2-column Grid (Dabbon) mein banayen */
    .nav-item {
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 5px !important;
        width: 46% !important;
        margin: 5px 1% !important;
        padding: 10px 5px !important;
        font-size: 11px !important;
        text-align: center !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        white-space: normal !important;
    }

    /* Bottom wale Password/Logout buttons ki setting */
    .sidebar > div:last-child {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 100%;
    }
    
    .sidebar > div:last-child button {
        flex: 1 !important;
        margin: 0 !important;
        font-size: 11px !important;
    }
}
/* Zoom & Reset controls ko Top-Left par shift karein */
#svg-pan-zoom-controls {
    transform: translate(15px, 15px) !important;
}
/* 🔥 MASTER MODAL (POPUP) STYLES 🔥 */
.modal-overlay {
    display: none; /* By default chupa rahega */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px); /* Background ko dhundla karega */
}

.modal-box {
    background: #1a1e29; /* Aapka dark theme */
    border: 1px solid #d4af37; /* Golden border */
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

/* Close Button (Cross) */
.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}
.modal-close:hover { color: #f44336; }

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Action Buttons */
.modal-btn-group {
    display: flex; flex-direction: column; gap: 12px; margin-top: 25px;
}
.modal-btn {
    padding: 12px; border: none; border-radius: 6px; 
    font-weight: bold; font-size: 14px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 1px;
    transition: 0.2s;
}
.btn-pay { background: #2e7d32; color: white; } /* Green */
.btn-pay:hover { background: #1b5e20; }
.btn-transfer { background: #f57c00; color: white; } /* Orange */
.btn-transfer:hover { background: #e65100; }
.btn-cancel { background: #d32f2f; color: white; } /* Red */
.btn-cancel:hover { background: #b71c1c; }
/* 🔥 EXPENSE BUTTON FIX */
button.expense-btn {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: var(--text-dark) !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    cursor: pointer !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    margin-top: 20px !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2) !important;
    position: static !important;
    transform: none !important;
}

button.expense-btn:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4) !important;
}
/* 🔥 VIP MODAL (POPUP) STYLING 🔥 */
.vip-modal-overlay {
    display: none; /* By default hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 28, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

.vip-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(212, 175, 55, 0.1);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    
    /* 🔥 Yeh 2 lines Screen Height ka masla hal karengi 🔥 */
    max-height: 85vh; /* Screen ka maximum 85% height lega */
    overflow-y: auto; /* Agar form lamba hai toh andar hi scroll aa jayega */
}

/* 🔥 VIP Scrollbar Design for Modal (Optional but Premium look) */
.vip-modal-content::-webkit-scrollbar {
    width: 8px;
}
.vip-modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.vip-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
/* Close Button (X) */
.close-vip-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-vip-modal:hover {
    color: var(--danger);
    transform: scale(1.1);
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   VIP PORTAL GLASSMORPHISM & ROI STYLES
   ========================================= */
.vip-glass-card {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
    border-radius: 16px !important;
    padding: 24px;
    position: relative;
    overflow: hidden;
    color: #e5e7eb;
}

.vip-gold-gradient-text {
    background: linear-gradient(to right, #f6d365 0%, #ffb347 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vip-gold-border {
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.05), transparent) !important;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.vip-grid-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
    height: 100%;
}

@media (min-width: 1024px) {
    /* VIP cards stack vertically internally to flow properly in the portfolio grid */
}

.vip-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 32px;
}

/* Removed 4-column grid constraint for stats box to ensure 2x2 layout */

.vip-stat-box {
    background: rgba(15, 23, 42, 0.5);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.vip-stat-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.vip-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.vip-text-success { color: #4ade80 !important; }
.vip-text-danger { color: #f87171 !important; }
.vip-text-primary { color: #d4af37 !important; }

.vip-btn-pay {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    color: white !important;
    font-weight: bold;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
    cursor: pointer;
    font-size: 14px !important;
    transition: 0.3s;
}
.vip-btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
}

.vip-glow-circle {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 160px;
    height: 160px;
    background: #d4af37;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    pointer-events: none;
}
/* Executive Golden Pulse & Shimmer for Client's Owned Plot */
@keyframes executiveGoldGlow {
  0% {
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4), 0 0 20px rgba(202, 138, 4, 0.2);
    border-color: #facc15;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.6));
  }
  50% {
    box-shadow: 0 0 22px rgba(234, 179, 8, 0.85), 0 0 35px rgba(202, 138, 4, 0.5);
    border-color: #fef08a;
    filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.95));
  }
  100% {
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4), 0 0 20px rgba(202, 138, 4, 0.2);
    border-color: #facc15;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.6));
  }
}

/* SVG / Grid Path class */
.plot-executive-gold {
  fill: #eab308 !important;
  stroke: #fef08a !important;
  stroke-width: 2.5px;
  stroke-dasharray: 4;
  animation: executiveGoldGlow 2.2s infinite ease-in-out;
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.25s ease;
}

.plot-executive-gold:hover {
  transform: scale(1.04);
  stroke-width: 3.5px;
}

.plot-available-green {
  fill: #22c55e !important;
  cursor: pointer;
  transition: all 0.2s ease;
}
.plot-available-green:hover {
  fill: #16a34a !important;
  stroke: #4ade80 !important;
  stroke-width: 2px;
}

.plot-booked-red {
  fill: #ef4444 !important;
  opacity: 0.75;
  cursor: not-allowed;
}

/* ========================================== */
/* 🎖️ VIP GAMIFICATION & STAR PAYER BADGES    */
/* ========================================== */

.vip-badge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.badge-vip-gold {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #000;
  border: 1px solid #fef08a;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
}
.badge-vip-gold:hover {
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.6);
  transform: translateY(-2px);
}

.badge-tier-silver {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
  border: 1px solid #cbd5e1;
}

.badge-grace-warning {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #000;
  border: 1px solid #fdba74;
  animation: pulse-orange 2s infinite;
}

.badge-overdue-alert {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff;
  border: 1px solid #fca5a5;
  animation: pulse-red 1.5s infinite;
}

.vip-status-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

@keyframes pulse-orange {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ========================================== */
/* 🛠️ SUPPORT TICKET PROGRESS TRACKER          */
/* ========================================== */
.step-tracker-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  position: relative;
  width: 100%;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
}
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: var(--text-muted);
  transition: all 0.3s ease;
  margin-bottom: 8px;
}
.step-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}
.step-connector {
  position: absolute;
  top: 15px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: var(--text-muted);
  z-index: 1;
  opacity: 0.3;
}
.step-connector-fill {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 0.4s ease;
}

/* State Modifiers */
.step-completed .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step-completed .step-label {
  color: var(--success);
}
.step-active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  animation: pulse-orange 2s infinite;
}
.step-active .step-label {
  color: var(--primary);
}

@media print {
    /* HTML aur Body ko poori tarah safaid aur lock kar do */
    html, body {
        background: #ffffff !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Target ke ilawa baqi poori website ke containers ko gayab kar do */
    body > *:not(.active-print-target),
    body.is-printing > *:not(.active-print-target) {
        display: none !important;
    }
    
    /* Sirf aur sirf active print target apni asli halat mein top par rahega */
    .active-print-target {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        top: auto !important;
        z-index: auto !important;
        page-break-after: auto;
        break-after: auto;
    }
    body.is-printing .active-print-target,
    body.is-printing #template-ledger-statement,
    body.is-printing #template-installment-receipt {
        padding: 0 !important;
        margin: 0 !important;
    }
    body.is-printing #template-ledger-statement > *,
    body.is-printing #template-installment-receipt > * {
        page-break-inside: avoid;
    }

    /* Rate list: don't break rows across pages */
    #template-rate-list table tr {
        page-break-inside: avoid;
    }
    #template-rate-list table thead {
        display: table-header-group;
    }
    body.is-printing #template-rate-list {
        padding: 0 !important;
        margin: 0 !important;
    }
}

