:root {
    --primary: #0f2c67;
    --primary-2: #1f4aa0;
    --accent: #0ea5e9;
    --bg: #f4f7fb;
    --text: #14213d;
    --muted: #64748b;
    --border: #d8e0ee;
    --danger: #d92d20;
    --success: #0f9d58;
    --warning: #f59e0b;
    --logo-topbar-width: min(352px, 34vw);
    --logo-login-width: min(388px, 86%);
    --logo-sidebar-width: min(100%, 214px);
    --logo-mobile-width: min(100%, 306px);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1120px; margin: 0 auto; padding: 24px; }
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .inner {
    max-width: 1120px; margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand img { height: 44px; }
.brand small { color: var(--muted); display: block; }
.nav-links { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.btn, button, input[type=submit] {
    border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
    font-weight: 700; transition: .2s ease; font-size: 14px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0b2351; }
.btn-secondary { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: #eef3fb; text-decoration: none; }
.card {
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    padding: 24px; box-shadow: 0 8px 24px rgba(15,44,103,.05);
}
.grid { display:grid; gap:20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.hero {
    display:grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center;
}
.hero h1 { font-size: 40px; margin: 10px 0; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.6; }
.kpi { background:#fff; border:1px solid var(--border); border-radius:18px; padding:18px; }
.kpi strong { display:block; font-size:28px; margin-top:8px; }
.form-grid { display:grid; gap:16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display:block; margin-bottom:6px; font-weight:700; font-size:14px; }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
    width:100%; border:1px solid var(--border); border-radius:12px; padding:12px 14px;
    font-size:14px; background:#fff;
}
input[readonly] { background:#f8fafc; }
textarea { min-height: 120px; resize: vertical; }
.field-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.service-reminder-panel{
    margin-top:10px;
    padding:12px 14px;
    border:1px solid #cfe0ff;
    background:#f5f9ff;
    border-radius:8px;
}
.service-reminder-panel strong{
    display:block;
    margin-bottom:6px;
    color:var(--primary);
    font-size:13px;
}
.service-reminder-panel p{
    margin:0;
    white-space:pre-line;
    color:#274060;
    font-size:14px;
    line-height:1.5;
}
.suggestion-inline {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 13px;
    line-height: 1.45;
}
.suggestion-inline strong {
    color: var(--primary);
}
.alert { border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.alert-success { background: #ecfdf3; color: #0f5132; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.badge { display:inline-flex; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.badge-open { background:#dbeafe; color:#1d4ed8; }
.badge-progress { background:#fef3c7; color:#92400e; }
.badge-pending { background:#ede9fe; color:#6d28d9; }
.badge-closed { background:#dcfce7; color:#166534; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom:1px solid var(--border); text-align:left; font-size:14px; vertical-align: top; }
th { color:var(--muted); font-size:12px; text-transform: uppercase; letter-spacing: .04em; }
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-card { max-width: 420px; width:100%; }
.sidebar-layout { display:grid; grid-template-columns: 260px 1fr; min-height:100vh; }
.sidebar { background:#0f2c67; color:#fff; padding:24px; }
.sidebar a { color:#fff; display:block; padding:12px 14px; border-radius:12px; margin-bottom:8px; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.12); text-decoration:none; }
.main-panel { padding:24px; }
.section-title { margin: 0 0 4px; }
.muted { color: var(--muted); }
.hidden { display:none !important; }
.footer-note { text-align:center; color:var(--muted); margin: 24px 0; font-size:13px; }
@media (max-width: 900px) {
    .hero, .grid-4, .grid-3, .grid-2, .form-grid, .sidebar-layout { grid-template-columns: 1fr; }
    .topbar .inner { align-items:flex-start; }
}


/* --- Innercom corporate logo optimization --- */
.brand.brand-stack { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.brand.brand-stack img { height: auto; width: min(420px, 100%); max-width: 100%; }
.brand.brand-stack small { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.brand.brand-stack strong { font-size: 26px; color: var(--text); }

.topbar .brand img,
.brand img.logo-wide {
    height: auto;
    width: var(--logo-topbar-width);
    max-width: 100%;
    object-fit: contain;
}

.sidebar img.sidebar-logo {
    width: var(--logo-sidebar-width) !important;
    max-width: 214px !important;
    height: auto !important;
    display: block;
    margin: 0 auto 18px;
    background: #fff;
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(15,44,103,.10);
}

.login-card { max-width: 520px; }
.login-card .brand img,
.login-card .login-brand img {
    height: auto;
    width: var(--logo-login-width);
    max-width: 100%;
    display: block;
    margin: 0 auto 14px;
}
.login-card .brand small,
.login-card .login-brand small {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
}
.login-card .brand strong,
.login-card .login-brand strong {
    display: block;
    font-size: 28px;
    color: var(--text);
}

@media (max-width: 900px) {
    .topbar .inner { flex-direction: column; align-items: flex-start; }
    .topbar .brand { width: 100%; }
    .topbar .brand img.logo-wide,
    .topbar .brand img { width: var(--logo-mobile-width); }
    .sidebar img.sidebar-logo { max-width: 196px !important; }
    .login-card .brand img,
    .login-card .login-brand img { width: var(--logo-mobile-width); }
}

@media (max-width: 640px) {
    .brand.brand-stack strong { font-size: 22px; }
    .login-card { padding: 24px 20px; }
}

.back-link{display:inline-flex;align-items:center;gap:8px;margin-top:16px}.sidebar-top-link{display:block;margin-top:12px;color:#fff;border:1px solid rgba(255,255,255,.18);padding:10px 12px;border-radius:12px;text-align:center}.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.full-width{width:100%}.readonly-note{font-size:13px;color:var(--muted);margin-top:8px}

.badge-danger{background:#fee2e2;color:#991b1b}
.live-item{padding:12px 14px;border:1px solid var(--border);border-radius:12px;margin-bottom:12px;background:#fff}
.code-inline{padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#f8fafc;margin-top:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

.suggestion-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
}
.suggestion-modal.hidden { display: none !important; }
.suggestion-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 44, 103, .38);
}
.suggestion-modal__dialog {
    position: relative;
    width: min(100%, 540px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 48px rgba(15,44,103,.18);
}
.suggestion-modal__eyebrow {
    color: var(--primary-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.suggestion-modal__title {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.1;
}
.suggestion-modal__text {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}
.suggestion-modal__suggested,
.suggestion-modal__current {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
    margin-bottom: 14px;
}
.suggestion-modal__suggested {
    background: #eff6ff;
    color: var(--primary);
}
.suggestion-modal__current {
    background: #f8fafc;
    color: var(--text);
}
.suggestion-modal__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 18px;
}


/* --- enterprise links, footer and client dashboard --- */
.topbar .nav-links .btn,
.sidebar-top-link,
.back-link {
    position: relative;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .01em;
}
.topbar .nav-links .btn-secondary,
.sidebar-top-link,
.back-link {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #c9d8f0;
    box-shadow: 0 8px 18px rgba(15,44,103,.06);
}
.topbar .nav-links .btn-secondary:hover,
.sidebar-top-link:hover,
.back-link:hover {
    background: #eef4ff;
    text-decoration: none;
    transform: translateY(-1px);
}
.sidebar-top-link {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    padding: 12px 14px !important;
    margin-bottom: 18px;
}
.login-footer,
.page-footer {
    margin: 28px auto 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: #64748b;
    font-size: 13px;
    letter-spacing: .04em;
}
.mini-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin-top:20px}
.stat-card{background:#fff;border:1px solid var(--border);border-radius:18px;padding:18px 20px;box-shadow:0 8px 24px rgba(15,44,103,.05)}
.stat-card .label{display:block;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.08em}
.stat-card .value{display:block;font-size:30px;font-weight:700;margin-top:8px}
.chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}
.chart-card canvas{width:100% !important;max-height:320px}
.inline-note{margin-top:8px;color:var(--muted);font-size:13px}
.sla-summary{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.sla-chip{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a;font-size:13px;font-weight:700}
.sla-cell{min-width:210px;display:grid;gap:7px}
.sla-cell-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sla-cell-head strong{font-size:12px;color:var(--muted)}
.sla-progress-track{width:100%;height:8px;border-radius:999px;background:#e5e7eb;overflow:hidden}
.sla-progress-track span{display:block;height:100%;border-radius:999px;min-width:4px}
.sla-progress-ok{background:#0f9d58}
.sla-progress-warning{background:#f59e0b}
.sla-progress-danger{background:#d92d20}
.sla-progress-paused{background:#64748b}
.sla-progress-complete{background:#16a34a}
.ticket-hero{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
}
.ticket-hero-subject{
    margin:8px 0;
    color:var(--ink);
    font-size:20px;
    font-weight:700;
    line-height:1.35;
}
.ticket-dossier-strip{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:12px;
    margin-top:14px;
}
.ticket-dossier-strip div{
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
    padding:13px 14px;
    box-shadow:0 8px 22px rgba(15,44,103,.05);
}
.ticket-dossier-strip span{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    margin-bottom:6px;
}
.ticket-dossier-strip strong{
    display:block;
    color:var(--ink);
    overflow-wrap:anywhere;
}
.ticket-kicker{
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
}
.ticket-hero-actions{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.ticket-detail-grid{
    display:grid;
    grid-template-columns:minmax(0, 1.35fr) minmax(300px, .65fr);
    gap:20px;
    align-items:start;
    margin-top:20px;
}
.ticket-detail-side{
    display:grid;
    gap:20px;
    position:sticky;
    top:96px;
}
.ticket-card-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    margin-bottom:16px;
}
.ticket-action-pill{
    display:inline-flex;
    align-items:center;
    min-height:32px;
    padding:7px 10px;
    border-radius:8px;
    background:#eff6ff;
    color:#1d4ed8;
    border:1px solid #bfdbfe;
    font-size:12px;
    font-weight:700;
}
.ticket-info-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:12px;
}
.ticket-info-grid.compact{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    margin-top:10px;
}
.ticket-info-grid.contact-grid{
    grid-template-columns:repeat(5, minmax(0, 1fr));
    margin-top:10px;
}
.ticket-dossier-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
}
.ticket-dossier-card{
    border:1px solid var(--border);
    border-radius:8px;
    padding:14px;
    background:#fff;
}
.ticket-dossier-card.full{
    grid-column:1 / -1;
}
.ticket-info-grid div,
.ticket-side-list div{
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px;
    background:#f8fafc;
}
.ticket-info-grid span,
.ticket-side-list span,
.ticket-note-block span{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    margin-bottom:6px;
}
.ticket-info-grid strong,
.ticket-side-list strong{
    display:block;
    overflow-wrap:anywhere;
}
.ticket-contact-list div{
    display:block;
}
.ticket-contact-list strong{
    font-size:15px;
    line-height:1.35;
}
#plano-sucursal{
    overflow:hidden;
}
.branch-floorplan-preview{
    display:block;
    width:100%;
    max-width:100%;
    height:clamp(140px, 16vw, 220px);
    margin-top:12px;
    border:1px solid var(--border);
    border-radius:8px;
    overflow:hidden;
    background:#f8fafc;
}
.branch-floorplan-preview img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    background:#fff;
}
.branch-floorplan-file{
    margin-top:12px;
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px;
    background:#f8fafc;
}
.branch-floorplan-file strong,
.branch-floorplan-file span{
    display:block;
}
.branch-floorplan-file span{
    color:var(--muted);
    font-size:12px;
    margin-top:4px;
}
.branch-floorplan-list{
    display:grid;
    gap:8px;
    margin-top:12px;
}
.branch-floorplan-list a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border:1px solid var(--border);
    border-radius:8px;
    padding:10px 12px;
    background:#fff;
    text-decoration:none;
}
.branch-floorplan-list strong{
    display:block;
    min-width:0;
    overflow-wrap:anywhere;
    line-height:1.25;
}
.branch-floorplan-list span{
    display:inline-flex;
    align-items:center;
    border-left:1px solid var(--border);
    padding-left:10px;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}
.branch-floorplan-picker{
    display:grid;
    gap:10px;
    margin-top:12px;
}
.branch-floorplan-picker select{
    width:100%;
    min-width:0;
}
.branch-floorplan-picker .btn{
    width:100%;
    justify-content:center;
}
.ticket-note-block{
    margin-top:14px;
    padding:14px 16px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
}
.ticket-note-block p{
    margin:0;
    line-height:1.65;
}
.closure-summary-block{
    border-color:#bbf7d0;
    background:#f0fdf4;
}
.closure-fields{
    border:1px solid #bbf7d0;
    border-radius:8px;
    padding:16px;
    background:#f0fdf4;
}
.ticket-side-card{
    padding:20px;
}
.ticket-index-card{
    border-color:#bfdbfe;
    background:#f8fafc;
}
.ticket-index-links{
    display:grid;
    gap:8px;
    margin-top:14px;
}
.ticket-index-links a{
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
    color:var(--primary);
    font-weight:700;
}
.ticket-index-links a::after{
    content:"Ver";
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}
.ticket-side-list{
    display:grid;
    gap:10px;
    margin-top:14px;
}
.sla-cell.expanded{
    margin-top:14px;
    min-width:0;
}
.admin-ticket-timeline{
    display:grid;
    gap:0;
    margin-top:12px;
}
.timeline-item{
    display:grid;
    grid-template-columns:28px minmax(0, 1fr);
    gap:12px;
}
.timeline-rail{
    display:grid;
    justify-items:center;
    grid-template-rows:18px 1fr;
}
.timeline-dot{
    width:14px;
    height:14px;
    border-radius:50%;
    background:var(--primary-2);
    border:3px solid #dbeafe;
    margin-top:3px;
}
.timeline-line{
    width:2px;
    min-height:100%;
    background:var(--border);
}
.timeline-item:last-child .timeline-line{
    display:none;
}
.timeline-card{
    border:1px solid var(--border);
    border-radius:8px;
    padding:14px 16px;
    margin-bottom:14px;
    background:#fff;
}
.timeline-head{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    margin-bottom:10px;
}
.timeline-author{
    font-weight:700;
}
.timeline-meta{
    color:var(--muted);
    font-size:12px;
    margin-top:3px;
}
.timeline-badges{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.ticket-count-pills{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.timeline-badge{
    display:inline-flex;
    padding:5px 8px;
    border-radius:8px;
    background:#eef3fb;
    color:#334155;
    font-size:12px;
    font-weight:700;
}
.timeline-badge.is-internal{
    background:#fffbeb;
    color:#92400e;
}
.timeline-body{
    line-height:1.65;
    overflow-wrap:anywhere;
}
.timeline-customer .timeline-dot{background:#0f9d58;border-color:#dcfce7}
.timeline-agent .timeline-dot{background:#1d4ed8;border-color:#dbeafe}
.timeline-system .timeline-dot{background:#64748b;border-color:#e2e8f0}
.timeline-empty{
    padding:14px 16px;
    border:1px dashed var(--border);
    border-radius:8px;
    color:var(--muted);
}
.ticket-attachment-list{
    display:grid;
    gap:10px;
    margin-top:12px;
}
.ticket-attachment-item{
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px;
    background:#f8fafc;
}
.ticket-attachment-item strong,
.ticket-attachment-item span{
    display:block;
    overflow-wrap:anywhere;
}
.ticket-attachment-item span{
    color:var(--muted);
    font-size:12px;
    margin-top:4px;
}
.ticket-audit-card{
    margin-top:20px;
}
.action-filter-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.action-filter{
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-height:38px;
    padding:8px 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
    color:#334155;
    font-size:12px;
    font-weight:700;
    text-decoration:none;
}
.action-filter:hover,
.action-filter.active{
    background:#eff6ff;
    border-color:#bfdbfe;
    text-decoration:none;
}
.action-filter strong{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:24px;
    height:24px;
    border-radius:999px;
    background:#eef3fb;
    color:#13254b;
}
.action-pill{
    display:inline-flex;
    align-items:center;
    min-height:30px;
    padding:6px 9px;
    border-radius:8px;
    font-size:12px;
    font-weight:700;
    border:1px solid var(--border);
    background:#f8fafc;
    color:#334155;
}
.action-assign,
.action-filter.action-assign.active{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
.action-sla_breach,
.action-filter.action-sla_breach.active{background:#fef2f2;color:#991b1b;border-color:#fecaca}
.action-sla_risk,
.action-filter.action-sla_risk.active{background:#fffbeb;color:#92400e;border-color:#fde68a}
.action-customer_wait,
.action-filter.action-customer_wait.active{background:#f5f3ff;color:#6d28d9;border-color:#ddd6fe}
.action-pending_closure,
.action-filter.action-pending_closure.active{background:#ffedd5;color:#9a3412;border-color:#fb923c}
.action-start,
.action-filter.action-start.active{background:#ecfdf3;color:#166534;border-color:#bbf7d0}
.action-follow,
.action-filter.action-follow.active{background:#f8fafc;color:#334155;border-color:#d8e0ee}
.action-closed,
.action-filter.action-closed.active{background:#f1f5f9;color:#475569;border-color:#cbd5e1}
.ticket-board{
    display:grid;
    gap:14px;
}
.ticket-work-card{
    display:grid;
    grid-template-columns:minmax(0, 1.25fr) minmax(220px, .55fr) minmax(130px, .35fr);
    gap:16px;
    align-items:start;
    padding:18px;
    border:1px solid var(--border);
    border-left:5px solid #cbd5e1;
    border-radius:10px;
    background:#fff;
    box-shadow:0 8px 20px rgba(15,44,103,.04);
    overflow:hidden;
}
.action-border-assign{border-left-color:#1d4ed8}
.action-border-sla_breach{border-left-color:#d92d20}
.action-border-sla_risk{border-left-color:#f59e0b}
.action-border-customer_wait{border-left-color:#7c3aed}
.action-border-pending_closure{border-left-color:#f97316}
.action-border-start{border-left-color:#0f9d58}
.action-border-follow{border-left-color:#64748b}
.action-border-closed{border-left-color:#94a3b8}
.ticket-work-head{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    flex-wrap:wrap;
}
.ticket-work-head > div:first-child{
    flex:1 1 100%;
    min-width:0;
}
.ticket-work-head .action-pill{
    flex:0 1 auto;
    margin-left:auto;
}
.ticket-number-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:fit-content;
    min-width:min(240px, 100%);
    max-width:100%;
    min-height:30px;
    padding:6px 9px;
    border:1px solid #bfdbfe;
    border-radius:8px;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:13px;
    font-weight:800;
    line-height:1.2;
    letter-spacing:0;
    white-space:nowrap;
    word-break:keep-all;
    overflow-wrap:normal;
    overflow:hidden;
    text-decoration:none;
}
.ticket-number-link:hover{
    background:#dbeafe;
    border-color:#93c5fd;
    text-decoration:none;
}
.table-wrap td:first-child > a[href*="ticket="],
.table-wrap td:first-child > a[href*="ticket_history.php"]{
    display:inline-flex;
    align-items:center;
    max-width:100%;
    padding:6px 9px;
    border:1px solid #bfdbfe;
    border-radius:8px;
    background:#eff6ff;
    color:#1d4ed8;
    font-weight:800;
    line-height:1;
    white-space:nowrap;
    word-break:keep-all;
    overflow-wrap:normal;
    overflow-x:auto;
    scrollbar-width:none;
    text-decoration:none;
}
.table-wrap td:first-child > a[href*="ticket="]::-webkit-scrollbar,
.table-wrap td:first-child > a[href*="ticket_history.php"]::-webkit-scrollbar{
    display:none;
}
.table-wrap td:first-child > a[href*="ticket="]:hover,
.table-wrap td:first-child > a[href*="ticket_history.php"]:hover{
    background:#dbeafe;
    border-color:#93c5fd;
    text-decoration:none;
}
.ticket-work-main h3{
    margin:10px 0 8px;
    font-size:17px;
    line-height:1.35;
}
.ticket-work-meta{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.ticket-work-meta span{
    display:inline-flex;
    padding:5px 8px;
    border-radius:8px;
    background:#f8fafc;
    border:1px solid var(--border);
    color:#475569;
    font-size:12px;
}
.ticket-work-status{
    display:grid;
    gap:10px;
    justify-items:start;
}
.ticket-work-update{
    grid-column:1 / -1;
    padding-top:14px;
    border-top:1px solid var(--border);
}
.ticket-quick-update{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
    gap:10px;
    align-items:center;
}
.ticket-quick-update input,
.ticket-quick-update select{
    min-height:42px;
}
.public-ticket-shell{
    display:grid;
    gap:20px;
    margin-top:20px;
}
.public-ticket-hero{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
}
.public-ticket-hero p{
    margin:8px 0 0;
    color:var(--muted);
    line-height:1.55;
}
.public-ticket-badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}
.public-next-step{
    flex:0 0 min(320px, 100%);
    border:1px solid #bfdbfe;
    border-radius:8px;
    padding:14px 16px;
    background:#eff6ff;
}
.public-next-step span{
    display:block;
    color:#1d4ed8;
    font-size:12px;
    font-weight:800;
    margin-bottom:6px;
}
.public-next-step strong{
    display:block;
    line-height:1.45;
}
.public-ticket-grid{
    display:grid;
    grid-template-columns:minmax(0, 1.25fr) minmax(300px, .75fr);
    gap:20px;
    align-items:start;
}
.public-ticket-side{
    display:grid;
    gap:20px;
    position:sticky;
    top:96px;
}
.public-info-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
}
.public-update-form{
    grid-template-columns:1fr;
}
.company-scope{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:#f8fafc;border:1px solid var(--border);color:#334155;font-size:13px}
@media (max-width: 900px) {
    .mini-stats, .chart-grid { grid-template-columns: 1fr; }
}

.portal-banner{margin-bottom:20px;background:linear-gradient(135deg, rgba(15,44,103,.06), rgba(14,165,233,.06));}.portal-config-grid{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.portal-banner p{line-height:1.6}.login-subtitle{color:var(--muted);line-height:1.6}.stat-card .value{color:var(--primary)}

.catalog-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.catalog-grid.compact{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.catalog-card{border:1px solid #dbe3f0;border-radius:16px;padding:18px;background:#fff;display:flex;flex-direction:column;gap:10px;box-shadow:0 8px 20px rgba(15,44,103,.06)}.catalog-card h3{margin:0;font-size:1.05rem}.catalog-card p{margin:0;color:#526077}.catalog-meta{display:flex;flex-wrap:wrap;gap:8px}.catalog-meta span,.knowledge-tag{display:inline-flex;align-items:center;border-radius:999px;background:#eef3ff;color:#0f2c67;padding:6px 10px;font-size:.82rem;font-weight:600}.knowledge-list{display:grid;gap:16px}.knowledge-list.compact{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.knowledge-card{padding:22px}.knowledge-content{color:#344054;line-height:1.6}.knowledge-content ul{padding-left:18px}.knowledge-mini{border:1px solid #dbe3f0;border-radius:14px;padding:16px;background:#fbfcff}.knowledge-mini p{margin:.5rem 0 0;color:#667085}.portal-resources{display:grid;gap:20px;margin-top:20px}


/* --- block 5: automations + final corporate UX --- */
.quick-actions{display:flex;flex-wrap:wrap;gap:12px;margin:14px 0 0}.quick-link{display:inline-flex;align-items:center;justify-content:center;padding:11px 16px;border-radius:14px;background:#fff;border:1px solid var(--border);box-shadow:0 10px 24px rgba(15,44,103,.06);font-weight:700}.quick-link:hover{text-decoration:none;transform:translateY(-1px);background:#eef4ff}.enterprise-table tr:hover td{background:#fbfdff}.row-subtext{font-size:12px;color:var(--muted);margin-top:4px}.inline-editor{gap:8px}.inline-editor input[type=text],.inline-editor select{min-width:180px}.compact-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar{box-shadow:inset -1px 0 0 rgba(255,255,255,.06)}.sidebar a{font-weight:600}.card h2.section-title,.card h1.section-title{letter-spacing:-.01em}.toolbar form{display:inline-block}.hero .card,.kpi,.stat-card,.catalog-card,.knowledge-mini{transition:transform .18s ease,box-shadow .18s ease}.hero .card:hover,.kpi:hover,.stat-card:hover,.catalog-card:hover,.knowledge-mini:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(15,44,103,.08)}code{background:#f8fafc;padding:2px 6px;border-radius:8px;border:1px solid var(--border)}@media (max-width: 900px){.compact-stats{grid-template-columns:1fr}.inline-editor input[type=text],.inline-editor select{min-width:100%}}

/* ===== shared layout spacing system ===== */
:root {
    --layout-max-width: 1200px;
    --layout-side-padding: 24px;
}

.container,
.topbar-home-2row .inner-home-2row,
.topbar .inner {
    max-width: var(--layout-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--layout-side-padding);
    padding-right: var(--layout-side-padding);
}

.topbar-home-2row .inner-home-2row {
    padding-top: 16px;
    padding-bottom: 14px;
}

.topbar-home-2row + main.container {
    padding-top: 36px;
}

.hero,
.grid,
.grid-2,
.grid-3,
.grid-4,
.form-grid,
.portal-resources,
.chart-grid,
.mini-stats {
    align-items: stretch;
}

.card,
.kpi,
.stat-card,
.catalog-card,
.knowledge-mini {
    border-radius: 22px;
}

@media (max-width: 900px) {
    :root {
        --layout-side-padding: 20px;
    }
}

@media (max-width: 640px) {
    :root {
        --layout-side-padding: 16px;
    }
}

/* ===== unified header system ===== */
:root {
    --header-max-width: var(--layout-max-width, 1200px);
    --header-side-padding: var(--layout-side-padding, 24px);
    --header-gap: 20px;
    --header-sticky-bg: rgba(255,255,255,.94);
    --header-sticky-shadow: 0 10px 24px rgba(15,44,103,.04);
}

.topbar-unified {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--header-sticky-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(201,216,240,.9);
    box-shadow: var(--header-sticky-shadow);
}

.header-shell,
.topbar-unified .header-shell {
    max-width: var(--header-max-width);
    margin: 0 auto;
    padding: 16px var(--header-side-padding) 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.header-brand-wrap,
.header-actions-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.brand-unified {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.brand-unified img.logo-wide,
.brand-unified img {
    width: var(--logo-topbar-width);
    max-width: 100%;
    height: auto;
    flex: 0 0 auto;
}

.header-copy {
    min-width: 240px;
    max-width: 440px;
}

.header-copy small {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.15;
    margin-bottom: 4px;
}

.header-copy strong {
    display: block;
    color: var(--text);
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.nav-links-unified {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px 14px;
}

.nav-links-unified .btn {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(15,44,103,.04);
}

.topbar-unified + main.container,
.admin-topbar-unified + * {
    margin-top: 34px;
}

.topbar-public .header-copy { max-width: 420px; }
.topbar-client .header-copy { max-width: 420px; }

.admin-topbar-unified {
    position: sticky;
    top: 0;
    z-index: 25;
    background: var(--header-sticky-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(201,216,240,.9);
    border-radius: 22px;
    box-shadow: var(--header-sticky-shadow);
    margin-bottom: 22px;
}

.admin-header-shell {
    max-width: none;
    padding: 16px 20px 14px;
}

.nav-links-admin {
    justify-content: flex-start;
}

.sidebar-profile-card {
    margin: 16px 0 14px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.14);
}

.sidebar-profile-name {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.sidebar-profile-meta {
    font-size: 12px;
    color: rgba(255,255,255,.78);
    line-height: 1.45;
}

@media (max-width: 900px) {
    .header-shell,
    .topbar-unified .header-shell {
        padding: 14px var(--header-side-padding) 12px;
        gap: 12px;
    }

    .brand-unified {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-copy {
        min-width: 0;
        max-width: none;
    }

    .header-copy strong {
        font-size: 20px;
    }

    .nav-links-unified .btn {
        padding: 10px 16px;
    }
}

@media (max-width: 640px) {
    .nav-links-unified {
        gap: 10px 10px;
    }

    .nav-links-unified .btn {
        min-height: 40px;
        padding: 9px 14px;
        font-size: 12px;
    }
}



/* ===== admin unified chrome ===== */
.admin-shell-body {
    background:
        radial-gradient(circle at top left, rgba(14,165,233,.08), transparent 26%),
        radial-gradient(circle at top right, rgba(15,44,103,.07), transparent 24%),
        #f4f7fb;
}

.topbar-admin .header-copy small {
    color: var(--primary);
}

.admin-shell {
    max-width: var(--layout-max-width, 1200px);
    margin: 24px auto 0;
    padding: 0 var(--layout-side-padding, 24px) 28px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-sidebar,
.admin-main {
    min-width: 0;
}

.admin-sidebar {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 112px);
    overflow: auto;
    padding-right: 6px;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

.admin-sidebar-card {
    border-radius: 24px;
    overflow: hidden;
}

.admin-sidebar-profile {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-sidebar-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 0 10px;
}

.admin-sidebar .sidebar-logo {
    width: min(220px, 100%) !important;
    max-width: 220px !important;
    margin: 0 auto;
}

.admin-sidebar-eyebrow,
.admin-page-kicker,
.admin-nav-title {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
    font-weight: 700;
}

.admin-sidebar-eyebrow,
.admin-page-kicker {
    color: var(--primary);
}

.admin-sidebar-profile h2 {
    margin: 8px 0 6px;
    font-size: 22px;
}

.admin-sidebar-profile p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.admin-sidebar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.admin-sidebar-actions {
    margin-top: 16px;
}

.admin-page-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.admin-page-shortcuts .quick-link {
    min-height: 42px;
}

.admin-sidebar::-webkit-scrollbar {
    width: 10px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .42);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-nav-card {
    scroll-margin-top: 120px;
}

.admin-nav-card {
    padding: 18px;
}

.admin-nav-title {
    color: #475569;
    margin-bottom: 12px;
}

.admin-nav-list {
    display: grid;
    gap: 10px;
}

.admin-nav-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(15,44,103,.05);
}

.admin-nav-list a:hover,
.admin-nav-list a.active {
    text-decoration: none;
    background: #eef4ff;
    border-color: #c9d8f0;
    transform: translateY(-1px);
}

.admin-main {
    display: grid;
    gap: 20px;
}

.admin-page-intro {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(15,44,103,.06), rgba(14,165,233,.07));
}

.admin-page-footer {
    margin-top: 8px;
}

.admin-top-actions {
    justify-content: flex-end;
}

.admin-main > h1.section-title:first-child,
.admin-main > p.muted:first-of-type {
    display: none;
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .admin-page-intro {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Ajuste: tarjeta lateral sin logo superior */
.admin-sidebar-profile {
    padding-top: 24px;
}


/* IT Team phone quick actions */
.phone-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:6px;
}
.phone-action-icon{
    width:36px;
    height:36px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #d9e2f0;
    border-radius:8px;
    background:#fff;
    color:#1e3a8a;
    font-size:18px;
    line-height:1;
    text-decoration:none;
}
.phone-action-icon:hover{
    background:#eff6ff;
    border-color:#bfdbfe;
    text-decoration:none;
}
.btn-sm{
    min-height:34px;
    padding:8px 12px;
    font-size:12px;
}


/* Dropdown SaaS para acciones en tablas */
.table-actions-dropdown{
    position:relative;
    display:inline-block;
}
.table-actions-dropdown .dropdown-toggle{
    min-width:120px;
}
.table-actions-dropdown .dropdown-menu{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    min-width:180px;
    background:#fff;
    border:1px solid #d9e2f0;
    border-radius:18px;
    box-shadow:0 18px 32px rgba(15,44,103,.12);
    padding:8px;
    display:none;
    z-index:50;
}
.table-actions-dropdown.is-open .dropdown-menu{
    display:block;
}
.dropdown-item{
    display:flex;
    align-items:center;
    width:100%;
    min-height:42px;
    padding:10px 14px;
    border:none;
    background:transparent;
    border-radius:12px;
    text-decoration:none;
    color:#13254b;
    font:inherit;
    cursor:pointer;
    text-align:left;
}
.dropdown-item:hover{
    background:#f5f8fc;
    text-decoration:none;
}
.dropdown-form{
    margin:0;
}
.dropdown-danger{
    color:#b42318;
}
.dropdown-danger:hover{
    background:#fff5f5;
}





/* Fix alineación líneas tabla clientes */
table{
    border-collapse:collapse;
    width:100%;
}
table tr{
    border-bottom:1px solid #d9e2f0;
}
table td, table th{
    padding:18px 16px;
    vertical-align:middle;
}
.table-wrap table tr td{
    border-bottom:none;
}
.table-wrap table tr{
    border-bottom:1px solid #d9e2f0;
}


/* Hover suave filas tabla */
.table-wrap table tbody tr{
    transition:background-color .18s ease, transform .12s ease;
}
.table-wrap table tbody tr:hover{
    background:#f7faff;
}


/* Phase 2: branch dashboard premium experience */
.dashboard-grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}
.dashboard-card-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    flex-wrap:wrap;
}
.section-subtitle{
    font-size:14px;
    margin:0 0 8px;
}
.chart-list{
    display:grid;
    gap:12px;
}
.chart-row{
    display:grid;
    gap:6px;
}
.chart-meta{
    display:flex;
    justify-content:space-between;
    gap:12px;
    font-size:14px;
}
.chart-track{
    width:100%;
    height:10px;
    background:#eef3fb;
    border-radius:999px;
    overflow:hidden;
}
.chart-track span{
    display:block;
    height:100%;
    background:linear-gradient(90deg, var(--primary), var(--accent));
    border-radius:999px;
}
.chart-track-accent span{
    background:linear-gradient(90deg, var(--accent), #7dd3fc);
}
.dashboard-split{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}
.tag-cloud{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.mini-columns{
    min-height:180px;
    display:flex;
    align-items:flex-end;
    gap:12px;
    padding-top:18px;
}
.mini-col{
    flex:1;
    min-width:44px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
}
.mini-col-bar{
    width:100%;
    min-height:18px;
    border-radius:12px 12px 6px 6px;
    background:linear-gradient(180deg, var(--accent), var(--primary));
}
.mini-col span{
    color:var(--muted);
    font-size:12px;
}
.mini-col strong{
    font-size:12px;
}
.detail-layout{
    grid-template-columns:minmax(0, 1.35fr) minmax(280px, .65fr);
    align-items:start;
}
.detail-side-panel{
    position:sticky;
    top:96px;
}
.detail-list{
    display:grid;
    gap:10px;
    margin-top:14px;
}
.detail-list div{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:10px 0;
    border-bottom:1px solid var(--border);
}
.detail-list span{
    color:var(--muted);
    font-size:13px;
}
.detail-list strong{
    text-align:right;
    font-size:14px;
}
.detail-description{
    margin-top:16px;
    padding:14px 16px;
    border-radius:16px;
    background:#f8fafc;
    border:1px solid var(--border);
}
.filter-pill.is-active{
    background:var(--primary);
    color:#fff;
    border-color:var(--primary);
}
.branch-ticket-row{
    cursor:pointer;
    transition:background-color .18s ease, transform .12s ease;
}
.branch-ticket-row:hover{
    background:#f7faff;
}
.branch-ticket-row.is-active{
    background:#eef4ff;
    position:relative;
}
.branch-ticket-row.is-active td:first-child{
    box-shadow:inset 4px 0 0 #3b82f6;
}
.branch-ticket-folio{
    display:inline-flex;
    align-items:center;
    max-width:100%;
    padding:6px 9px;
    border:1px solid #bfdbfe;
    border-radius:8px;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:13px;
    line-height:1.2;
    white-space:nowrap;
}
.branch-next-step{
    margin:12px 0 4px;
    width:100%;
}
@media (max-width: 980px){
    .dashboard-grid-2,
    .dashboard-split,
    .detail-layout{
        grid-template-columns:1fr;
    }
    .detail-side-panel{
        position:static;
    }
    .ticket-hero,
    .ticket-card-head{
        flex-direction:column;
    }
    .ticket-hero-actions{
        justify-content:flex-start;
    }
    .ticket-dossier-strip,
    .ticket-dossier-grid,
    .ticket-info-grid.compact,
    .ticket-info-grid.contact-grid{
        grid-template-columns:1fr;
    }
    .ticket-detail-grid{
        grid-template-columns:1fr;
    }
    .ticket-detail-side{
        position:static;
    }
    .ticket-info-grid{
        grid-template-columns:1fr;
    }
    .ticket-work-card{
        grid-template-columns:1fr;
    }
    .ticket-work-head{
        flex-direction:column;
    }
    .ticket-quick-update{
        grid-template-columns:1fr;
    }
    .public-ticket-hero{
        flex-direction:column;
    }
    .public-next-step{
        flex-basis:auto;
        width:100%;
    }
    .public-ticket-grid{
        grid-template-columns:1fr;
    }
    .public-ticket-side{
        position:static;
    }
    .public-info-grid{
        grid-template-columns:1fr;
    }
    .timeline-head{
        flex-direction:column;
    }
    .timeline-badges{
        justify-content:flex-start;
    }
}


/* Historial de usuario en lista */
.user-history-list table th{
    text-transform:uppercase;
    letter-spacing:.04em;
    font-size:13px;
}
.user-history-list table td{
    vertical-align:top;
}
.user-history-list table td:first-child{
    white-space:nowrap;
    min-width:170px;
}
.user-history-list table td:nth-child(2){
    min-width:180px;
    font-weight:600;
}











/* Sistema homologado de iconos de acciones */
.action-group{
    display:inline-flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap;
}
.icon-action-btn{
    position:relative;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    width:44px;
    min-width:44px;
    height:44px;
    padding:0 !important;
    border-radius:14px;
    background:#f5f8fc !important;
    border:1px solid #d9e2f0 !important;
    text-decoration:none;
    cursor:pointer;
    font-size:18px;
    line-height:1;
    color:#16305f !important;
    box-sizing:border-box;
    transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}
.icon-action-btn:hover{
    background:#eaf1fb !important;
    border-color:#c8d4e8 !important;
    box-shadow:0 8px 18px rgba(15,44,103,.10);
    transform:translateY(-1px);
}
.icon-action-btn:active{ transform:translateY(0); }
.icon-action-btn.icon-delete{
    color:#b42318 !important;
}
.icon-action-btn.icon-delete:hover{
    background:#fff5f5 !important;
    border-color:#f0c7c3 !important;
}
.icon-action-btn.icon-history{ font-size:19px; }
.icon-action-btn.icon-edit{ font-size:18px; }

.tooltip-wrap{ position:relative; }
.tooltip-wrap::after{
    content:attr(data-tooltip);
    position:absolute;
    left:50%;
    bottom:calc(100% + 10px);
    transform:translateX(-50%) translateY(4px);
    background:#13254b;
    color:#fff;
    padding:7px 10px;
    border-radius:10px;
    font-size:12px;
    line-height:1;
    white-space:nowrap;
    box-shadow:0 10px 24px rgba(15,44,103,.18);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .14s ease, transform .14s ease, visibility .14s ease;
    z-index:70;
}
.tooltip-wrap::before{
    content:"";
    position:absolute;
    left:50%;
    bottom:calc(100% + 4px);
    transform:translateX(-50%) translateY(4px);
    border-width:6px 6px 0 6px;
    border-style:solid;
    border-color:#13254b transparent transparent transparent;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .14s ease, transform .14s ease, visibility .14s ease;
    z-index:70;
}
.tooltip-wrap:hover::after,
.tooltip-wrap:hover::before,
.tooltip-wrap:focus-visible::after,
.tooltip-wrap:focus-visible::before{
    opacity:1;
    visibility:visible;
    transform:translateX(-50%) translateY(0);
}

/* Botones primarios/secundarios homologados para formularios */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:44px;
    padding:0 22px;
    border-radius:16px;
    font-weight:700;
    line-height:1.1;
    text-align:center;
    box-sizing:border-box;
    white-space:nowrap;
}
.btn.btn-primary{
    min-width:160px;
}
.btn.btn-secondary{
    min-width:140px;
}
.btn.block-fix{
    min-width:180px;
}


/* Homologación definitiva de iconos y botones */
.icon-action-btn{
    width:38px !important;
    min-width:38px !important;
    height:38px !important;
    padding:0 !important;
    border-radius:12px !important;
    font-size:16px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    box-sizing:border-box !important;
}
.icon-action-btn.icon-history,
.icon-action-btn.icon-edit,
.icon-action-btn.icon-delete{
    width:38px !important;
    min-width:38px !important;
    height:38px !important;
    border-radius:12px !important;
    font-size:16px !important;
}
.btn.block-fix{
    min-width:180px !important;
    height:44px !important;
    padding:0 24px !important;
    border-radius:16px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
    font-size:16px !important;
    line-height:1.1 !important;
}


/* Ajuste definitivo ícono editar tipo emoji */
.icon-action-btn.icon-edit{
    width:38px !important;
    min-width:38px !important;
    height:38px !important;
    border-radius:12px !important;
    font-size:16px !important;
    line-height:1 !important;
}




/* Fix específico service_catalog y knowledge_base */
.icon-action-btn.icon-edit{
    width:38px !important;
    min-width:38px !important;
    max-width:38px !important;
    height:38px !important;
    padding:0 !important;
    border-radius:12px !important;
    font-size:16px !important;
    line-height:1 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
}

.btn.block-fix{
    min-width:180px !important;
    width:auto !important;
    max-width:none !important;
    height:44px !important;
    padding:0 24px !important;
    border-radius:16px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
}


/* ===== FASE 3 UI ENTERPRISE ===== */
:root{
    --row-pad-y: 18px;
    --row-pad-x: 16px;
    --badge-font: 13px;
}
:root[data-density="compact"]{
    --row-pad-y: 12px;
    --row-pad-x: 12px;
    --badge-font: 12px;
}
table th, table td{
    padding: var(--row-pad-y) var(--row-pad-x);
}
.table-wrap table tbody tr{
    transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.table-wrap table tbody tr:hover{
    background:#f7faff;
}

/* badges mejorados */
.status-badge,
.badge,
.chip,
.sla-chip{
    font-size: var(--badge-font);
}
.badge-success,
.status-success,
.chip-success{
    background:#dcfce7 !important;
    color:#166534 !important;
}
.badge-warning,
.status-warning,
.chip-warning{
    background:#fef3c7 !important;
    color:#92400e !important;
}
.badge-danger,
.status-danger,
.chip-danger{
    background:#fee2e2 !important;
    color:#991b1b !important;
}
.badge-info,
.status-info,
.chip-info{
    background:#dbeafe !important;
    color:#1d4ed8 !important;
}
.sla-chip::before,
.status-pill::before{
    content:"";
    width:8px;
    height:8px;
    border-radius:999px;
    display:inline-block;
    margin-right:8px;
    background:currentColor;
    opacity:.28;
}

/* icon system polish */
.icon-action-btn{
    box-shadow:0 1px 0 rgba(15,44,103,.03);
}
.icon-action-btn.icon-more{
    font-size:20px !important;
    letter-spacing:-2px;
}
.icon-action-btn:hover{
    transform:translateY(-1px) scale(1.03);
}
.icon-action-btn:active{
    transform:translateY(0) scale(.97);
}
.icon-action-btn.icon-history,
.icon-action-btn.icon-edit,
.icon-action-btn.icon-delete,
.icon-action-btn.icon-more{
    width:38px !important;
    min-width:38px !important;
    max-width:38px !important;
    height:38px !important;
    border-radius:12px !important;
    font-size:16px !important;
}

/* grouped actions menu */
.action-menu{
    position:relative;
    display:inline-block;
}
.action-menu-panel{
    position:absolute;
    right:0;
    top:calc(100% + 8px);
    min-width:170px;
    background:#fff;
    border:1px solid #d9e2f0;
    border-radius:16px;
    box-shadow:0 18px 32px rgba(15,44,103,.12);
    padding:8px;
    display:none;
    z-index:80;
}
.action-menu.is-open .action-menu-panel{
    display:block;
}
.action-menu-item{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:40px;
    padding:10px 12px;
    border-radius:12px;
    text-decoration:none;
    color:#16305f;
    font-weight:600;
}
.action-menu-item:hover{
    background:#f5f8fc;
}

/* density toggle */
.admin-view-controls{
    display:flex;
    align-items:center;
    margin-right:10px;
}
.density-toggle{
    min-width:132px !important;
}

/* primary button sizing fixes */
.btn.btn-primary,
.btn.block-fix{
    min-width:180px !important;
    width:auto !important;
    max-width:none !important;
}
.btn.btn-primary:hover,
.btn.block-fix:hover{
    transform:translateY(-1px);
}

/* card polish */
.card{
    box-shadow:0 1px 0 rgba(15,44,103,.03);
}

/* dashboard final fix */
.icon-action-btn.icon-history{
width:38px!important;
min-width:38px!important;
max-width:38px!important;
height:38px!important;
display:inline-flex!important;
align-items:center!important;
justify-content:center!important;
border-radius:12px!important;
font-size:16px!important;
}


/* FIX definitivo tamaños invertidos */
.icon-action-btn{
    width:38px !important;
    min-width:38px !important;
    max-width:38px !important;
    height:38px !important;
    padding:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
}

/* Botones primarios grandes (filtros, guardar, etc) */
button.btn,
.btn.btn-primary,
.btn.block-fix{
    min-width:180px !important;
    height:44px !important;
    padding:0 24px !important;
    border-radius:14px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:15px !important;
}

/* Evitar que botones primarios hereden estilos de icono */
button.btn:not(.icon-action-btn){
    width:auto !important;
    max-width:none !important;
}

/* Caso específico aplicar filtros */
button:contains("Aplicar filtros"){
    min-width:200px !important;
}



/* ===== Admin dashboard targeted fixes ===== */
.dashboard-history-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:38px !important;
    min-width:38px !important;
    max-width:38px !important;
    height:38px !important;
    padding:0 !important;
    border-radius:12px !important;
    background:#f5f8fc !important;
    border:1px solid #d9e2f0 !important;
    text-decoration:none !important;
    color:#16305f !important;
    font-size:16px !important;
    line-height:1 !important;
    box-sizing:border-box !important;
    transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease !important;
}
.dashboard-history-btn:hover{
    background:#eaf1fb !important;
    border-color:#c8d4e8 !important;
    box-shadow:0 8px 18px rgba(15,44,103,.10) !important;
    transform:translateY(-1px) !important;
}
.dashboard-filter-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:180px !important;
    width:auto !important;
    max-width:none !important;
    height:44px !important;
    padding:0 24px !important;
    border-radius:16px !important;
    white-space:nowrap !important;
    font-size:16px !important;
    line-height:1.1 !important;
}


/* DASHBOARD FIX REAL FINAL */
.dashboard-history-btn, a[href*="ticket_history"]{
    width:38px !important;
    height:38px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:12px !important;
    border:1px solid #d9e2f0 !important;
    background:#f5f8fc !important;
    font-size:16px !important;
}




/* ===== FASE 4 Dashboard KPIs ===== */
.dashboard-kpi-shell{
    margin: 0 0 28px;
}
.dashboard-kpi-grid{
    display:grid;
    grid-template-columns:repeat(6, minmax(0, 1fr));
    gap:16px;
    margin-bottom:20px;
}
.dashboard-kpi-card{
    background:#fff;
    border:1px solid #d9e2f0;
    border-radius:22px;
    padding:18px 18px 16px;
    box-shadow:0 10px 24px rgba(15,44,103,.05);
}
.dashboard-kpi-label{
    display:block;
    color:#64748b;
    font-size:13px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.04em;
    margin-bottom:8px;
}
.dashboard-kpi-value{
    display:block;
    font-size:32px;
    line-height:1;
    color:#16305f;
    margin-bottom:8px;
}
.dashboard-kpi-meta{
    display:block;
    color:#64748b;
    font-size:13px;
}
.dashboard-insight-grid{
    display:grid;
    grid-template-columns:1.05fr 1.05fr 1.4fr;
    gap:16px;
    margin-bottom:18px;
}
.dashboard-panel{
    background:#fff;
    border:1px solid #d9e2f0;
    border-radius:22px;
    padding:18px;
    box-shadow:0 10px 24px rgba(15,44,103,.05);
}
.dashboard-panel-wide{
    grid-column:auto;
}
.dashboard-panel-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}
.dashboard-panel-head h2{
    margin:2px 0 0;
    font-size:22px;
    line-height:1.1;
}
.dashboard-panel-eyebrow{
    color:#64748b;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.05em;
    font-weight:700;
}
.dashboard-radar-list{
    display:grid;
    gap:12px;
}
.dashboard-radar-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:52px;
    padding:0 14px;
    border-radius:16px;
    background:#f8fbff;
    border:1px solid #e2e8f0;
}
.dashboard-radar-name{
    color:#334155;
    font-weight:600;
}
.dashboard-radar-count{
    color:#16305f;
    font-size:24px;
}
.dashboard-status-bars{
    display:grid;
    gap:12px;
}
.dashboard-status-row{
    display:grid;
    gap:7px;
}
.dashboard-status-meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    font-size:14px;
    color:#334155;
}
.dashboard-status-track{
    width:100%;
    height:10px;
    border-radius:999px;
    background:#eef4fb;
    overflow:hidden;
}
.dashboard-status-track span{
    display:block;
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg,#1d4ed8,#60a5fa);
}
.dashboard-month-bars{
    display:flex;
    align-items:flex-end;
    gap:14px;
    min-height:150px;
}
.dashboard-month-item{
    flex:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
}
.dashboard-month-bar{
    width:100%;
    max-width:52px;
    border-radius:16px 16px 8px 8px;
    background:linear-gradient(180deg,#60a5fa,#1d4ed8);
}
.dashboard-month-item span{
    color:#64748b;
    font-size:12px;
}
.dashboard-month-item strong{
    color:#16305f;
    font-size:13px;
}

.dashboard-history-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:38px !important;
    min-width:38px !important;
    max-width:38px !important;
    height:38px !important;
    padding:0 !important;
    border-radius:12px !important;
    background:#f5f8fc !important;
    border:1px solid #d9e2f0 !important;
    text-decoration:none !important;
    color:#16305f !important;
    font-size:16px !important;
    line-height:1 !important;
    box-sizing:border-box !important;
}
.dashboard-filter-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:180px !important;
    width:auto !important;
    height:44px !important;
    padding:0 24px !important;
    border-radius:16px !important;
    white-space:nowrap !important;
}

@media (max-width: 1400px){
    .dashboard-kpi-grid{
        grid-template-columns:repeat(3, minmax(0,1fr));
    }
    .dashboard-insight-grid{
        grid-template-columns:1fr;
    }
}
@media (max-width: 768px){
    .dashboard-kpi-grid{
        grid-template-columns:repeat(2, minmax(0,1fr));
    }
}


/* ===== FIX LIMPIO DASHBOARD ===== */

/* botón aplicar filtros */
.dashboard-filter-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:180px;
    height:44px;
    padding:0 24px;
    border-radius:14px;
    white-space:nowrap;
}

/* botón historial */
.dashboard-history-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;
    min-width:38px;
    height:38px;
    padding:0;
    border-radius:12px;
    border:1px solid #d9e2f0;
    background:#f5f8fc;
    font-size:16px;
    line-height:1;
    text-decoration:none;
}
.dashboard-history-btn:hover{
    background:#eaf1fb;
}


/* ===== FASE 4.1 UX PRO ===== */

/* SLA colores dinámicos */
.sla-ok{background:#dcfce7;color:#166534;}
.sla-warning{background:#fef3c7;color:#92400e;}
.sla-danger{background:#fee2e2;color:#991b1b;animation:pulse 1.8s infinite;}

/* animación crítica */
@keyframes pulse{
    0%{box-shadow:0 0 0 0 rgba(220,38,38,0.5);}
    70%{box-shadow:0 0 0 10px rgba(220,38,38,0);}
    100%{box-shadow:0 0 0 0 rgba(220,38,38,0);}
}

/* tarjetas KPI hover */
.dashboard-kpi-card:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 28px rgba(0,0,0,0.08);
    transition:all .2s ease;
}

/* filas críticas */
tr.critical-ticket{
    background:#fff1f2 !important;
}
tr.critical-ticket:hover{
    background:#ffe4e6 !important;
}

/* prioridad visual */
.priority-high{color:#dc2626;font-weight:700;}
.priority-medium{color:#f59e0b;font-weight:600;}
.priority-low{color:#16a34a;font-weight:600;}


/* RC ajuste expediente: datos clave más legibles */
.ticket-summary-card .ticket-dossier-grid{
    grid-template-columns:1fr;
    gap:16px;
}
.ticket-summary-card .ticket-dossier-card{
    padding:18px;
}
.ticket-summary-card .ticket-info-grid.compact{
    grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
    gap:12px;
}
.ticket-summary-card .ticket-info-grid div{
    min-height:82px;
    display:flex;
    flex-direction:column;
    justify-content:center;
}
.ticket-summary-card .ticket-info-grid span{
    font-size:12px;
    line-height:1.2;
    margin-bottom:8px;
}
.ticket-summary-card .ticket-info-grid strong{
    font-size:17px;
    line-height:1.28;
    overflow-wrap:break-word;
    word-break:normal;
    hyphens:none;
}
@media (max-width: 700px){
    .ticket-summary-card .ticket-info-grid.compact{
        grid-template-columns:1fr;
    }
    .ticket-summary-card .ticket-info-grid div{
        min-height:auto;
        padding:12px 14px;
    }
}


/* RC Final UI Polish: admin compacto y adjuntos con preview */
.admin-shell-body .topbar .inner{
    padding-top:10px;
    padding-bottom:10px;
}
.admin-main{
    padding-top:18px;
}
.admin-page-intro{
    padding:16px 18px;
    margin-bottom:14px;
}
.admin-page-intro .section-title{
    font-size:22px;
}
.admin-sidebar-card{
    padding:16px;
}
.admin-nav-list a{
    padding:9px 11px;
    min-height:36px;
}
.admin-shell-body .card{
    border-radius:12px;
}
.admin-shell-body .section-title{
    line-height:1.18;
}
.admin-shell-body .form-grid{
    gap:12px;
}
.admin-shell-body input[type=text],
.admin-shell-body input[type=email],
.admin-shell-body input[type=tel],
.admin-shell-body input[type=password],
.admin-shell-body textarea,
.admin-shell-body select{
    border-radius:8px;
    padding:10px 12px;
}
.admin-shell-body .btn,
.admin-shell-body button,
.admin-shell-body input[type=submit]{
    border-radius:8px;
    padding:10px 14px;
}
.admin-shell-body table th,
.admin-shell-body table td{
    padding-top:10px;
    padding-bottom:10px;
}
.admin-shell-body .mini-stats{
    gap:10px;
    margin-top:12px;
    grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
}
.admin-shell-body .stat-card{
    border-radius:12px;
    padding:12px 14px;
}
.admin-shell-body .stat-card .value{
    font-size:24px;
    margin-top:4px;
}
.ticket-workbench{
    padding:16px;
}
.ticket-workbench .form-grid{
    grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
    align-items:end;
}
.action-filter-row{
    gap:8px;
}
.action-filter{
    min-height:34px;
    padding:7px 9px;
}
.ticket-board{
    gap:10px;
}
.ticket-work-card{
    grid-template-columns:minmax(0, 1.15fr) minmax(200px, .55fr) minmax(118px, .3fr);
    gap:12px;
    padding:14px;
    border-radius:8px;
}
.ticket-work-main h3{
    margin:10px 0 8px;
    font-size:18px;
    line-height:1.25;
}
.ticket-work-meta{
    gap:6px;
}
.ticket-work-meta span{
    padding:6px 9px;
    border-radius:8px;
}
.ticket-work-sla .sla-cell{
    min-width:0;
}
.ticket-work-status{
    gap:8px;
}
.ticket-quick-update{
    grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
    gap:8px;
}
.ticket-detail-grid{
    gap:14px;
    margin-top:14px;
}
.ticket-detail-side{
    gap:14px;
    top:82px;
}
.ticket-side-card,
.ticket-summary-card,
.ticket-audit-card{
    padding:18px;
}
.ticket-dossier-strip{
    gap:8px;
    margin-top:10px;
}
.ticket-dossier-strip div{
    padding:10px 12px;
    border-radius:8px;
}
.timeline-card{
    padding:12px 14px;
    margin-bottom:10px;
}
.attachment-preview-list{
    grid-template-columns:1fr;
}
.attachment-preview-item{
    display:grid;
    grid-template-columns:76px minmax(0,1fr);
    align-items:center;
    gap:12px;
    padding:10px;
}
.attachment-thumb,
.attachment-file-icon{
    width:76px;
    height:58px;
    border:1px solid var(--border);
    border-radius:8px;
    overflow:hidden;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
}
.attachment-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.attachment-file-icon{
    background:#eef4ff;
    color:#1d4ed8;
    font-size:13px;
    font-weight:800;
}
.attachment-type-pdf .attachment-file-icon{
    background:#fef2f2;
    color:#991b1b;
}
.attachment-file-body{
    min-width:0;
}
.attachment-open-link{
    display:inline-flex;
    margin-top:6px;
    font-size:12px;
    font-weight:700;
}
@media (max-width: 1100px){
    .ticket-work-card{
        grid-template-columns:1fr;
    }
    .ticket-work-status{
        flex-direction:row;
        justify-content:flex-start;
    }
}
@media (max-width: 700px){
    .attachment-preview-item{
        grid-template-columns:64px minmax(0,1fr);
    }
    .attachment-thumb,
    .attachment-file-icon{
        width:64px;
        height:52px;
    }
}


/* RC fix bandeja: tickets cerrados sin espacio fantasma */
.ticket-work-status{
    align-content:start;
}
.ticket-work-status .btn{
    min-height:38px;
    width:auto;
    min-width:112px;
    justify-content:center;
}
.ticket-work-card:not(:has(.ticket-work-update)){
    align-items:start;
}
.ticket-work-card:not(:has(.ticket-work-update)) .ticket-work-status{
    align-self:start;
}


/* RC Final: ancho homogéneo del portal interno */
:root{
    --admin-layout-max-width: 1440px;
    --admin-sidebar-width: 286px;
}
.topbar-admin .inner,
.admin-shell{
    max-width: var(--admin-layout-max-width);
}
.admin-shell{
    width:100%;
    grid-template-columns:var(--admin-sidebar-width) minmax(0, 1fr);
    gap:18px;
}
.admin-main{
    width:100%;
    max-width:calc(var(--admin-layout-max-width) - var(--admin-sidebar-width) - 18px - (var(--layout-side-padding, 24px) * 2));
    margin:0 auto;
}
.admin-main > .card,
.admin-main > section,
.admin-main > form,
.admin-main > .grid,
.admin-main > .mini-stats,
.admin-main > .ticket-board,
.admin-main > .ticket-detail-grid{
    width:100%;
    max-width:100%;
}
.admin-main .table-wrap{
    width:100%;
    max-width:100%;
}
.admin-main .table-wrap table{
    min-width:860px;
}
.admin-main .ticket-board,
.admin-main .ticket-workbench,
.admin-main .ticket-detail-grid,
.admin-main .ticket-audit-card{
    max-width:100%;
}
@media (min-width: 1500px){
    :root{
        --admin-layout-max-width: 1480px;
        --admin-sidebar-width: 300px;
    }
}
@media (max-width: 1100px){
    .admin-shell{
        grid-template-columns:1fr;
    }
    .admin-sidebar{
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .admin-main{
        max-width:100%;
    }
    .admin-main .table-wrap table{
        min-width:760px;
    }
}
@media (max-width: 760px){
    .admin-shell{
        padding-left:14px;
        padding-right:14px;
    }
    .admin-main .table-wrap table{
        min-width:680px;
    }
}



.table-ticket-link{
    display:inline !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:#1d4ed8 !important;
    font-weight:800;
    line-height:1.35;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:anywhere;
    overflow:visible !important;
    text-decoration:none;
    box-shadow:none !important;
}
.table-ticket-link:hover{
    background:transparent !important;
    border-color:transparent !important;
    text-decoration:underline;
}



.table-ticket-text{
    display:inline-block;
    color:#1d4ed8;
    font-weight:800;
    line-height:1.35;
    white-space:normal;
    word-break:break-word;
    overflow-wrap:anywhere;
}

/* Folio en tablas SLA y alertas: enlace limpio sin cápsula */
.table-wrap td:first-child > a[href*="ticket="]:not(.ticket-number-link),
.table-wrap td:first-child > a[href*="ticket_history.php"]:not(.ticket-number-link){
    display:inline;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    color:#1d4ed8;
    font-weight:800;
    line-height:1.35;
    white-space:normal;
    word-break:normal;
    overflow-wrap:anywhere;
    overflow:visible;
    scrollbar-width:auto;
    text-decoration:none;
}
.table-wrap td:first-child > a[href*="ticket="]:not(.ticket-number-link):hover,
.table-wrap td:first-child > a[href*="ticket_history.php"]:not(.ticket-number-link):hover{
    background:transparent;
    border-color:transparent;
    text-decoration:underline;
}

/* RC22.5 ajuste visual: Pendientes de cierre */
.action-filter.action-pending_closure,
.action-pending_closure{
    background:#fff7ed !important;
    color:#9a3412 !important;
    border-color:#fed7aa !important;
}
.action-filter.action-pending_closure:hover,
.action-filter.action-pending_closure.active{
    background:#ffedd5 !important;
    color:#7c2d12 !important;
    border-color:#fdba74 !important;
}
.action-filter.action-pending_closure strong{
    background:#ffedd5 !important;
    color:#7c2d12 !important;
}
.action-filter.action-pending_closure:hover strong,
.action-filter.action-pending_closure.active strong{
    background:#fdba74 !important;
    color:#7c2d12 !important;
}
.action-border-pending_closure{
    border-left-color:#fb923c !important;
}


.perf-debug-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(420px, calc(100vw - 36px));
  max-height: min(70vh, 620px);
  overflow: auto;
  background: #111827;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .25);
  padding: 14px;
  font-size: 13px;
}
.perf-debug-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.perf-debug-head strong { font-size: 15px; }
.perf-debug-head a { color: #bfdbfe; text-decoration: none; font-weight: 700; }
.perf-debug-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 14px;
  padding: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}
.perf-debug-grid span { color: #cbd5e1; }
.perf-debug-grid strong { text-align: right; }
.perf-debug-slow { margin-top: 10px; }
.perf-debug-slow summary { cursor: pointer; color: #bfdbfe; font-weight: 700; }
.perf-debug-slow div { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(148,163,184,.25); }
.perf-debug-slow code {
  display: block;
  margin-top: 4px;
  color: #e2e8f0;
  white-space: normal;
  word-break: break-word;
  font-size: 12px;
}
.perf-debug-panel small {
  display: block;
  margin-top: 10px;
  color: #94a3b8;
  word-break: break-word;
}

.legal-shell {
    display: grid;
    gap: 24px;
}
.legal-hero {
    display: grid;
    gap: 14px;
}
.legal-hero h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.08;
}
.legal-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}
.legal-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 700;
}
.legal-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 24px;
}
.legal-content {
    display: grid;
    gap: 18px;
}
.legal-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15,44,103,.05);
}
.legal-section h2 {
    margin: 0 0 12px;
    font-size: 24px;
}
.legal-section p {
    margin: 0 0 14px;
    color: var(--text);
    line-height: 1.7;
}
.legal-section p:last-child {
    margin-bottom: 0;
}
.legal-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 10px;
}
.legal-list li {
    line-height: 1.65;
}
.legal-aside {
    display: grid;
    gap: 16px;
    align-self: start;
}
.legal-aside .card,
.legal-aside .legal-section {
    padding: 20px;
}
.legal-aside h3 {
    margin: 0 0 10px;
    font-size: 18px;
}
.legal-link-list {
    display: grid;
    gap: 10px;
}
.legal-link-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.legal-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--muted);
    line-height: 1.6;
}
.legal-contact {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}
.legal-contact strong {
    color: var(--text);
}
@media (max-width: 900px) {
    .legal-grid {
        grid-template-columns: 1fr;
    }
    .legal-hero h1 {
        font-size: 30px;
    }
}
