@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
    --theme-primary: #FE7F00;
    --theme-primary-hover: #df7000;
    --theme-primary-active: #bf6100;
    --theme-primary-soft: #3b3727;
    --theme-secondary: #FE7F00;
    --theme-secondary-hover: #df7000;
    --theme-background: #002E21;
    --theme-surface: #073B2D;
    --theme-surface-strong: #0b4636;
    --theme-surface-muted: #053529;
    --theme-text: #FFFFFF;
    --theme-text-muted: #d6e1dc;
    --theme-border: #1B5A48;
    --theme-button-text: #101010;
    --theme-secondary-button-text: #ffffff;
    --theme-danger: #ef4444;
    --theme-danger-text: #ffffff;
    --theme-danger-soft: #fef2f2;
    --theme-success: #22c55e;
    --theme-success-text: #101010;
    --theme-success-soft: #f0fdf4;
    --theme-warning: #f59e0b;
    --theme-warning-text: #101010;
    --theme-warning-soft: #fffbeb;
    --theme-focus: #5f3f1e;
    --theme-disabled-bg: #12372e;
    --theme-disabled-text: #8aa59b;
    --theme-shadow: 0 18px 44px rgb(0 0 0 / 32%);
    --color-primary: var(--theme-primary);
    --color-secondary: var(--theme-secondary);
    --color-background: var(--theme-background);
    --color-text: var(--theme-text);
    --color-card: var(--theme-surface);
    --color-border: var(--theme-border);
    --brand: var(--theme-primary);
    --brand-dark: var(--theme-primary-hover);
    --brand-soft: var(--theme-primary-soft);
    --ink: var(--theme-text);
    --muted: var(--theme-text-muted);
    --line: var(--theme-border);
    --surface: var(--theme-surface);
    --canvas: var(--theme-background);
    --success: var(--theme-success);
    --danger: var(--theme-danger);
    --warning: var(--theme-warning);
    --bs-body-bg: var(--theme-background);
    --bs-body-color: var(--theme-text);
    --bs-primary: var(--theme-primary);
    --bs-secondary: var(--theme-secondary);
    --bs-border-color: var(--theme-border);
    --rz-primary: var(--theme-primary);
    --rz-primary-light: var(--theme-primary-hover);
    --rz-primary-lighter: var(--theme-primary-soft);
    --rz-primary-dark: var(--theme-primary-active);
    --rz-input-focus-border: var(--theme-primary);
    --rz-outline-color: var(--theme-focus);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: "Outfit", "Segoe UI", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-background);
}

html:has(.public-booking),
body:has(.public-booking) {
    background: #0f0f0f;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--theme-primary-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.btn,
.rz-button {
    border-radius: 8px;
}

button,
.btn,
.btn-primary,
.rz-button.rz-primary,
.rz-button.primary-action {
    border-color: var(--theme-primary);
    background-color: var(--theme-primary);
    color: var(--theme-button-text);
}

button:hover,
.btn:hover,
.btn-primary:hover,
.rz-button.rz-primary:hover {
    border-color: var(--theme-primary-hover);
    background-color: var(--theme-primary-hover);
    color: var(--theme-button-text);
}

button:active,
.btn:active,
.btn-primary:active,
.rz-button.rz-primary:active {
    border-color: var(--theme-primary-active);
    background-color: var(--theme-primary-active);
    color: var(--theme-button-text);
}

button:disabled,
.btn:disabled,
.rz-button:disabled,
.rz-state-disabled {
    border-color: var(--theme-border) !important;
    background: var(--theme-disabled-bg) !important;
    color: var(--theme-disabled-text) !important;
    cursor: not-allowed;
    opacity: 0.78;
}

.btn-secondary,
.btn-outline-primary,
.rz-button.rz-secondary,
.rz-button.rz-light {
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    color: var(--theme-text);
}

.btn-outline-primary:hover,
.btn-secondary:hover,
.rz-button.rz-secondary:hover,
.rz-button.rz-light:hover {
    border-color: var(--theme-primary);
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
}

.text-muted,
.small,
small,
label,
::placeholder {
    color: var(--theme-text-muted) !important;
}

input,
select,
textarea,
.form-control,
.form-select,
.rz-textbox,
.rz-inputtext,
.rz-dropdown,
.rz-mask,
.rz-numeric,
.rz-spinner,
.rz-password,
.rz-password input {
    border-color: var(--theme-border) !important;
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

option,
.dropdown-item,
.rz-dropdown-panel,
.rz-dropdown-items,
.rz-dropdown-item,
.rz-popup,
.rz-datepicker,
.rz-calendar {
    border-color: var(--theme-border) !important;
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.dropdown-item:hover,
.dropdown-item:focus,
.rz-dropdown-item:hover,
.rz-dropdown-item.rz-state-highlight,
.rz-datepicker td.rz-state-selected,
.rz-calendar td.rz-state-selected {
    background: var(--theme-primary-soft) !important;
    color: var(--theme-primary) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus,
.rz-textbox:focus,
.rz-inputtext:focus,
.rz-dropdown:focus,
.rz-mask:focus,
.rz-state-focused {
    border-color: var(--theme-primary) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 4px var(--theme-focus) !important;
}

.card,
.modal-content,
.dropdown-menu,
.rz-dialog,
.rz-card,
.rz-panel,
.table {
    border-color: var(--theme-border) !important;
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.badge,
.status-badge {
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
}

.badge-success,
.text-success {
    color: var(--theme-success) !important;
}

.badge-danger,
.text-danger {
    color: var(--theme-danger) !important;
}

.badge-warning,
.text-warning {
    color: var(--theme-warning) !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--theme-text);
    --bs-table-border-color: var(--theme-border);
    --bs-table-striped-bg: var(--theme-surface-muted);
    --bs-table-striped-color: var(--theme-text);
    --bs-table-hover-bg: var(--theme-primary-soft);
    --bs-table-hover-color: var(--theme-text);
    width: 100%;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--theme-border);
    color: var(--theme-text);
}

.table thead th {
    color: var(--theme-text-muted);
}

h1:focus {
    outline: none;
}

.content {
    padding: 24px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.metric-card,
.panel {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--theme-shadow);
}

.metric-card {
    padding: 22px;
}

.metric-card p {
    margin: 16px 0 8px;
    color: var(--muted);
    font-size: 14px;
}

.metric-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
}

.metric-card small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 600;
}

.metric-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    font-weight: 800;
}

.metric-icon.income,
.positive {
    color: var(--success);
}

.metric-icon.income {
    background: var(--theme-success-soft);
}

.metric-icon.expense,
.negative {
    color: var(--danger);
}

.metric-icon.expense {
    background: var(--theme-danger-soft);
}

.metric-icon.balance {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary), transparent 88%);
}

.metric-icon.pending {
    color: var(--warning);
    background: var(--theme-warning-soft);
}

.dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
    gap: 20px;
    margin-top: 20px;
}

.panel {
    padding: 22px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-header h2 {
    margin: 0;
    font-size: 20px;
}

.panel-header button {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-card);
    color: var(--color-text);
    padding: 9px 14px;
    font-weight: 700;
}

.due-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.due-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.due-list span {
    color: var(--muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.quick-actions button {
    min-height: 46px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-card);
    color: var(--color-text);
    font-weight: 700;
}

.quick-actions .primary-action {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--theme-button-text);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--theme-success);
}

.invalid {
    outline: 1px solid var(--theme-danger);
}

.validation-message {
    color: var(--theme-danger);
}

#blazor-error-ui {
    background: var(--theme-warning-soft);
    bottom: 0;
    box-shadow: var(--theme-shadow);
    color: var(--theme-text);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--theme-danger);
    color: var(--theme-danger-text);
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: var(--theme-border);
    stroke-width: 0.6rem;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.loading-progress circle:last-child {
    stroke: var(--brand);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    font-weight: 700;
    text-align: center;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: var(--theme-secondary);
}

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

    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

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

    .panel {
        padding: 16px;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .due-list li {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
.validated-field {
    display: grid;
    gap: .4rem;
}

.required-marker {
    color: #b42318;
}

.field-validation-message {
    display: block;
    color: #b42318;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid,
.validated-field input[aria-invalid="true"] {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .16rem rgba(220, 53, 69, .14) !important;
}

/* Radzen renderiza as notificações no topo por padrão. O APEX BARBER usa o canto inferior direito. */
.rz-notification {
    top: auto !important;
    right: 1rem !important;
    bottom: 1rem !important;
    left: auto !important;
    z-index: 21500 !important;
}

@media (max-width: 576px) {
    .rz-notification {
        right: .75rem !important;
        bottom: .75rem !important;
        left: .75rem !important;
        width: auto !important;
    }
}
