/* ====================================================
    MINE ERP SYSTEM - GLOBAL STYLESHEET (style.css)
==================================================== */

:root {
    --p-color: #2980b9;
    --s-color: #2c3e50;
    --accent: #e67e22;
    --red: #e74c3c;
    --green: #27ae60;
    --bg-color: #f4f7f6;
    --sidebar-bg: #0b1a2a;
    --sidebar-hover: #13263d;
    --text-main: #333333;
    --text-muted: #7f8c8d;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
    SIDEBAR STYLES
========================================== */
#sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: 0.3s;
    z-index: 100;
}
.logo-wrap { padding: 20px; text-align: center; background-color: #07121e; border-bottom: 1px solid #1a2c42; }
.logo-text { font-size: 16px; font-weight: 900; letter-spacing: 1px; color: #ffffff; margin-top: 5px; }
.live-status { display: inline-flex; align-items: center; gap: 6px; background: rgba(39, 174, 96, 0.1); color: #27ae60; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: bold; border: 1px solid rgba(39, 174, 96, 0.3); margin-top: 10px; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; background-color: #27ae60; border-radius: 50%; animation: pulse-green 1.5s infinite; }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); } 100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); } }
.menu-head { font-size: 11px; color: #7f8c8d; text-transform: uppercase; padding: 15px 20px 5px 20px; font-weight: bold; }
.menu-btn { width: 100%; background: transparent; color: #bdc3c7; border: none; padding: 12px 20px; text-align: left; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; border-left: 4px solid transparent; }
.menu-btn:hover, .menu-btn.active { background-color: var(--sidebar-hover); color: #ffffff; }
.menu-btn.active { border-left-color: var(--p-color); }
.sub-menu-btn { padding-left: 35px; font-size: 13px; color: #95a5a6; }
.sub-menu-btn.active { color: #3498db; font-weight: bold; }

/* ==========================================
    MAIN CONTENT & FORMS
========================================== */
#main { flex: 1; overflow-y: auto; padding: 20px; background-color: var(--bg-color); }
.container { max-width: 1200px; margin: 0 auto; }
.card { background: #ffffff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border-top: 4px solid var(--p-color); }
.form-grid { display: grid; gap: 15px; }
label { display: block; font-size: 12px; font-weight: 700; color: var(--s-color); margin-bottom: 5px; text-transform: uppercase; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea { width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; font-family: inherit; font-size: 14px; box-sizing: border-box; }
input:focus, select:focus, textarea:focus { border-color: var(--p-color); outline: none; box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1); }
input[readonly] { background-color: #e9ecef; cursor: not-allowed; font-weight: bold; }
.btn-action { padding: 10px 20px; background-color: var(--p-color); color: #ffffff; border: none; border-radius: 4px; font-size: 14px; font-weight: bold; cursor: pointer; text-transform: uppercase; }

/* ==========================================
    TABLES
========================================== */
.table-responsive { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 6px 8px !important; border: 1px solid #000 !important; font-size: 12px !important; text-align: center; }
th { background-color: #f8f9fa !important; color: #000 !important; font-weight: bold !important; }

/* ==========================================
    AI CHATBOT
========================================== */
.chatbot-toggler { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background-color: #2980b9; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; z-index: 9999; border: none; }
.chatbot-window { position: fixed; bottom: 100px; right: 30px; width: 350px; height: 450px; background: #ffffff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); display: none; flex-direction: column; z-index: 9998; overflow: hidden; border: 1px solid #e2e8f0; }

/* ==========================================
    ULTIMATE PRINT FIX (PORTRAIT)
========================================== */
@media print {
    @page { 
        size: A4 portrait; 
        margin: 5mm; 
    }

    body { 
        background: white; 
        /* 🟢 জুম আউট করে পেজটিকে সঙ্কুচিত করা হলো যাতে ডানদিক না কাটে */
        zoom: 0.85; 
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important;
    }
    
    #sidebar, .no-print, .chatbot-toggler, .chatbot-window { 
        display: none !important; 
    }
    
    /* 🟢 সবচেয়ে জরুরি ফিক্স: overflow: visible করে দেওয়া হলো যাতে ডানদিক কোনোভাবেই হাইড না হয় */
    html, body, #main, .container, .card, .table-responsive, .gov-dash-wrapper { 
        display: block !important; 
        width: 100% !important; 
        max-width: 100% !important;
        margin: 0 !important; 
        padding: 0 !important;
        overflow: visible !important; 
        overflow-x: visible !important; 
        box-shadow: none !important; 
        border: none !important; 
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid !important;
        margin-bottom: 5px !important;
    }

    .dash-stat-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    
    .dash-stat-grid > * {
        flex: 1 !important;
        margin: 0 5px !important;
    }

    /* 🟢 টেবিল ব্রেক এবং কলাম ফিক্স */
    table { 
        page-break-inside: auto !important; 
        border-collapse: collapse !important; 
        width: 100% !important; 
        table-layout: auto !important; 
    }
    
    thead { display: table-header-group !important; } 
    tfoot { display: table-footer-group !important; } 
    
    tr { 
        page-break-inside: avoid !important; 
        break-inside: avoid !important; 
        page-break-after: auto !important;
    }
    
    /* 🟢 লেখাগুলো লম্বা হলে নিচে নামবে (wrap), কিন্তু কলাম ডানদিকে ঠেলবে না */
    th, td { 
        page-break-inside: avoid !important;
        border: 1px solid #000 !important; 
        padding: 4px 2px !important; 
        font-size: 10px !important; 
        word-wrap: break-word !important;
        white-space: normal !important; 
        text-align: center !important;
    }
}