/* ============================================================
   INVENTORY MANAGEMENT SYSTEM - STYLESHEET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #eef1fd;
    --success: #2ec4b6;
    --warning: #f4a261;
    --danger: #e63946;
    --sidebar-bg: #0f0e17;
    --sidebar-w: 240px;
    --navbar-h: 60px;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --bg: #f0f2f8;
    --card: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 2px 16px rgba(67, 97, 238, 0.07);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}

/* LOGIN */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0e17, #1a1a2e, #16213e);
    padding: 16px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.35);
}

.login-brand h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 13px;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    width: 100%;
    padding: 12px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    color: #fff;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

/* TOP NAVBAR */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    gap: 12px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hamburger-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
}

.hamburger-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    white-space: nowrap;
}

.brand-label {
    display: inline;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid #ffd5d5;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--navbar-h));
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.sidebar-header i {
    color: var(--primary);
    font-size: 20px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    margin-left: auto;
    cursor: pointer;
    padding: 4px 6px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 8px 20px 4px;
}

.mt-2 {
    margin-top: 10px;
}

.nav-dropdown {
    display: flex;
    flex-direction: column;
}

.nav-dropdown+.nav-dropdown {
    margin-top: 4px;
}

.nav-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-dropdown-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-dropdown.open>.nav-dropdown-toggle {
    color: #fff;
    background: rgba(67, 97, 238, 0.15);
    border-left-color: var(--primary);
}

.nav-dropdown-menu {
    display: none;
    flex-direction: column;
}

.nav-dropdown.open>.nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-menu .nav-link-item {
    padding-left: 38px;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link-item i {
    width: 17px;
    text-align: center;
    font-size: 14px;
}

.nav-link-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.nav-link-item.active {
    color: #fff;
    background: rgba(67, 97, 238, 0.2);
    border-left-color: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 850;
}

/* PAGE WRAPPER */
.page-wrapper {
    margin-top: var(--navbar-h);
    margin-left: var(--sidebar-w);
    min-height: calc(100vh - var(--navbar-h));
    transition: margin-left 0.3s;
}

.page-content {
    padding: 24px;
}

/* PAGE ELEMENTS */
.page-header {
    margin-bottom: 22px;
}

.page-header h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 3px;
}

.page-header p {
    font-size: 13px;
}

.card-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

/* STAT CARDS */
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.12);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.stat-blue .stat-icon {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
}

.stat-green .stat-icon {
    background: linear-gradient(135deg, #2ec4b6, #0d9488);
}

.stat-orange .stat-icon {
    background: linear-gradient(135deg, #f4a261, #e76f51);
}

.stat-purple .stat-icon {
    background: linear-gradient(135deg, #7b2d8b, #4361ee);
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.stat-info p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

/* TABLE */
.table {
    font-size: 13.5px;
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 11px 14px;
    white-space: nowrap;
}

.table td {
    padding: 11px 14px;
    vertical-align: middle;
    border-color: var(--border);
}

.table tbody tr:hover {
    background: #f8faff;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
}

/* BUTTONS */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: 8px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* MODALS */
.modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    padding: 15px 20px;
}

.modal-title {
    font-weight: 600;
    font-size: 15px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 13px 20px;
}

/* FORMS */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dde1ec;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 9px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
}

.input-group-text {
    background: #f0f2f8;
    border: 1px solid #dde1ec;
    color: var(--primary);
}

/* TOAST */
#toastContainer {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 32px);
}

.toast-msg {
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-color: var(--success);
    color: #0d9488;
}

.toast-success i {
    color: var(--success);
}

.toast-error {
    border-color: var(--danger);
    color: var(--danger);
}

.toast-error i {
    color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* DATATABLES */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1px solid #dde1ec;
    padding: 6px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

/* ============================================================
   RESPONSIVE — TABLET  ≤ 991px
   ============================================================ */
@media (max-width: 991px) {
    .hamburger-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .page-wrapper {
        margin-left: 0;
    }

    .page-content {
        padding: 16px;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE  ≤ 575px
   ============================================================ */
@media (max-width: 575px) {
    .brand-label {
        display: none;
    }

    .login-card {
        padding: 28px 20px;
    }

    .page-content {
        padding: 12px;
    }

    .card-box {
        padding: 14px;
        overflow-x: auto;
    }

    /* Stack page header */
    .page-header.d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    /* Smaller stat cards */
    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 17px;
        border-radius: 10px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .stat-info p {
        font-size: 12px;
    }

    .table thead th,
    .table td {
        padding: 9px 10px;
        font-size: 12.5px;
    }

    /* Full-width modal on phone */
    .modal-dialog {
        margin: 8px;
    }

    .modal-content {
        border-radius: 12px;
    }

    /* Toast full width */
    #toastContainer {
        left: 12px;
        right: 12px;
    }

    .toast-msg {
        min-width: unset;
        width: 100%;
    }
}