:root {
    --primary: #12355b;
    --primary-dark: #0b2340;
    --blue: #1267d6;
    --green: #16a085;
    --orange: #ff7a11;
    --purple: #7650c7;
    --red: #e23a4e;
    --teal: #19bfd3;
    --yellow: #f6bd16;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --soft-border: #eef2f7;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 24px 60px rgba(15, 23, 42, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
}

/* =====================================================
   LOGIN PAGE
===================================================== */

.login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(18, 53, 91, 0.96), rgba(22, 160, 133, 0.92)),
        radial-gradient(circle at top left, #ffffff 0, transparent 35%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22);
}

.login-logo {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--blue), var(--green));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    margin: 0 auto 18px;
}

.login-card h1 {
    text-align: center;
    font-size: 25px;
    margin: 0;
    color: var(--primary);
}

.login-subtitle {
    text-align: center;
    color: var(--muted);
    margin: 8px 0 25px;
}

.login-help {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px dashed var(--border);
    color: var(--muted);
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

/* =====================================================
   MAIN LAYOUT
===================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    color: var(--text);
    padding: 20px 16px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 30;
    box-shadow: 12px 0 35px rgba(15, 23, 42, 0.05);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blue), var(--green));
    color: #ffffff;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 25px rgba(18, 103, 214, 0.25);
}

.brand h2 {
    margin: 0;
    font-size: 19px;
    color: var(--primary);
}

.brand p {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.side-nav a {
    padding: 12px 13px;
    border-radius: 14px;
    color: #263244;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s ease;
}

.side-nav a span {
    width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-nav a:hover,
.side-nav a.active {
    background: linear-gradient(135deg, #0f8f38, #10a548);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(16, 165, 72, 0.22);
}

.nav-section {
    margin: 16px 10px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 900;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    min-width: 0;
}

.topbar {
    height: 82px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 13px;
}

.topbar h1 {
    margin: 0;
    font-size: 25px;
    color: var(--primary);
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.menu-toggle {
    display: none;
    border: none;
    background: var(--primary);
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 18px;
    cursor: pointer;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details strong {
    display: block;
    font-size: 14px;
}

.user-details span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.logout-btn {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 13px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13px;
    transition: 0.2s ease;
}

.logout-btn:hover {
    background: #fecaca;
}

.content-area {
    padding: 28px;
}

.footer {
    padding: 18px 28px;
    color: var(--muted);
    font-size: 13px;
}

/* =====================================================
   ALERTS / NOTICES
===================================================== */

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 700;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.notice-card {
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #155e75;
    padding: 16px 18px;
    border-radius: 18px;
    margin-bottom: 22px;
    font-size: 15px;
}

/* =====================================================
   FORMS
===================================================== */

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

.form-card h2 {
    margin: 0 0 20px;
    color: var(--primary);
    font-size: 22px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
    transition: 0.2s ease;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(22, 160, 133, 0.12);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* =====================================================
   BUTTONS
===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 13px;
    border: none;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-light {
    background: #e5e7eb;
    color: #374151;
    margin-left: 8px;
}

.btn-light:hover {
    background: #d1d5db;
}

.btn-small {
    padding: 7px 11px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 12px;
}

.btn-small:hover {
    background: #dbeafe;
}

.no-margin {
    margin-left: 0 !important;
    margin-top: 12px;
}

/* =====================================================
   PANELS / TABLES
===================================================== */

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 22px;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

.panel-header {
    padding: 19px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    margin: 0;
    font-size: 19px;
    color: var(--primary);
}

.panel-header a {
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: #fbfdff;
}

.empty-state {
    padding: 34px 20px;
    color: var(--muted);
    text-align: center;
}

/* =====================================================
   BADGES
===================================================== */

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-neutral {
    background: #e5e7eb;
    color: #374151;
}

/* =====================================================
   MODERN DASHBOARD
===================================================== */

.modern-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 38px;
    margin-bottom: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 92% 8%, rgba(255,255,255,0.22) 0, rgba(255,255,255,0.22) 125px, transparent 126px),
        linear-gradient(135deg, #0f3d75, #1267d6 55%, #16a085);
    box-shadow: 0 18px 45px rgba(15, 61, 117, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.hero-label {
    display: inline-flex;
    background: rgba(255,255,255,0.16);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.modern-hero h2 {
    margin: 0 0 10px;
    font-size: 35px;
    line-height: 1.1;
    color: #ffffff;
}

.modern-hero p {
    margin: 0;
    font-size: 17px;
    max-width: 820px;
    color: rgba(255,255,255,0.92);
}

.hero-badge {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    padding: 16px 18px;
    min-width: 220px;
}

.hero-badge strong {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.hero-badge span {
    font-size: 13px;
    color: rgba(255,255,255,0.86);
}

.modern-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.modern-stat-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--soft-border);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 18px;
}

.stat-icon.blue {
    background: #eaf3ff;
}

.stat-icon.green {
    background: #e8fff4;
}

.stat-icon.orange {
    background: #fff3e2;
}

.stat-icon.purple {
    background: #f0eaff;
}

.modern-stat-card span {
    display: block;
    color: #667085;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 10px;
}

.modern-stat-card strong {
    display: block;
    color: #111827;
    font-size: 28px;
    margin-bottom: 6px;
}

.modern-stat-card small {
    color: #6b7280;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 25px;
}

.section-heading p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 15px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.quick-card {
    min-height: 155px;
    color: #ffffff;
    border-radius: 25px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card::after {
    content: "";
    position: absolute;
    right: -35px;
    top: -35px;
    width: 135px;
    height: 135px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}

.quick-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.quick-icon {
    font-size: 34px;
    margin-bottom: 22px;
}

.quick-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #ffffff;
}

.quick-card p {
    margin: 0;
    color: rgba(255,255,255,0.9);
    font-size: 15px;
}

.quick-green {
    background: linear-gradient(135deg, #169b62, #0f6844);
}

.quick-orange {
    background: linear-gradient(135deg, #ff7a11, #d85d00);
}

.quick-blue {
    background: linear-gradient(135deg, #1d7af2, #0e4fb4);
}

.quick-purple {
    background: linear-gradient(135deg, #7650c7, #4e2c97);
}

.quick-red {
    background: linear-gradient(135deg, #e23a4e, #b91c32);
}

.quick-teal {
    background: linear-gradient(135deg, #19bfd3, #0e8291);
}

.quick-dark {
    background: linear-gradient(135deg, #1f2937, #111827);
}

.quick-yellow {
    background: linear-gradient(135deg, #f6bd16, #df8c00);
}

.modern-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.summary-card {
    background: #ffffff;
    border: 1px solid var(--soft-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.summary-card span {
    color: #6b7280;
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 900;
}

.summary-card strong {
    display: block;
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 6px;
}

.summary-card p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

/* =====================================================
   STOCK RECEIVING ENTRY TABLE
===================================================== */

.receiving-items-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 18px;
}

.entry-table select,
.entry-table input {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    transition: 0.2s ease;
}

.entry-table select:focus,
.entry-table input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.12);
}

.filter-button-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1200px) {
    .modern-stats-grid,
    .quick-actions-grid,
    .modern-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: 0.25s ease;
    }

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

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .user-details {
        display: none;
    }
}

@media (max-width: 700px) {
    .content-area {
        padding: 18px;
    }

    .modern-hero {
        padding: 26px;
        border-radius: 22px;
    }

    .modern-hero h2 {
        font-size: 26px;
    }

    .modern-stats-grid,
    .quick-actions-grid,
    .modern-summary-grid {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .logout-btn {
        padding: 8px 10px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    th,
    td {
        padding: 12px;
        font-size: 13px;
    }
}