:root {
    --primary: #1e3a8a; 
    --secondary: #3b82f6; 
    --accent: #f59e0b; 
    --success: #10b981; 
    --danger: #ef4444; 
    --info: #06b6d4;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Hind Siliguri', sans-serif; }
body { background: var(--bg-body); color: var(--text-dark); overflow-x: hidden; font-size: 15px; }

.swal2-container { z-index: 99999 !important; }


#login-screen { 
    display: none; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background: #ffffff; 
    padding: 20px; 
}



.login-box { 
    background: transparent; 
    padding: 10px; 
    border-radius: 0; 
    width: 100%; 
    max-width: 400px; 
    box-shadow: none; 
    text-align: center; 
}

.login-box h2 { color: var(--primary); font-size: 28px; font-weight: 700; margin-bottom: 5px; }
.login-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 25px; }
.dev-credit { margin-top: 20px; font-size: 13px; color: var(--text-muted); font-weight: 600; border-top: 1px dashed var(--border); padding-top: 15px; }
.dev-credit span { color: var(--secondary); font-weight: 700; font-size: 15px; }

.form-control { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; outline: none; background: #f8fafc; transition: 0.3s; }
.form-control:focus { border-color: var(--secondary); background: #fff; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dark); }

.btn { width: 100%; padding: 10px 14px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; color: #fff; display: inline-flex; justify-content: center; align-items: center; gap: 6px; transition: 0.2s; }
.btn-primary { background: var(--secondary); }
.btn-primary:hover { background: var(--primary); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--accent); color: #fff; }
.btn-info { background: var(--info); }
.btn-dark { background: var(--text-dark); }

.action-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.action-btns .btn { padding: 5px 8px; font-size: 12px; width: auto; }

.app-layout { display: none; height: 100vh; flex-direction: row; }
.sidebar { width: 260px; background: var(--primary); color: #fff; display: flex; flex-direction: column; transition: 0.3s; z-index: 1000; box-shadow: 4px 0 15px rgba(0,0,0,0.05); }
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h3 { font-size: 22px; font-weight: 700; }
.sidebar-header p { font-size: 12px; color: #93c5fd; margin-top: 3px; }

.nav-links { flex: 1; list-style: none; padding: 10px 0; overflow-y: auto; }
.nav-links li { padding: 13px 20px; font-size: 15px; cursor: pointer; color: #cbd5e1; font-weight: 500; display: flex; align-items: center; gap: 10px; border-left: 4px solid transparent; transition: 0.2s; }
.nav-links li:hover, .nav-links li.active { color: #fff; background: rgba(255,255,255,0.1); border-left-color: var(--accent); }
.logout-box { padding: 15px; border-top: 1px solid rgba(255,255,255,0.1); }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: #fff; height: 65px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border); }
.menu-toggle { display: none; font-size: 22px; cursor: pointer; color: var(--primary); }
.page-title { font-size: 18px; font-weight: 700; color: var(--primary); }

.content-area { flex: 1; padding: 20px; overflow-y: auto; }
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card-header { font-size: 16px; font-weight: 700; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid var(--bg-body); color: var(--primary); display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.calc-results { background: #e0f2fe; border: 1px solid #bae6fd; border-radius: var(--radius); padding: 15px; margin-top: 15px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.calc-box { background: #fff; padding: 12px; border-radius: 6px; text-align: center; border: 1px solid #e2e8f0; }
.calc-box p { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.calc-box h3 { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 4px; }

.schedule-wrapper { margin-top: 20px; border: 1px solid var(--success); border-radius: 6px; overflow: hidden; display: none; }
.schedule-header { background: var(--success); color: #fff; padding: 10px; font-weight: 600; text-align: center; font-size: 14px; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 750px; background: #fff; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f8fafc; font-weight: 600; color: var(--text-muted); }
tr:hover { background: #f1f5f9; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); justify-content: center; align-items: center; z-index: 2000; padding: 15px; backdrop-filter: blur(3px); }
.modal-content { background: #fff; padding: 20px; border-radius: var(--radius); width: 100%; max-width: 450px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3); position: relative; }
.close-modal { position: absolute; top: 12px; right: 15px; cursor: pointer; color: var(--danger); font-size: 24px; font-weight: bold; background: none; border: none; }

.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f8fafc; padding: 12px; border-radius: 6px; margin-bottom: 15px; border: 1px solid var(--border); }
.preview-grid div { border-bottom: 1px dashed #cbd5e1; padding-bottom: 4px; font-size: 14px; font-weight: 600; }
.preview-grid div span { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; height: 100%; }
    .sidebar.active { left: 0; }
    .menu-toggle { display: block; }
    .content-area { padding: 12px; }
    .topbar { padding: 0 15px; }
    .form-grid { grid-template-columns: 1fr; }
    #sidebar-overlay { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:999; }
    #sidebar-overlay.active { display: block; }
}

.app-logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px auto;
    display: block;
    border: 3px solid var(--primary);
    background: #fff;
    padding: 2px;
}
.sidebar-logo {
    width: 70px;
    height: 70px;
    border-color: #fff;
    margin-bottom: 8px;
}


/* --- Loading Screen CSS --- */
#ts_loader {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255,255,255,0.72) !important;
    backdrop-filter: blur(7px) !important;
    -webkit-backdrop-filter: blur(7px) !important;
    z-index: 99999999 !important;
}

.green-spinner {
    display: block !important;
    font-size: 45px !important;
    color: #10b981 !important;
    margin-bottom: 15px !important;
}

#ts_loader h2 {
    margin: 0 !important;
    color: #334155 !important;
    font-family: "Hind Siliguri", Arial, sans-serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

