:root {
    --guinda: #651c32;
    --guinda-dark: #4a1424;
    --ambar: #a16207;
    --verde: #16a34a;
    --crema: #d1bca1;
    --gris: #64748b;
    --bg: #f4f1ee;
    --line: #e3ddd5;
}

* { box-sizing: border-box; }

html, body {
    font-family: Roboto, 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    background: var(--bg);
    color: #2b2b2b;
}

h1:focus { outline: none; }

/* ---------- Shell (sidebar + main) ---------- */
.iss-shell { display: flex; min-height: 100vh; }

.iss-sidebar {
    width: 250px;
    background: var(--guinda);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0;
}

.iss-brand {
    display: flex; align-items: center; gap: .7rem;
    padding: 0 1.2rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: .6rem;
}
.iss-brand small { display: block; color: var(--crema); font-size: .72rem; }
.iss-brand strong { font-size: 1.05rem; letter-spacing: .5px; }

.iss-brand-mark {
    background: var(--crema); color: var(--guinda-dark);
    width: 38px; height: 38px; border-radius: 8px;
    display: grid; place-items: center; font-weight: 700;
}
.iss-brand-mark--lg { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 12px; }

.iss-nav { display: flex; flex-direction: column; }
.iss-nav-link {
    color: #f3e9ec; text-decoration: none; padding: .7rem 1.3rem; font-size: .95rem;
    border-left: 3px solid transparent;
}
.iss-nav-link:hover { background: rgba(255,255,255,.08); }
.iss-nav-link.active { background: var(--guinda-dark); border-left-color: var(--crema); font-weight: 600; }

.iss-main { flex: 1; display: flex; flex-direction: column; }

.iss-topbar {
    display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
    background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.5rem;
}
.iss-user { display: flex; align-items: center; gap: .6rem; }
.iss-user-name { font-weight: 600; }
.iss-chip { background: var(--crema); color: var(--guinda-dark); padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; }

.iss-content { padding: 1.6rem 1.8rem; }

/* ---------- Typography ---------- */
.iss-h1 { color: var(--guinda); font-size: 1.6rem; margin: 0 0 .2rem; }
.iss-sub { color: var(--gris); margin: 0 0 1.2rem; }
.iss-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ---------- Buttons ---------- */
.iss-btn {
    display: inline-block; border: none; border-radius: 8px; padding: .55rem 1.1rem;
    font-size: .9rem; cursor: pointer; text-decoration: none; font-weight: 600;
}
.iss-btn-primary { background: var(--guinda); color: #fff; }
.iss-btn-primary:hover { background: var(--guinda-dark); }
.iss-btn-ghost { background: #fff; color: var(--guinda); border: 1px solid var(--line); }
.iss-btn-ok { background: var(--verde); color: #fff; }
.iss-btn-reject { background: #b3261e; color: #fff; }
.iss-btn-block { width: 100%; margin-top: .5rem; }
.iss-btn:disabled { opacity: .6; cursor: default; }
.iss-actions-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.iss-link { color: var(--guinda); font-weight: 600; text-decoration: none; }

/* ---------- Cards ---------- */
.iss-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.iss-card {
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem;
    display: flex; flex-direction: column; gap: .3rem; border-top: 4px solid var(--guinda);
}
.iss-card--warn { border-top-color: var(--ambar); }
.iss-card--ok { border-top-color: var(--verde); }
.iss-card-num { font-size: 2rem; font-weight: 700; color: var(--guinda-dark); }

/* ---------- Tables ---------- */
.iss-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.iss-table th { background: #faf7f3; text-align: left; padding: .7rem .9rem; font-size: .8rem; color: var(--gris); text-transform: uppercase; letter-spacing: .3px; }
.iss-table td { padding: .7rem .9rem; border-top: 1px solid var(--line); font-size: .92rem; }

/* ---------- Badges ---------- */
.iss-badge { padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.iss-badge--draft { background: #eee; color: #555; }
.iss-badge--pending { background: #fde9c8; color: #92500a; }
.iss-badge--ok { background: #d7f0df; color: #14773a; }
.iss-badge--reject { background: #f7d4d1; color: #a3231b; }
.iss-badge--archived { background: #e4dccf; color: #6b5836; }

/* ---------- Forms ---------- */
.iss-form { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; max-width: 760px; }
.iss-label { display: block; font-weight: 600; font-size: .85rem; margin: .9rem 0 .3rem; color: var(--guinda-dark); }
.iss-input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; font-family: inherit; }
.iss-input:focus { outline: 2px solid var(--crema); border-color: var(--guinda); }
.iss-textarea { resize: vertical; }
.iss-hint { color: var(--gris); font-size: .9rem; }

.iss-content-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; line-height: 1.6; }

/* ---------- Alerts ---------- */
.iss-alert { padding: .7rem .9rem; border-radius: 8px; margin-top: 1rem; font-size: .9rem; }
.iss-alert-error { background: #f7d4d1; color: #a3231b; }
.iss-alert-warn { background: #fde9c8; color: #92500a; }

/* ---------- Login ---------- */
.iss-login-bg { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--guinda), var(--guinda-dark)); padding: 1rem; }
.iss-login-card { background: #fff; border-radius: 16px; padding: 2rem; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.iss-login-head { text-align: center; margin-bottom: 1.2rem; }
.iss-login-head h1 { color: var(--guinda); margin: .6rem 0 .1rem; font-size: 1.5rem; }
.iss-login-head p { color: var(--gris); margin: 0; font-size: .85rem; }
.iss-login-head .iss-brand-mark { margin: 0 auto; }

/* ---------- Blazor error UI (plantilla) ---------- */
#blazor-error-ui {
    background: var(--ambar); color: #fff; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Ocurrió un error."; }

/* ===== Mejoras UX (editor, moderación, notificaciones) ===== */

/* Editor Quill */
.iss-quill { background: #fff; border-radius: 0 0 8px 8px; min-height: 220px; }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--line); }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; }
.ql-container.ql-snow { border-radius: 0 0 8px 8px; font-size: 1rem; }

/* Chips de filtro */
.iss-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.iss-chip-filter {
    text-decoration: none; color: var(--guinda-dark); background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; font-weight: 600;
}
.iss-chip-filter:hover { border-color: var(--guinda); }
.iss-chip-filter.active { background: var(--guinda); color: #fff; border-color: var(--guinda); }

/* Acciones rápidas en filas + botón pequeño */
.iss-row-actions { display: flex; gap: .5rem; align-items: center; }
.iss-row-actions form { display: inline; margin: 0; }
.iss-btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* Badge del menú (pendientes) */
.iss-nav-badge {
    background: var(--ambar); color: #fff; border-radius: 999px; font-size: .72rem;
    padding: .05rem .45rem; margin-left: .4rem; font-weight: 700;
}

/* Campanita */
.iss-bell { position: relative; text-decoration: none; font-size: 1.3rem; line-height: 1; }
.iss-bell-badge {
    position: absolute; top: -6px; right: -8px; background: #b3261e; color: #fff;
    border-radius: 999px; font-size: .68rem; padding: .05rem .35rem; font-weight: 700;
}

/* Notificaciones */
.iss-notif-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.iss-notif { display: flex; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.iss-notif--unread { border-left: 4px solid var(--guinda); background: #fbf7f3; }
.iss-notif-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: 0 0 auto; }
.iss-notif-icon.ok { background: var(--verde); }
.iss-notif-icon.reject { background: #b3261e; }
.iss-notif-title { font-weight: 600; color: var(--guinda); text-decoration: none; }
.iss-notif-msg { color: #92500a; font-size: .9rem; margin-top: .2rem; }
.iss-notif-date { color: var(--gris); font-size: .8rem; margin-top: .2rem; }

/* Estado vacío */
.iss-empty { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 2rem; text-align: center; color: var(--gris); }

/* Toast de éxito + búsqueda + responsive (UX-4/5) */
.iss-alert-ok { background: #d7f0df; color: #14773a; }
.iss-search { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; max-width: 540px; }
.iss-search .iss-input { flex: 1; }

@media (max-width: 820px) {
    .iss-shell { flex-direction: column; }
    .iss-sidebar { width: 100%; flex-direction: column; padding: .6rem 1rem; }
    .iss-nav { flex-direction: row; flex-wrap: wrap; gap: .2rem; }
    .iss-nav-link { border-left: none; border-bottom: 3px solid transparent; padding: .45rem .7rem; }
    .iss-nav-link.active { border-left: none; border-bottom-color: var(--crema); }
    .iss-content { padding: 1rem; }
    .iss-cards { grid-template-columns: 1fr 1fr; }
    .iss-topbar { padding: .6rem 1rem; }
}
