html, body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f7fb;
    color: #0f172a;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.app-shell {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(300deg, rgba(249, 115, 22, 0.12), transparent 38%),
        #f5f7fb;
}

.app-topbar {
    background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 44%, #0f766e 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.app-title {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
    line-height: 1.1;
}

.app-title .mud-typography-caption {
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: 0;
}

.app-drawer {
    border-right: 1px solid #e2e8f0;
    box-shadow: 16px 0 42px rgba(15, 23, 42, 0.06);
}

.app-drawer .mud-drawer {
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 58%, #eef6ff 100%) !important;
}

.app-main {
    min-height: 100vh;
    padding-top: 72px;
}

.app-content {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 20px 18px 14px;
    color: #0f172a;
}

.nav-brand-logo {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.nav-brand .mud-typography-caption {
    color: #64748b;
}

.modern-nav {
    padding: 4px 10px 18px;
}

.modern-nav .mud-nav-link {
    min-height: 44px;
    margin: 5px 0;
    border-radius: 8px;
    color: #334155;
    font-weight: 600;
}

.modern-nav .mud-nav-link:hover {
    background: #eaf2ff;
    color: #1d4ed8;
}

.modern-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(20, 184, 166, 0.12));
    color: #1d4ed8;
}

.modern-nav .mud-nav-link.active .mud-nav-link-icon {
    color: #2563eb;
}

.modern-logout {
    padding: 8px 0 0;
}

.modern-logout button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: transparent;
    color: #dc2626;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.modern-logout button:hover {
    background: #fff1f2;
}

.mud-paper,
.mud-card {
    border-radius: 8px !important;
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.mud-button-root {
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 700 !important;
}

.mud-button-filled .mud-button-label,
.mud-button-filled .mud-button-icon-start,
.mud-button-filled .mud-button-icon-end,
.mud-button-filled .mud-icon-root {
    color: #ffffff !important;
}

.mud-table-root {
    border-radius: 8px;
    overflow: hidden;
}

.mud-table-head {
    background: #f1f5f9;
}

.mud-input-control .mud-input {
    border-radius: 8px;
}

.proposal-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.proposal-hero {
    position: relative;
    overflow: hidden;
    margin: 20px 0 28px;
    padding: 26px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, #f8fafc 0%, #eef6ff 48%, #f6f8fb 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
    color: #ffffff;
}

.proposal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(20, 184, 166, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.82;
}

.proposal-hero > * {
    position: relative;
    z-index: 1;
}

.proposal-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.proposal-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.proposal-hero h1 {
    margin: 14px 0 4px;
    color: #0f172a;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 850;
    letter-spacing: 0;
}

.proposal-hero p {
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.proposal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    backdrop-filter: blur(10px);
}

.proposal-actions .mud-icon-button {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.proposal-client-block {
    margin: 28px 0 18px;
    padding: 22px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06));
    backdrop-filter: blur(12px);
}

.proposal-client-block span,
.proposal-info-card span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.proposal-client-block strong {
    display: block;
    color: #0f172a;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 850;
    line-height: 1.02;
}

.proposal-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.proposal-info-grid-closed {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.proposal-info-card {
    min-height: 122px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.proposal-info-card span {
    color: #64748b;
}

.proposal-info-card strong {
    display: block;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.proposal-info-card small {
    display: block;
    color: #64748b;
    font-size: 0.84rem;
    margin-top: 3px;
}

.proposal-status-card,
.proposal-owner-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proposal-status-card .mud-input-control {
    margin: 0;
}

.proposal-owner-card .mud-button-root,
.proposal-status-card .mud-button-root {
    align-self: flex-start;
}

.proposal-closed-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    background: rgba(22, 163, 74, 0.96);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.24);
}

.proposal-section-card {
    margin: 22px 0;
    overflow: hidden;
    background: #ffffff !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07) !important;
}

.proposal-section-header {
    min-height: 76px;
    padding: 18px 22px !important;
    border-bottom: 1px solid #e2e8f0;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.05)),
        #ffffff;
}

.proposal-section-header .mud-typography-h5 {
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 850;
}

.proposal-section-header .mud-typography-body2 {
    margin-top: 3px;
    color: #64748b;
}

.proposal-section-content {
    width: 100%;
    padding: 20px 22px !important;
}

.proposal-quick-actions {
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(249, 115, 22, 0.06)),
        #ffffff !important;
}

.proposal-quick-actions .mud-card-content {
    display: flex;
    justify-content: flex-end;
}

.proposal-quick-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.proposal-action-button {
    min-height: 44px;
    padding-inline: 16px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.proposal-upload-row {
    display: flex;
    align-items: center;
    min-height: 72px;
}

.proposal-section-card .mud-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.proposal-section-card .mud-table-head {
    background: #f8fafc;
}

.proposal-section-card .mud-table-cell {
    border-color: #e2e8f0 !important;
}

.proposal-section-card .mud-table-row:hover {
    background: #f8fbff !important;
}

.proposal-section-card .mud-table-pagination {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.proposal-filter-panel {
    margin: 12px 0 18px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.mensagens-board {
    background:
        linear-gradient(130deg, rgba(37, 99, 235, 0.05), rgba(16, 185, 129, 0.04)),
        #ffffff !important;
}

.mensagens-panels .mud-expand-panel {
    border: 1px solid #dbe7ff;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.mensagem-thread-panel .mud-expand-panel-header {
    min-height: 62px;
}

.mensagem-thread-title .mud-typography-subtitle1 {
    font-weight: 800;
    color: #0f172a;
}

.mensagem-preview {
    max-width: 420px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mensagem-item {
    padding: 10px;
    border-radius: 8px;
}

.msg-recebida {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.09), rgba(37, 99, 235, 0.05));
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.msg-enviada {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.24);
}

.mensagem-bubble {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    padding: 8px 10px;
    color: #1e293b;
}

.mensagem-time {
    color: #64748b;
    font-weight: 700;
}

.dashboard-header {
    margin: 8px 0 18px;
}

.dashboard-header .mud-typography-h4 {
    font-weight: 850;
    color: #0f172a;
}

.dashboard-header .mud-typography-body1 {
    color: #64748b;
}

.dashboard-card {
    border-radius: 8px !important;
    color: #ffffff;
}

.dashboard-card .mud-typography-subtitle2 {
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-card .mud-typography-h3 {
    color: #ffffff;
    font-weight: 900;
}

.dashboard-card-open {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.dashboard-card-closed {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.dashboard-card-month {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.proposal-image-badge {
    max-width: min(100%, 1100px);
    margin: 16px 18px;
}

.proposal-image-preview {
    width: auto;
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.proposal-image-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.proposal-image-dialog-content {
    display: grid;
    place-items: center;
    max-width: 90vw;
    max-height: 82vh;
    padding: 12px !important;
    background: #0f172a;
}

.proposal-image-full {
    width: auto;
    max-width: 86vw;
    max-height: 78vh;
    border-radius: 8px;
    object-fit: contain;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.94) 0%, rgba(15, 118, 110, 0.9) 52%, rgba(249, 115, 22, 0.9) 100%),
        #2563eb;
    position: relative;
    overflow: hidden;
}

.login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 86%);
}

.login-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(420px, calc(100vw - 32px));
    min-height: min(420px, calc(100vh - 48px));
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.34);
}

.login-brand {
    display: grid;
    place-items: center;
    width: 112px;
    height: 72px;
    margin: 0 auto 22px;
}

.login-brand-logo {
    width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.login-card .mud-typography-h4 {
    color: #0f172a;
    font-size: 2rem;
    font-weight: 850;
}

.login-card .mud-typography-body2 {
    color: #64748b;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    color: #334155;
    font-size: 0.875rem;
    font-weight: 700;
}

.login-field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 14px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.login-field input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

@media (max-width: 640px) {
    .app-content {
        padding: 16px;
    }

    .login-card {
        min-height: auto;
        padding: 28px 22px;
    }
}

@media (max-width: 1100px) {
    .proposal-info-grid,
    .proposal-info-grid-closed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .proposal-hero {
        padding: 20px;
    }

    .proposal-hero-top {
        flex-direction: column;
    }

    .proposal-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .proposal-info-grid,
    .proposal-info-grid-closed {
        grid-template-columns: 1fr;
    }
}
