/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary: #4f46e5;       /* মেইন কালার (Blue/Purple) */
    --primary-hover: #4338ca;
    --secondary: #0f172a;     /* সাইডবার কালার */
    --bg-light: #f1f5f9;      /* ব্যাকগ্রাউন্ড কালার */
    --white: #ffffff;
    --text-dark: #334155;
    --text-gray: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Inter, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
    font-size: 15px;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* =========================================
   2. SIDEBAR (MOBILE OPTIMIZED)
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1001;
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.menu { padding: 10px 0; }

.menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    transition: 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
}

.menu li a i { width: 25px; text-align: center; margin-right: 10px; font-size: 1.1rem; }

.menu li a:hover, .menu li a.active {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-left-color: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

/* =========================================
   3. MAIN CONTENT AREA
   ========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Top Header Bar */
.header-bar {
    background: var(--white);
    height: var(--header-height);
    padding: 0 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    margin-bottom: 25px;
    position: sticky;
    top: 10px;
    z-index: 900;
}

.mobile-toggle {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--secondary);
    padding: 5px;
}

/* =========================================
   4. CARDS & GRID
   ========================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    position: relative;
}

.card h3 { font-size: 1rem; color: var(--text-gray); margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.card .value { font-size: 1.8rem; font-weight: 700; color: var(--secondary); }

/* =========================================
   5. FORMS & INPUTS
   ========================================= */
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ড্রপডাউন সাদা হওয়ার সমস্যার সমাধান */
select.form-control {
    background-color: #ffffff !important;
    color: #1e293b !important;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    cursor: pointer;
}

select.form-control option {
    background: #fff;
    color: #333;
    padding: 10px;
}

label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }

/* =========================================
   6. SEARCH BOX (LIVE SEARCH)
   ========================================= */
.search-box { position: relative; }

.search-results {
    position: absolute; 
    top: 100%; left: 0; width: 100%;
    background: white; border: 1px solid var(--border);
    border-radius: 8px; z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.search-list li { 
    padding: 12px; border-bottom: 1px solid var(--bg-light); cursor: pointer; 
}
.search-list li:hover { background: #f8fafc; color: var(--primary); }

.no-result-box {
    padding: 15px; text-align: center; color: var(--text-gray);
}

.btn-add-mini { 
    background: var(--primary); color: white; border: none; 
    padding: 8px 15px; border-radius: 6px; font-size: 0.85rem; 
    margin-top: 8px; cursor: pointer; 
}

/* =========================================
   7. MODAL / POPUP (আপনার স্ক্রিনশটের সমস্যার সমাধান)
   ========================================= */
.modal {
    display: none; /* ডিফল্টভাবে লুকানো থাকবে */
    position: fixed; /* স্ক্রিনের এক জায়গায় ফিক্স থাকবে */
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); /* পেছনের অংশ ঝাপসা হবে */
    z-index: 2000; /* সবার উপরে থাকবে */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

/* jQuery show() ব্যবহার করলে এটি display: block করে দেয়, তাই flex জোর করে দেওয়া হলো */
.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: slideDown 0.3s ease;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   8. BUTTONS & TABLES
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: auto;
    transition: 0.3s;
}
.btn:hover { background: var(--primary-hover); }

.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; color: var(--text-gray); }

/* Status Badges */
.badge { padding: 5px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; display: inline-block; }
.bg-Solved { background: #dcfce7; color: #166534; }
.bg-Pending { background: #fee2e2; color: #991b1b; }
.bg-InProgress { background: #dbeafe; color: #1e40af; }

/* Alerts */
.alert { padding: 12px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; }
.success { background: #dcfce7; color: #166534; }
.error { background: #fee2e2; color: #991b1b; }

/* =========================================
   9. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    /* Sidebar Hide */
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }

    /* Main Content Full Width */
    .main-content { margin-left: 0; width: 100%; padding: 15px; }

    /* Header */
    .mobile-toggle { display: block; }
    .header-bar { padding: 0 15px; }

    /* Cards */
    .card-grid { grid-template-columns: 1fr; }

    /* Forms */
    form div[style*="display:flex"] {
        flex-direction: column; /* Start/End Time নিচে নিচে আসবে */
        gap: 0 !important;
    }
    
    .btn { width: 100%; margin-top: 10px; }
}