/**
 * Nebulosa ERP — página de soporte (Soporte.html)
 */

body.neb-soporte-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

.sp-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.sp-topbar-brand {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sp-topbar-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.sp-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    background: #eff6ff;
}

.sp-topbar-link:hover {
    background: #dbeafe;
}

.sp-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

.sp-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
    border-radius: 16px;
    padding: 1.5rem 1.35rem;
    color: #fff;
    margin-bottom: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35);
}

.sp-hero h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sp-hero p {
    margin: 0.5rem 0 0;
    opacity: 0.92;
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 52ch;
}

.sp-hero-ti {
    background: linear-gradient(135deg, #334155 0%, #475569 50%, #64748b 100%);
    box-shadow: 0 10px 25px -5px rgba(51, 65, 85, 0.35);
}

.sti-login-panel {
    max-width: 440px;
    margin: 0 auto;
}

.sti-login-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1.2rem 1.15rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sti-login-error {
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.82rem;
    line-height: 1.4;
}

.sti-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.sti-input-wrap {
    position: relative;
}

.sti-input-wrap i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.sti-input-wrap input,
.sti-select {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0.55rem 0.8rem 0.55rem 2.35rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.92rem;
    color: #0f172a;
    background: #fff;
}

.sti-select {
    padding-left: 0.8rem;
}

.sti-input-wrap input:focus,
.sti-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sti-context-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.15rem;
    border-top: 1px dashed #e2e8f0;
}

.sti-btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    height: 44px;
    margin-top: 0.15rem;
    border: none;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.sti-btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

body.neb-soporte-ti-page:not(.sti-authenticated) #sti_panel_tools {
    display: none !important;
}

.sp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.sp-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.15rem 1.2rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sp-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
}

.sp-card-icon.email { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.sp-card-icon.whatsapp { background: linear-gradient(135deg, #15803d, #22c55e); }
.sp-card-icon.worker { background: linear-gradient(135deg, #334155, #64748b); }
.sp-card-icon.webhooks { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.sp-card-icon.bancario { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.sp-card-icon.colaborador { background: linear-gradient(135deg, #4338ca, #6366f1); }
.sp-card-icon.devices { background: linear-gradient(135deg, #134e4a, #0d9488, #14b8a6); }
.sp-card-icon.tickets { background: linear-gradient(135deg, #b45309, #ea580c, #f97316); }
.sp-card-icon.spy { background: linear-gradient(135deg, #1e3a8a, #2563eb, #0ea5e9); }
.sp-card-icon.bitacora { background: linear-gradient(135deg, #9f1239, #e11d48); }
.sp-card-icon.activos { background: linear-gradient(135deg, #854d0e, #ca8a04, #eab308); }
.sp-card-icon.objetivos { background: linear-gradient(135deg, #4c1d95, #6d28d9, #8b5cf6); }
.sp-card-icon.motor { background: linear-gradient(135deg, #1e3a8a, #0369a1); }

.sp-card h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.sp-card p {
    margin: 0;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.45;
    flex: 1;
}

.sp-card .sp-email {
    font-weight: 600;
    color: #2563eb;
    font-size: 0.88rem;
    word-break: break-all;
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.sp-btn:hover {
    transform: translateY(-1px);
}

.sp-btn-primary {
    background: #2563eb;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.sp-btn-whatsapp {
    background: #16a34a;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.sp-btn-outline {
    background: #f8fafc;
    color: #334155 !important;
    border-color: #e2e8f0;
}

.sp-section-title {
    margin: 1.5rem 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.sp-section-hint {
    margin: -0.35rem 0 0.85rem;
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sp-section-hint .fa-lock {
    color: #2563eb;
    font-size: 0.78rem;
}

.sp-grid-access .sp-card {
    border-style: dashed;
    border-color: #cbd5e1;
}

.sp-section-desc {
    margin: -0.35rem 0 1rem;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.5;
    max-width: 62ch;
}

.sp-ticket-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.2rem 1.15rem 1.15rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.sp-ticket-error {
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.85rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.82rem;
    line-height: 1.4;
}

.sp-ticket-success {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.sp-ticket-success .fa-check-circle {
    font-size: 1.35rem;
    margin-top: 0.1rem;
    color: #059669;
}

.sp-ticket-success p {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
}

.sp-ticket-success code {
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.65);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.sp-ticket-reset-btn {
    margin-top: 0.65rem !important;
}

.sp-ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.9rem;
    margin-bottom: 1rem;
}

.sp-ticket-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sp-ticket-field-full {
    grid-column: 1 / -1;
}

.sp-ticket-field span {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.sp-ticket-field input,
.sp-ticket-field select,
.sp-ticket-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: #0f172a;
    background: #fff;
}

.sp-ticket-field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.45;
}

.sp-ticket-field input:focus,
.sp-ticket-field select:focus,
.sp-ticket-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sp-ticket-submit {
    width: 100%;
    border: none;
    cursor: pointer;
}

.sp-ticket-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* —— Soporte TI — monitoreo dispositivos multi-empresa —— */
body.neb-sti-devices-page .sp-page {
    max-width: 1280px;
}

.std-unauth-panel {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.std-unauth-btn {
    margin-top: 0.5rem;
}

.std-hero-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.std-hero-actions {
    flex-shrink: 0;
}

.std-btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.std-btn-refresh:hover {
    background: rgba(255, 255, 255, 0.2);
}

.std-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.std-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.std-kpi .label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.std-kpi .value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.std-kpi.online .value { color: #059669; }
.std-kpi.alerta .value { color: #d97706; }
.std-kpi.offline .value { color: #64748b; }
.std-kpi.fault .value { color: #dc2626; }

.std-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.std-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.std-panel-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.std-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem 0.75rem;
}

.std-filter {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.std-filter-check {
    flex-direction: row;
    align-items: center;
    text-transform: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    padding-bottom: 0.35rem;
}

.std-select {
    min-width: 120px;
    height: 34px;
    padding: 0 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #0f172a;
    background: #fff;
}

.std-refresh-meta {
    font-size: 0.78rem;
    color: #64748b;
    padding-bottom: 0.35rem;
    white-space: nowrap;
}

.std-panel-body {
    padding: 0.75rem 1rem 1rem;
}

.std-loading,
.std-error,
.std-empty {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0.5rem 0;
}

.std-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
}

.std-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.std-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.std-table thead th {
    text-align: left;
    padding: 0.55rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.std-table tbody td {
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #0f172a;
}

.std-table tbody tr:hover {
    background: #f8fafc;
}

.std-serie {
    font-size: 0.78rem;
    background: #f1f5f9;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.std-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.std-badge.online { background: #d1fae5; color: #065f46; }
.std-badge.alerta { background: #ffedd5; color: #9a3412; }
.std-badge.offline { background: #f1f5f9; color: #475569; }
.std-badge.fault { background: #fee2e2; color: #991b1b; }
.std-badge.unknown { background: #f8fafc; color: #64748b; }

/* —— Soporte TI — gestión tickets —— */
body.neb-sti-tickets-page .sp-page {
    max-width: 1280px;
}

.stt-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.stt-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
}

.stt-kpi .label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stt-kpi .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.stt-kpi.proceso .value { color: #2563eb; }
.stt-kpi.espera .value { color: #d97706; }
.stt-kpi.resuelto .value { color: #059669; }
.stt-kpi.cerrado .value { color: #64748b; }

.stt-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 1rem;
    align-items: start;
}

.stt-table tbody tr.stt-row {
    cursor: pointer;
}

.stt-table tbody tr.stt-row-active {
    background: #eff6ff;
}

.stt-row-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.stt-pri {
    display: inline-flex;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.stt-pri.urgente { background: #fee2e2; color: #991b1b; }
.stt-pri.alta { background: #ffedd5; color: #9a3412; }
.stt-pri.media { background: #dbeafe; color: #1e40af; }
.stt-pri.baja { background: #f1f5f9; color: #475569; }

.stt-badge {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.stt-badge.nuevo { background: #dbeafe; color: #1e40af; }
.stt-badge.proceso { background: #e0e7ff; color: #3730a3; }
.stt-badge.espera { background: #ffedd5; color: #9a3412; }
.stt-badge.resuelto { background: #d1fae5; color: #065f46; }
.stt-badge.cerrado { background: #f1f5f9; color: #475569; }

.stt-filter-search .std-input-search {
    min-width: 180px;
    height: 34px;
    padding: 0 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
}

.stt-detail-panel {
    position: sticky;
    top: 4.5rem;
}

.stt-detail-empty {
    color: #64748b;
    font-size: 0.88rem;
    margin: 0;
}

.stt-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.stt-detail-asunto {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    line-height: 1.35;
}

.stt-detail-meta {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
}

.stt-detail-meta div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.35rem;
}

.stt-detail-meta dt {
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.stt-detail-meta dd {
    margin: 0;
    color: #0f172a;
}

.stt-detail-block {
    margin-bottom: 0.85rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.stt-detail-block p {
    margin: 0.35rem 0 0;
    white-space: pre-wrap;
}

.stt-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.stt-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 90px;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.86rem;
    text-transform: none;
    font-weight: 400;
    letter-spacing: normal;
    resize: vertical;
}

.stt-save-btn {
    width: 100%;
    border: none;
    cursor: pointer;
}

.sti-mejora-box {
    margin-top: 0.85rem;
    padding: 0.7rem 0.75rem;
    border: 1px dashed #93c5fd;
    border-radius: 10px;
    background: #eff6ff;
}

.sti-mejora-hint {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #1e40af;
    line-height: 1.35;
}

.stt-mejora-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
}

.sti-mejora-msg {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.sti-mejora-msg.is-ok { color: #047857; }
.sti-mejora-msg.is-error { color: #b91c1c; }

@media (max-width: 992px) {
    .stt-layout {
        grid-template-columns: 1fr;
    }

    .stt-detail-panel {
        position: static;
    }

    .stt-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .sp-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-topbar-nav {
        justify-content: center;
    }

    .sp-ticket-grid {
        grid-template-columns: 1fr;
    }
}

/* —— Soporte TI — bitácora e inventario —— */
body.neb-sti-bitacora-page .sp-page,
body.neb-sti-activos-page .sp-page,
body.neb-sti-objetivos-page .sp-page {
    max-width: 1400px;
}

body.neb-sti-objetivos-page .sp-page {
    max-width: 1600px;
}

.sti-crud-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.sti-mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.8rem;
    font-weight: 600;
}

.sti-link-btn {
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sti-crud-form .stt-field {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
    font-size: 0.78rem;
    color: #64748b;
}

.sti-crud-input,
.sti-crud-form .std-select.sti-crud-input {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    height: 38px;
    padding: 0.4rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    color: #0f172a;
    background: #fff;
}

.sti-crud-input:focus,
.sti-crud-form .std-select:focus,
.stt-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sti-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.sti-motivos-fieldset {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.7rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-width: 0;
    max-width: 100%;
}

.sti-motivos-fieldset legend {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    padding: 0 0.25rem;
}

.sti-motivos-grid {
    display: grid;
    gap: 0.35rem;
}

.sti-check {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
}

.sti-check input {
    margin-top: 0.15rem;
}

.sti-chip {
    display: inline-flex;
    margin: 0.1rem 0.15rem 0.1rem 0;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.sti-planta-summary {
    margin: -0.25rem 0 1rem;
}

.sti-planta-summary-head {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.sti-planta-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.55rem;
}

.sti-planta-chip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sti-planta-chip strong {
    font-size: 0.86rem;
    color: #0f172a;
}

.sti-planta-chip span {
    font-size: 0.75rem;
    color: #64748b;
}

.sti-planta-chip em {
    font-style: normal;
    font-weight: 700;
    font-size: 0.95rem;
    color: #854d0e;
}

@media (max-width: 992px) {
    .sti-crud-layout {
        grid-template-columns: 1fr;
    }

    .stb-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .sti-form-row {
        grid-template-columns: 1fr;
    }
}

/* —— Soporte TI — objetivos / Gantt —— */
.sto-progress-wrap {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: -0.4rem 0 1rem;
}

.sto-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6d28d9, #8b5cf6, #22c55e);
    transition: width 0.35s ease;
}

.sto-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.sto-gantt-wrap {
    overflow: auto;
    max-height: min(70vh, 860px);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.sto-gantt {
    min-width: 920px;
}

.sto-gantt-head,
.sto-gantt-row {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr);
    align-items: stretch;
}

.sto-gantt-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sto-gantt-label-col {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-right: 1px solid #e2e8f0;
    min-height: 44px;
}

.sto-gantt-weeks {
    display: flex;
}

.sto-gantt-week {
    flex: 1 0 72px;
    padding: 0.55rem 0.2rem;
    text-align: center;
    border-left: 1px dashed #e2e8f0;
}

.sto-gantt-row {
    border-top: 1px solid #f1f5f9;
    cursor: pointer;
    background: #fff;
}

.sto-gantt-row:hover {
    background: #f8fafc;
}

.sto-gantt-row.is-active {
    background: #eef2ff;
}

.sto-gantt-row.is-group {
    background: #f8fafc;
    font-weight: 700;
}

.sto-gantt-row.is-group.is-active {
    background: #e0e7ff;
}

.sto-task-text {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
    flex: 1;
}

.sto-task-text strong {
    font-size: 0.8rem;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.25;
}

.sto-task-meta {
    font-size: 0.68rem;
    font-weight: 500;
    color: #64748b;
}

.sto-gantt-track {
    position: relative;
    min-height: 44px;
    background-image: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent calc(100% / var(--sto-weeks, 8) - 1px),
        #eef2f7 calc(100% / var(--sto-weeks, 8) - 1px),
        #eef2f7 calc(100% / var(--sto-weeks, 8))
    );
}

.sto-bar {
    position: absolute;
    top: 12px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.4rem;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 28px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.sto-bar-pendiente { background: #94a3b8; }
.sto-bar-en_proceso { background: #2563eb; }
.sto-bar-completada { background: #059669; }
.sto-bar-cancelada { background: #e11d48; }
.sto-bar-group {
    height: 14px;
    top: 15px;
    opacity: 0.9;
    background: #7c3aed;
}

.sto-bar-none {
    position: absolute;
    top: 13px;
    left: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    font-style: italic;
}

.sto-caret,
.sto-caret-spacer,
.sto-check-spacer {
    width: 16px;
    flex: 0 0 16px;
}

.sto-caret {
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    padding: 0;
}

.sto-caret.is-collapsed i {
    transform: rotate(-90deg);
    display: inline-block;
}

.sto-check {
    margin: 0;
}

.sto-range {
    width: 100%;
    accent-color: #6d28d9;
}

.sto-avance-val {
    display: inline-block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4c1d95;
}

.sto-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.sto-btn-delete {
    color: #b91c1c !important;
}

.sto-padre-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sto-padre-head label {
    margin: 0;
}

.sto-add-grupo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    padding: 0.22rem 0.55rem;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.sto-add-grupo-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.sto-add-grupo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.sto-add-grupo-row[hidden] {
    display: none;
}

.sto-add-grupo-row .sti-crud-input {
    flex: 1;
    min-width: 0;
}

.sto-add-grupo-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    flex: 0 0 auto;
    height: 38px;
    padding: 0 0.7rem;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.sto-add-grupo-confirm:hover {
    background: #1d4ed8;
}

.sto-add-grupo-confirm:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 992px) {
    .sto-layout {
        grid-template-columns: 1fr;
    }
}

