* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 45%, #f6f7fb 100%);
    color: #172033;
}

a {
    text-decoration: none;
    color: #2563eb;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px;
}

.topbar {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #ffffff;
    padding: 18px 30px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.25);
}

.topbar a {
    color: #ffffff;
    margin-right: 18px;
    font-weight: 600;
}

.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    margin-bottom: 22px;
}

.page-title {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
}

.page-subtitle {
    color: #64748b;
    margin-bottom: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: 0 10px 22px rgba(71, 85, 105, 0.18);
}

.btn-light {
    background: #ffffff;
    color: #1e3a8a;
    border: 1px solid #dbeafe;
    box-shadow: none;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d8e0ef;
    border-radius: 14px;
    font-size: 14px;
    background: #ffffff;
    outline: none;
    transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

label {
    font-weight: 700;
    margin-bottom: 7px;
    display: block;
    color: #334155;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

th {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 800;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

tr:last-child td {
    border-bottom: none;
}

.login-box {
    max-width: 440px;
    margin: 90px auto;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    font-weight: 800;
    font-size: 13px;
}

@media (max-width: 768px) {
    .container {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
        border-radius: 18px;
    }

    .page-title {
        font-size: 24px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 10px;
    }
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border-radius: 0;
        border: none;
    }
}

/* ===============================
   ERP SIDEBAR GLOBAL LAYOUT
   =============================== */

.erp-layout {
    display: flex;
    min-height: 100vh;
    background: #f3f6fb;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #061226, #0f172a);
    color: #fff;
    padding: 24px 18px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
}

.sidebar-logo {
    background: #fff;
    border-radius: 18px;
    padding: 6px;
    margin-bottom: 22px;
    text-align: center;
}

.sidebar-logo img {
    max-width: 160px;
    max-height: 70px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 14px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin: 18px 10px 8px;
    font-weight: 800;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 11px;
    border-radius: 14px;
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 6px;
    transition: .2s ease;
}

.side-link:hover,
.side-link.active {
    background: rgba(37,99,235,.24);
    color: #fff;
}

.side-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255,255,255,.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
}

.main-area {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 26px;
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: .25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
        width: 100%;
        padding: 14px;
    }

    .mobile-menu-btn {
        display: inline-flex;
        border: none;
        background: #0f172a;
        color: #fff;
        border-radius: 12px;
        padding: 10px 14px;
        font-weight: 900;
        margin-bottom: 12px;
    }
}

/* Mobile sidebar overlay fix */
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {

    .sidebar {
        width: 82%;
        max-width: 320px;
        box-shadow: 20px 0 60px rgba(0,0,0,0.35);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.62);
        z-index: 998;
    }

    .mobile-menu-btn {
        position: sticky;
        top: 10px;
        z-index: 997;
    }
}

@media print {
    .sidebar,
    .sidebar-overlay,
    .mobile-menu-btn {
        display: none !important;
    }

    .main-area {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .erp-layout {
        display: block !important;
        background: #ffffff !important;
    }
}

