.aw-ghl-dashboard {
    --aw-bg: #0f1115;
    --aw-panel: #171a1f;
    --aw-text: #f5f7fa;
    --aw-muted: #aeb4bd;
    --aw-border: #2b3038;
    --aw-accent: #e31b2b;
    --aw-accent-light: #ff5a67;
    --aw-dark: #ffffff;
    --aw-error-bg: #2a1518;
    --aw-error-text: #ff6b76;

    width: 100%;
    padding: 28px;
    border-radius: 20px;
    background: var(--aw-bg);
    color: var(--aw-text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    box-sizing: border-box;
}

.aw-ghl-dashboard *,
.aw-ghl-dashboard *::before,
.aw-ghl-dashboard *::after {
    box-sizing: border-box;
}

/* Header */

.aw-ghl-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.aw-ghl-eyebrow,
.aw-ghl-panel-header > span,
.aw-ghl-table-header > div:first-child > span {
    display: block;
    color: var(--aw-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.4px;
    line-height: 1.2;
    text-transform: uppercase;
}

.aw-ghl-header h2 {
    margin: 6px 0;
    color: var(--aw-dark);
    font-size: clamp(29px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.05;
}

.aw-ghl-header p {
    margin: 0;
    color: var(--aw-muted);
    font-size: 14px;
}

/* Date filters */

.aw-ghl-date-filters {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.aw-ghl-date-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--aw-muted);
    font-size: 12px;
    font-weight: 700;
}

.aw-ghl-date-filters input,
.aw-ghl-date-filters button {
    min-height: 44px;
    border-radius: 9px;
    font: inherit;
}

.aw-ghl-date-filters input {
    min-width: 150px;
    padding: 8px 11px;
    border: 1px solid var(--aw-border);
    outline: none;
    background: var(--aw-panel);
    color: var(--aw-text);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.aw-ghl-date-filters input:focus {
    border-color: var(--aw-accent);
    box-shadow:
        0 0 0 3px
        rgba(201, 155, 69, 0.15);
}

.aw-ghl-date-filters button {
    padding: 10px 18px;
    border: 0;
    background: var(--aw-dark);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        background 0.2s ease;
}

.aw-ghl-date-filters button:hover {
    background: #2a2a2a;
    transform: translateY(-1px);
}

.aw-ghl-date-filters button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* Error message */

.aw-ghl-message {
    display: none;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #5c242b;
    border-radius: 9px;
    background: var(--aw-error-bg);
    color: var(--aw-error-text);
    font-size: 14px;
    line-height: 1.5;
}

.aw-ghl-message.is-visible {
    display: block;
}

/* Summary cards */

.aw-ghl-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.aw-ghl-summary-card,
.aw-ghl-panel {
    border: 1px solid var(--aw-border);
    background: var(--aw-panel);
    box-shadow:
        0 8px 28px
        rgba(16, 24, 40, 0.055);
}

.aw-ghl-summary-card {
    position: relative;
    min-height: 155px;
    padding: 22px;
    border-radius: 15px;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.aw-ghl-summary-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--aw-accent),
        var(--aw-accent-light)
    );
    content: "";
}

.aw-ghl-summary-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 13px 32px
        rgba(16, 24, 40, 0.08);
}

.aw-ghl-summary-card > span,
.aw-ghl-summary-card > small {
    display: block;
    color: var(--aw-muted);
}

.aw-ghl-summary-card > span {
    font-size: 14px;
    font-weight: 700;
}

.aw-ghl-summary-card > strong {
    display: block;
    margin: 15px 0 8px;
    color: var(--aw-dark);
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
}

.aw-ghl-summary-card > small {
    font-size: 12px;
    line-height: 1.4;
}

.aw-ghl-currency-value {
    font-size: 34px !important;
    overflow-wrap: anywhere;
}

/* Main chart panels */

.aw-ghl-chart-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.85fr)
        minmax(0, 1.15fr);
    gap: 16px;
}

.aw-ghl-panel {
    min-width: 0;
    padding: 22px;
    border-radius: 15px;
}

.aw-ghl-panel-header {
    margin-bottom: 22px;
}

.aw-ghl-panel-header h3 {
    margin: 5px 0 0;
    color: var(--aw-dark);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
}

/* Contact Sources */

.aw-ghl-source-layout {
    display: grid;
    grid-template-columns:
        190px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    min-height: 250px;
}

.aw-ghl-source-chart {
    position: relative;
    width: 190px;
    max-width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
    background: #2a2f36;
    transition:
        background 0.3s ease;
}

.aw-ghl-source-chart::after {
    position: absolute;
    inset: 32px;
    border-radius: 50%;
    background: var(--aw-panel);
    content: "";
}

.aw-ghl-chart-center {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none;
}

.aw-ghl-chart-center strong {
    color: var(--aw-dark);
    font-size: 31px;
    font-weight: 800;
    line-height: 1;
}

.aw-ghl-chart-center span {
    margin-top: 6px;
    color: var(--aw-muted);
    font-size: 12px;
    font-weight: 600;
}

.aw-ghl-source-legend {
    display: flex;
    flex-direction: column;
    gap: 13px;
    min-width: 0;
}

.aw-ghl-source-legend p {
    margin: 0;
    color: var(--aw-muted);
    font-size: 14px;
}

.aw-ghl-legend-row {
    display: grid;
    grid-template-columns:
        11px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    font-size: 14px;
}

.aw-ghl-legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.aw-ghl-legend-label {
    min-width: 0;
    color: var(--aw-text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.aw-ghl-legend-value {
    color: var(--aw-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* Opportunity Stages and Why Not Closed */

.aw-ghl-stage-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
    max-height: 395px;
    padding-right: 7px;
    overflow-y: auto;
}

.aw-ghl-stage-list > p {
    margin: 0;
    color: var(--aw-muted);
    font-size: 14px;
}

.aw-ghl-stage-list::-webkit-scrollbar {
    width: 6px;
}

.aw-ghl-stage-list::-webkit-scrollbar-track {
    border-radius: 20px;
    background: #20242a;
}

.aw-ghl-stage-list::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: #4b525c;
}

.aw-ghl-stage-row {
    display: grid;
    grid-template-columns:
        minmax(125px, 0.9fr)
        minmax(120px, 1.8fr)
        38px;
    align-items: center;
    gap: 12px;
    color: var(--aw-text);
    font-size: 13px;
}

.aw-ghl-stage-row > span:first-child {
    font-weight: 600;
    line-height: 1.25;
}

.aw-ghl-stage-row.is-zero {
    opacity: 0.43;
}

.aw-ghl-stage-track {
    height: 9px;
    border-radius: 100px;
    background: #242930;
    overflow: hidden;
}

.aw-ghl-stage-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--aw-accent),
        var(--aw-accent-light)
    );
    transition:
        width 0.4s ease;
}

.aw-ghl-stage-count {
    color: var(--aw-dark);
    text-align: right;
    font-weight: 800;
}

.aw-ghl-why-panel {
    margin-top: 16px;
}

.aw-ghl-why-panel .aw-ghl-stage-list {
    max-height: none;
}

/* Closed Leads table */

.aw-ghl-closed-panel {
    margin-top: 16px;
}

.aw-ghl-table-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.aw-ghl-closed-summary {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
}

.aw-ghl-closed-summary span {
    color: var(--aw-muted);
    font-size: 12px;
    font-weight: 700;
}

.aw-ghl-closed-summary strong {
    color: var(--aw-dark);
    font-size: 22px;
    font-weight: 800;
}

.aw-ghl-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--aw-border);
    border-radius: 11px;
    background: var(--aw-panel);
}

.aw-ghl-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.aw-ghl-table-wrapper::-webkit-scrollbar-track {
    background: #20242a;
}

.aw-ghl-table-wrapper::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: #4b525c;
}

.aw-ghl-table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
    background: var(--aw-panel);
}

.aw-ghl-table th,
.aw-ghl-table td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--aw-border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.aw-ghl-table th {
    background: #1d2127;
    color: var(--aw-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.25px;
    text-transform: uppercase;
}

.aw-ghl-table td {
    color: var(--aw-text);
    font-size: 13px;
}

.aw-ghl-table tbody tr:last-child td {
    border-bottom: 0;
}

.aw-ghl-table tbody tr:hover td {
    background: #20242a;
}

.aw-ghl-table-contact {
    color: var(--aw-dark);
    font-weight: 700;
}

.aw-ghl-table-revenue {
    color: var(--aw-dark);
    font-weight: 800;
}

.aw-ghl-table-empty {
    padding: 35px 15px !important;
    color: var(--aw-muted) !important;
    text-align: center !important;
}

/* Footer */

.aw-ghl-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    color: var(--aw-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* Loading state */

.aw-ghl-dashboard.is-loading {
    cursor: wait;
}

.aw-ghl-dashboard.is-loading
.aw-ghl-summary-card strong {
    animation:
        aw-ghl-pulse
        1.1s
        infinite
        alternate;
}

@keyframes aw-ghl-pulse {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

/* Tablet */

@media (max-width: 1000px) {
    .aw-ghl-header {
        align-items: stretch;
        flex-direction: column;
    }

    .aw-ghl-date-filters {
        justify-content: flex-start;
    }

    .aw-ghl-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .aw-ghl-chart-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */

@media (max-width: 620px) {
    .aw-ghl-dashboard {
        padding: 16px;
        border-radius: 12px;
    }

    .aw-ghl-header {
        gap: 18px;
        margin-bottom: 18px;
    }

    .aw-ghl-header h2 {
        font-size: 31px;
    }

    .aw-ghl-date-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .aw-ghl-date-filters label,
    .aw-ghl-date-filters input {
        width: 100%;
        min-width: 0;
    }

    .aw-ghl-date-filters button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .aw-ghl-summary-grid {
        grid-template-columns: 1fr;
    }

    .aw-ghl-summary-card {
        min-height: 138px;
    }

    .aw-ghl-source-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .aw-ghl-source-legend {
        width: 100%;
    }

    .aw-ghl-stage-row {
        grid-template-columns:
            minmax(90px, 0.9fr)
            minmax(80px, 1.5fr)
            28px;
        gap: 8px;
        font-size: 12px;
    }

    .aw-ghl-panel {
        padding: 18px;
    }

    .aw-ghl-table-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .aw-ghl-closed-summary {
        align-items: flex-start;
    }

    .aw-ghl-currency-value {
        font-size: 30px !important;
    }

    .aw-ghl-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Very small screens */

@media (max-width: 390px) {
    .aw-ghl-date-filters {
        grid-template-columns: 1fr;
    }

    .aw-ghl-date-filters button {
        grid-column: auto;
    }

    .aw-ghl-source-chart {
        width: 165px;
    }

    .aw-ghl-source-chart::after {
        inset: 28px;
    }
}

/* ========================================
   Full-screen loading overlay
======================================== */

.aw-ghl-loading-overlay {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 7, 10, 0.78);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.aw-ghl-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.aw-ghl-loading-card {
    width: min(430px, 100%);
    padding: 34px 30px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    background: var(--aw-panel);
    box-shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.24);
    text-align: center;
}

.aw-ghl-loading-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto 20px;
    border: 6px solid #3a2024;
    border-top-color: var(--aw-accent);
    border-radius: 50%;
    animation:
        aw-ghl-spinner
        0.85s
        linear
        infinite;
}

.aw-ghl-loading-card h3 {
    margin: 0 0 10px;
    color: var(--aw-dark);
    font-size: 24px;
    font-weight: 800;
}

.aw-ghl-loading-card p {
    min-height: 44px;
    margin: 0;
    color: var(--aw-muted);
    font-size: 15px;
    line-height: 1.5;
}

.aw-ghl-loading-progress {
    position: relative;
    height: 7px;
    margin: 22px 0 14px;
    border-radius: 100px;
    background: #242930;
    overflow: hidden;
}

.aw-ghl-loading-progress span {
    position: absolute;
    top: 0;
    left: -42%;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--aw-accent),
        var(--aw-accent-light)
    );
    animation:
        aw-ghl-loading-bar
        1.35s
        ease-in-out
        infinite;
}

.aw-ghl-loading-elapsed,
.aw-ghl-loading-note {
    display: block;
    color: var(--aw-muted);
    font-size: 12px;
}

.aw-ghl-loading-note {
    margin-top: 5px;
    opacity: 0.78;
}

.aw-ghl-loading-overlay.is-success
.aw-ghl-loading-spinner {
    border-color: #d1fadf;
    border-top-color: #12b76a;
}

.aw-ghl-loading-overlay.is-error
.aw-ghl-loading-spinner {
    border-color: #fee4e2;
    border-top-color: #d92d20;
}

body.aw-ghl-report-loading {
    overflow: hidden;
}

@keyframes aw-ghl-spinner {
    to {
        transform: rotate(360deg);
    }
}

@keyframes aw-ghl-loading-bar {
    0% {
        left: -42%;
    }

    100% {
        left: 105%;
    }
}

@media (max-width: 620px) {
    .aw-ghl-loading-card {
        padding: 28px 20px;
        border-radius: 15px;
    }

    .aw-ghl-loading-spinner {
        width: 50px;
        height: 50px;
    }

    .aw-ghl-loading-card h3 {
        font-size: 21px;
    }

    .aw-ghl-loading-card p {
        font-size: 14px;
    }
}

/* ========================================
   Do It Right brand refinements
======================================== */

.aw-ghl-dashboard {
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 24px 70px rgba(0, 0, 0, 0.18);
}

.aw-ghl-summary-card:hover {
    border-color: rgba(227, 27, 43, 0.38);
}

.aw-ghl-date-filters input {
    color-scheme: dark;
}

.aw-ghl-date-filters button {
    background: var(--aw-accent);
    box-shadow: 0 8px 22px rgba(227, 27, 43, 0.18);
}

.aw-ghl-date-filters button:hover {
    background: #c91625;
}

.aw-ghl-stage-fill,
.aw-ghl-loading-progress span,
.aw-ghl-summary-card::before {
    background: linear-gradient(
        90deg,
        var(--aw-accent),
        var(--aw-accent-light)
    );
}

.aw-ghl-table-wrapper,
.aw-ghl-table {
    background: var(--aw-panel);
}

.aw-ghl-table tbody tr:hover td {
    background: #20242a;
}

.aw-ghl-loading-card {
    background: #171a1f;
}

.aw-ghl-loading-progress {
    background: #242930;
}

.aw-ghl-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 14px;
}