:root {
    --ce-navy: #0B2D4A;
    --ce-teal: #14B8A6;
    --ce-blue: #3B82F6;
    --ce-bg: #F9FAFB;
    --ce-border: #E5E7EB;
    --ce-text: #111827;
    --ce-muted: #4B5563;
    --ce-surface: #FFFFFF;
    --ce-success: #198754;
    --ce-danger: #DC3545;
    --ce-warning-accent: #F59E0B;

    --app-bg-page: var(--ce-bg);
    --app-surface: var(--ce-surface);
    --app-border: var(--ce-border);
    --app-text: var(--ce-text);
    --app-text-muted: var(--ce-muted);
    --app-primary: var(--ce-teal);
    --app-primary-hover: #0f9889;
}

html,
body {
    font-family: "Poppins", "Inter", "Segoe UI", sans-serif;
    color: var(--ce-text);
    background-color: var(--ce-bg);
}

a,
.btn-link {
    color: var(--ce-blue);
}

a:hover,
.btn-link:hover {
    color: #1d4ed8;
}

.btn-primary,
.ce-btn-primary {
    color: #fff;
    background-color: var(--ce-teal);
    border-color: var(--ce-teal);
}

.btn-primary:hover,
.btn-primary:focus,
.ce-btn-primary:hover,
.ce-btn-primary:focus {
    color: #fff;
    background-color: #0f9889;
    border-color: #0f9889;
}

.btn-outline-primary,
.ce-btn-secondary {
    color: var(--ce-navy);
    border-color: var(--ce-blue);
    background-color: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.ce-btn-secondary:hover,
.ce-btn-secondary:focus {
    color: #fff;
    background-color: var(--ce-blue);
    border-color: var(--ce-blue);
}

.btn-danger,
.ce-btn-danger {
    color: #fff;
    background-color: var(--ce-danger);
    border-color: var(--ce-danger);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus,
.ce-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.18);
    border-color: var(--ce-teal);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ce-success);
}

.invalid {
    outline: 1px solid var(--ce-danger);
}

.validation-message {
    color: var(--ce-danger);
}

.card,
.ce-card {
    border: 1px solid var(--ce-border);
    border-radius: 0.9rem;
    background: var(--ce-surface);
}

.card-header,
.ce-card-header {
    border-bottom: 1px solid var(--ce-border);
}

.table {
    --bs-table-bg: #ffffff;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--ce-border);
}

.table thead th {
    color: var(--ce-muted);
    font-weight: 600;
    background-color: #f3f6fb;
}

.alert {
    border-radius: 0.7rem;
}

.ce-page-header,
.page-hero {
    margin-bottom: 1.25rem;
}

.ce-page-header h1,
.page-hero h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ce-navy);
    margin-bottom: 0.4rem;
}

.ce-page-header p,
.page-hero p {
    color: var(--ce-muted);
    margin-bottom: 0;
}

.ce-badge,
.badge.bg-light.text-dark {
    background-color: #eef2f7 !important;
    color: var(--ce-navy) !important;
    border: 1px solid #dbe3ee;
}

.ce-metric-card {
    border: 1px solid var(--ce-border);
    border-radius: 0.9rem;
    background: var(--ce-surface);
    padding: 1rem;
    min-height: 128px;
}

.ce-metric-card h2,
.app-placeholder-card h2 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--ce-navy);
    font-weight: 600;
}

.ce-metric-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ce-text);
}

.ce-metric-accent {
    color: var(--ce-warning-accent);
}

.app-placeholder-card {
    border: 1px solid var(--ce-border);
    border-radius: 0.9rem;
    background-color: var(--ce-surface);
    padding: 1rem;
    min-height: 130px;
}

.app-placeholder-card p {
    color: var(--ce-muted);
    margin-bottom: 0;
}

.auth-shell {
    max-width: 1160px;
    margin: 2.25rem auto;
}

.auth-card {
    border: 1px solid var(--ce-border);
    border-radius: 1rem;
    overflow: hidden;
}

.auth-card-logo {
    max-width: 270px;
    width: 100%;
    height: auto;
}

.auth-brand {
    color: var(--ce-navy);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.auth-subtitle {
    color: var(--ce-muted);
}

.auth-side-visual {
    min-height: 100%;
    background: linear-gradient(155deg, #0B2D4A 0%, #123f63 55%, #14B8A6 100%);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: #fff;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.8rem;
}

.auth-side-visual-login {
    background-position: center center;
}

.auth-side-visual-register {
    background-position: center center;
}

.auth-side-visual-onboarding {
    background-position: center center;
}

.auth-side-visual h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.auth-side-visual p {
    margin: 0;
    opacity: 0.92;
}

.empresa-card {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.empresa-card:hover {
    border-color: #bfd4ec;
    box-shadow: 0 10px 24px rgba(11, 45, 74, 0.08);
}

.empresa-card-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    flex: 0 0 48px;
}

.empresa-card-logo-placeholder {
    border-radius: 0.6rem;
    border: 1px solid #d6e2f4;
    background: linear-gradient(145deg, #f8fbff 0%, #eaf1fc 100%);
    color: #315482;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.blazor-error-boundary {
    background-color: #b02a37;
    color: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Se produjo un error.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 991.98px) {
    .auth-shell {
        max-width: 720px;
        margin: 1.5rem auto;
    }

    .auth-side-visual {
        display: none;
    }
}
