:root {
  --navy: #071f63;
  --navy-2: #0a2f96;
  --primary: #0d3add;
  --primary-dark: #082aa8;
  --primary-soft: #edf3ff;
  --cyan: #36c5d8;
  --surface: #ffffff;
  --background: #f7f9ff;
  --text: #182033;
  --muted: #6f7890;
  --border: #dfe6f5;
  --success: #159a68;
  --warning: #d58a15;
  --danger: #d4455d;
  --shadow-sm: 0 12px 30px rgba(13, 58, 221, 0.08);
  --shadow-lg: 0 26px 80px rgba(13, 58, 221, 0.16);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #fbfdff 0%, var(--background) 100%); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow.light { color: #9fb8ff; }

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #2f5df2, #0d3add);
  color: white;
  font-weight: 900;
  letter-spacing: -.06em;
  box-shadow: 0 10px 24px rgba(13, 58, 221, .34);
}
.large-mark { width: 62px; height: 62px; border-radius: 18px; font-size: 1.25rem; margin-bottom: 34px; }

.login-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(440px, 1.1fr) minmax(420px, .9fr);
  overflow: hidden;
  background: white;
}
.login-brand-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 8vw, 120px);
  overflow: hidden;
  background: linear-gradient(145deg, #082aa8 0%, #0d3add 56%, #2454e8 100%);
  color: white;
}
.login-brand-panel::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -200px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.018);
}
.login-brand-panel h1 { max-width: 650px; margin: 0; font-size: clamp(2.6rem, 5vw, 5rem); line-height: .98; letter-spacing: -.055em; }
.login-copy { max-width: 610px; margin: 30px 0; color: #cbd1e8; font-size: 1.06rem; line-height: 1.75; }
.feature-list { display: grid; gap: 14px; color: #edf0ff; font-weight: 600; }
.feature-list span { display: inline-grid; width: 25px; height: 25px; margin-right: 9px; place-items: center; border-radius: 50%; background: rgba(13,58,221,.38); color: #d4e0ff; }
.login-form-panel { position: relative; z-index: 2; display: grid; place-items: center; padding: 40px; background: #fbfcff; }
.login-card { width: min(430px, 100%); padding: 46px; border: 1px solid var(--border); border-radius: 24px; background: white; box-shadow: var(--shadow-lg); }
.login-card h2 { margin: 0 0 7px; font-size: 2rem; letter-spacing: -.035em; }
.login-card > .muted { margin: 0 0 30px; line-height: 1.55; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-decoration { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.login-decoration-one { top: -130px; left: 44%; width: 290px; height: 290px; background: rgba(54,197,216,.12); }
.login-decoration-two { right: -100px; bottom: -130px; width: 340px; height: 340px; background: rgba(13,58,221,.10); }

.field { display: grid; gap: 8px; margin-bottom: 19px; }
.field > span { color: #3e475d; font-size: .85rem; font-weight: 750; }
.field small { color: #9299aa; font-size: .72rem; font-weight: 500; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: #f8faff;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input, select { min-height: 46px; padding: 0 13px; }
textarea { padding: 13px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: #7d9cff; background: white; box-shadow: 0 0 0 4px rgba(13,58,221,.1); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.icon-button { position: absolute; top: 50%; right: 7px; width: 34px; height: 34px; border: 0; border-radius: 9px; transform: translateY(-50%); background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--background); }
.form-error { margin: 15px 0 0; padding: 11px 13px; border-radius: 10px; background: #fff0f2; color: var(--danger); font-size: .86rem; font-weight: 650; }
.character-counter { justify-self: end; margin-top: -4px; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 0; border-radius: 11px; font-weight: 800; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .6; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--primary), #2454e8); color: white; box-shadow: 0 9px 20px rgba(13,58,221,.22); }
.button-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #153fc6); box-shadow: 0 12px 25px rgba(13,58,221,.3); }
.button-secondary { border: 1px solid var(--border); background: white; color: #485168; box-shadow: 0 4px 12px rgba(25,36,65,.04); }
.button-danger { background: #fff1f3; color: var(--danger); }
.button-full { width: 100%; }
.button.compact { min-height: 40px; padding: 0 15px; font-size: .85rem; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 24px 18px 18px; background: var(--navy); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 27px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand strong { display: block; font-size: .92rem; }
.sidebar-brand small { display: block; margin-top: 3px; color: #8790ad; font-size: .72rem; }
.sidebar-nav { display: grid; gap: 8px; margin-top: 28px; }
.nav-button { display: flex; min-height: 47px; align-items: center; gap: 13px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #9da6c2; text-align: left; font-weight: 700; }
.nav-button:hover { background: rgba(255,255,255,.055); color: white; }
.nav-button.active { background: linear-gradient(135deg, rgba(13,58,221,.95), rgba(18,68,204,.82)); color: white; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.nav-icon { width: 23px; text-align: center; font-size: 1.08rem; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.profile-mini { display: flex; align-items: center; gap: 11px; padding: 8px; }
.avatar { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #36c5d8, #0d3add); font-weight: 900; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: .82rem; }
.profile-copy small { margin-top: 3px; color: #8992ad; font-size: .7rem; }
.logout-button { width: 100%; margin-top: 8px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: #8992ad; text-align: left; font-size: .78rem; font-weight: 700; }
.logout-button:hover { background: rgba(255,255,255,.05); color: #ff9cab; }

.main-column { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 88px; align-items: center; justify-content: space-between; padding: 17px clamp(22px, 4vw, 48px); border-bottom: 1px solid rgba(228,232,241,.85); background: rgba(255,255,255,.89); backdrop-filter: blur(16px); }
.topbar h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; }
.topbar-actions { display: flex; gap: 10px; }
.mobile-menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.content-area { padding: 30px clamp(22px, 4vw, 48px) 70px; }
.page-section { max-width: 1500px; margin: 0 auto; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.stat-card::after { content: ""; position: absolute; top: -22px; right: -22px; width: 75px; height: 75px; border-radius: 50%; background: var(--stat-soft, #edf2ff); }
.stat-icon { position: relative; z-index: 1; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--stat-soft, #edf2ff); color: var(--stat-color, var(--primary)); }
.stat-label { margin: 16px 0 5px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.stat-number { margin: 0; font-size: 1.72rem; letter-spacing: -.04em; }
.toolbar-card { display: grid; grid-template-columns: minmax(250px, 1fr) 190px 220px; gap: 12px; margin-bottom: 20px; padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: white; box-shadow: var(--shadow-sm); }
.search-box { position: relative; }
.search-box span { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: #9ca3b3; font-size: 1.25rem; }
.search-box input { padding-left: 40px; }

.ticket-list { display: grid; gap: 21px; }
.company-group { overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: white; box-shadow: var(--shadow-sm); }
.company-group-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; border-bottom: 1px solid var(--border); background: #fafbfe; }
.company-group-title { display: flex; align-items: center; gap: 11px; }
.company-logo { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.company-group-title h3 { margin: 0; font-size: .96rem; }
.company-group-title small { display: block; margin-top: 3px; color: var(--muted); }
.count-badge { padding: 5px 9px; border-radius: 999px; background: #eef0f6; color: #647087; font-size: .72rem; font-weight: 800; }
.ticket-table-wrap { overflow-x: auto; }
.ticket-table { width: 100%; border-collapse: collapse; }
.ticket-table th { padding: 12px 17px; background: white; color: #9299aa; font-size: .68rem; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.ticket-table td { padding: 15px 17px; border-top: 1px solid #edf0f5; color: #465069; font-size: .82rem; vertical-align: middle; }
.ticket-row { cursor: pointer; transition: background .16s; }
.ticket-row:hover { background: #fafaff; }
.ticket-subject strong { display: block; max-width: 480px; color: var(--text); font-size: .86rem; }
.ticket-subject small { display: block; max-width: 500px; margin-top: 5px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.folio { color: var(--primary); font-weight: 850; }
.status-badge, .priority-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-open { background: #fff4df; color: #b77714; }
.status-in_progress { background: #e8eeff; color: #0d3add; }
.status-waiting { background: #e7f7fb; color: #248ca1; }
.status-resolved { background: #e5f7ef; color: #138b5d; }
.status-closed { background: #eef0f4; color: #6e778b; }
.priority-low { background: #f0f2f6; color: #6f788a; }
.priority-medium { background: #eaf0ff; color: #244ec9; }
.priority-high { background: #fff0df; color: #bf7113; }
.priority-urgent { background: #ffebef; color: #ca3d57; }
.sla-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(0,0,0,.025); }
.sla-green { background: #25ad79; }
.sla-yellow { background: #e4a42a; }
.sla-red { background: #df4c62; }
.sla-gray { background: #9ca3b3; }
.meta-icons { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.empty-state { padding: 70px 24px; border: 1px dashed #ced4e1; border-radius: 18px; background: white; text-align: center; }
.empty-state-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 16px; place-items: center; border-radius: 18px; background: var(--primary-soft); color: var(--primary); font-size: 1.6rem; }
.empty-state h3 { margin: 0 0 7px; }
.empty-state p { max-width: 470px; margin: 0 auto 20px; color: var(--muted); line-height: 1.6; }

.panel { border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.panel-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
.step-badge { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.form-panel { padding: 28px; }
.compact-panel { align-self: start; }
.two-column-form-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .75fr); gap: 22px; }
.help-panel { align-self: start; padding: 27px; background: linear-gradient(145deg, #111a32, #222e58); color: white; }
.help-panel h3 { margin: 0 0 25px; font-size: 1.3rem; }
.help-list { display: grid; gap: 21px; margin: 0; padding: 0; list-style: none; }
.help-list li { display: flex; gap: 13px; }
.help-list li > span { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: rgba(13,58,221,.45); color: #d7d8ff; font-size: .75rem; font-weight: 900; }
.help-list strong { font-size: .88rem; }
.help-list p { margin: 5px 0 0; color: #b7bfd8; font-size: .78rem; line-height: 1.55; }
.security-note { margin-top: 28px; padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: rgba(255,255,255,.05); color: #c7cde2; font-size: .75rem; line-height: 1.5; }
.drop-zone { display: grid; min-height: 150px; place-items: center; padding: 24px; border: 1.5px dashed #cbd1df; border-radius: 14px; background: #fafbfe; text-align: center; transition: all .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: #f1f5ff; }
.drop-zone > * { display: block; }
.drop-zone strong { margin: 9px 0 5px; font-size: .86rem; }
.drop-zone small { color: var(--muted); }
.drop-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; }
.selected-files { display: grid; gap: 7px; margin-top: 10px; }
.selected-file { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-radius: 9px; background: #f5f7fb; color: #536078; font-size: .75rem; }
.form-actions { display: flex; gap: 10px; margin-top: 25px; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(500px, 1.3fr); gap: 22px; }
.table-panel { overflow: hidden; }
.table-panel .panel-heading { margin: 0; padding: 25px 25px 18px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 20px; border-top: 1px solid var(--border); text-align: left; }
.data-table th { background: #fafbfe; color: #9299aa; font-size: .67rem; letter-spacing: .07em; text-transform: uppercase; }
.data-table td { color: #4e5870; font-size: .8rem; }
.data-table strong { color: var(--text); }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(9,14,31,.68); backdrop-filter: blur(5px); }
.modal-card { display: flex; width: min(900px, 100%); max-height: min(90vh, 920px); flex-direction: column; overflow: hidden; border-radius: 20px; background: white; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 25px; background: linear-gradient(145deg, #10182f, #232e5b); color: white; }
.modal-header h2 { margin: 0; font-size: 1.23rem; }
.modal-close { width: 39px; height: 39px; border: 0; border-radius: 11px; background: rgba(255,255,255,.08); color: white; font-size: 1.45rem; }
.modal-close:hover { background: rgba(255,255,255,.14); }
.modal-content { overflow-y: auto; padding: 25px; }
.ticket-detail-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 21px; }
.meta-card { padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #fafbfe; }
.meta-card small { display: block; margin-bottom: 5px; color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.meta-card strong { font-size: .79rem; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 11px; font-size: .88rem; }
.description-box { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfe; color: #465069; font-size: .85rem; line-height: 1.7; white-space: pre-wrap; }
.admin-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 15px; border: 1px solid #dfe1ff; border-radius: 13px; background: #f5f8ff; }
.admin-controls .field { margin: 0; }
.admin-controls .button { align-self: end; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.attachment-card { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fafbfe; }
.attachment-preview { display: grid; height: 130px; place-items: center; overflow: hidden; background: #eef1f7; color: var(--muted); }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-info { padding: 10px; }
.attachment-info strong { display: block; overflow: hidden; color: #465069; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.attachment-info button { margin-top: 7px; padding: 0; border: 0; background: transparent; color: var(--primary); font-size: .72rem; font-weight: 800; }
.comment-list { display: grid; gap: 11px; }
.comment { max-width: 82%; padding: 12px 14px; border-radius: 13px 13px 13px 3px; background: #f0f2f7; }
.comment.admin-comment { margin-left: auto; border-radius: 13px 13px 3px 13px; background: #ececff; }
.comment-header { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 7px; color: var(--muted); font-size: .67rem; }
.comment-header strong { color: #4c566d; }
.comment p { margin: 0; color: #465069; font-size: .8rem; line-height: 1.55; white-space: pre-wrap; }
.comment-form { display: grid; gap: 9px; margin-top: 13px; }
.comment-form textarea { min-height: 84px; }

.toast-container { position: fixed; z-index: 300; top: 20px; right: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 11px; padding: 14px 15px; border: 1px solid var(--border); border-radius: 13px; background: white; box-shadow: var(--shadow-lg); animation: toast-in .25s ease both; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast strong { display: block; margin-bottom: 3px; font-size: .8rem; }
.toast p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.loading-skeleton { height: 120px; border-radius: 16px; background: linear-gradient(90deg, #eff1f6 25%, #f8f9fc 45%, #eff1f6 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -100% 0; } }

.sidebar-overlay { position: fixed; z-index: 39; inset: 0; background: rgba(9,14,31,.5); }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid, .two-column-form-layout { grid-template-columns: 1fr; }
  .help-panel { order: -1; }
}

@media (max-width: 850px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 25px; background: linear-gradient(145deg, #edf3ff, #f9fbff); }
  .login-card { padding: 32px 25px; }
  .mobile-brand { display: flex; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; left: 0; width: 270px; transform: translateX(-105%); transition: transform .23s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-button { display: block; }
  .topbar { gap: 13px; padding: 14px 18px; }
  .topbar > div:nth-child(2) { margin-right: auto; }
  .content-area { padding: 22px 16px 55px; }
  .toolbar-card { grid-template-columns: 1fr; }
  .ticket-detail-meta { grid-template-columns: repeat(2, 1fr); }
  .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-controls { grid-template-columns: 1fr; }
  .topbar-actions .button-secondary { display: none; }
}

@media (max-width: 560px) {
  .login-form-panel { padding: 15px; }
  .login-card { border-radius: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-number { font-size: 1.42rem; }
  .topbar h1 { font-size: 1.2rem; }
  .topbar .eyebrow { display: none; }
  .button.compact { padding: 0 12px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal-card { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .modal-content { padding: 18px; }
  .ticket-detail-meta { grid-template-columns: 1fr 1fr; }
  .attachment-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .ticket-table th:nth-child(4), .ticket-table td:nth-child(4), .ticket-table th:nth-child(6), .ticket-table td:nth-child(6) { display: none; }
}

/* === Notificaciones y reportes v2 === */
.notification-center {
  position: relative;
}

.notification-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border, #e6e8f0);
  border-radius: 13px;
  background: #fff;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(31, 35, 48, 0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.notification-button:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 58, 221, .38);
  box-shadow: 0 10px 24px rgba(31, 35, 48, .1);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-size: .66rem;
  font-weight: 800;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, calc(100vw - 32px));
  max-height: 540px;
  overflow: hidden;
  z-index: 120;
  border: 1px solid #e4e6ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(27, 31, 47, .2);
}

.notification-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid #eceef4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.notification-panel-header > div {
  display: grid;
  gap: 2px;
}

.notification-panel-header strong {
  font-size: .98rem;
}

.notification-panel-header small {
  color: var(--muted, #777d8d);
  font-size: .76rem;
}

.notification-panel-header button {
  border: 0;
  background: transparent;
  color: var(--primary, #0d3add);
  cursor: pointer;
  font-weight: 700;
  font-size: .76rem;
}

.notification-list {
  max-height: 450px;
  overflow-y: auto;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #f0f1f6;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease;
}

.notification-item:hover {
  background: #f8f8fd;
}

.notification-item.unread {
  background: #f1f5ff;
}

.notification-kind {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e7eeff;
  color: #0d3add;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.notification-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notification-copy strong,
.notification-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-copy strong {
  color: #252838;
  font-size: .87rem;
}

.notification-copy span {
  color: #666c7d;
  font-size: .78rem;
}

.notification-copy small {
  color: #969baa;
  font-size: .68rem;
}

.notification-empty {
  padding: 38px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #717788;
}

.notification-empty > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f7ef;
  color: #159a68;
  font-weight: 900;
}

.notification-empty p {
  margin: 0;
  font-size: .78rem;
}

.reports-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-bottom: 20px;
}

.reports-toolbar h2,
.reports-toolbar p {
  margin-bottom: 0;
}

.report-period-field {
  min-width: 210px;
  margin: 0;
}

.report-summary {
  margin-bottom: 20px;
}

.report-number {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(460px, 1.4fr);
  gap: 20px;
  margin-bottom: 20px;
}

.report-panel {
  min-width: 0;
  padding: 24px;
}

.horizontal-report {
  display: grid;
  gap: 18px;
}

.horizontal-row {
  display: grid;
  gap: 8px;
}

.horizontal-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: .86rem;
}

.horizontal-row-head strong {
  font-size: .86rem;
}

.horizontal-row-head small {
  color: #8b90a0;
  font-weight: 600;
}

.horizontal-track {
  height: 10px;
  border-radius: 999px;
  background: #f0f1f6;
  overflow: hidden;
}

.status-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 3px;
}

.status-bar-open { background: #d99326; }
.status-bar-in_progress { background: #0d3add; }
.status-bar-waiting { background: #2795a8; }
.status-bar-resolved { background: #31a875; }
.status-bar-closed { background: #667085; }

.monthly-chart {
  height: 280px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 2px 4px;
  border-bottom: 1px solid #eceef4;
}

.month-column {
  min-width: 52px;
  flex: 1 0 52px;
  display: grid;
  grid-template-rows: 24px 1fr 26px;
  gap: 6px;
  text-align: center;
}

.month-values {
  display: flex;
  justify-content: center;
  gap: 9px;
  color: #777d8d;
  font-size: .65rem;
}

.month-bars {
  min-height: 190px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.month-bar {
  width: min(15px, 35%);
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  transition: height .25s ease;
}

.month-bar.created { background: #2f5df2; }
.month-bar.closed { background: #31a875; }

.month-column > strong {
  color: #777d8d;
  font-size: .67rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding-top: 16px;
  color: #686e7d;
  font-size: .76rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-created { background: #2f5df2; }
.legend-closed { background: #31a875; }

.report-company-panel {
  padding: 24px;
}

.completion-pill {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7f7ef;
  color: #13865b;
  font-weight: 800;
  font-size: .76rem;
}

@media (max-width: 1050px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-actions .button-secondary {
    display: none;
  }

  .notification-panel {
    position: fixed;
    top: 76px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .reports-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-period-field {
    min-width: 0;
  }

  .report-panel,
  .report-company-panel,
  .reports-toolbar {
    padding: 18px;
  }
}

/* CRUD administrativo v3 */
.button-danger {
  border: 1px solid #ffd0d5;
  background: #fff1f3;
  color: #c92a43;
  box-shadow: 0 7px 16px rgba(201, 42, 67, .08);
}

.button-danger:hover {
  background: #ffe4e8;
  box-shadow: 0 10px 20px rgba(201, 42, 67, .13);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.table-action {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #dfe2eb;
  border-radius: 8px;
  background: #fff;
  color: #4f5870;
  font-size: .72rem;
  font-weight: 800;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}

.table-action:hover {
  border-color: #a9bbff;
  background: #f3f6ff;
  color: #0d3add;
  transform: translateY(-1px);
}

.table-action.danger {
  border-color: #ffd5da;
  background: #fff7f8;
  color: #c92a43;
}

.table-action.danger:hover {
  border-color: #f2aeb8;
  background: #fff0f2;
  color: #aa2036;
}

.catalog-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
}

.catalog-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: '';
}

.catalog-status.active {
  background: #e8f8f0;
  color: #15845d;
}

.catalog-status.active::before { background: #22a875; }
.catalog-status.inactive {
  background: #f0f1f5;
  color: #72798a;
}
.catalog-status.inactive::before { background: #9298a6; }

.modal-card-small { width: min(610px, 100%); }

.crud-form {
  display: grid;
  gap: 17px;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfe;
}

.toggle-field > span {
  display: grid;
  gap: 3px;
}

.toggle-field strong {
  color: var(--text);
  font-size: .86rem;
}

.toggle-field small {
  color: var(--muted);
  font-size: .72rem;
}

.toggle-field input {
  width: 42px;
  height: 22px;
  accent-color: var(--primary);
}

.crud-record-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.crud-record-summary span,
.crud-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf2ff;
  color: #0d3add;
  font-size: .7rem;
  font-weight: 800;
}

.crud-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-help {
  margin: -4px 0 0;
  color: #9c5964;
  font-size: .72rem;
  line-height: 1.55;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.section-title-row h3 { margin: 0; }

.admin-edit-section {
  border: 1px solid #dbe5ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfcff, #f5f8ff);
  padding: 20px;
}

.admin-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-edit-grid .field { margin: 0; }
.admin-edit-grid .field-wide { grid-column: 1 / -1; }
.admin-edit-section .crud-actions { margin-top: 16px; }
.admin-edit-section .danger-help { margin-top: 9px; }

@media (max-width: 760px) {
  .admin-edit-grid { grid-template-columns: 1fr; }
  .admin-edit-grid .field-wide { grid-column: auto; }
  .crud-actions .button { width: 100%; }
  .row-actions { flex-direction: column; align-items: stretch; }
  .table-action { width: 100%; }
}

/* === Identidad De La Mora y configuración SLA v4 === */
.brand-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.login-brand-logo {
  width: min(620px, 88%);
  margin: 0 0 38px;
  filter: brightness(0) invert(1);
  opacity: .96;
}

.mobile-brand-logo {
  width: 235px;
  max-width: 82vw;
}

.sidebar-brand {
  justify-content: center;
  min-height: 86px;
  padding: 0 5px 22px;
}

.sidebar-brand-logo {
  width: 220px;
  max-height: 74px;
  filter: brightness(0) invert(1);
  opacity: .96;
}

.sla-display {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 750;
  font-size: .76rem;
}

.ticket-detail-meta {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sla-meta-card strong {
  display: flex;
  align-items: center;
}

.sla-meta-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .67rem;
  font-style: normal;
  line-height: 1.35;
}

.notification-kind-sla_warning {
  background: #fff3df;
  color: #bb7512;
}

.notification-kind-sla_breached {
  background: #fff0f2;
  color: #ca304a;
}

.sla-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 25px;
  margin-bottom: 16px;
}

.sla-intro h2,
.sla-intro p {
  margin-bottom: 0;
}

.sla-service-status {
  min-width: 275px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fafbfe;
}

.sla-service-status strong {
  font-size: .86rem;
}

.sla-service-status small {
  color: var(--muted);
  font-size: .7rem;
}

.sla-service-status.active {
  border-color: #b9ead5;
  background: #effaf5;
  color: #117b55;
}

.sla-service-status.warning {
  border-color: #f0d7a7;
  background: #fff9ec;
  color: #a66a0f;
}

.sla-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  color: #5f687e;
  font-size: .78rem;
}

.sla-flow span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sla-flow strong {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .72rem;
}

.sla-flow i {
  color: #b1b6c5;
  font-style: normal;
}

.sla-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.sla-policy-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.sla-policy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 21px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(145deg, #fff, #fafbff);
}

.sla-policy-header h3 {
  margin: 12px 0 4px;
  font-size: 1.65rem;
  letter-spacing: -.04em;
}

.sla-policy-header p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.sla-card-body {
  padding: 21px;
}

.sla-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(120px, .7fr);
  gap: 12px;
}

.sla-active-switch {
  position: relative;
  width: 45px;
  height: 25px;
  flex: 0 0 auto;
}

.sla-active-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sla-active-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8ccd7;
  transition: .2s ease;
}

.sla-active-switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
  transition: .2s ease;
}

.sla-active-switch input:checked + span {
  background: var(--success);
}

.sla-active-switch input:checked + span::after {
  transform: translateX(20px);
}

.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-suffix input {
  border-radius: 11px 0 0 11px;
}

.input-suffix > span {
  display: grid;
  place-items: center;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 11px 11px 0;
  background: #f2f4f8;
  color: #70788c;
  font-size: .75rem;
  font-weight: 700;
}

.sla-apply-open {
  margin: 4px 0 18px;
}

.sla-help-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 20px;
}

.sla-help-panel > div {
  padding: 5px 22px;
  border-right: 1px solid var(--border);
}

.sla-help-panel > div:last-child {
  border-right: 0;
}

.sla-help-panel strong {
  display: block;
  margin-bottom: 7px;
  font-size: .86rem;
}

.sla-help-panel p {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.55;
}

.report-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sla-breached-pill {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0f2;
  color: #c92a43;
  font-weight: 800;
  font-size: .76rem;
}

@media (max-width: 1100px) {
  .ticket-detail-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sla-policy-grid {
    grid-template-columns: 1fr;
  }

  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .login-brand-logo {
    width: min(520px, 90%);
  }

  .sla-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .sla-service-status {
    min-width: 0;
  }

  .sla-flow {
    align-items: flex-start;
    flex-direction: column;
  }

  .sla-flow i {
    display: none;
  }

  .sla-help-panel {
    grid-template-columns: 1fr;
  }

  .sla-help-panel > div {
    padding: 14px 5px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sla-help-panel > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .mobile-brand-logo {
    width: 215px;
  }

  .ticket-detail-meta,
  .report-summary {
    grid-template-columns: 1fr 1fr;
  }

  .sla-time-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sla-policy-header,
  .sla-card-body,
  .sla-intro,
  .sla-help-panel {
    padding: 17px;
  }
}

/* === Tema v6: fondo claro, sombras azules y portada corporativa === */
:root {
  --primary-bright: #2454e8;
  --primary-lighter: #4f75ee;
  --page-glow: rgba(13, 58, 221, .075);
}

.app-shell {
  background:
    radial-gradient(circle at 86% 8%, rgba(36, 84, 232, .08), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
}

.main-column {
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0%, rgba(13, 58, 221, .055), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.content-area {
  min-height: calc(100vh - 88px);
}

.topbar {
  border-bottom-color: rgba(13, 58, 221, .10);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 28px rgba(13, 58, 221, .045);
}

.sidebar {
  background:
    radial-gradient(circle at 110% 18%, rgba(79, 117, 238, .34), transparent 30%),
    linear-gradient(180deg, #071f63 0%, #092c8d 60%, #0d3add 100%);
  box-shadow: 16px 0 38px rgba(7, 31, 99, .16);
}

.sidebar-brand,
.sidebar-footer {
  border-color: rgba(255, 255, 255, .14);
}

.nav-button {
  color: #d6e0ff;
}

.nav-button:hover {
  background: rgba(255, 255, 255, .10);
}

.nav-button.active {
  background: linear-gradient(135deg, #2454e8 0%, #3768f0 100%);
  box-shadow: 0 12px 28px rgba(0, 20, 92, .30), inset 0 1px 0 rgba(255,255,255,.18);
}

.login-brand-panel {
  background:
    radial-gradient(circle at 86% 86%, rgba(255, 255, 255, .14), transparent 30%),
    linear-gradient(145deg, #082aa8 0%, #0d3add 52%, #2454e8 100%);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,.06), transparent 36%),
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.10), transparent 26%);
}

.login-form-panel {
  background:
    radial-gradient(circle at 90% 12%, rgba(36, 84, 232, .08), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f4f7ff 100%);
}

.login-card {
  border-color: rgba(13, 58, 221, .12);
  box-shadow: 0 28px 80px rgba(13, 58, 221, .15), 0 8px 24px rgba(16, 24, 47, .06);
}

.panel,
.stat-card,
.toolbar-card,
.company-group,
.sla-policy-card,
.report-panel,
.reports-toolbar {
  border-color: rgba(13, 58, 221, .11);
  box-shadow: 0 12px 34px rgba(13, 58, 221, .075);
}

.panel:hover,
.stat-card:hover,
.company-group:hover,
.sla-policy-card:hover {
  border-color: rgba(13, 58, 221, .17);
}

.company-group-header,
.data-table th,
.meta-card,
.description-box,
.attachment-card,
.sla-service-status,
.drop-zone {
  background: #f9fbff;
}

input,
textarea,
select {
  border-color: #dbe4f7;
  background: #fbfdff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #6485ef;
  box-shadow: 0 0 0 4px rgba(13, 58, 221, .11);
}

.button-primary {
  background: linear-gradient(135deg, #0d3add 0%, #2454e8 100%);
  box-shadow: 0 11px 24px rgba(13, 58, 221, .26);
}

.button-primary:hover {
  background: linear-gradient(135deg, #082aa8 0%, #1745d5 100%);
  box-shadow: 0 14px 30px rgba(13, 58, 221, .34);
}

.help-panel,
.modal-header {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.14), transparent 32%),
    linear-gradient(145deg, #082aa8 0%, #0d3add 62%, #2454e8 100%);
}

@media (max-width: 850px) {
  .login-form-panel {
    background:
      radial-gradient(circle at 90% 8%, rgba(36, 84, 232, .12), transparent 30%),
      linear-gradient(145deg, #ffffff, #edf3ff);
  }
}


/* === V7 · Iconografía profesional y diagnóstico SMTP === */
.stat-card {
  border-top: 3px solid var(--stat-color, var(--primary));
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.stat-card::after {
  top: -32px;
  right: -28px;
  width: 108px;
  height: 108px;
  background: var(--stat-color, var(--primary));
  opacity: .075;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--stat-color, var(--primary)), var(--stat-deep, var(--navy)));
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 9px 22px color-mix(in srgb, var(--stat-color, var(--primary)) 28%, transparent);
}

.stat-label {
  color: #526079;
  font-weight: 800;
}

.stat-number {
  color: #111a2f;
}

/* Estados con fondos sobrios, sin bloques pastel. */
.status-badge,
.priority-badge {
  border: 1px solid currentColor;
  background: #ffffff;
  box-shadow: 0 3px 9px rgba(15, 31, 75, .035);
}

.status-open { color: #965700; }
.status-in_progress { color: #0d3add; }
.status-waiting { color: #176978; }
.status-resolved { color: #116c4c; }
.status-closed { color: #596579; }
.priority-low { color: #526079; }
.priority-medium { color: #0d3add; }
.priority-high { color: #965700; }
.priority-urgent { color: #a63448; }

.empty-state-icon,
.drop-icon,
.step-badge {
  border: 1px solid rgba(13, 58, 221, .18);
  background: linear-gradient(145deg, #0d3add, #071f63);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(13, 58, 221, .18);
}

.smtp-test-panel {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(240px, .7fr) auto;
  align-items: end;
  gap: 18px;
  margin: 18px 0;
  padding: 22px 24px;
  border-left: 4px solid var(--primary);
}

.smtp-test-copy h3 {
  margin: 0 0 6px;
  color: #111a2f;
  font-size: 1.08rem;
}

.smtp-test-copy p {
  margin: 0;
  line-height: 1.55;
}

.smtp-test-field {
  margin: 0;
}

.smtp-test-panel .button {
  min-width: 150px;
}

.smtp-test-result {
  grid-column: 1 / -1;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.5;
}

.smtp-test-result.pending {
  border-color: #aebde6;
  background: #f6f8ff;
  color: #334f80;
}

.smtp-test-result.success {
  border-color: #3f896e;
  background: #f3faf7;
  color: #0d5b40;
}

.smtp-test-result.error {
  border-color: #bd6877;
  background: #fff7f8;
  color: #8f293c;
}

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
  .stat-icon {
    box-shadow: 0 9px 22px rgba(13, 58, 221, .20);
  }
}

@media (max-width: 980px) {
  .smtp-test-panel {
    grid-template-columns: 1fr 1fr;
  }
  .smtp-test-copy,
  .smtp-test-result {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .smtp-test-panel {
    grid-template-columns: 1fr;
    padding: 19px;
  }
  .smtp-test-copy,
  .smtp-test-result {
    grid-column: auto;
  }
  .smtp-test-panel .button {
    width: 100%;
  }
}

/* === Trazabilidad, roles y notas privadas v8 === */
.urgent-ticket-toggle {
  border-color: rgba(166, 52, 72, .28);
  background: linear-gradient(180deg, #ffffff, #fff9fa);
}

.urgent-ticket-toggle input {
  accent-color: #a63448;
}

.platform-id-cell {
  color: #243f78;
  font-weight: 800;
  white-space: nowrap;
}

.traceability-help {
  margin: 12px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: #f5f8ff;
  color: #405273;
  font-size: .75rem;
  line-height: 1.55;
}

.private-admin-section {
  border: 1px solid rgba(13, 58, 221, .22);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8faff, #ffffff);
  padding: 20px;
}

.private-badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffffff;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.private-badge,
.role-admin {
  color: #0d3add;
}

.role-client {
  color: #334f80;
}

.internal-note-list,
.history-list {
  display: grid;
  gap: 10px;
}

.internal-note {
  padding: 14px 15px;
  border: 1px solid #d9e3fb;
  border-left: 4px solid #0d3add;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(13, 58, 221, .06);
}

.internal-note p {
  margin: 8px 0 0;
  color: #263650;
  line-height: 1.62;
  white-space: pre-wrap;
}

.private-note-form {
  margin-top: 14px;
}

.history-section {
  border-top: 1px solid var(--border);
}

.history-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 9px 0;
}

.history-marker {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #0d3add;
  box-shadow: 0 0 0 2px rgba(13, 58, 221, .2);
}

.history-item strong {
  color: #17233c;
  font-size: .82rem;
}

.history-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .72rem;
}

.field-disabled {
  opacity: .58;
}

.field-disabled select {
  cursor: not-allowed;
  background: #f1f4fa;
}

.current-user-label {
  display: block;
  margin-top: 3px;
  color: #0d3add;
  font-size: .67rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  .ticket-detail-meta {
    grid-template-columns: 1fr 1fr;
  }
}


/* ==========================================================
   Identidad de portada y visibilidad de filtros — v8.2.0
   ========================================================== */

/*
 * El título toma la inclinación, peso y doble línea del logotipo,
 * sin competir visualmente con la marca principal.
 */
.login-brand-panel .login-system-title {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-self: flex-start;
  gap: .22em;
  width: fit-content;
  max-width: min(100%, 650px);
  margin: clamp(26px, 4.5vw, 54px) 0 0;
  padding: 0 4px 18px 0;
  color: #ffffff;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(2.15rem, 4vw, 3.65rem);
  font-style: italic;
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.052em;
  text-shadow: 0 8px 24px rgba(0, 20, 92, .22);
}

.login-brand-panel .login-system-title-main {
  font-weight: 650;
}

.login-brand-panel .login-system-title-accent {
  font-weight: 900;
}

.login-brand-panel .login-system-title::before,
.login-brand-panel .login-system-title::after {
  content: "";
  position: absolute;
  left: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  pointer-events: none;
}

.login-brand-panel .login-system-title::before {
  bottom: 8px;
  width: min(100%, 560px);
  height: 4px;
}

.login-brand-panel .login-system-title::after {
  bottom: 0;
  width: min(91%, 510px);
  height: 3px;
  opacity: .82;
}

/* Defensa visual adicional: el filtro por empresa es administrativo. */
body.client-session #company-filter,
.company-filter-client-hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .login-brand-panel .login-system-title {
    font-size: clamp(2rem, 3.7vw, 3.15rem);
  }
}

@media (max-width: 860px) {
  .login-brand-panel .login-system-title {
    font-size: 2.1rem;
  }
}

