/* ==================================================
   GLOBAL
================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f6fa;
    color: #222;
}


/* ==================================================
   SIDEBAR
================================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;

    width: 230px;
    height: 100vh;

    background: #111827;
    color: white;

    padding: 25px 18px;

    z-index: 100;
}

.logo {
    padding: 0 8px;
    margin-bottom: 40px;
}

.logo h2 {
    font-size: 20px;
    letter-spacing: 0.5px;
}

.logo span {
    display: block;

    font-size: 12px;

    opacity: 0.6;

    margin-top: 3px;

    letter-spacing: 1px;
}

nav a {
    display: block;

    text-decoration: none;

    color: #cbd5e1;

    padding: 12px 14px;

    margin-bottom: 6px;

    border-radius: 8px;

    font-size: 14px;

    transition: all 0.2s ease;
}

nav a:hover {
    background: #1f2937;
    color: white;
}

nav a.active {
    background: #374151;
    color: white;

    font-weight: 600;
}


/* ==================================================
   MAIN CONTENT
================================================== */

.main-content {
    margin-left: 230px;

    padding: 30px;

    min-height: 100vh;
}


/* ==================================================
   PAGE
================================================== */

.page {
    display: none;
}

.page.active-page {
    display: block;
}


/* ==================================================
   TOPBAR
================================================== */

.topbar {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 28px;
}

.topbar h1 {
    font-size: 28px;

    font-weight: 700;
}

.topbar p {
    color: #6b7280;

    margin-top: 6px;

    font-size: 14px;
}

.user {
    background: white;

    padding: 10px 16px;

    border-radius: 8px;

    font-size: 13px;

    color: #374151;

    border: 1px solid #e5e7eb;
}


/* ==================================================
   KPI
================================================== */

.kpi-container {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

    margin-bottom: 22px;
}

.kpi-card {
    background: white;

    padding: 22px;

    border-radius: 12px;

    border: 1px solid #e5e7eb;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.03);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.06);
}

.kpi-card span {
    color: #6b7280;

    font-size: 13px;
}

.kpi-card h2 {
    margin-top: 10px;

    font-size: 23px;

    color: #111827;
}

.kpi-card p {
    margin-top: 8px;

    font-size: 12px;

    color: #9ca3af;
}


/* ==================================================
   CHART
================================================== */

.chart-grid {
    display: grid;

    grid-template-columns:
        2fr 1fr;

    gap: 18px;

    margin-bottom: 18px;
}

.chart-card {
    background: white;

    padding: 20px;

    border-radius: 12px;

    min-height: 320px;

    border: 1px solid #e5e7eb;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.03);
}

.card-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;

    color: #111827;
}

.card-header select {
    padding: 7px 10px;

    border: 1px solid #d1d5db;

    border-radius: 6px;

    background: white;

    color: #374151;
}


/* ==================================================
   INSIGHTS
================================================== */

.insights {
    margin-top: 32px;
}

.insights h2 {
    font-size: 20px;

    margin-bottom: 15px;
}

.insight-container {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 18px;
}

.insight-card {
    background: white;

    padding: 20px;

    border-radius: 12px;

    border: 1px solid #e5e7eb;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.03);
}

.insight-card h3 {
    margin-bottom: 10px;

    font-size: 15px;

    color: #111827;
}

.insight-card p {
    color: #6b7280;

    line-height: 1.5;

    font-size: 13px;
}


/* ==================================================
   SALES DATA
================================================== */

.sales-section {
    margin-top: 30px;
}

.section-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 21px;
}

.section-header p {
    color: #6b7280;

    margin-top: 5px;

    font-size: 14px;
}


/* ==================================================
   BUTTONS
================================================== */

.add-btn {
    border: none;

    background: #111827;

    color: white;

    padding: 11px 17px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 13px;

    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.add-btn:hover {
    background: #1f2937;

    transform: translateY(-1px);
}


/* ==================================================
   FILTER
================================================== */

.filter-container {
    display: flex;

    gap: 10px;

    margin-bottom: 15px;
}

.filter-container input,
.filter-container select {
    padding: 10px 12px;

    border: 1px solid #d1d5db;

    border-radius: 7px;

    background: white;

    font-size: 13px;

    color: #374151;

    outline: none;
}

.filter-container input {
    width: 240px;
}

.filter-container input:focus,
.filter-container select:focus {
    border-color: #6b7280;
}


/* ==================================================
   TABLE
================================================== */

.table-card {
    background: white;

    border-radius: 12px;

    overflow-x: auto;

    border: 1px solid #e5e7eb;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.03);
}

table {
    width: 100%;

    border-collapse: collapse;

    min-width: 850px;
}

th,
td {
    padding: 13px 16px;

    text-align: left;

    border-bottom:
        1px solid #f0f0f0;

    font-size: 13px;
}

th {
    color: #6b7280;

    font-weight: 600;

    background: #fafafa;

    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: 0.3px;
}

tbody tr:hover {
    background: #fafafa;
}

tbody tr:last-child td {
    border-bottom: none;
}


/* ==================================================
   TABLE ACTION BUTTONS
================================================== */

.edit-btn,
.delete-btn {
    border: none;

    padding: 6px 10px;

    border-radius: 6px;

    cursor: pointer;

    font-size: 12px;

    margin-right: 5px;
}

.edit-btn {
    background: #f3f4f6;

    color: #374151;
}

.delete-btn {
    background: #fef2f2;

    color: #b91c1c;
}

.edit-btn:hover {
    background: #e5e7eb;
}

.delete-btn:hover {
    background: #fee2e2;
}


/* ==================================================
   MODAL
================================================== */

.modal {
    display: none;

    position: fixed;

    inset: 0;

    background:
        rgba(17, 24, 39, 0.55);

    justify-content: center;

    align-items: center;

    z-index: 1000;

    padding: 20px;
}

.modal-content {
    width: 420px;

    max-width: 100%;

    background: white;

    padding: 25px;

    border-radius: 12px;

    box-shadow:
        0 15px 40px
        rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
}

.modal-header button {
    border: none;

    background: none;

    font-size: 25px;

    color: #6b7280;

    cursor: pointer;
}

.modal-content form {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.modal-content label {
    margin-top: 8px;

    font-size: 13px;

    font-weight: 600;

    color: #374151;
}

.modal-content input,
.modal-content select {
    padding: 10px;

    border: 1px solid #d1d5db;

    border-radius: 7px;

    background: white;

    outline: none;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: #6b7280;
}

.save-btn {
    margin-top: 15px;

    padding: 12px;

    border: none;

    border-radius: 8px;

    background: #111827;

    color: white;

    cursor: pointer;

    font-weight: 600;
}

.save-btn:hover {
    background: #1f2937;
}


/* ==================================================
   EMPTY PAGE
================================================== */

.empty-page {
    background: white;

    padding: 50px 30px;

    border-radius: 12px;

    text-align: center;

    border: 1px solid #e5e7eb;
}

.empty-page h2 {
    margin-bottom: 10px;

    font-size: 20px;
}

.empty-page p {
    color: #6b7280;

    font-size: 14px;
}


/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 1100px) {

    .kpi-container {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .insight-container {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .sidebar {
        width: 70px;

        padding: 25px 10px;
    }

    .sidebar .logo {
        display: none;
    }

    nav a {
        font-size: 0;

        text-align: center;

        padding: 13px 5px;
    }

    .main-content {
        margin-left: 70px;

        padding: 20px;
    }

    .topbar {
        align-items: flex-start;

        gap: 15px;

        flex-direction: column;
    }

    .kpi-container {
        grid-template-columns: 1fr;
    }

    .filter-container {
        flex-direction: column;
    }

    .filter-container input {
        width: 100%;
    }

    .section-header {
        align-items: flex-start;

        gap: 15px;

        flex-direction: column;
    }

}

/* ==================================================
   TOAST NOTIFICATION
================================================== */

.toast {
    position: fixed;

    top: 25px;
    right: 25px;

    min-width: 280px;

    background: white;

    padding: 16px 18px;

    border-radius: 10px;

    border: 1px solid #e5e7eb;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12);

    display: flex;

    align-items: flex-start;

    gap: 12px;

    z-index: 2000;

    opacity: 0;

    transform: translateY(-10px);

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.toast.show {
    opacity: 1;

    transform: translateY(0);
}

.toast-icon {
    font-size: 18px;

    font-weight: bold;
}

.toast-content strong {
    display: block;

    font-size: 14px;

    color: #111827;

    margin-bottom: 3px;
}

.toast-content p {
    font-size: 12px;

    color: #6b7280;

    margin: 0;
}


/* SUCCESS */

.toast.success .toast-icon {
    color: #16a34a;
}


/* ERROR */

.toast.error .toast-icon {
    color: #dc2626;
}


/* MOBILE */

@media (max-width: 700px) {

    .toast {
        left: 20px;
        right: 20px;

        top: 20px;

        min-width: unset;
    }

}