/* =====================================================================
   Tecontrol — tema visual unificado
   Cargado en todas las páginas AdminLTE (config/adminlte.php → plugins.TecontrolTheme).
   1) Tokens   2) Base AdminLTE/Bootstrap   3) Componentes tc-*
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- 1) Tokens ---------- */
:root {
    --tc-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --tc-page: #f4f6fa;
    --tc-surface: #ffffff;
    --tc-soft: #f7f8fb;
    --tc-head: #fafbfc;
    --tc-border: #e6e9ef;
    --tc-divider: #f0f2f5;
    --tc-text: #1f2937;
    --tc-text-2: #4b5563;
    --tc-muted: #8a94a6;
    --tc-faint: #c3c9d4;

    --tc-primary: #3b6fd8;
    --tc-primary-hover: #2f5ec2;
    --tc-primary-soft: #e9effc;
    --tc-red: #e5484d;     --tc-red-soft: #fdecec;     --tc-red-ink: #c62f34;
    --tc-amber: #f5a524;   --tc-amber-soft: #fef4e2;   --tc-amber-ink: #a76a06;
    --tc-green: #30a46c;   --tc-green-soft: #e6f6ee;   --tc-green-ink: #1f7a4d;
    --tc-teal: #12a594;    --tc-teal-soft: #e0f5f2;    --tc-teal-ink: #0b7569;
    --tc-violet: #7c66dc;  --tc-violet-soft: #efecfb;  --tc-violet-ink: #5a46b8;
    --tc-gray-soft: #f1f3f6; --tc-gray-ink: #6b7280;

    --tc-radius: 12px;
    --tc-radius-sm: 8px;
    --tc-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --tc-shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);
    --tc-ring: 0 0 0 3px rgba(59, 111, 216, .15);

    --tc-sidebar: #111827;
    --tc-sidebar-hover: rgba(255, 255, 255, .06);
}

/* ---------- 2) Base ---------- */
body, .tooltip, .popover, .swal2-popup { font-family: var(--tc-font); }
body { color: var(--tc-text); font-size: 14px; -webkit-font-smoothing: antialiased; }
.content-wrapper { background: var(--tc-page) !important; color: var(--tc-text); }
.text-muted { color: var(--tc-muted) !important; }
a { color: var(--tc-primary); }
a:hover { color: var(--tc-primary-hover); }
hr { border-color: var(--tc-border); }
td, th { vertical-align: middle !important; }

/* Encabezado de página */
.content-header { padding: 20px 1rem 12px; }
.content-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0; color: var(--tc-text); }

/* Navbar */
.main-header.navbar { background: var(--tc-surface); border-bottom: 1px solid var(--tc-border) !important; box-shadow: none; }
.main-header .nav-link { color: var(--tc-text-2) !important; }
.main-header .dropdown-menu { border: 1px solid var(--tc-border); border-radius: var(--tc-radius); box-shadow: var(--tc-shadow-lg); }

/* Sidebar */
.main-sidebar, .main-sidebar .brand-link { background: var(--tc-sidebar) !important; }
.main-sidebar { box-shadow: none !important; border-right: 1px solid rgba(255,255,255,.04); }
.main-sidebar .brand-link { border-bottom: 1px solid rgba(255,255,255,.06) !important; height: 57px; display: flex; align-items: center; padding: 0 .9rem; }
.main-sidebar .brand-link .brand-image { float: none; margin: 0 .7rem 0 .15rem; max-height: 32px; box-shadow: none !important; border-radius: 9px; }
.main-sidebar .brand-text { font-weight: 700 !important; font-size: 17px; letter-spacing: -.01em; color: #fff; }
.main-sidebar .sidebar { padding: 6px 10px 16px; }
.sidebar .nav-sidebar .nav-item { margin-bottom: 1px; }
.sidebar .nav-sidebar .nav-link { border-radius: var(--tc-radius-sm); color: #b4bdcb; font-size: 14px; font-weight: 500; padding: 8px 10px; display: flex; align-items: center; gap: .6rem;
                                  width: auto !important; transition: background .12s, color .12s; }
.sidebar .nav-sidebar .nav-link > .nav-icon { color: #7d889b; font-size: 15px; width: 1.4rem; margin: 0 !important; text-align: center; transition: color .12s; flex: none; }
.sidebar .nav-sidebar .nav-link > p { flex: 1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .nav-sidebar .nav-link > p > .right { position: static; margin-left: auto; float: right; font-size: 11px; opacity: .6; transition: transform .2s; }
.sidebar .nav-sidebar .nav-link:hover { background: var(--tc-sidebar-hover); color: #fff; }
.sidebar .nav-sidebar .nav-link:hover > .nav-icon { color: #fff; }
.sidebar .nav-sidebar > .nav-item > .nav-link.active { background: var(--tc-primary) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(59,111,216,.35) !important; }
.sidebar .nav-sidebar .nav-link.active > .nav-icon { color: #fff; }
.sidebar .nav-sidebar .menu-open > .nav-link:not(.active) { background: rgba(255,255,255,.04); color: #fff; }
/* Submenú: indentado con guía vertical */
.sidebar .nav-treeview { margin: 2px 0 4px 1.3rem; padding-left: .55rem; border-left: 1px solid rgba(255,255,255,.08); }
.sidebar .nav-treeview .nav-link { font-size: 13.5px; padding: 6px 10px; }
.sidebar .nav-treeview .nav-link > .nav-icon { font-size: 12.5px; width: 1.3rem; }
.sidebar .nav-sidebar .nav-treeview > .nav-item > .nav-link.active { background: rgba(59, 111, 216, .2) !important; color: #fff !important; box-shadow: none !important; }
/* Encabezados de sección */
.sidebar .nav-header { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5d6779 !important; font-weight: 700;
                       padding: 1.1rem .7rem .4rem !important; background: transparent !important; }
/* Sidebar colapsado (mini): sólo íconos centrados; los encabezados pasan a ser un separador */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .sidebar { padding: 6px 8px 16px; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-link { justify-content: center; padding: 9px 0; width: auto; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-link > .nav-icon { margin: 0; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-header { font-size: 0 !important; padding: 0 !important; height: 1px; margin: 10px 8px; background: rgba(255,255,255,.08) !important; overflow: hidden; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-treeview { margin-left: 0; padding-left: 0; border-left: 0; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-link { justify-content: center; padding: 0; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-link .brand-image { margin: 0; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-link .brand-text { display: none; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-link { gap: 0; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-link > p { display: none; }
/* Scrollbar discreta */
.main-sidebar .os-scrollbar-handle { background: rgba(255,255,255,.15) !important; }
/* Cards */
.card { background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: var(--tc-radius); box-shadow: var(--tc-shadow); margin-bottom: 16px; }
.card > .card-header { background: transparent; border-bottom: 1px solid var(--tc-border); padding: 14px 16px; }
.card > .card-header:first-child { border-radius: var(--tc-radius) var(--tc-radius) 0 0; }
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px; }
.card-footer { background: var(--tc-head); border-top: 1px solid var(--tc-border); padding: 10px 16px; }
.card-footer:last-child { border-radius: 0 0 var(--tc-radius) var(--tc-radius); }
.card.card-outline { border-top-width: 1px; }

/* Tablas */
.table { color: var(--tc-text); font-size: 14px; margin-bottom: 0; }
.table thead th { background: var(--tc-head); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--tc-muted);
                  font-weight: 600; padding: 10px 12px; border-top: 0; border-bottom: 1px solid var(--tc-border); white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--tc-divider); }
.table-sm td, .table-sm th { padding: 6px 10px; }
.table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.table-hover tbody tr:hover { background: #f8faff; color: inherit; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--tc-divider); }
.table .thead-dark th { background: var(--tc-head); color: var(--tc-muted); border-color: var(--tc-border); }

/* Formularios */
label:not(.form-check-label):not(.custom-control-label):not(.tc-switch) { font-size: 12.5px; font-weight: 600; color: var(--tc-text-2); margin-bottom: 4px; }
.form-control, .custom-select { border-radius: var(--tc-radius-sm); border-color: var(--tc-border); color: var(--tc-text); font-size: 14px; }
.form-control:not(textarea):not([multiple]), .custom-select { height: 38px; }
.form-control-sm:not(textarea), .custom-select-sm { height: 31px; font-size: 13px; }
.form-control:focus, .custom-select:focus { border-color: var(--tc-primary); box-shadow: var(--tc-ring); }
.form-control[readonly], .form-control:disabled { background: var(--tc-soft); }
.form-control::placeholder { color: var(--tc-faint); }
.input-group-text { background: var(--tc-soft); border-color: var(--tc-border); color: var(--tc-muted); border-radius: var(--tc-radius-sm); }
.invalid-feedback, .text-danger { color: var(--tc-red-ink) !important; }
.form-control.is-invalid { border-color: var(--tc-red); }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--tc-primary); border-color: var(--tc-primary); }

/* Botones */
.btn { border-radius: var(--tc-radius-sm); font-weight: 500; font-size: 14px; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn-sm { font-size: 13px; padding: 5px 10px; border-radius: 7px; }
.btn-xs { border-radius: 6px; }
.btn:focus, .btn.focus { box-shadow: var(--tc-ring) !important; }
.btn-primary { background: var(--tc-primary); border-color: var(--tc-primary); }
.btn-primary:hover, .btn-primary:not(:disabled):not(.disabled):active { background: var(--tc-primary-hover); border-color: var(--tc-primary-hover); }
.btn-success { background: var(--tc-green); border-color: var(--tc-green); }
.btn-success:hover { background: var(--tc-green-ink); border-color: var(--tc-green-ink); }
.btn-danger { background: var(--tc-red); border-color: var(--tc-red); }
.btn-danger:hover { background: var(--tc-red-ink); border-color: var(--tc-red-ink); }
.btn-warning { background: var(--tc-amber); border-color: var(--tc-amber); color: #3b2a05; }
.btn-info { background: var(--tc-teal); border-color: var(--tc-teal); }
.btn-default, .btn-secondary, .btn-light { background: var(--tc-surface); border: 1px solid var(--tc-border); color: var(--tc-text-2); }
.btn-default:hover, .btn-secondary:hover, .btn-light:hover { background: var(--tc-soft); border-color: #d5dae3; color: var(--tc-text); }
.btn-outline-secondary { border-color: var(--tc-border); color: var(--tc-text-2); }
.btn-outline-secondary:hover { background: var(--tc-soft); border-color: #d5dae3; color: var(--tc-text); }
.btn-outline-primary { border-color: var(--tc-primary); color: var(--tc-primary); }
.btn-outline-primary:hover { background: var(--tc-primary); color: #fff; }

/* Badges */
.badge { font-weight: 600; border-radius: 999px; padding: .3em .7em; font-size: 11.5px; }
.badge-primary { background: var(--tc-primary-soft); color: var(--tc-primary); }
.badge-success { background: var(--tc-green-soft); color: var(--tc-green-ink); }
.badge-danger  { background: var(--tc-red-soft); color: var(--tc-red-ink); }
.badge-warning { background: var(--tc-amber-soft); color: var(--tc-amber-ink); }
.badge-info    { background: var(--tc-teal-soft); color: var(--tc-teal-ink); }
.badge-secondary, .badge-light { background: var(--tc-gray-soft); color: var(--tc-gray-ink); }
.badge-dark    { background: #e5e7eb; color: #374151; }

/* Alertas */
.alert { border-radius: 10px; border: 1px solid transparent; font-size: 14px; }
.alert-success { background: var(--tc-green-soft); border-color: #c6ead6; color: var(--tc-green-ink); }
.alert-danger  { background: var(--tc-red-soft); border-color: #f6caca; color: var(--tc-red-ink); }
.alert-warning { background: var(--tc-amber-soft); border-color: #f8dfae; color: var(--tc-amber-ink); }
.alert-info    { background: var(--tc-primary-soft); border-color: #cddbf7; color: #2a54ad; }
.alert .close { color: inherit; }

/* Paginación */
.pagination { gap: 4px; margin: 0; flex-wrap: wrap; }
.page-link { border-radius: 7px !important; border: 1px solid var(--tc-border); color: var(--tc-text-2); font-size: 13px; padding: 5px 10px; margin: 0; }
.page-link:hover { background: var(--tc-soft); color: var(--tc-text); border-color: var(--tc-border); }
.page-item.active .page-link { background: var(--tc-primary); border-color: var(--tc-primary); color: #fff; }
.page-item.disabled .page-link { color: var(--tc-faint); border-color: var(--tc-border); }

/* Modales Bootstrap */
.modal-content { border: 0; border-radius: 14px; box-shadow: var(--tc-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--tc-border); padding: 16px 20px; }
.modal-header.bg-dark, .modal-header.bg-primary, .modal-header.bg-info { background: var(--tc-surface) !important; color: var(--tc-text) !important; }
.modal-header.bg-dark .close, .modal-header.bg-primary .close { color: var(--tc-text) !important; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 18px 20px; }
.modal-footer { border-top: 1px solid var(--tc-border); padding: 12px 20px; background: var(--tc-head); border-radius: 0 0 14px 14px; }
.modal-backdrop.show { opacity: .35; background: #0f172a; }

/* Nav tabs */
.nav-tabs { border-bottom: 1px solid var(--tc-border); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--tc-muted); font-weight: 500; padding: 10px 14px; }
.nav-tabs .nav-link:hover { color: var(--tc-text); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--tc-primary); border-bottom-color: var(--tc-primary); background: transparent; }

/* Dropdowns */
.dropdown-menu { border: 1px solid var(--tc-border); border-radius: 10px; box-shadow: var(--tc-shadow-lg); padding: 6px; font-size: 14px; }
.dropdown-item { border-radius: 6px; padding: 6px 10px; }
.dropdown-item:active { background: var(--tc-primary); }

/* SweetAlert */
.swal2-popup { border-radius: 16px !important; }
.swal2-styled { border-radius: var(--tc-radius-sm) !important; font-weight: 500 !important; }

/* Overlay de carga (wire:loading) — usado por las vistas viejas como .modload */
.modload, .tc-loading {
    position: fixed; inset: 0; z-index: 1060; display: flex; align-items: center; justify-content: center;
    background: rgba(244, 246, 250, .55); backdrop-filter: blur(1.5px);
}
.spinload, .tc-loading__spin { font-size: 0; }
.spinload > *, .tc-loading__spin > * { display: none; }
.spinload::after, .tc-loading__spin::after {
    content: ''; width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid var(--tc-primary-soft); border-top-color: var(--tc-primary); display: block;
    animation: tcSpin .7s linear infinite;
}
@keyframes tcSpin { to { transform: rotate(360deg); } }
.hiddenRow { display: none !important; padding: 0 !important; }

/* ---------- 3) Componentes tc-* ---------- */
.tc-num { font-variant-numeric: tabular-nums; }
.tc-sub { font-size: 12px; color: var(--tc-muted); margin-top: 2px; }
.tc-zero { color: var(--tc-faint); }
.tc-strong { font-weight: 600; }
.tc-big { font-size: 17px; font-weight: 700; }
.tc-nowrap { white-space: nowrap; }
.tc-gap { gap: 10px; }

/* Encabezado con acciones: @section('content_header') */
.tc-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.tc-head__sub { font-size: 13.5px; color: var(--tc-muted); margin: 2px 0 0; }
.tc-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* KPIs */
.tc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.tc-kpis.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tc-kpis.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1199px) { .tc-kpis, .tc-kpis.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .tc-kpis, .tc-kpis.cols-3, .tc-kpis.cols-2 { grid-template-columns: 1fr; } }
.tc-kpi { background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: var(--tc-radius); padding: 14px 16px;
          display: flex; gap: 14px; align-items: flex-start; transition: box-shadow .15s, border-color .15s; min-width: 0; }
.tc-kpi.is-action { cursor: pointer; }
.tc-kpi.is-action:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.tc-kpi__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 16px;
                background: var(--tc-primary-soft); color: var(--tc-primary); }
.tc-kpi__body { flex: 1; min-width: 0; }
.tc-kpi__label { font-size: 12px; color: var(--tc-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tc-kpi__value { font-size: clamp(19px, 1.6vw, 26px); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-kpi__hint { font-size: 12px; color: var(--tc-muted); }
.tc-kpi__row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.tc-kpi__row b { font-size: 16px; }
.tone-red .tc-kpi__icon    { background: var(--tc-red-soft); color: var(--tc-red); }
.tone-amber .tc-kpi__icon  { background: var(--tc-amber-soft); color: #c98a12; }
.tone-green .tc-kpi__icon  { background: var(--tc-green-soft); color: var(--tc-green); }
.tone-teal .tc-kpi__icon   { background: var(--tc-teal-soft); color: var(--tc-teal); }
.tone-violet .tc-kpi__icon { background: var(--tc-violet-soft); color: var(--tc-violet); }
.tc-kpi.is-active { border-color: var(--tc-primary); box-shadow: 0 0 0 1px var(--tc-primary) inset; }

/* Card de listado + toolbar */
.tc-card { background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: var(--tc-radius); box-shadow: var(--tc-shadow); margin-bottom: 16px; overflow: hidden; }
.tc-card.is-visible { overflow: visible; }
.tc-card__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--tc-border); }
.tc-card__title { font-size: 15px; font-weight: 600; margin: 0; }
.tc-card__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tc-card__body { padding: 16px; }
.tc-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--tc-border); }
.tc-toolbar .form-control, .tc-toolbar .custom-select { width: auto; min-width: 150px; max-width: 240px; }
.tc-toolbar .tc-input-sm { min-width: 0; width: 120px; }
.tc-search { position: relative; flex: 1 1 240px; max-width: 360px; }
.tc-toolbar .tc-search .form-control { width: 100%; max-width: none; }
.tc-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tc-muted); font-size: 13px; pointer-events: none; }
.tc-search .form-control { padding-left: 34px; }
.tc-seg { display: inline-flex; background: var(--tc-soft); border: 1px solid var(--tc-border); border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.tc-seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--tc-text-2); font-weight: 500; white-space: nowrap; }
.tc-seg button:hover { color: var(--tc-text); }
.tc-seg button.is-on { background: var(--tc-surface); color: var(--tc-text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.tc-link { background: none; border: 0; color: var(--tc-primary); font-size: 13px; padding: 0 4px; cursor: pointer; }
.tc-link:hover { text-decoration: underline; }
.tc-count { margin-left: auto; font-size: 13px; color: var(--tc-muted); white-space: nowrap; }
.tc-toolbar__end { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Switch compacto para filtros booleanos (checkbox real dentro) */
.tc-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tc-text-2); cursor: pointer; user-select: none; margin: 0; font-weight: 500 !important; }
.tc-switch input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #d5dae3;
                   position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.tc-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
                          box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.tc-switch input:checked { background: var(--tc-primary); }
.tc-switch input:checked::after { transform: translateX(14px); }
.tc-switch input:disabled { opacity: .6; cursor: default; }

/* Tabla moderna */
.tc-table-wrap { overflow-x: auto; position: relative; }
.tc-table-wrap.is-scroll { max-height: calc(100vh - 300px); overflow-y: auto; }
.tc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; color: var(--tc-text); }
.tc-table th { position: sticky; top: 0; background: var(--tc-head); z-index: 1; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
               color: var(--tc-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--tc-border); white-space: nowrap; text-align: left; }
.tc-table th.text-right, .tc-table td.text-right { text-align: right; }
.tc-table th.text-center, .tc-table td.text-center { text-align: center; }
.tc-table th.sortable { cursor: pointer; user-select: none; }
.tc-table th.sortable:hover { color: var(--tc-text); }
.tc-table td { padding: 11px 12px; border-bottom: 1px solid var(--tc-divider); vertical-align: middle; }
.tc-table tbody tr:last-child > td { border-bottom: 0; }
.tc-table tbody tr.tc-row { cursor: pointer; transition: background .1s; }
.tc-table tbody tr.tc-row:hover > td { background: #f8faff; }
.tc-table tbody tr.is-selected > td { background: #f3f7ff; }
.tc-table.is-compact td { padding: 7px 12px; }
.tc-table-wrap.is-loading tbody { opacity: .45; transition: opacity .15s; }
.tc-table .tc-actions { white-space: nowrap; text-align: right; width: 1%; }
.tc-table input.form-control, .tc-table select.form-control, .tc-table .custom-select { height: 34px; font-size: 13.5px; }
/* Fila expandida (detalle) */
.tc-expand > td { background: var(--tc-soft) !important; padding: 14px 16px 16px 16px !important; }
.tc-expand .tc-table { background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: 10px; overflow: hidden; }
.tc-expand .tc-table th { position: static; }
.tc-note { margin-top: 10px; padding: 10px 12px; background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: 10px; font-size: 13px; color: var(--tc-text-2); }

/* Botones de icono para acciones de fila */
.tc-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--tc-radius-sm); border: 1px solid transparent;
               background: transparent; color: var(--tc-muted); font-size: 14px; transition: background .12s, color .12s; cursor: pointer; text-decoration: none !important; vertical-align: middle; padding: 0; }
.tc-icon-btn:hover { background: var(--tc-gray-soft); color: var(--tc-text); }
.tc-icon-btn.is-primary:hover { background: var(--tc-primary-soft); color: var(--tc-primary); }
.tc-icon-btn.is-danger:hover { background: var(--tc-red-soft); color: var(--tc-red); }
.tc-icon-btn.is-success:hover { background: var(--tc-green-soft); color: var(--tc-green); }
.tc-icon-btn:disabled, .tc-icon-btn.disabled { opacity: .4; pointer-events: none; }
.tc-icon-btn.is-bordered { border-color: var(--tc-border); background: var(--tc-surface); }

/* Pills de estado */
.tc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
           background: var(--tc-gray-soft); color: var(--tc-gray-ink); line-height: 1.5; }
.tc-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tc-pill.no-dot::before { display: none; }
.pill-red    { background: var(--tc-red-soft);    color: var(--tc-red-ink); }
.pill-amber  { background: var(--tc-amber-soft);  color: var(--tc-amber-ink); }
.pill-green  { background: var(--tc-green-soft);  color: var(--tc-green-ink); }
.pill-blue   { background: var(--tc-primary-soft); color: #2a54ad; }
.pill-teal   { background: var(--tc-teal-soft);   color: var(--tc-teal-ink); }
.pill-violet { background: var(--tc-violet-soft); color: var(--tc-violet-ink); }
.pill-gray   { background: var(--tc-gray-soft);   color: var(--tc-gray-ink); }
/* Pill con color arbitrario: style="--pill:#hex" */
.tc-pill.is-custom { background: color-mix(in srgb, var(--pill) 14%, #fff); color: color-mix(in srgb, var(--pill) 78%, #000); }

/* Chips (etiquetas neutras, ej. empresa) */
.tc-chip { display: inline-block; background: var(--tc-gray-soft); color: var(--tc-text-2); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; max-width: 100%;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* Avatar con iniciales */
.tc-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
             background: var(--tc-primary-soft); color: var(--tc-primary); flex: none; text-transform: uppercase; }

/* Estado vacío */
.tc-empty { padding: 48px 16px; text-align: center; color: var(--tc-muted); }
.tc-empty > i { font-size: 32px; color: #cfd5df; margin-bottom: 10px; display: block; }

.tc-footer { padding: 10px 16px; border-top: 1px solid var(--tc-border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tc-footer nav, .tc-footer .pagination { margin: 0; }
.tc-footer p.small { margin: 0; }

/* Formularios en secciones */
.tc-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted); font-weight: 700; margin: 4px 0 12px; }
.tc-form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.tc-form-grid > * { grid-column: span 12; min-width: 0; }
@media (min-width: 768px) {
    .tc-form-grid .span-2 { grid-column: span 2; } .tc-form-grid .span-3 { grid-column: span 3; }
    .tc-form-grid .span-4 { grid-column: span 4; } .tc-form-grid .span-5 { grid-column: span 5; }
    .tc-form-grid .span-6 { grid-column: span 6; } .tc-form-grid .span-8 { grid-column: span 8; }
    .tc-form-grid .span-9 { grid-column: span 9; }
}
.tc-field label { display: block; }
.tc-field .form-group { margin-bottom: 0; }
.tc-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--tc-border); background: var(--tc-head); }

/* Totales / resumen */
.tc-summary { display: flex; flex-direction: column; gap: 6px; min-width: 260px; margin-left: auto; font-variant-numeric: tabular-nums; }
.tc-summary__row { display: flex; justify-content: space-between; gap: 20px; font-size: 14px; color: var(--tc-text-2); }
.tc-summary__row.is-total { font-size: 17px; font-weight: 700; color: var(--tc-text); border-top: 1px solid var(--tc-border); padding-top: 8px; margin-top: 2px; }

/* Métricas compactas */
.tc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.tc-metric { background: var(--tc-soft); border-radius: 10px; padding: 10px 12px; }
.tc-metric span { display: block; font-size: 11.5px; color: var(--tc-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tc-metric b { font-size: 20px; }

/* Drawer lateral + modal propio para Livewire */
.tc-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 1040; animation: tcFade .15s ease-out; }
.tc-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--tc-surface); z-index: 1050;
             box-shadow: -12px 0 32px rgba(15, 23, 42, .18); display: flex; flex-direction: column; animation: tcSlide .2s ease-out; }
.tc-drawer.is-wide { width: min(820px, 100vw); }
.tc-drawer__head { padding: 18px 20px; border-bottom: 1px solid var(--tc-border); display: flex; gap: 12px; align-items: flex-start; }
.tc-drawer__title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.tc-drawer__close { margin-left: auto; border: 0; background: var(--tc-soft); width: 34px; height: 34px; border-radius: var(--tc-radius-sm); color: var(--tc-text-2); flex: none; }
.tc-drawer__close:hover { background: #eceff4; }
.tc-drawer__body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.tc-drawer__foot { padding: 12px 20px; border-top: 1px solid var(--tc-border); display: flex; justify-content: flex-end; gap: 8px; background: var(--tc-head); }
.tc-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.tc-modal__box { background: var(--tc-surface); border-radius: 14px; box-shadow: var(--tc-shadow-lg); width: 100%; max-width: 560px; animation: tcPop .18s ease-out; }
.tc-modal__box.is-lg { max-width: 860px; }
.tc-modal__box.is-xl { max-width: 1140px; }
@keyframes tcSlide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tcPop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Timeline */
.tc-timeline { list-style: none; padding: 0; margin: 0; }
.tc-timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tc-divider); }
.tc-timeline li:last-child { border-bottom: 0; }
.tc-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; background: var(--tc-primary-soft); color: var(--tc-primary); }
.tc-dot.is-green { background: var(--tc-green-soft); color: var(--tc-green); }
.tc-dot.is-red { background: var(--tc-red-soft); color: var(--tc-red); }
.tc-dot.is-amber { background: var(--tc-amber-soft); color: #c98a12; }

/* Gráficos */
.tc-chart { min-height: 320px; }
.tc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--tc-text-2); }
.tc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Kanban viejo (Tablero) */
.sortable-list { cursor: move; list-style: none; padding: 0; margin: 0; }
.quotation-card { background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--tc-shadow); }

/* Timeline viejo (visita planta) */
.timeline { border-left: 2px solid var(--tc-border); padding-left: 1rem; }
.timeline .border { position: relative; border-color: var(--tc-border) !important; border-radius: 10px; }
.timeline .border::before { content: ""; position: absolute; left: -1.4rem; top: .7rem; width: .7rem; height: .7rem; background: var(--tc-primary); border-radius: 50%; box-shadow: 0 0 0 3px var(--tc-page); }

.tc-dim { opacity: .5; transition: opacity .15s; }
