/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&display=swap');

/* ============================================================
   রিসেট
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #2c3e50;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   লগইন পেজ
   ============================================================ */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.login-header { text-align: center; margin-bottom: 25px; }
.login-header h2 { color: #1e3c72; font-size: 24px; font-weight: 700; }
.login-header p { color: #666; font-size: 14px; }

.login-footer-hint {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #777;
}

/* ============================================================
   মূল লেআউট
   ============================================================ */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   শীর্ষ হেডার
   ============================================================ */
.app-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #1a365d;
    color: #fff;
    padding: 12px 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-title {
    flex: 1;
    min-width: 0;
}
.brand-title h2 {
    font-size: 19px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.role-pill {
    background: #2b6cb0;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ============================================================
   হ্যামবার্গার বাটন (ডিফল্ট: ডেস্কটপে লুকানো)
   ============================================================ */
.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
    width: 42px;
    height: 42px;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.hamburger-btn:hover { background: rgba(255,255,255,0.12); }

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

/* ============================================================
   সাইডবার ওভারলে
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================================
   সাইডবার মোবাইল হেডার (ডিফল্ট: লুকানো)
   ============================================================ */
.sidebar-mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #0f172a;
    color: #fff;
    border-bottom: 1px solid #1e293b;
    font-weight: 700;
    font-size: 15px;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* ============================================================
   ★★★ সাইডবার (প্রফেশনাল লুক) ★★★
   ============================================================ */
.app-main-layout {
    display: flex;
    flex: 1;
    margin-bottom: 45px; /* ফুটারের জন্য জায়গা */
}

.app-sidebar {
    width: 260px;
    min-width: 260px;
    background: #1e293b;
    color: #cbd5e0;
    border-right: 1px solid #0f172a;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}

.sidebar-menu-wrapper {
    padding: 10px 0 30px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ---------- সেকশন হেডিং (রঙিন) ---------- */
.nav-header-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px 8px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    margin-top: 4px;
}

.nav-header-item .nav-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    color: #fff;
}

/* সেকশন-ভিত্তিক রঙ */
.nav-accent-blue   { color: #63b3ed; }
.nav-accent-blue .nav-header-icon   { background: #3182ce; box-shadow: 0 2px 6px rgba(49,130,206,0.4); }

.nav-accent-green  { color: #68d391; }
.nav-accent-green .nav-header-icon  { background: #38a169; box-shadow: 0 2px 6px rgba(56,161,105,0.4); }

.nav-accent-orange { color: #f6ad55; }
.nav-accent-orange .nav-header-icon { background: #dd6b20; box-shadow: 0 2px 6px rgba(221,107,32,0.4); }

.nav-accent-purple { color: #b794f4; }
.nav-accent-purple .nav-header-icon { background: #805ad5; box-shadow: 0 2px 6px rgba(128,90,213,0.4); }

/* হেডারের নিচে সরু রঙিন লাইন */
.nav-header-item::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 1px;
    opacity: 0.15;
}
.nav-accent-blue::after   { background: #3182ce; }
.nav-accent-green::after  { background: #38a169; }
.nav-accent-orange::after { background: #dd6b20; }
.nav-accent-purple::after { background: #805ad5; }

/* ---------- মেনু লিংক ---------- */
.sidebar-nav li a.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 18px 11px 16px;
    color: #b8c2cc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    margin: 2px 8px 2px 0;
    position: relative;
}

.sidebar-nav li a.nav-link .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.sidebar-nav li a.nav-link span:last-child {
    flex: 1;
    min-width: 0;
}

/* হোভার ও অ্যাক্টিভ স্টেট — সেকশন-ভিত্তিক রঙ */
.sidebar-nav li a.nav-link-blue:hover,
.sidebar-nav li a.nav-link-blue.active {
    background: rgba(49,130,206,0.15);
    color: #90cdf4;
    border-left-color: #3182ce;
}
.sidebar-nav li a.nav-link-blue:hover .nav-icon,
.sidebar-nav li a.nav-link-blue.active .nav-icon {
    color: #63b3ed;
    opacity: 1;
}

.sidebar-nav li a.nav-link-green:hover,
.sidebar-nav li a.nav-link-green.active {
    background: rgba(56,161,105,0.15);
    color: #9ae6b4;
    border-left-color: #38a169;
}
.sidebar-nav li a.nav-link-green:hover .nav-icon,
.sidebar-nav li a.nav-link-green.active .nav-icon {
    color: #68d391;
    opacity: 1;
}

.sidebar-nav li a.nav-link-orange:hover,
.sidebar-nav li a.nav-link-orange.active {
    background: rgba(221,107,32,0.15);
    color: #fbd38d;
    border-left-color: #dd6b20;
}
.sidebar-nav li a.nav-link-orange:hover .nav-icon,
.sidebar-nav li a.nav-link-orange.active .nav-icon {
    color: #f6ad55;
    opacity: 1;
}

.sidebar-nav li a.nav-link-purple:hover,
.sidebar-nav li a.nav-link-purple.active {
    background: rgba(128,90,213,0.15);
    color: #d6bcfa;
    border-left-color: #805ad5;
}
.sidebar-nav li a.nav-link-purple:hover .nav-icon,
.sidebar-nav li a.nav-link-purple.active .nav-icon {
    color: #b794f4;
    opacity: 1;
}

/* ============================================================
   মূল কনটেন্ট এরিয়া
   ============================================================ */
.app-content-area {
    flex: 1;
    padding: 25px;
    background: #f8fafc;
    min-width: 0;
    overflow-x: hidden;
}

/* ============================================================
   কার্ড
   ============================================================ */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #edf2f7;
}

/* ============================================================
   ফর্ম
   ============================================================ */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-group { margin-bottom: 15px; }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14.5px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-control:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

/* ============================================================
   বাটন
   ============================================================ */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    text-align: center;
}

.btn-primary { background: #3182ce; color: #fff; }
.btn-primary:hover { background: #2b6cb0; }

.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }

.btn-success { background: #38a169; color: #fff; }
.btn-success:hover { background: #2f855a; }

.btn-logout {
    background: #e53e3e;
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.btn-block { width: 100%; }

/* ============================================================
   ফুটার
   ============================================================ */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #1a202c;
    color: #e2e8f0;
    text-align: center;
    padding: 8px 15px;
    font-size: 13px;
    z-index: 90;
    border-top: 1px solid #2d3748;
}

/* ============================================================
   টেবিল
   ============================================================ */
table { font-size: 13.5px; }

/* ============================================================
   ★★★ ট্যাবলেট (১০২৪px এর নিচে) ★★★
   ============================================================ */
@media (max-width: 1024px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .app-content-area { padding: 20px; }
}

/* ============================================================
   ★★★ ছোট ট্যাবলেট (৯০০px এর নিচে) ★★★
   ============================================================ */
@media (max-width: 900px) {
    .brand-title h2 { font-size: 16px; }
    .user-name { display: none; }
}

/* ============================================================
   ★★★ মোবাইল (৭৬৮px এর নিচে) ★★★
   ============================================================ */
@media (max-width: 768px) {

    /* ---------- হেডার ---------- */
    .app-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .brand-title h2 {
        font-size: 13.5px;
        white-space: normal;
        line-height: 1.3;
        overflow: visible;
        text-overflow: clip;
    }

    /* হ্যামবার্গার দেখাও */
    .hamburger-btn {
        display: flex;
        flex-shrink: 0;
    }

    .header-user-panel { gap: 6px; }

    .role-pill {
        font-size: 9.5px;
        padding: 2px 6px;
    }

    .btn-logout {
        padding: 5px 9px;
        font-size: 11.5px;
    }

    /* ---------- সাইডবার: স্লাইড ড্রয়ার ---------- */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 290px;
        min-width: 0;
        max-width: 88%;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
        overflow-y: auto;
    }

    .app-sidebar.active {
        transform: translateX(0);
    }

    /* সাইডবার মোবাইল হেডার দেখাও */
    .sidebar-mobile-header {
        display: flex;
    }

    /* ---------- মূল কনটেন্ট ---------- */
    .app-main-layout {
        display: block;
        margin-bottom: 40px;
    }

    .app-content-area {
        padding: 12px;
        width: 100%;
    }

    /* ---------- কার্ড ---------- */
    .card {
        padding: 14px;
        border-radius: 6px;
        margin-bottom: 14px;
    }

    .card-title,
    .card h2 {
        font-size: 16px !important;
    }

    .card h3 {
        font-size: 14.5px !important;
    }

    /* ---------- ফর্ম ---------- */
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .form-group { margin-bottom: 12px; }

    .form-group label {
        font-size: 13px;
    }

    .form-control {
        font-size: 14px;
        padding: 8px 10px;
    }

    /* ---------- ফুটার ---------- */
    .app-footer {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* ---------- টেবিল ---------- */
    .card > div[style*="overflow-x"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 12.5px;
        min-width: 600px;
    }

    /* ---------- বাটন ---------- */
    .btn {
        padding: 7px 14px;
        font-size: 13px;
    }
}

/* ============================================================
   ★★★ ছোট মোবাইল (৪৮০px এর নিচে) ★★★
   ============================================================ */
@media (max-width: 480px) {
    .app-header {
        padding: 8px 10px;
        gap: 6px;
    }

    .brand-title h2 {
        font-size: 12px;
    }

    .hamburger-btn {
        width: 38px;
        height: 38px;
    }

    .hamburger-btn span {
        width: 20px;
        height: 2.5px;
    }

    .role-pill { display: none; }

    .btn-logout {
        padding: 4px 8px;
        font-size: 11px;
    }

    .app-sidebar {
        width: 270px;
    }

    .app-content-area { padding: 10px; }

    .card { padding: 12px; }

    .card-title,
    .card h2 {
        font-size: 15px !important;
    }

    .sidebar-nav li a.nav-link {
        font-size: 13.5px;
        padding: 10px 14px 10px 12px;
    }
}

/* ============================================================
   ★★★ Fallback: চেকবক্স দিয়ে সেকশন দেখানো (CSS-only) ★★★
   ============================================================ */
.section-toggle { cursor: pointer; }

.section-content { display: none; }

.section-toggle:checked ~ .section-content {
    display: block !important;
}