﻿body {
    margin: 0;
    background: #f4f6f9;
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100%;
    background: #1e293b;
    overflow-y: auto;
    z-index: 1050;
    transition: transform 0.3s ease-in-out;
}

.logo {
    background: #0f172a;
    color: white;
    padding: 18px 20px;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-menu {
    padding-top: 10px;
}

    .sidebar-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        color: #e2e8f0;
        text-decoration: none;
        padding: 13px 20px;
        font-size: 15px;
        transition: 0.2s;
        border-left: 3px solid transparent;
    }

        .sidebar-menu a:hover,
        .sidebar-menu a.active {
            background: #334155;
            color: #ffffff;
            border-left-color: #38bdf8;
        }

/* Main Content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

/* Top Header (Flexbox layout for clean mobile alignment) */
.top-header {
    height: 60px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle-btn {
    display: none;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    border-radius: 6px;
    padding: 6px 11px;
    font-size: 18px;
    cursor: pointer;
}

    .sidebar-toggle-btn:hover {
        background: #e2e8f0;
    }

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.user-info {
    font-weight: 600;
    color: #334155;
    font-size: 14px;
    white-space: nowrap;
}

.page-content {
    padding: 20px;
}

/* Mobile Backdrop Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1040;
}

    .sidebar-overlay.show {
        display: block;
    }

/* Toast Notifications */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.erp-toast {
    min-width: 280px;
    max-width: 90vw;
    margin-bottom: 10px;
    padding: 12px 15px;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadein 0.3s;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================
   MOBILE & TABLET RESPONSIVE RULES (<= 768px)
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle-btn,
    .sidebar-close-btn {
        display: inline-block;
    }

    .page-title {
        font-size: 16px;
    }

    .user-text {
        display: none; /* Mobile par sirf icon dikhega taake header tang na ho */
    }

    .page-content {
        padding: 12px;
    }

    #toastContainer {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .erp-toast {
        min-width: auto;
        width: 100%;
    }
}
