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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F5F7FA;
    color: #2C2C2C;
}

button {
    background: #1A73E8;
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 9px 14px;
}

button:hover {
    background: #155AB6;
}

/* Top navigation bar */
nav {
    background: #1A1A2E;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links a {
    color: #AAB;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
}

.nav-button {
    background: transparent;
    border: 1px solid #3B3B56;
    color: #fff;
    padding: 6px 12px;
    gap: 2;
    margin-left: 10px;
}

.link {
    height: 35px;
}

.nav-button:hover {
    background: #24243D;
}

/* .nav-links a.active,
.nav-links a:hover {
    background: #1A73E8;
    color: #fff;
} */

/* Date range dropdown */
select {
    background: #fff;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.date-range-control {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    width: 168px;
}

.custom-range-toggle {
    background: #243B63;
    border: 1px solid #3B5B8E;
    font-size: 13px;
    padding: 5px 10px;
    width: 100%;
}

.custom-range-toggle:hover,
.custom-range-toggle.is-active {
    background: #1A73E8;
}

.custom-range-panel {
    background: #fff;
    border: 1px solid #D9DEE7;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(26, 26, 46, 0.18);
    display: grid;
    gap: 10px;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    z-index: 120;
}

.custom-range-panel label {
    color: #555;
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 5px;
    text-transform: uppercase;
}

.custom-range-panel input {
    border: 1px solid #D9DEE7;
    border-radius: 4px;
    color: #2C2C2C;
    font: inherit;
    padding: 8px 10px;
}

.custom-range-panel input:focus {
    border-color: #1A73E8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    outline: none;
}

.custom-range-message {
    color: #D93025;
    font-size: 12px;
    min-height: 16px;
}

/* Main content area */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
}

/* Section headers */
.section-title {
    font-size: 13px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1A73E8;
}

/* KPI cards row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-top: 3px solid #1A73E8;
}

.kpi-card h4 {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-card .value {
    font-size: 28px;
    font-weight: bold;
    color: #1A1A2E;
}

/* Chart containers */
.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.chart-box {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chart-box h4 {
    font-size: 12px;
    color: #666;
    margin-bottom: 14px;
}

/* Tables */
.table-box {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-top: 16px;
    overflow-x: auto;
}

.table-box h4 {
    font-size: 12px;
    color: #666;
    margin-bottom: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: #1A1A2E;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
}

td {
    padding: 9px 12px;
    border-bottom: 1px solid #F0F0F0;
}

tr:hover td {
    background: #F8F9FF;
}

.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.secondary-button {
    background: #F1F3F5;
    color: #333;
}

.secondary-button:hover {
    background: #E0E4EA;
}

.danger-button {
    background: #D93025;
}

.danger-button:hover {
    background: #B3261E;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.inline-form input {
    border: 1px solid #D9DEE7;
    border-radius: 4px;
    flex: 1;
    font: inherit;
    min-width: 0;
    padding: 9px 12px;
}

.empty-state {
    color: #777;
    font-size: 14px;
    padding: 10px 0;
}

/* Opportunity rows highlighted in yellow */
.opportunity td {
    background: #FFFDE7;
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #E74C3C;
    font-size: 14px;
}

.auth-page {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.auth-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(26, 26, 46, 0.12);
    margin: 0 auto;
    max-width: 420px;
    padding: 32px;
    width: 100%;
}

.auth-header {
    margin-bottom: 24px;
}

.auth-kicker {
    color: #1A73E8;
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.auth-header h1 {
    color: #1A1A2E;
    font-size: 28px;
    letter-spacing: 0;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    color: #555;
    display: grid;
    font-size: 13px;
    font-weight: 600;
    gap: 7px;
}

.auth-form input {
    border: 1px solid #D9DEE7;
    border-radius: 4px;
    color: #2C2C2C;
    font: inherit;
    padding: 11px 12px;
}

.auth-form input:focus {
    border-color: #1A73E8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    outline: none;
}

.form-message {
    color: #666;
    font-size: 13px;
    min-height: 18px;
}

.auth-screen {
    display: block;
}

.auth-footer-actions {
    align-items: center;
    display: grid;
    gap: 10px;
    justify-items: center;
    margin-top: 4px;
    text-align: center;
}

.link-button {
    background: transparent;
    color: #1A73E8;
    display: inline;
    font-weight: 600;
    padding: 0;
    text-decoration: none;
}

.link-button:hover {
    background: transparent;
    color: #155AB6;
}

.hidden,
[hidden] {
    display: none !important;
}

.auth-panel .auth-form+.auth-form {
    border-top: 1px solid #E8ECF2;
    margin-top: 16px;
    padding-top: 16px;
}

.auth-switch {
    color: #666;
    font-size: 14px;
    text-align: center;
}

.auth-switch a {
    color: #1A73E8;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch button {
    color: #1A73E8;
    font-weight: 600;
    text-decoration: none;
    /* background-color: None; */
    background: None;
}

@media (min-width: 761px) {
    .mobileNavToggle {
        display: none;
    }

    .allLinks {
        display: flex;
        align-items: center;
        gap: 2;
    }
}

@media (max-width: 760px) {
    .mobileNavToggle {
        display: flex;
        background: none;
        border: solid #aaa 1px;
    }

    .allLinks {
        right:10px;
        display: none;
        flex-wrap: wrap;
        justify-content: center;
        /* flex-direction: column; */
        gap: 10px;
        /* align-items: end; */
    }

    nav {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-links {
        /* background: teal; */
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: end;
        gap: 8px;
    }

    .date-range-control {
        width: 100%;
    }

    .custom-range-panel {
        position: static;
        width: 100%;
        /* padding-bottom: calc(-40px); */
    }

    .custom-range-message{
        height:0;
        margin-bottom: calc(-40px);
    }

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

    .auth-panel {
        padding: 24px;
    }

    .inline-form {
        flex-direction: column;
    }
}