/* =====================================================
   GLOBAL
===================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;

    background: #f5f6f8;

    color: #172033;

    line-height: 1.5;
}

a {
    color: inherit;
}

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


/* =====================================================
   APPLICATION LAYOUT
===================================================== */

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


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 260px;

    padding: 28px 20px;

    background: #07101f;

    color: #ffffff;

    overflow-y: auto;

    z-index: 100;
}


/* SCROLLBAR */

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

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #344054;

    border-radius: 10px;
}


/* BRAND */

.brand {
    margin-bottom: 25px;

    padding: 0 10px 28px;

    border-bottom: 1px solid #253044;
}

.brand h1 {
    color: #ffffff;

    font-size: 24px;
    font-weight: 700;
}

.brand p {
    margin-top: 4px;

    color: #d5af49;

    font-size: 13px;
}


/* =====================================================
   NAVIGATION
===================================================== */

.sidebar-nav {
    display: flex;

    flex-direction: column;

    gap: 6px;
}

.nav-section-title {
    margin: 24px 14px 8px;

    color: #73819a;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1.4px;

    text-transform: uppercase;
}

.nav-link,
.nav-link:link,
.nav-link:visited {
    display: block;

    width: 100%;

    padding: 11px 14px;

    border-radius: 7px;

    background: transparent;

    color: #adb6c7;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.nav-link:hover {
    background: #151f30;

    color: #ffffff;

    text-decoration: none;
}

.nav-link.active {
    background: #d5af49;

    color: #07101f;

    font-weight: 700;
}


/* =====================================================
   MAIN CONTENT
===================================================== */

.main-content {
    width: calc(100% - 260px);

    min-height: 100vh;

    margin-left: 260px;

    padding: 32px;
}


/* =====================================================
   TOP BAR
===================================================== */

.topbar {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 30px;
}

.topbar h2 {
    color: #07101f;

    font-size: 30px;
    line-height: 1.2;
}

.page-description {
    margin-top: 5px;

    color: #667085;

    font-size: 14px;
}

.eyebrow {
    margin-bottom: 5px;

    color: #967621;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.topbar-actions {
    display: flex;

    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


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

.btn,
.btn:link,
.btn:visited {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 10px 16px;

    border: none;
    border-radius: 7px;

    cursor: pointer;

    font-weight: 600;

    text-decoration: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.btn-primary {
    background: #c9a227;

    color: #07101f;
}

.btn-primary:hover {
    background: #b49122;
}

.btn-secondary {
    background: #ffffff;

    border: 1px solid #d5dae3;

    color: #172033;
}

.btn-secondary:hover {
    border-color: #b8bfcb;

    background: #f8f9fb;
}

.text-button,
.text-button:link,
.text-button:visited {
    border: none;

    background: none;

    color: #8b6b13;

    font-weight: 600;

    text-decoration: none;

    cursor: pointer;
}

.text-button:hover {
    text-decoration: underline;
}


/* =====================================================
   WELCOME CARD
===================================================== */

.welcome-card {
    margin-bottom: 22px;

    padding: 28px;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;
}

.welcome-card h3 {
    margin-bottom: 8px;

    color: #07101f;

    font-size: 26px;
}

.welcome-card p:last-child {
    color: #667085;
}


/* =====================================================
   KPI CARDS
===================================================== */

.kpi-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 22px;
}

.kpi-card {
    padding: 22px;

    background: #ffffff;

    border: 1px solid #e4e7ec;

    border-radius: 10px;
}

.kpi-card span {
    display: block;

    margin-bottom: 8px;

    color: #667085;

    font-size: 14px;
}

.kpi-card strong {
    display: block;

    margin-bottom: 5px;

    color: #07101f;

    font-size: 28px;
}

.kpi-card small {
    color: #8b94a5;
}


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

.panel {
    background: #ffffff;

    border: 1px solid #e4e7ec;

    border-radius: 10px;

    overflow: hidden;
}

.panel-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 22px;
}

.panel-header h3 {
    color: #07101f;

    font-size: 20px;
}

.panel-header p {
    margin-top: 4px;

    color: #667085;

    font-size: 14px;
}

.dashboard-panel {
    margin-top: 28px;
}


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

.table-container {
    width: 100%;

    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 14px 20px;

    border-top: 1px solid #eaecf0;

    text-align: left;
}

th {
    background: #f8f9fb;

    color: #667085;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;

    white-space: nowrap;
}

td {
    color: #172033;

    font-size: 14px;
}


/* =====================================================
   STATUS
===================================================== */

.status {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

.status.healthy {
    background: #e8f7ef;

    color: #18794e;
}

.status.warning {
    background: #fff4d6;

    color: #926b00;
}

.status.danger {
    background: #feecec;

    color: #b42318;
}


/* =====================================================
   PLANNING OVERVIEW
===================================================== */

.dashboard-section {
    margin-top: 28px;
    margin-bottom: 28px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h3 {
    margin-bottom: 5px;

    color: #07101f;

    font-size: 22px;
}

.section-heading p {
    color: #667085;

    font-size: 14px;
}


/* MODULE GRID */

.module-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


/* MODULE CARDS */

.module-card,
.module-card:link,
.module-card:visited {
    display: flex;

    flex-direction: column;

    min-width: 0;
    min-height: 210px;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e4e7ec;

    border-radius: 12px;

    color: #07101f;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.module-card:hover {
    transform: translateY(-3px);

    border-color: #d5af49;

    color: #07101f;

    text-decoration: none;

    box-shadow:
        0 8px 24px rgba(7, 16, 31, 0.08);
}

.module-label {
    display: inline-flex;

    align-items: center;

    width: fit-content;

    margin-bottom: 14px;

    padding: 5px 10px;

    background: #f7f0d8;

    border-radius: 20px;

    color: #8b6914;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.8px;

    text-transform: uppercase;
}

.module-card h4 {
    margin-bottom: 10px;

    color: #07101f;

    font-size: 18px;
}

.module-card p {
    margin-bottom: 20px;

    color: #667085;

    font-size: 14px;

    line-height: 1.6;
}

.module-link {
    margin-top: auto;

    color: #967621;

    font-size: 14px;
    font-weight: 700;
}

.module-card:hover .module-link {
    color: #70540f;
}


/* =====================================================
   SALES CHANNELS
===================================================== */

.channel-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.dashboard-channel-grid {
    padding: 0 22px 22px;
}

.channel-card {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e4e7ec;

    border-radius: 10px;
}

.channel-card h4 {
    margin-bottom: 5px;

    color: #07101f;

    font-size: 18px;
}

.channel-card p {
    color: #667085;

    font-size: 14px;
}


/* CONNECTION STATUS */

.connection-status {
    display: inline-block;

    padding: 6px 10px;

    border-radius: 20px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

.connection-status.connected {
    background: #e8f7ef;

    color: #18794e;
}

.connection-status.disconnected {
    background: #f2f4f7;

    color: #667085;
}

.connection-status.demo {
    background: #fff4d6;

    color: #926b00;
}

.connection-status.manual {
    background: #eef2ff;

    color: #3949ab;
}


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

@media (max-width: 1250px) {

    .kpi-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 900px) {

    .sidebar {
        width: 220px;
    }

    .main-content {
        width: calc(100% - 220px);

        margin-left: 220px;

        padding: 24px;
    }

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

}


@media (max-width: 700px) {

    .sidebar {
        position: relative;

        width: 100%;
        height: auto;
        min-height: auto;
    }

    .main-content {
        width: 100%;

        margin-left: 0;

        padding: 20px;
    }

    .topbar {
        align-items: flex-start;

        flex-direction: column;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

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

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

    .panel-header {
        align-items: flex-start;

        flex-direction: column;
    }

}
/* =====================================================
   SETTINGS
===================================================== */

.settings-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;

    padding: 0 22px 22px;
}

.form-field {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.form-field label {
    color: #344054;

    font-size: 13px;
    font-weight: 700;
}

.form-field input,
.form-field select {
    width: 100%;

    padding: 11px 12px;

    background: #ffffff;

    border: 1px solid #d5dae3;

    border-radius: 7px;

    color: #172033;

    outline: none;
}

.form-field input:focus,
.form-field select:focus {
    border-color: #c9a227;

    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.12);
}

.form-field small {
    color: #8b94a5;

    font-size: 12px;
}


@media (max-width: 700px) {

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

}
/* =====================================================
   INTERACTIVE PLANNING
===================================================== */

.table-input {
    width: 85px;

    padding: 7px 8px;

    background: #ffffff;

    border: 1px solid #d5dae3;

    border-radius: 6px;

    color: #172033;

    text-align: right;

    outline: none;
}


.table-input:focus {
    border-color: #c9a227;

    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.12);
}


.calculated-value {
    font-weight: 700;

    color: #07101f;

    background: #fafbfc;
}


/* =====================================================
   PLANNING NOTES
===================================================== */

.planning-notes {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    padding: 0 22px 22px;
}


.planning-notes > div {
    padding: 18px;

    background: #f8f9fb;

    border: 1px solid #e4e7ec;

    border-radius: 8px;
}


.planning-notes strong {
    display: block;

    margin-bottom: 6px;

    color: #07101f;

    font-size: 14px;
}


.planning-notes p {
    color: #667085;

    font-size: 13px;

    line-height: 1.5;
}


@media (max-width: 900px) {

    .planning-notes {
        grid-template-columns: 1fr;
    }

}
