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

html, body {
    font-family: Inter, Roboto, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ── AppBar ───────────────────────────────────────────────── */
.ct-appbar {
    background: linear-gradient(135deg, #0F4C81 0%, #1565C0 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(8px);
}

.ct-brand {
    font-weight: 400;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.9) !important;
}

.ct-brand-bold {
    font-weight: 700;
    color: #fff;
}

.ct-user-chip {
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.8rem;
}

/* ── Drawer ───────────────────────────────────────────────── */
.ct-drawer {
    background: #0D1B2A !important;
    border-right: none !important;
}

.ct-drawer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
}

.ct-logo-icon {
    font-size: 2rem !important;
    color: #38BDF8 !important;
    background: rgba(56,189,248,0.12);
    border-radius: 10px;
    padding: 6px;
    width: 42px !important;
    height: 42px !important;
}

.ct-logo-title {
    color: #F1F5F9;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.ct-logo-sub {
    color: #64748B;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 1px;
}

.ct-drawer-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 16px 8px;
    flex-shrink: 0;
}

/* Elimina todo espacio interno del drawer y nav */
.ct-drawer .mud-drawer-content > * {
    flex-shrink: 0;
}

.ct-drawer .mud-nav-menu {
    padding: 0 !important;
    margin: 0 !important;
}

.ct-drawer .mud-nav-menu > ul,
.ct-drawer .mud-navmenu {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none;
}

/* Nav links en sidebar oscuro */
.ct-drawer .mud-nav-link {
    color: #94A3B8 !important;
    border-radius: 8px !important;
    margin: 1px 8px !important;
    padding: 8px 12px !important;
    font-size: 0.875rem;
    transition: all 0.18s ease;
}

.ct-drawer .mud-nav-link:hover {
    background: rgba(56,189,248,0.08) !important;
    color: #E2E8F0 !important;
}

.ct-drawer .mud-nav-link.active {
    background: rgba(56,189,248,0.15) !important;
    color: #38BDF8 !important;
    font-weight: 600;
}

.ct-drawer .mud-nav-link .mud-icon-root {
    color: inherit !important;
    font-size: 1.15rem !important;
}

/* NavGroup headers */
.ct-drawer .mud-nav-group .mud-nav-group-header {
    color: #64748B !important;
    border-radius: 8px !important;
    margin: 1px 8px !important;
    font-size: 0.875rem;
}

.ct-drawer .mud-nav-group .mud-nav-group-header:hover {
    background: rgba(56,189,248,0.06) !important;
    color: #94A3B8 !important;
}

/* Sección labels sobre grupos */
.ct-nav-section {
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 14px 20px 4px;
}

/* ── Main Content ─────────────────────────────────────────── */
.ct-main-content {
    background: #F0F4F8 !important;
}

.ct-page-wrapper {
    padding: 24px;
    min-height: calc(100vh - 64px);
}

/* ── Cards más modernas ───────────────────────────────────── */
.mud-card {
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04) !important;
    border: 1px solid #E2E8F0;
    transition: box-shadow 0.2s ease;
}

.mud-card:hover {
    box-shadow: 0 4px 16px rgba(15,76,129,0.10), 0 1px 4px rgba(0,0,0,0.06) !important;
}

/* ── Paper / MudPaper ─────────────────────────────────────── */
.mud-paper {
    border-radius: 14px !important;
}

/* ── DataGrid ─────────────────────────────────────────────── */
.mud-table-container {
    border-radius: 14px !important;
    overflow: hidden;
}

.mud-table thead th {
    background: #F8FAFC !important;
    color: #475569 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-bottom: 2px solid #E2E8F0 !important;
}

.mud-table tbody tr {
    transition: background 0.12s ease;
}

/* ── Buttons ──────────────────────────────────────────────── */
.mud-button-root {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

/* ── Input fields ─────────────────────────────────────────── */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px !important;
}

/* ── Chips ────────────────────────────────────────────────── */
.mud-chip {
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 0.78rem !important;
}

/* ── Page Header ──────────────────────────────────────────── */
.ct-page-header {
    margin-bottom: 24px;
}

.ct-page-title {
    font-weight: 700 !important;
    color: #1E293B !important;
    line-height: 1.3 !important;
}

.ct-page-subtitle {
    color: #94A3B8 !important;
    margin-top: 2px;
    text-transform: capitalize;
}

/* ── Stat Cards (Dashboard) ───────────────────────────────── */
.ct-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: default;
}

.ct-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08) !important;
}

.ct-stat-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
}

.ct-stat-icon-wrap .mud-icon-root {
    font-size: 1.6rem !important;
}

.ct-stat-blue .ct-stat-icon-wrap  { background: rgba(15,76,129,0.10); color: #0F4C81; }
.ct-stat-green .ct-stat-icon-wrap { background: rgba(5,150,105,0.10);  color: #059669; }
.ct-stat-orange .ct-stat-icon-wrap{ background: rgba(234,88,12,0.10);  color: #EA580C; }
.ct-stat-teal .ct-stat-icon-wrap  { background: rgba(0,150,136,0.10);  color: #009688; }

.ct-stat-body {
    flex: 1;
}

.ct-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1;
    margin-bottom: 4px;
}

.ct-stat-label {
    font-size: 0.8rem;
    color: #94A3B8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Auth / Login Layout ──────────────────────────────────── */
.ct-auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0D1B2A 0%, #0F4C81 60%, #1565C0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: Inter, Roboto, sans-serif;
}

.ct-auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    color: #fff;
}

.ct-auth-brand-icon {
    font-size: 2.4rem;
    background: rgba(56,189,248,0.18);
    border-radius: 14px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px;
    box-sizing: border-box;
    text-align: center;
}

.ct-auth-brand-name {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.3px;
}

.ct-auth-brand-name strong {
    font-weight: 700;
    color: #fff;
}

.ct-auth-brand-sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

.ct-auth-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.15);
    padding: 40px 44px;
    width: 100%;
    max-width: 440px;
}

.ct-auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 4px;
}

.ct-auth-card h2 {
    font-size: 0.9rem;
    font-weight: 400;
    color: #64748B;
    margin: 0 0 24px;
}

.ct-auth-card .form-floating {
    margin-bottom: 16px;
}

.ct-auth-card .form-control {
    border-radius: 10px !important;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    font-size: 0.9rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ct-auth-card .form-control:focus {
    border-color: #0F4C81 !important;
    box-shadow: 0 0 0 3px rgba(15,76,129,0.12) !important;
    background: #fff;
}

.ct-auth-card label {
    color: #64748B;
    font-size: 0.85rem;
}

.ct-auth-card .btn-primary {
    background: linear-gradient(135deg, #0F4C81, #1565C0);
    border: none;
    border-radius: 10px !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px;
    letter-spacing: 0.02em;
    transition: opacity 0.18s ease, transform 0.12s ease;
}

.ct-auth-card .btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.ct-auth-card hr {
    border-color: #E2E8F0;
    margin: 20px 0;
}

.ct-auth-card a {
    color: #0F4C81;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}

.ct-auth-card a:hover {
    text-decoration: underline;
    color: #1565C0;
}

.ct-auth-card p {
    margin: 6px 0;
}

.ct-auth-card .checkbox label {
    font-size: 0.85rem;
    color: #475569;
}

.ct-auth-card .text-danger {
    font-size: 0.8rem;
}

.ct-auth-card .alert {
    border-radius: 10px;
    font-size: 0.875rem;
}

.ct-auth-card .btn-link {
    color: #0F4C81 !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.ct-auth-card .btn-link:hover {
    text-decoration: underline;
}

.ct-auth-footer {
    margin-top: 24px;
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    text-align: center;
}

/* ── Blazor error */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "Ha ocurrido un error.";
}
