:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --line: #e4eaf3;
    --text: #111827;
    --muted: #667085;
    --blue: #0d6efd;
    --green: #20b83e;
    --purple: #6d35f2;
    --orange: #ff9f1c;
    --red: #ff3b30;
    --cyan: #0ea5a8;
    --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
}

input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.dashboard {
    width: 100%;
    min-height: 100vh;
    padding: 0 28px 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    margin: 0 -28px 18px;
    padding: 14px 34px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.title-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.title-area h1 {
    color: #111827;
    font-size: clamp(1.45rem, 1.9vw, 1.85rem);
    font-weight: 800;
    line-height: 1.15;
}

.title-area p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #1f2937;
    background: transparent;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.icon-button:hover {
    color: var(--blue);
    background: #eef5ff;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 16px;
    color: #344054;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.logout-button:hover,
.logout-button:focus {
    color: var(--blue);
    background: #eef5ff;
    border-color: #b8cdfa;
    outline: 0;
}

.filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr)) minmax(150px, 0.55fr) minmax(150px, 0.55fr);
    gap: 12px;
    margin-bottom: 18px;
}

.filter-card,
.refresh-button,
.export-button {
    min-height: 58px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.filter-card {
    position: relative;
    z-index: 2;
    color: #344054;
    background: var(--card);
    border: 1px solid var(--line);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-card[open] {
    z-index: 30;
}

.filter-card:focus-within {
    border-color: #b8cdfa;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08), var(--shadow);
}

.filter-card summary {
    display: grid;
    grid-template-columns: 30px 1fr 18px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 11px 14px;
    list-style: none;
}

.filter-card summary::-webkit-details-marker {
    display: none;
}

.filter-card summary > i:first-child {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: #475467;
    background: #f2f5fa;
    border-radius: 8px;
}

.filter-card summary > i:last-child {
    color: #667085;
    font-size: 0.72rem;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.filter-card[open] summary > i:last-child {
    transform: rotate(180deg);
}

.filter-card span {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.filter-card small {
    color: #344054;
    font-size: 0.76rem;
    font-weight: 800;
}

.dropdown-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    overflow: hidden;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #d8e1ee;
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(16, 24, 40, 0.14);
}

.dropdown-menu button {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    color: #1d2939;
    background: #ffffff;
    border-radius: 7px;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 600;
}

.dropdown-menu button:hover,
.dropdown-menu button:focus {
    color: #0b5ed7;
    background: #eef5ff;
    outline: 0;
}

.dropdown-menu button.active {
    color: #0d6efd;
    background: #f3f8ff;
    font-weight: 800;
}

.refresh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    color: #ffffff;
    background: var(--blue);
    font-weight: 800;
    box-shadow: 0 12px 22px rgba(13, 110, 253, 0.24);
}

.export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    color: #344054;
    background: #ffffff;
    border: 1px solid var(--line);
    font-weight: 800;
    text-decoration: none;
}

.export-button:hover,
.export-button:focus {
    color: #0b5ed7;
    background: #eef5ff;
    border-color: #b8cdfa;
    outline: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 16px;
}

.metric-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.metric-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-areas:
        "icon info"
        "footer footer";
    column-gap: 18px;
    row-gap: 10px;
    min-height: 132px;
    padding: 18px 20px;
    align-items: start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(16, 24, 40, 0.11);
}

.metric-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    font-size: 1.45rem;
}

.metric-icon.blue {
    color: #0561ef;
    background: #eaf2ff;
}

.metric-icon.green {
    color: var(--green);
    background: #dcf8e4;
}

.metric-icon.purple {
    color: var(--purple);
    background: #f0eaff;
}

.metric-icon.orange {
    color: var(--orange);
    background: #fff1d7;
}

.metric-icon.red {
    color: var(--red);
    background: #ffe4e7;
}

.metric-icon.cyan {
    color: var(--cyan);
    background: #e0f7f7;
}

.metric-icon.violet {
    color: #7048e8;
    background: #efeaff;
}

.metric-info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-width: 0;
}

.metric-info h2 {
    max-width: 100%;
    color: #344054;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.22;
}

.metric-info strong {
    display: block;
    margin-top: 12px;
    color: #101828;
    font-size: clamp(1.62rem, 2vw, 2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.metric-footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: -2px;
    color: #475467;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
}

.sales-footer {
    display: block;
    width: 100%;
}

.positive,
.big-positive {
    color: #0bae3a;
    font-weight: 800;
}

.big-positive {
    font-size: clamp(1.7rem, 2.15vw, 2.15rem) !important;
}

.warning-dot,
.danger-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.warning-dot {
    background: var(--orange);
}

.danger-dot {
    background: var(--red);
}

.card-title-row {
    display: flex;
    align-items: flex-start;
}

.card-title-row {
    justify-content: space-between;
    gap: 10px;
}

.sales-card .metric-info strong {
    text-align: left;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    color: #475467;
    font-size: 0.78rem;
    font-weight: 600;
}

.progress-label span:last-child {
    color: var(--blue);
    font-weight: 800;
}

.progress-bar {
    width: 100%;
    height: 9px;
    margin-top: 8px;
    overflow: hidden;
    background: #e9edf4;
    border-radius: 999px;
}

.progress-bar span {
    display: block;
    width: 71%;
    height: 100%;
    background: var(--blue);
    border-radius: inherit;
}

.login-body {
    background: #0b6fb8;
    font-family: "Poppins", Arial, sans-serif;
}

.login-page {
    display: grid;
    min-height: 100vh;
    padding: 6px 8px;
    place-items: center;
}

.login-shell {
    width: min(520px, 100%);
}

.login-card-brand {
    margin-bottom: 38px;
}

.login-card-brand img {
    display: block;
    width: min(272px, 100%);
    height: auto;
}

.login-card {
    display: flex;
    flex-direction: column;
    min-height: 540px;
    padding: 40px 40px 40px;
    background: #f8f8f8;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    box-shadow: none;
}

.login-heading {
    margin-bottom: 34px;
}

.login-heading p {
    margin-top: 8px;
    color: #0d1321;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.45;
    text-transform: none;
}

.login-heading h1 {
    color: #030712;
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.field {
    position: relative;
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
    color: #05070f;
    font-size: 1rem;
    font-weight: 800;
}

.field input {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    color: #101828;
    background: #ffffff;
    border: 1.5px solid #175cff;
    border-radius: 11px;
    outline: 0;
    box-shadow: 3px 5px 0 #d7d7d7;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
    border-color: #0648ff;
    box-shadow: 0 0 0 3px rgba(23, 92, 255, 0.13), 3px 5px 0 #d7d7d7;
}

.field input::placeholder {
    color: #8b93a3;
}

.login-error {
    margin: -8px 0 18px;
    padding: 10px 12px;
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffdad7;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: min(260px, 100%);
    min-height: 50px;
    margin-top: 16px;
    padding: 0 24px;
    color: #ffffff;
    background: #8b93a0;
    border-radius: 999px;
    font-weight: 800;
    box-shadow: none;
}

.login-button:hover {
    background: #737c89;
}

.login-button.is-email-valid {
    background: #0b6fb8;
}

.login-button.is-email-valid:hover {
    background: #075f9f;
}

@media (max-width: 1180px) {
    .filters,
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .refresh-button,
    .export-button {
        grid-column: span 2;
    }
}

@media (max-width: 680px) {
    .dashboard {
        padding: 0 16px 24px;
    }

    .topbar {
        align-items: flex-start;
        gap: 16px;
        margin: 0 -16px 18px;
        padding: 18px 16px;
    }

    .title-area {
        align-items: flex-start;
        gap: 12px;
    }

    .logout-button {
        flex: 0 0 auto;
    }

    .filters,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .refresh-button {
        grid-column: auto;
    }

    .export-button {
        grid-column: auto;
    }

    .metric-card {
        grid-template-columns: 58px 1fr;
        padding: 20px 16px;
    }

    .metric-icon {
        width: 58px;
        height: 58px;
        font-size: 1.45rem;
    }

    .login-page {
        padding: 0;
    }

    .login-shell {
        width: 100%;
    }

    .login-card {
        min-height: 100vh;
        padding: 34px 32px;
        border-radius: 0;
    }
}
