:root {
    --marron: #3D2B1F;
    --crema: #F5EFE6;
    --crema-2: #EBE1D2;
    --verde: #2E7D44;
    --verde-claro: #E3F4E8;
    --rojo: #B23B3B;
    --rojo-claro: #FBE6E6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--crema);
    color: var(--marron);
    -webkit-text-size-adjust: 100%;
}

h1, h2 { font-weight: 700; }
h1:focus { outline: none; }

/* ── Shell ─────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    background: var(--marron);
    color: var(--crema);
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
}
.app-header .brand { font-weight: 700; font-size: 1.2rem; letter-spacing: .5px; }
.header-user { font-size: .9rem; display: flex; align-items: center; gap: 12px; }
.logout {
    background: transparent; color: var(--crema);
    border: 1px solid rgba(245,239,230,.5); border-radius: 8px;
    padding: 4px 10px; font-size: .85rem; cursor: pointer;
}
.logout:active { background: rgba(245,239,230,.15); }

.app-main { flex: 1; padding: 20px 18px 40px; max-width: 560px; width: 100%; margin: 0 auto; }

.saludo { font-size: 1.5rem; margin: 8px 0 2px; }
.rol { color: #7a6a5c; margin: 0 0 22px; }
.cargando, .vacio, .proximamente { color: #7a6a5c; }
.proximamente { margin-top: 28px; font-size: .85rem; }

/* ── Tarjetas dashboard ────────────────────────────────── */
.cards { display: grid; gap: 14px; }
.cards-grid { grid-template-columns: 1fr 1fr; }
.card {
    background: #fff; border: none; border-radius: 16px;
    padding: 20px; text-align: left; cursor: pointer;
    box-shadow: 0 2px 8px rgba(61,43,31,.08);
    display: flex; flex-direction: column; gap: 4px;
}
.card:active { background: var(--crema-2); }
.card-icon { font-size: 1.6rem; }
.card-title { font-weight: 700; font-size: 1.05rem; }
.card-desc { color: #7a6a5c; font-size: .85rem; }

/* ── Login ─────────────────────────────────────────────── */
.login-bg {
    min-height: 100vh; background: var(--marron);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
    background: var(--crema); border-radius: 20px;
    padding: 32px 26px; width: 100%; max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login-brand { text-align: center; margin: 0; font-size: 2rem; letter-spacing: 1px; }
.login-sub { text-align: center; color: #7a6a5c; margin: 4px 0 24px; }
.login-form { display: flex; flex-direction: column; }
.login-form label { font-size: .85rem; font-weight: 600; margin: 12px 0 6px; }
.login-form input {
    border: 1px solid #d6c9b8; border-radius: 10px; padding: 12px;
    font-size: 1rem; background: #fff; color: var(--marron);
}
.login-form input:focus { outline: 2px solid var(--marron); border-color: var(--marron); }
.login-btn {
    margin-top: 22px; background: var(--marron); color: var(--crema);
    border: none; border-radius: 10px; padding: 14px; font-size: 1rem;
    font-weight: 600; cursor: pointer;
}
.login-btn:disabled { opacity: .6; }
.login-error { color: var(--rojo); font-size: .9rem; margin: 14px 0 0; }
.login-sep { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #a09080; font-size: .85rem; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: #d6c9b8; }
.login-clickup {
    width: 100%; background: #fff; color: #7B68EE; border: 1.5px solid #7B68EE;
    border-radius: 10px; padding: 13px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.login-clickup:disabled { opacity: .6; }
.login-clickup:active { background: #f3f0ff; }

/* ── Fichaje ───────────────────────────────────────────── */
.estado-box {
    border-radius: 16px; padding: 18px; margin-bottom: 18px;
    display: flex; flex-direction: column; gap: 2px;
}
.estado-box.dentro { background: var(--rojo-claro); }
.estado-box.fuera  { background: var(--verde-claro); }
.estado-label { font-weight: 700; font-size: 1.1rem; }
.estado-desde { color: #7a6a5c; font-size: .9rem; }

.fichar-btn {
    width: 100%; border: none; border-radius: 16px; padding: 20px;
    font-size: 1.15rem; font-weight: 700; cursor: pointer; color: #fff;
}
.fichar-btn.entrada { background: var(--verde); }
.fichar-btn.salida  { background: var(--rojo); }
.fichar-btn:disabled { opacity: .6; }
.aviso { color: var(--rojo); font-size: .9rem; }

.hoy-title { font-size: 1.1rem; margin: 28px 0 10px; }
.lista-fichajes { list-style: none; padding: 0; margin: 0; }
.lista-fichajes li {
    background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 4px rgba(61,43,31,.06);
}
.tipo { font-weight: 600; }
.tipo.entrada { color: var(--verde); }
.tipo.salida  { color: var(--rojo); }
.hora { font-variant-numeric: tabular-nums; color: var(--marron); }

/* ── Vacaciones ────────────────────────────────────────── */
.vac-panel {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px;
}
.vac-kpi {
    background: #fff; border-radius: 14px; padding: 16px 8px; text-align: center;
    box-shadow: 0 1px 4px rgba(61,43,31,.06);
    display: flex; flex-direction: column; gap: 2px;
}
.vac-kpi.destacado { background: var(--marron); color: var(--crema); }
.vac-num { font-size: 1.6rem; font-weight: 700; }
.vac-lbl { font-size: .8rem; opacity: .8; }
.vac-solicitar { margin-bottom: 4px; }
.vac-form {
    background: #fff; border-radius: 14px; padding: 16px; margin: 14px 0 8px;
    display: flex; flex-direction: column; box-shadow: 0 1px 4px rgba(61,43,31,.06);
}
.vac-form label { font-size: .85rem; font-weight: 600; margin: 10px 0 4px; }
.vac-form input, .vac-form textarea {
    border: 1px solid #d6c9b8; border-radius: 10px; padding: 10px;
    font-size: 1rem; background: #fff; color: var(--marron); font-family: inherit;
}
.vac-item { }
.vac-item-info { display: flex; flex-direction: column; gap: 2px; }
.vac-periodo { font-weight: 600; }
.vac-dias { color: #7a6a5c; font-size: .85rem; }

.badge {
    font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
    white-space: nowrap;
}
.estado-pendiente { background: #FEF3C7; color: #92400E; }
.estado-aprobada  { background: #D1FAE5; color: #065F46; }
.estado-rechazada { background: #FEE2E2; color: #991B1B; }
.estado-cancelada { background: #F3F4F6; color: #374151; }

/* ── Consultas ─────────────────────────────────────────── */
.trabajo-item { cursor: pointer; gap: 10px; }
.trabajo-item:active { background: var(--crema-2); }
.trabajo-name { font-weight: 600; flex: 1; }
.status-chip {
    color: #fff; font-size: .75rem; font-weight: 600; padding: 4px 10px;
    border-radius: 999px; white-space: nowrap; text-transform: capitalize;
    text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.volver {
    background: none; border: none; color: var(--marron); font-size: .95rem;
    cursor: pointer; padding: 4px 0; margin-bottom: 6px; font-weight: 600;
}
.detalle-estado { margin-bottom: 14px; }
.detalle-row {
    background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
    display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 4px rgba(61,43,31,.06);
}
.detalle-lbl { font-size: .75rem; font-weight: 700; color: #7a6a5c; text-transform: uppercase; letter-spacing: .5px; }
.detalle-link { color: #2563EB; text-decoration: none; word-break: break-word; }
.detalle-desc { white-space: pre-wrap; }
.fotos-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px;
}
.fotos-grid img {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
    background: var(--crema-2);
}
.vac-form select {
    border: 1px solid #d6c9b8; border-radius: 10px; padding: 10px;
    font-size: 1rem; background: #fff; color: var(--marron);
}

/* ── Nóminas / Documentos ──────────────────────────────── */
.doc-item { gap: 10px; }
.doc-firma, .doc-estado { font-size: .8rem; }
.doc-estado { color: #7a6a5c; }
.doc-acciones { display: flex; gap: 6px; flex-shrink: 0; }
.btn-mini {
    border: 1px solid #d6c9b8; background: #fff; color: var(--marron);
    border-radius: 8px; padding: 6px 12px; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.btn-mini:active { background: var(--crema-2); }
.btn-mini.firmar { background: #D9A441; color: #fff; border-color: #D9A441; }
.btn-mini.leido  { background: var(--marron); color: var(--crema); border-color: var(--marron); }

/* ── Validación / Error UI ─────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    box-sizing: border-box; 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; }
