:root {
    --primary: #0b5ed7;
    --primary-dark: #084298;
    --primary-light: #eaf3ff;
    --orange: #f7931e;
    --orange-dark: #d97706;
    --orange-light: #fff4e5;
    --secondary: #4b5563;
    --muted: #6b7280;
    --border: #e4eaf2;
    --background: #f5f8fc;
    --white: #ffffff;
    --success: #16803c;
    --success-background: #edf8f1;
    --danger: #c62828;
    --danger-background: #fff1f1;
    --shadow: 0 12px 35px rgba(11, 94, 215, 0.08);
    --radius: 18px;
    --transition: 0.2s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: #172033;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}


/* =========================================================
   HEADER
   ========================================================= */

.dashboard-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    width: min(1150px, calc(100% - 40px));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand img {
    width: 150px;
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    border: 2px solid #d9e9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #172033;
}

.logout-button {
    border: 1px solid #d9e1ec;
    background: var(--white);
    color: #172033;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    transition: var(--transition);
}

.logout-button:hover {
    border-color: var(--orange);
    color: var(--orange-dark);
    background: var(--orange-light);
}


/* =========================================================
   PAGE
   ========================================================= */

.dashboard-page {
    padding: 55px 20px 80px;
}

.dashboard-container {
    width: min(1150px, 100%);
    margin: 0 auto;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading-state {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.loading-state p {
    margin: 0;
    color: var(--secondary);
    font-size: 14px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #dce8f8;
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   ERROR
   ========================================================= */

.error-state {
    max-width: 520px;
    margin: 80px auto;
    padding: 35px;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.error-state h2 {
    margin: 0 0 10px;
    font-size: 21px;
}

.error-state p {
    margin: 0 0 25px;
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   WELCOME
   ========================================================= */

.welcome-section {
    min-height: 250px;
    padding: 40px;
    border-radius: var(--radius);
    background:
        linear-gradient(
            135deg,
            var(--primary-dark) 0%,
            var(--primary) 70%,
            #1976e8 100%
        );
    color: var(--white);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

.welcome-section::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -70px;
    top: -100px;
    border-radius: 50%;
    background: rgba(247, 147, 30, 0.2);
}

.welcome-copy {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.welcome-section .eyebrow {
    color: #d7e8ff;
}

.welcome-section h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.welcome-section p {
    max-width: 600px;
    margin: 0;
    color: #dceaff;
    font-size: 15px;
    line-height: 1.6;
}

.profile-button {
    min-height: 46px;
    padding: 0 19px;
    border-radius: 9px;
    background: var(--orange);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.profile-button:hover {
    background: var(--orange-dark);
    transform: translateY(-1px);
}


/* =========================================================
   SUMMARY
   ========================================================= */

.summary-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.summary-card {
    min-height: 105px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #cbdcf2;
}

.summary-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border-radius: 11px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.summary-card:nth-child(2) .summary-icon,
.summary-card:nth-child(4) .summary-icon {
    background: var(--orange-light);
    color: var(--orange-dark);
}

.summary-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.summary-card strong {
    font-size: 20px;
    color: #172033;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section {
    margin-top: 55px;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading .eyebrow {
    color: var(--orange-dark);
}

.section-heading h2 {
    margin: 0;
    font-size: 24px;
    color: #172033;
    letter-spacing: -0.025em;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.action-card {
    position: relative;
    min-height: 170px;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 15px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: #bcd3f0;
    box-shadow: var(--shadow);
}

.action-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
}

.action-card:nth-child(2) .action-icon {
    background: var(--orange-light);
    color: var(--orange-dark);
}

.action-card:nth-child(3) .action-icon {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.action-card h3 {
    margin: 0 0 7px;
    font-size: 16px;
    color: #172033;
}

.action-card p {
    max-width: 250px;
    margin: 0;
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.55;
}

.action-arrow {
    position: absolute;
    right: 22px;
    bottom: 20px;
    color: var(--orange);
    font-size: 19px;
    font-weight: 700;
}


/* =========================================================
   DATA CARDS
   ========================================================= */

.data-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(11, 94, 215, 0.025);
}

.empty-state {
    padding: 55px 25px;
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 17px;
    border-radius: 12px;
    background: var(--orange-light);
    color: var(--orange-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.empty-state p {
    max-width: 430px;
    margin: 0 auto 22px;
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   DYNAMIC LISTS
   ========================================================= */

.quote-list,
.project-list {
    display: flex;
    flex-direction: column;
}

.quote-item,
.project-item {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.quote-item:hover,
.project-item:hover {
    background: #fbfdff;
}

.quote-item:last-child,
.project-item:last-child {
    border-bottom: 0;
}

.quote-top,
.project-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.quote-title,
.project-title {
    margin: 0;
    font-size: 15px;
    color: #172033;
}

.quote-status,
.project-status {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 700;
}

.quote-meta,
.project-meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button,
.secondary-button {
    min-height: 44px;
    padding: 0 17px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: var(--transition);
}

.primary-button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--white);
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    border: 1px solid var(--primary);
    background: var(--white);
    color: var(--primary);
}

.secondary-button:hover {
    background: var(--primary);
    color: var(--white);
}


/* =========================================================
   ACCOUNT SECTION
   ========================================================= */

.account-section {
    margin-top: 55px;
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--orange);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    box-shadow: 0 5px 20px rgba(11, 94, 215, 0.03);
}

.account-section .eyebrow {
    color: var(--orange-dark);
}

.account-section h2 {
    margin: 0 0 7px;
    font-size: 20px;
    color: #172033;
}

.account-section p {
    margin: 0;
    color: var(--secondary);
    font-size: 13px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.dashboard-footer {
    width: min(1150px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 35px;
    text-align: center;
}

.dashboard-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .header-container {
        width: calc(100% - 30px);
        min-height: 68px;
    }

    .brand img {
        width: 125px;
    }

    .profile-name {
        display: none;
    }

    .logout-button {
        padding: 0 11px;
    }

    .dashboard-page {
        padding: 35px 15px 60px;
    }

    .welcome-section {
        min-height: 0;
        padding: 28px 22px;
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-section h1 {
        font-size: 34px;
    }

    .profile-button {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .account-section {
        align-items: flex-start;
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }

    .dashboard-footer {
        width: calc(100% - 30px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}