/* =========================================================
   Sistema de Inventario — Estilo "AI SaaS Dashboard"
   (rojo + amarillo sobre blanco / claro)
   ========================================================= */
:root {
    /* Base / fondo */
    --bg:            #FAFAFA;
    --surface:       #FFFFFF;
    --surface-2:     #FFF3F0;
    --border:        #F2E4E2;
    --ink:           #1A1414;
    --muted:         #6B7280;
    --muted-soft:    #9CA3AF;

    /* Marca / acento (rojo) */
    --brand:         #FF0000;
    --brand-strong:  #CC0000;
    --brand-soft:    #FFE5E3;

    /* Acento secundario (amarillo) */
    --accent-yellow:      #FFFF00;
    --accent-yellow-ink:  #4D4D00;
    --accent-yellow-soft: #FFFDE0;

    /* Hero oscuro */
    --hero-bg-1:     #0D0000;
    --hero-bg-2:     #6E0000;
    --hero-glow:     #FF0000;
    --hero-accent:   #FFFF00;
    --hero-text:     #FFFFFF;
    --hero-text-2:   #FFD1CE;

    /* Chips de categoría */
    --chip-red:      #FF0000;
    --chip-gold:     #FFC700;
    --chip-orange:   #FF7A00;
    --chip-coral:    #FF5252;
    --chip-graphite: #3F3B3B;

    /* Sombra estándar */
    --shadow: 0 1px 2px rgba(26,20,20,0.04), 0 8px 24px -12px rgba(26,20,20,0.08);
    --shadow-lg: 0 4px 8px rgba(26,20,20,0.06), 0 18px 40px -18px rgba(26,20,20,0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Manrope', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   Login
   ========================================================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 30%, rgba(255,0,0,0.35), transparent 55%),
        linear-gradient(135deg, var(--hero-bg-1) 0%, var(--hero-bg-2) 100%);
    padding: 20px;
}

.login-container {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.55);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: var(--ink);
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 800;
}

.login-container p {
    text-align: center;
    color: var(--muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 10px 24px -8px rgba(255,0,0,0.55);
}

/* =========================================================
   Formularios
   ========================================================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* =========================================================
   Botones
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(255,0,0,0.7);
}
.btn-primary:hover {
    background: var(--brand-strong);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--chip-graphite);
    color: #fff;
}
.btn-success:hover {
    background: #2a2727;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--brand-strong);
    color: #fff;
}
.btn-danger:hover {
    background: #a30000;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--chip-gold);
    color: var(--accent-yellow-ink);
}
.btn-warning:hover {
    background: #eab700;
    transform: translateY(-1px);
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--surface-2);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 9px;
}

.btn-block {
    width: 100%;
}

/* =========================================================
   Alerts
   ========================================================= */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-danger {
    background: var(--brand-soft);
    color: var(--brand-strong);
    border-color: #ffc9c5;
}

.alert-success {
    background: var(--accent-yellow-soft);
    color: var(--accent-yellow-ink);
    border-color: #f2edb0;
}

/* =========================================================
   Layout
   ========================================================= */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Barra superior y menú móvil (ocultos en escritorio) */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 1100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 12px;
    padding: 0 12px;
}
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
}
.menu-toggle {
    width: 42px; height: 42px;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 9px;
    cursor: pointer;
    border-radius: 10px;
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle span {
    display: block;
    height: 2.5px;
    width: 100%;
    background: var(--ink);
    border-radius: 3px;
    transition: transform .25s, opacity .2s;
}
.menu-toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13,0,0,0.45);
    z-index: 1150;
}
.sidebar-overlay.show { display: block; }
body.no-scroll { overflow: hidden; }

/* --- Sidebar claro --- */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    color: var(--ink);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 18px -8px rgba(255,0,0,0.6);
}

.sidebar-header h2 {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.2;
}

.sidebar-header p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.sidebar-menu {
    padding: 8px 12px 16px;
    flex: 1;
}

.sidebar-menu .menu-label {
    padding: 14px 8px 6px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted-soft);
    letter-spacing: 0.06em;
    font-weight: 600;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 11px;
    transition: all .18s;
    gap: 10px;
}

.sidebar-menu a:hover {
    background: var(--surface-2);
}

.sidebar-menu a.active {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.sidebar-menu a .icon {
    width: 20px;
    text-align: center;
    color: var(--muted-soft);
    font-size: 15px;
}

.sidebar-menu a.active .icon {
    color: var(--brand);
}

.sidebar-menu .badge-new {
    margin-left: auto;
    background: var(--accent-yellow);
    color: var(--accent-yellow-ink);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
}

/* --- Contenido principal --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    max-width: 1400px;
}

.main-content h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.main-content .subtitle {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 14px;
}

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--muted-soft);
    margin-bottom: 12px;
}

/* =========================================================
   Hero (única zona oscura)
   ========================================================= */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 34px 38px;
    margin-bottom: 22px;
    background:
        radial-gradient(60% 90% at 78% 55%, rgba(255,0,0,0.38), transparent 60%),
        linear-gradient(135deg, var(--hero-bg-1) 0%, var(--hero-bg-2) 100%);
    color: var(--hero-text);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--hero-text);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.hero-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-yellow);
    box-shadow: 0 0 8px 1px rgba(255,255,0,0.7);
}

.hero h1 {
    color: var(--hero-text);
    font-size: 38px;
    font-weight: 800;
    line-height: 1.1;
    max-width: 560px;
    text-wrap: balance;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.hero .hero-sub {
    color: var(--hero-text-2);
    font-size: 15px;
    line-height: 1.5;
    max-width: 480px;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.hero .btn-hero-ghost {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
}
.hero .btn-hero-ghost:hover {
    background: rgba(255,255,255,0.12);
}

.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.hero-stat .num {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.hero-stat .lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hero-text-2);
    margin-top: 6px;
}

/* Orbe central + chips flotantes */
.hero-orb {
    position: absolute;
    top: 50%;
    right: 60px;
    transform: translateY(-50%);
    width: 220px;
    height: 220px;
    display: none;
}
@media (min-width: 1080px) {
    .hero-orb { display: block; }
}

.hero-orb .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.10);
}
.hero-orb .ring.r2 { inset: 30px; border-color: rgba(255,255,255,0.08); }

.hero-orb .core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    box-shadow: 0 0 60px 10px rgba(255,0,0,0.45);
}

.hero-orb .float {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}
.hero-orb .float.f1 { top: 6px;  left: 30px;  color: var(--chip-gold); }
.hero-orb .float.f2 { top: 6px;  right: 20px; color: var(--chip-coral); }
.hero-orb .float.f3 { bottom: 10px; left: 18px; color: var(--chip-orange); }
.hero-orb .float.f4 { bottom: 10px; right: 30px; color: var(--accent-yellow); }

/* =========================================================
   Tarjetas de estadística (KPIs)
   ========================================================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}

.card .chip {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.card .card-body { min-width: 0; }

.card h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card .numero {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
}

/* Colores de chip por categoría */
.chip-red     { background: var(--brand-soft);         color: var(--brand); }
.chip-gold    { background: var(--accent-yellow-soft); color: #b58a00; }
.chip-orange  { background: #FFEEDD;                   color: var(--chip-orange); }
.chip-coral   { background: #FFE7E7;                   color: var(--chip-coral); }
.chip-graphite{ background: #ECEAEA;                   color: var(--chip-graphite); }

/* Solidos (para hero / tiles de acción) */
.chip-solid-red      { background: var(--brand);         color: #fff; }
.chip-solid-gold     { background: var(--chip-gold);     color: var(--accent-yellow-ink); }
.chip-solid-orange   { background: var(--chip-orange);   color: #fff; }
.chip-solid-coral    { background: var(--chip-coral);    color: #fff; }
.chip-solid-graphite { background: var(--chip-graphite); color: #fff; }

/* =========================================================
   Accesos rápidos (feature cards)
   ========================================================= */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.quick-action {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all .2s;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-action .icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.quick-action .qa-body { flex: 1; min-width: 0; }

.quick-action h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.quick-action p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.quick-action .chevron {
    color: var(--muted-soft);
    font-size: 18px;
    font-weight: 600;
}

/* =========================================================
   Tablas
   ========================================================= */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.table-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 13px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table th {
    background: var(--surface-2);
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table tbody tr:last-child td { border-bottom: none; }

table tr:hover { background: var(--surface-2); }

table .actions {
    display: flex;
    gap: 8px;
}

/* =========================================================
   Badges
   ========================================================= */
.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-sistemas {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.badge-contabilidad {
    background: #ECEAEA;
    color: var(--chip-graphite);
}

.badge-success {
    background: var(--accent-yellow-soft);
    color: var(--accent-yellow-ink);
}

.badge-danger {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.badge-warning {
    background: #FFEEDD;
    color: #9a4a00;
}

/* =========================================================
   Formularios en tarjeta
   ========================================================= */
.form-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 30px;
    max-width: 760px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Compatibilidad con botones antiguos */
.btn-sistemas   { background: var(--brand); color: #fff; }
.btn-sistemas:hover { background: var(--brand-strong); }
.btn-contabilidad   { background: var(--chip-graphite); color: #fff; }
.btn-contabilidad:hover { background: #2a2727; }
.btn-export     { background: var(--chip-graphite); color: #fff; }
.btn-export:hover { background: #2a2727; transform: translateY(-1px); }

/* =========================================================
   Paginación
   ========================================================= */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface-2);
    transition: all .2s;
}

.pagination a:hover {
    background: var(--brand);
    color: #fff;
}

.pagination .active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================================
   Breadcrumbs
   ========================================================= */
.breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--brand-strong);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: var(--muted-soft);
}

/* =========================================================
   Modal
   ========================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13,0,0,0.55);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
}

.modal h3 {
    margin-bottom: 12px;
    color: var(--ink);
    font-weight: 700;
}

.modal p {
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 14px;
}

.modal .form-actions {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
    /* Menú lateral como cajón deslizable */
    .mobile-topbar { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1200;
        box-shadow: 0 0 50px rgba(0,0,0,0.25);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 72px; /* deja espacio para la barra superior fija */
    }
    .hero { padding: 24px; }
    .hero h1 { font-size: 26px; }
    .form-row {
        grid-template-columns: 1fr;
    }
    .cards {
        grid-template-columns: 1fr 1fr;
    }
    table th, table td {
        padding: 10px 14px;
        white-space: nowrap;
    }
    .form-container { padding: 22px; }
}

@media (max-width: 480px) {
    .cards { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .hero-stats { gap: 20px; }
    .hero h1 { font-size: 22px; }
    .hero .hero-sub { font-size: 14px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
    .main-content h1 { font-size: 21px; }
    .form-container { padding: 18px; }
    .field-section { padding: 18px; }
    .table-header { flex-direction: column; align-items: flex-start; }
    .survey-hero h1 { font-size: 22px; }
    .survey-hero { padding: 24px 22px; }
}

/* =========================================================
   Encuesta de Estado Tecnológico
   ========================================================= */
.encuesta-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 34px 20px 70px;
}

.survey-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 32px 34px;
    margin-bottom: 22px;
    background:
        radial-gradient(60% 100% at 85% 40%, rgba(255,0,0,0.35), transparent 62%),
        linear-gradient(135deg, var(--hero-bg-1) 0%, var(--hero-bg-2) 100%);
    color: var(--hero-text);
}
.survey-hero .hero-badge { margin-bottom: 14px; }
.survey-hero h1 {
    color: var(--hero-text);
    font-size: 27px;
    font-weight: 800;
    line-height: 1.15;
    max-width: 620px;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
.survey-hero p {
    color: var(--hero-text-2);
    font-size: 14px;
    max-width: 560px;
    line-height: 1.5;
}

.field-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 24px 26px;
    margin-bottom: 20px;
}
.field-section .sec-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}
.field-section .sec-desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

/* Matriz de calificación */
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.matrix {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
table.matrix th, table.matrix td {
    padding: 11px 8px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
table.matrix thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    font-weight: 600;
}
table.matrix thead th .em { display: block; font-size: 14px; margin-bottom: 2px; }
table.matrix th:first-child, table.matrix td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}
table.matrix tbody tr:last-child td { border-bottom: none; }
table.matrix tbody tr:hover { background: var(--surface-2); }
table.matrix input[type=radio] {
    accent-color: var(--brand);
    width: 18px; height: 18px;
    cursor: pointer;
}

/* Grupos de checkboxes */
.subgroup-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-soft);
    font-weight: 600;
    margin: 18px 0 8px;
}
.subgroup-label:first-child { margin-top: 0; }
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 10px 16px;
}
.check-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: .15s;
}
.check-item:hover { background: var(--surface-2); }
.check-item input {
    accent-color: var(--brand);
    width: 17px; height: 17px;
    flex-shrink: 0;
}

/* Evaluación en estrellas */
.stars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.star-opt { position: relative; }
.star-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.star-opt label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 14px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    color: var(--muted);
    transition: .15s;
}
.star-opt label .em { font-size: 16px; letter-spacing: -2px; }
.star-opt input:checked + label {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 600;
}
.star-opt input:focus-visible + label { outline: 2px solid var(--brand); }

/* Confirmación de envío */
.survey-done {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 46px 34px;
    text-align: center;
    max-width: 520px;
    margin: 40px auto;
}
.survey-done .ic {
    width: 66px; height: 66px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}
.survey-done h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.survey-done p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* Firma (canvas) */
.sign-pad {
    width: 100%;
    max-width: 600px;
    height: 200px;
    border: 1px dashed var(--muted-soft);
    border-radius: 12px;
    background: var(--surface-2);
    display: block;
    touch-action: none;
    cursor: crosshair;
}
.sign-actions { margin-top: 10px; }
.firma-img {
    max-width: 340px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 6px;
}

/* Chip de calificación en resultados */
.cal-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
