/* ========================================================
   File: assets/css/admin.css
   Project: BDCodeLab Prescription Management System
   Description: Ultra-Clear, High-End Medical UI (Large Fonts)
   FIXED VERSION — login.css সম্পূর্ণ আলাদা করা হয়েছে (login.css দেখুন)
   ======================================================== */

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f9;
    color: #1e293b;
    display: block;
    line-height: 1.6;
    font-size: 15px;
}

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    align-items: stretch;
}

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    width: 250px;
    background-color: #1e3a8a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    flex-shrink: 0;
    position: relative;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .logo {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.logo .icon {
    background-color: #ffffff;
    color: #1e3a8a;
    padding: 4px 7px;
    font-weight: 800;
    font-size: 14px;
    border-radius: 6px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.sidebar-menu li {
    margin: 0;
    padding: 0;
    width: 100%;
}

.sidebar-menu li a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s ease;
}

.sidebar-menu li a .menu-icon {
    opacity: 0.8;
    transition: opacity 0.2s;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-menu li a:hover .menu-icon,
.sidebar-menu li.active a .menu-icon {
    opacity: 1;
}

/* =========================================
   Main Content Area
   ========================================= */
.main-content {
    flex: 1;
    min-width: 0; /* flexbox overflow bug fix — এটা ছাড়া ভেতরের কনটেন্ট overflow করতে পারে */
    display: flex;
    flex-direction: column;
    padding: 25px 35px;
}

/* =========================================
   Top Header & Actions
   ========================================= */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    gap: 20px;
    flex-wrap: nowrap;
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
}

.top-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* Admin বাটন — সম্পূর্ণ self-contained, login.css এর উপর নির্ভর করে না */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background-color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;      /* কখনোই 100% নয় — এটা আগের bug এর মূল কারণ ছিল */
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* Responsive: header wrap */
@media (max-width: 991px) {
    .top-header {
        flex-wrap: wrap;
        gap: 15px;
    }
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* =========================================
   Cards & Layout
   ========================================= */
.card {
    background: #ffffff;
    padding: 22px 26px;
    margin-bottom: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   Forms & Inputs
   ========================================= */
.form-row {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
}

.form-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #334155;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    outline: none;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 12px;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control::-ms-expand {
    display: none;
}

input[type="date"].form-control {
    padding: 9px 14px;
}

/* =========================================
   Prescription / Medicine Grid Elements
   ========================================= */
.medicine-item {
    background-color: #f8fafc;
    padding: 18px 20px;
    margin-bottom: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.item-number {
    font-weight: 700;
    color: #1e3a8a;
    margin-right: 14px;
    display: flex;
    align-items: center;
    font-size: 16px;
    flex-shrink: 0;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.file-input {
    padding: 8px 10px;
    background-color: #f8fafc;
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
}

/* =========================================
   Footer
   ========================================= */
.admin-footer {
    margin-top: auto;
    padding: 15px 0 0 0;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

.admin-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.admin-footer strong {
    color: #1e3a8a;
    font-weight: 700;
}

.version-info {
    font-size: 13px;
    color: #94a3b8;
}

/* =========================================
   Mobile Offcanvas
   ========================================= */
.mobile-toggle-btn {
    display: none;
    background: transparent;
    color: #1e3a8a;
    padding: 6px;
    border: none;
    cursor: pointer;
    outline: none;
}

.close-sidebar-btn {
    display: none;
    background: transparent;
    color: #ffffff;
    padding: 6px;
    border: none;
    cursor: pointer;
    outline: none;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* =========================================
   Responsive Breakpoints
   ========================================= */
@media (max-width: 991px) {
    .mobile-toggle-btn {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        height: 100vh;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .close-sidebar-btn {
        display: block;
    }

    .main-content {
        width: 100%;
        padding: 20px;
    }

    .top-header {
        justify-content: flex-start;
    }

    .header-actions {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 14px;
    }

    .form-row[style*="margin-left"] {
        margin-left: 0 !important;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%; /* মোবাইলে বাটন ফুল-উইথ ভালো দেখায়, তাই শুধু এখানেই override */
    }

    .admin-footer .footer-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .card {
        padding: 16px 16px;
    }
    .main-content {
        padding: 14px;
    }
}