:root {
    font-family: "Lexend", "Segoe UI", sans-serif;
    --pp-bg: #f3f6fa;
    --pp-surface: #fcfdff;
    --pp-surface-alt: #f5f8fc;
    --pp-text-strong: #12284a;
    --pp-text-muted: #5d6d81;
    --pp-border-soft: #d7e0ea;
    --pp-border-table: #e3e9f1;
    --pp-primary: #0b2c5d;
    --pp-primary-strong: #061b3f;
    --pp-accent: #2f80c8;
    --pp-success: #2f7d62;
    --pp-warning: #b88733;
    --pp-error: #b13d3d;
    --pp-shadow-sm: 0 1px 2px rgba(8, 27, 56, 0.07);
    --pp-shadow-md: 0 10px 28px rgba(8, 27, 56, 0.1);
    --pp-radius-sm: 8px;
    --pp-radius-md: 10px;
    --pp-radius-lg: 14px;
    --pp-space-1: 4px;
    --pp-space-2: 8px;
    --pp-space-3: 12px;
    --pp-space-4: 16px;
    --pp-space-5: 24px;
    --pp-space-6: 32px;
    --pp-transition-fast: 120ms ease;
    --pp-transition-base: 180ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
    color: var(--pp-text-strong);
}

body {
    margin: 0;
}

a {
    color: var(--pp-primary);
}

:focus-visible {
    outline: 2px solid #2f80c8;
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

.pp-shell {
    min-height: 100vh;
}

.pp-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    background: #0b2c5d;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
}

.pp-skip-link:focus {
    left: 12px;
    top: 0;
}

.pp-appbar {
    border-bottom: 1px solid var(--pp-border-soft);
    backdrop-filter: blur(2px);
    background: rgba(252, 253, 255, 0.92);
    min-height: 64px;
    gap: 8px;
    min-width: 0;
}

.pp-drawer-toggle {
    display: inline-flex;
    flex: 0 0 auto;
}

.pp-appbar-account {
    min-width: 0;
    max-width: min(42vw, 360px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--pp-text-muted);
}

.pp-appbar-account .mud-typography {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.pp-appbar-title {
    color: var(--pp-text-muted);
    padding-left: 4px;
    font-size: 0.95rem;
    font-weight: 500;
}

.pp-brand {
    padding-left: var(--pp-space-2);
    letter-spacing: 0.01em;
}

.pp-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    width: min(560px, calc(100vw - 420px));
    min-width: 260px;
    justify-content: flex-start;
}

.pp-brand-logo {
    height: clamp(52px, 5.4vw, 74px);
    width: auto;
    object-fit: contain;
    max-width: 100%;
}

.pp-drawer {
    border-right: 1px solid var(--pp-border-soft);
    background: linear-gradient(180deg, #f7faff 0%, #f2f6fb 100%);
}

.pp-drawer-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 12px 10px;
    border-bottom: 1px solid var(--pp-border-soft);
}

.pp-drawer-brand .pp-brand-link {
    width: 100%;
    min-width: 0;
    justify-content: center;
}

.pp-drawer-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: none;
    max-height: 180px;
}

.pp-nav-menu {
    padding: var(--pp-space-4) var(--pp-space-3);
}

.pp-nav-account-text {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pp-nav-section {
    display: block;
    margin: var(--pp-space-2) var(--pp-space-2) var(--pp-space-1);
    font-weight: 600;
    color: var(--pp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pp-nav-menu .mud-nav-link {
    border-radius: var(--pp-radius-sm);
    margin: 2px 0;
    transition: background-color var(--pp-transition-fast), color var(--pp-transition-fast);
}

.pp-nav-menu .mud-nav-link.active {
    background: rgba(11, 44, 93, 0.1);
    color: var(--pp-primary-strong);
    font-weight: 600;
}

.pp-main-content {
    background: transparent;
}

.pp-page-container {
    padding: var(--pp-space-5) clamp(var(--pp-space-4), 2.4vw, var(--pp-space-6));
}

.mud-paper {
    border: 1px solid var(--pp-border-soft);
    box-shadow: var(--pp-shadow-sm);
    background-color: var(--pp-surface);
}

.mud-card {
    border: 1px solid var(--pp-border-soft);
    box-shadow: var(--pp-shadow-sm);
}

.mud-table-root .mud-table-container table {
    border-color: var(--pp-border-table);
}

.mud-table-root .mud-table-head th {
    color: var(--pp-text-muted);
    font-weight: 600;
    font-size: 0.82rem;
    border-bottom-color: var(--pp-border-soft);
}

.mud-table-root .mud-table-body td {
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom-color: var(--pp-border-table);
}

.mud-input-control > .mud-input-control-input-container {
    margin-top: 6px;
}

.mud-input-root {
    background: #fff;
}

.mud-button-filled {
    box-shadow: none;
}

.mud-button-filled:hover {
    box-shadow: var(--pp-shadow-sm);
}

.mud-button-root,
.mud-nav-link,
.mud-link,
.mud-input-control .mud-input-slot,
.mud-select-input {
    transition: box-shadow var(--pp-transition-fast), border-color var(--pp-transition-fast);
}

.mud-button-root:focus-visible,
.mud-nav-link:focus-visible,
.mud-link:focus-visible,
.mud-input-control .mud-input-slot:focus-within,
.mud-select-input:focus-visible {
    box-shadow: 0 0 0 2px rgba(47, 128, 200, 0.35);
}

.mud-button-root {
    min-height: 38px;
}

.mud-alert {
    border-radius: var(--pp-radius-sm);
    border: 1px solid var(--pp-border-soft);
}

.mud-dialog {
    border: 1px solid var(--pp-border-soft);
    box-shadow: var(--pp-shadow-md);
}

.pp-page-header {
    margin-bottom: var(--pp-space-5);
}

.pp-page-title {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--pp-text-strong);
}

.pp-page-subtitle {
    margin-top: var(--pp-space-2);
    color: var(--pp-text-muted);
    font-size: 0.95rem;
}

.pp-section-card {
    padding: var(--pp-space-5);
    border-radius: var(--pp-radius-md);
}

.pp-summary-panel {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-border-soft);
    background: linear-gradient(180deg, #fbfaf7 0%, #f7f5f1 100%);
}

.pp-empty-state {
    padding: var(--pp-space-6);
    text-align: center;
    color: var(--pp-text-muted);
    border: 1px dashed var(--pp-border-soft);
    border-radius: var(--pp-radius-md);
    background: linear-gradient(180deg, #fcfbf8 0%, #f7f5f1 100%);
}

.pp-loading-state {
    padding: var(--pp-space-5);
}

.pp-status-chip {
    font-weight: 600;
}

.dashboard-metric-card {
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-work-card {
    min-height: 220px;
}

.dashboard-focus-list {
    margin: 0;
    padding-left: 1.1rem;
}

.dashboard-focus-list li {
    padding: 0.42rem 0;
    border-bottom: 1px solid rgba(93, 109, 129, 0.18);
}

.dashboard-focus-list li:last-child {
    border-bottom: 0;
}

.dashboard-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(93, 109, 129, 0.16);
}

.dashboard-checklist-item:last-child {
    border-bottom: 0;
}

.leads-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.money-summary {
    background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
}

.money-metric {
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(93, 109, 129, 0.22);
    border-radius: 10px;
    min-height: 84px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.money-panel,
.settings-card,
.integrations-card,
.calendar-card,
.proposal-preview-card,
.public-proposal-card,
.crm-card,
.pp-auth-card {
    border: 1px solid rgba(93, 109, 129, 0.22);
}

.money-invoice-summary {
    border-left: 3px solid rgba(11, 44, 93, 0.3);
}

.reports-filter-card {
    overflow: hidden;
}

.reports-filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--pp-space-3);
}

.reports-filter-field {
    flex: 1 1 150px;
    min-width: 0;
}

.reports-view-field {
    flex-grow: 0.7;
}

.reports-filter-action {
    flex: 0 1 auto;
    min-width: 0;
    white-space: normal;
}

.proposal-item-card,
.public-proposal-item {
    background: #fcfcfa;
}

.pp-auth-container {
    padding-top: 2.5rem;
    padding-bottom: 1rem;
}

.pp-error-card {
    border: 1px solid rgba(161, 63, 58, 0.22);
}

.settings-launch-detail {
    color: var(--pp-text-muted);
    font-size: 0.82rem;
}

.settings-preset-header {
    gap: 12px;
}

.settings-preset-card {
    border-radius: 8px;
    padding: 14px;
    min-height: 286px;
}

.settings-preset-rate {
    display: grid;
    grid-template-columns: minmax(112px, 1fr) auto;
    gap: 4px 10px;
    align-items: baseline;
    padding: 5px 0;
}

.settings-preset-rate small {
    grid-column: 1 / -1;
    color: var(--pp-text-muted);
}

.settings-preset-actions {
    flex-wrap: wrap;
}

.support-guide-card,
.support-form-card {
    border: 1px solid rgba(93, 109, 129, 0.22);
}

.support-mode-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pp-space-2);
}

.support-mode-buttons .mud-button-root {
    min-height: 42px;
}

.support-actions {
    flex-wrap: wrap;
    gap: var(--pp-space-2);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 760px) {
    .settings-preset-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .settings-preset-card {
        min-height: auto;
    }
}

@media (max-width: 1279px) {
    .pp-page-container {
        padding: var(--pp-space-5) var(--pp-space-4);
    }

    .pp-drawer-brand {
        padding: 12px 10px 8px;
    }

    .pp-brand-link {
        width: min(460px, calc(100vw - 360px));
    }
}

@media (min-width: 1280px) {
    .pp-drawer-toggle {
        display: none;
    }
}

@media (max-width: 767px) {
    .pp-page-container {
        padding: var(--pp-space-4);
    }

    .pp-page-title {
        font-size: 1.4rem;
    }

    .pp-appbar {
        padding-left: 8px;
        padding-right: 8px;
        min-height: 60px;
    }

    .pp-appbar-account {
        max-width: 46vw;
    }

    .pp-logout-button {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .pp-brand-logo {
        height: clamp(42px, 9.2vw, 56px);
    }

    .pp-drawer-logo {
        max-height: 129px;
    }

    .pp-brand-link {
        width: min(420px, calc(100vw - 140px));
        min-width: 170px;
        padding: 4px 8px;
    }

    .reports-filter-bar {
        align-items: stretch;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .reports-filter-field,
    .reports-filter-action {
        width: 100%;
    }

    .reports-view-field,
    .reports-filter-action {
        grid-column: 1 / -1;
    }

    .reports-filter-action .mud-button-label {
        white-space: normal;
    }

    .support-mode-buttons,
    .support-mode-buttons .mud-button-root,
    .support-actions,
    .support-actions .mud-button-root {
        width: 100%;
    }

    .pp-top-nav {
        padding: 10px 12px 2px;
    }
}
