*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#1f2937;background:#f9fafb}
a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
h1{font-size:20px;font-weight:600;margin:0 0 16px;color:#111827}
h2{font-size:16px;font-weight:600;margin:20px 0 10px;color:#1f2937}

/* Header Navbar */
.top{border-bottom:1px solid #e5e7eb;background:#ffffff;position:sticky;top:0;z-index:20;box-shadow:0 1px 2px rgba(0,0,0,0.03)}
.bar{display:flex;align-items:center;gap:12px;padding:10px 16px;max-width:1200px;margin:0 auto}
.brand{font-weight:700;color:#111827;font-size:18px;display:flex;align-items:center;gap:6px}
.brand small{color:#6b7280;font-weight:500;font-size:12px;background:#f3f4f6;padding:2px 6px;border-radius:4px}
.toplinks{margin-left:auto;display:flex;align-items:center;gap:14px}
.logout-link{color:#ef4444;font-weight:500}

/* Header Menu Button */
.menu-btn{
    display:none;
    background:#ffffff;
    border:1px solid #d1d5db;
    border-radius:6px;
    padding:6px 10px;
    font-size:18px;
    line-height:1;
    color:#374151;
    cursor:pointer;
    transition:background-color .2s,border-color .2s;
}
.menu-btn:hover{background:#f3f4f6;border-color:#9ca3af}

/* Main Layout */
.layout{display:flex;max-width:1200px;margin:0 auto;min-height:calc(100vh - 120px);background:#ffffff}
.side{
    width:220px;
    border-right:1px solid #e5e7eb;
    padding:16px 0;
    flex-shrink:0;
    background:#ffffff;
}
.side ul{list-style:none;margin:0;padding:0}
.side a{
    display:block;
    padding:9px 20px;
    color:#4b5563;
    font-size:14px;
    font-weight:500;
    border-left:3px solid transparent;
    transition:background .15s,color .15s;
}
.side a:hover{background:#f9fafb;color:#111827;text-decoration:none}
.side a.on{
    background:#eff6ff;
    color:#2563eb;
    border-left-color:#2563eb;
}

/* Drawer Internal Header (Desktop এ লুকানো) */
.drawer-header{
    display:none;
    align-items:center;
    justify-content:space-between;
    padding:14px 18px;
    border-bottom:1px solid #e5e7eb;
    background:#ffffff;
}
.drawer-title{font-size:16px;font-weight:700;color:#111827}
.drawer-close{
    background:none;
    border:none;
    font-size:24px;
    line-height:1;
    color:#6b7280;
    cursor:pointer;
    padding:2px 6px;
}
.drawer-close:hover{color:#111827}

/* Drawer Background Overlay */
.drawer-overlay{
    display:none;
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(0,0,0,0.5);
    z-index:40;
    opacity:0;
    transition:opacity .3s ease;
}
.drawer-overlay.active{
    display:block;
    opacity:1;
}

/* Content Area */
.main{flex:1;padding:24px;min-width:0;background:#ffffff}
.card{border:1px solid #e5e7eb;border-radius:8px;padding:16px;margin-bottom:16px;background:#ffffff}
.muted{color:#6b7280;font-size:13px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.stat{border:1px solid #e5e7eb;border-radius:8px;padding:12px;background:#f9fafb}
.stat b{display:block;font-size:19px;font-weight:700;color:#111827;margin-top:2px}
.stat span{color:#6b7280;font-size:12px}

/* Tables */
table{border-collapse:collapse;width:100%}
th,td{border-bottom:1px solid #e5e7eb;padding:8px 10px;text-align:left;vertical-align:top}
th{background:#f9fafb;font-size:12px;font-weight:600;color:#4b5563;text-transform:uppercase;letter-spacing:.025em}
.tbl{overflow-x:auto;margin-bottom:14px;border:1px solid #e5e7eb;border-radius:6px}

/* Forms */
label{display:block;font-size:13px;font-weight:500;margin:12px 0 4px;color:#374151}
input,select,textarea{
    width:100%;
    max-width:460px;
    padding:8px 10px;
    border:1px solid #d1d5db;
    border-radius:6px;
    font:inherit;
    background:#ffffff;
    color:#111827;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,0.15)}
textarea{max-width:560px;min-height:90px}
input[type=checkbox]{width:auto}

/* Buttons */
button,.btn{
    display:inline-block;
    background:#2563eb;
    color:#ffffff;
    border:0;
    border-radius:6px;
    padding:8px 16px;
    font:inherit;
    font-size:14px;
    font-weight:500;
    cursor:pointer;
    margin-top:10px;
    transition:background-color .15s;
}
button:hover,.btn:hover{background:#1d4ed8;text-decoration:none}
button.sec,.btn.sec{background:#ffffff;color:#374151;border:1px solid #d1d5db}
button.sec:hover,.btn.sec:hover{background:#f9fafb;border-color:#9ca3af}
button.danger{background:#dc2626}
button.danger:hover{background:#b91c1c}

/* Alerts & Badges */
.alert{padding:10px 14px;border-radius:6px;margin-bottom:14px;border:1px solid;font-size:14px}
.alert.error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.alert.success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.alert.info{background:#eff6ff;border-color:#bfdbfe;color:#1e40af}

.badge{display:inline-block;border-radius:12px;padding:2px 8px;font-size:12px;font-weight:500;background:#f3f4f6;color:#374151}
.badge.ok{background:#dcfce7;color:#166534}
.badge.warn{background:#fef9c3;color:#854d0e}
.badge.bad{background:#fee2e2;color:#991b1b}
.badge.info{background:#dbeafe;color:#1e40af}

.pager{margin:12px 0}.pager a,.pager b{margin-right:8px}.inline{display:inline}.row{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}.row>div{flex:1 1 140px}
code,pre{background:#f3f4f6;border-radius:4px;font-size:13px}code{padding:2px 5px}pre{padding:12px;overflow-x:auto}
.foot{border-top:1px solid #e5e7eb;padding:16px;text-align:center;color:#6b7280;font-size:13px;background:#ffffff}
.narrow{max-width:420px;margin:40px auto;padding:0 16px}.hero{max-width:720px;margin:40px auto;padding:0 16px}
.keybox{background:#fffbeb;border:1px solid #fde68a;padding:10px;border-radius:6px;word-break:break-all}
.thumb{max-width:100%;max-height:360px;border:1px solid #e5e7eb;border-radius:6px}

/* Mobile & Tablet Drawer Screen (< 768px) */
@media(max-width:768px){
    .menu-btn{display:inline-flex;align-items:center;justify-content:center}
    .drawer-header{display:flex}
    .layout{display:block;min-height:auto}
    .main{padding:16px}

    /* সাইড ড্রয়ার হিসেবে বাম থেকে মসৃণভাবে স্লাইড হয়ে আসা */
    .side{
        position:fixed;
        top:0;
        left:0;
        bottom:0;
        width:260px;
        max-width:80%;
        background:#ffffff;
        z-index:50;
        box-shadow:4px 0 20px rgba(0,0,0,0.15);
        padding:0;
        transform:translateX(-100%);
        transition:transform .3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y:auto;
    }
    .side.open{
        transform:translateX(0);
    }
    .side ul{padding:8px 0}
    .side a{padding:12px 20px;font-size:15px}
}