/* =====================================================
   HSP WorkPlanner — Stylesheet
   Heidelberg Spain SLU — Servicio Técnico
   ===================================================== */

/* --- CSS Variables --- */
:root {
  --hsp-navy:       #0d2b4e;
  --hsp-blue:       #0070c0;
  --hsp-blue-light: #3a9ad9;
  --hsp-blue-pale:  #e8f3fb;
  --hsp-steel:      #4a6080;
  --hsp-silver:     #b8c5d3;
  --hsp-metal:      #d8e2ec;
  --hsp-bg:         #f0f3f8;
  --hsp-surface:    #ffffff;
  --hsp-border:     #d0dbe8;
  --hsp-text:       #1a2a3a;
  --hsp-muted:      #6b7e94;
  --hsp-sidebar-w: 210px;
  --hsp-navbar-h:  74px;
  --radius:         6px;
  --shadow-sm:      0 1px 4px rgba(0,40,80,0.08);
  --shadow-md:      0 3px 12px rgba(0,40,80,0.12);
  --shadow-lg:      0 8px 28px rgba(0,40,80,0.16);
  --transition:     0.18s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 400;
  color: var(--hsp-text);
  background: var(--hsp-bg);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =====================================================
   NAVBAR
   ===================================================== */
.hsp-navbar {
  background: linear-gradient(90deg, var(--hsp-navy) 0%, #0a3a6a 100%);
  box-shadow: 0 2px 12px rgba(0,20,50,0.3);
  position: relative;
  top: 0;
  z-index: 1040;
  border-bottom: 2px solid var(--hsp-blue);
  padding: 0;
}

/* Three-column flex layout: brand | center | user */
.hsp-navbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 16px;
  min-height: var(--hsp-navbar-h);
  gap: 12px;
}

/* LEFT: brand pill */
.hsp-brand-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.hsp-brand-pill:hover { background: rgba(255,255,255,0.08); }

/* CENTER: logo image + nav links stacked */
.hsp-navbar-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 0;
}

.hsp-hd-logo-link { display: block; line-height: 0; }
.hsp-hd-logo {
  height: 37px;
  width: auto;
  max-width: 299px;
  object-fit: contain;
  opacity: 0.95;
  transition: opacity var(--transition);
}
.hsp-hd-logo-link:hover .hsp-hd-logo { opacity: 1; }

/* Horizontal nav links row below logo */
.hsp-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* RIGHT: user badge */
.hsp-navbar-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Logo badge (H circle) */
.hsp-logo-badge {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--hsp-blue) 0%, #005a9e 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,112,192,0.4);
  flex-shrink: 0;
}
.hsp-logo-h {
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.hsp-brand-text { line-height: 1; }
.brand-hsp {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.06em;
}
.brand-wp {
  display: block;
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: 0.66rem;
  color: var(--hsp-silver);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hsp-nav-link {
  color: rgba(255,255,255,0.75);
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  font-size: 0.82rem;
  padding: 4px 11px;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.hsp-nav-link:hover,
.hsp-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* User badge in navbar */
.hsp-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 40px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
}
.user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--hsp-blue) 0%, var(--hsp-blue-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  flex-shrink: 0;
}
.user-info { line-height: 1.2; }
.user-name {
  display: block;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}
.user-role {
  display: block;
  color: var(--hsp-silver);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* =====================================================
   LAYOUT: SIDEBAR + MAIN
   ===================================================== */
.hsp-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--hsp-navbar-h) - 36px);
}

/* SIDEBAR */
.hsp-sidebar {
  width: var(--hsp-sidebar-w);
  background: var(--hsp-surface);
  border-right: 1px solid var(--hsp-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;

  height: calc(100vh - var(--hsp-navbar-h));
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,20,60,0.06);
}

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hsp-muted);
  padding: 0 6px;
  margin-bottom: 6px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--hsp-steel);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
}
.sidebar-item i { font-size: 0.95rem; width: 18px; text-align: center; }
.sidebar-item:hover { background: var(--hsp-blue-pale); color: var(--hsp-blue); }
.sidebar-item.active {
  background: var(--hsp-blue-pale);
  color: var(--hsp-blue);
  font-weight: 600;
  border-left: 3px solid var(--hsp-blue);
  margin-left: -1px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--hsp-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.text-danger-light { color: #c0392b !important; }
.text-danger-light:hover { background: #fdf0ef !important; color: #c0392b !important; }

/* MAIN */
.hsp-main {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
}
.hsp-main--full { margin-left: 0; }

/* =====================================================
   FOOTER
   ===================================================== */
.hsp-footer {
  background: var(--hsp-navy);
  color: var(--hsp-silver);
  text-align: center;
  font-size: 0.75rem;
  padding: 9px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* =====================================================
   COMPONENTS
   ===================================================== */

/* Cards */
.hsp-card {
  background: var(--hsp-surface);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
}

/* Page header */
.page-header { padding-bottom: 12px; border-bottom: 1px solid var(--hsp-border); margin-bottom: 20px; }
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--hsp-navy);
  letter-spacing: 0.01em;
}
.text-hsp-blue { color: var(--hsp-blue) !important; }

/* Buttons */
.btn-hsp-primary {
  background: linear-gradient(135deg, var(--hsp-blue) 0%, #005a9e 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 18px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,112,192,0.25);
  transition: all var(--transition);
}
.btn-hsp-primary:hover {
  background: linear-gradient(135deg, #0080d8 0%, #0066b2 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,112,192,0.35);
  transform: translateY(-1px);
}
.btn-hsp-outline {
  background: transparent;
  color: var(--hsp-blue);
  border: 1.5px solid var(--hsp-blue);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px;
  transition: all var(--transition);
}
.btn-hsp-outline:hover { background: var(--hsp-blue-pale); }
.btn-hsp-ghost {
  background: transparent;
  color: var(--hsp-steel);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  padding: 7px 14px;
  transition: all var(--transition);
}
.btn-hsp-ghost:hover { background: var(--hsp-bg); }

/* Forms */
.form-label-hsp {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hsp-steel);
  margin-bottom: 5px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-label-hsp.required::after { content: ' *'; color: #e74c3c; }
.form-control.hsp-input,
.form-select.hsp-select {
  border: 1.5px solid var(--hsp-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--hsp-text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control.hsp-input:focus,
.form-select.hsp-select:focus {
  border-color: var(--hsp-blue);
  box-shadow: 0 0 0 3px rgba(0,112,192,0.12);
  outline: none;
}

/* Filter bar */
.filter-bar {
  background: var(--hsp-surface);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hsp-muted);
}
.hsp-badge-nav {
  background: var(--hsp-navy);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
}

/* Badges */
.hsp-badge-code {
  background: var(--hsp-navy);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.badge-superuser {
  background: #4a0080;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-coord {
  background: var(--hsp-blue);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-tech {
  background: #2e7d32;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-active {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-inactive {
  background: #fafafa;
  color: #999;
  border: 1px solid #ddd;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
}

/* Table */
.hsp-table { font-size: 0.83rem; }
.hsp-table thead th {
  background: var(--hsp-navy);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  padding: 10px 12px;
}
.hsp-table tbody tr { transition: background var(--transition); }
.hsp-table tbody tr:hover { background: var(--hsp-blue-pale); }
.hsp-table tbody td { padding: 10px 12px; border-color: var(--hsp-border); vertical-align: middle; }
.row-inactive td { opacity: 0.5; }

/* Personal number code */
.pno-code {
  background: var(--hsp-metal);
  color: var(--hsp-navy);
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Mini avatar */
.mini-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--hsp-blue) 0%, var(--hsp-blue-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Stats cards */
.stat-card {
  background: var(--hsp-surface);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}
.stat-icon.bg-blue  { background: linear-gradient(135deg, var(--hsp-blue), var(--hsp-blue-light)); }
.stat-icon.bg-green { background: linear-gradient(135deg, #2e7d32, #43a047); }
.stat-icon.bg-orange{ background: linear-gradient(135deg, #e65100, #f57c00); }
.stat-icon.bg-red   { background: linear-gradient(135deg, #b71c1c, #e53935); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--hsp-navy); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--hsp-muted); margin-top: 2px; }

/* Breadcrumb */
.hsp-breadcrumb { font-size: 0.78rem; margin-bottom: 6px; }
.hsp-breadcrumb .breadcrumb-item a { color: var(--hsp-blue); text-decoration: none; }
.hsp-breadcrumb .breadcrumb-item.active { color: var(--hsp-muted); }

/* Section title in forms */
.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hsp-navy);
  border-bottom: 2px solid var(--hsp-blue-pale);
  padding-bottom: 6px;
}
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* Button actions in table cells */
.btn-edit-tech {
  display: none;
  font-size: 0.7rem;
  color: var(--hsp-muted);
  text-decoration: none;
}
.tech-info-cell:hover .btn-edit-tech { display: inline; }
.btn-cell-action {
  display: none;
  background: none;
  border: none;
  padding: 1px 4px;
  font-size: 0.72rem;
  color: var(--hsp-muted);
  cursor: pointer;
  border-radius: 3px;
  transition: all var(--transition);
}
.btn-cell-action:hover { background: var(--hsp-metal); color: var(--hsp-navy); }
.assign-cell:hover .btn-cell-action { display: inline-flex; }
.cell-actions { display: none; gap: 2px; }
.assign-cell:hover .cell-actions { display: inline-flex; }

/* Today highlight in planning */
.today-cell { background: rgba(0,112,192,0.06) !important; box-shadow: inset 0 0 0 1px rgba(0,112,192,0.2); }

/* Legend bar */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: var(--hsp-surface);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  font-size: 0.72rem;
}
.legend-title {
  font-weight: 700;
  color: var(--hsp-muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
.legend-item { display: inline-flex; align-items: center; }

/* Empty state */
.empty-state { color: var(--hsp-muted); }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-body {
  background: var(--hsp-bg);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left panel */
.login-brand-panel {
  width: 420px;
  min-width: 340px;
  background: linear-gradient(160deg, var(--hsp-navy) 0%, #0a3e6e 60%, #0d5090 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px 32px;
  position: relative;
  overflow: hidden;
}
.login-brand-panel::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.login-brand-panel::after {
  content: '';
  position: absolute;
  bottom: 60px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(0,112,192,0.12);
}
.login-brand-content { position: relative; z-index: 1; }
.login-logo-big { margin-bottom: 24px; }
.logo-circle-big {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--hsp-blue) 0%, var(--hsp-blue-light) 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,112,192,0.4);
}
.login-brand-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 12px;
}
.login-brand-title span { color: var(--hsp-blue-light); }
.login-brand-sub {
  color: var(--hsp-silver);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 36px;
}
.login-brand-features { display: flex; flex-direction: column; gap: 12px; }
.feat-item {
  color: rgba(255,255,255,0.75);
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feat-item i { color: var(--hsp-blue-light); font-size: 1rem; }
.login-brand-footer {
  color: rgba(255,255,255,0.4);
  font-size: 0.72rem;
  text-align: center;
  position: relative;
  z-index: 1;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Right panel */
.login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  padding: 0;
}
.login-form-content {
  max-width: 420px;
  width: 100%;
  margin: auto;
  padding: 48px 40px;
}
.login-form-header { margin-bottom: 32px; }
.login-form-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--hsp-navy);
  margin-bottom: 4px;
}
.login-form-header p { color: var(--hsp-muted); font-size: 0.87rem; }
.login-form .form-group-hsp { }
.input-password-wrapper { position: relative; }
.btn-toggle-pass {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--hsp-muted);
  cursor: pointer;
  padding: 4px;
}
.btn-toggle-pass:hover { color: var(--hsp-blue); }

/* Demo credentials */
.login-hints { border-top: 1px dashed var(--hsp-border); padding-top: 16px; }
.demo-creds { display: flex; flex-direction: column; gap: 8px; }
.demo-item {
  background: var(--hsp-bg);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge-role { font-size: 0.68rem; padding: 2px 7px; border-radius: 3px; font-weight: 700; flex-shrink: 0; }
.badge-role.coord { background: var(--hsp-blue); color: #fff; }
.badge-role.tech  { background: #2e7d32; color: #fff; }
.demo-item code { font-size: 0.75rem; color: var(--hsp-navy); background: none; padding: 0; }
.login-footer-text {
  text-align: center;
  font-size: 0.72rem;
  color: var(--hsp-muted);
  padding: 16px;
  border-top: 1px solid var(--hsp-border);
}

/* =====================================================
   CHANGE PASSWORD
   ===================================================== */
.change-pass-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--hsp-blue) 0%, var(--hsp-blue-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  margin: 0 auto 20px;
}

/* =====================================================
   COMPANIES PAGE
   ===================================================== */
.company-badge {
  display: inline-block;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--hsp-blue) 0%, var(--hsp-blue-light) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: 'Barlow Condensed', sans-serif;
  flex-shrink: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .hsp-sidebar { display: none; }
  .hsp-main { padding: 16px; }
  .login-brand-panel { display: none; }
  .login-form-content { padding: 32px 24px; }
}

@media (max-width: 600px) {
  .filter-bar { padding: 10px; }
  .page-title { font-size: 1rem; }
  .hsp-card { padding: 14px; }
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--hsp-bg); }
::-webkit-scrollbar-thumb { background: var(--hsp-silver); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--hsp-steel); }

/* =====================================================
   BACKUP PAGE
   ===================================================== */
.backup-info-box {
  background: var(--hsp-bg);
  border: 1px solid var(--hsp-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.restore-mode-card { display: block; cursor: pointer; margin: 0; }
.restore-mode-card .mode-card-inner {
  border: 2px solid var(--hsp-border);
  border-radius: var(--radius);
  padding: 14px;
  transition: all var(--transition);
  height: 100%;
}
.restore-mode-card:hover .mode-card-inner { border-color: var(--hsp-blue); }
.restore-mode-card.selected .mode-card-inner {
  border-color: var(--hsp-blue);
  background: var(--hsp-blue-pale);
  box-shadow: 0 0 0 3px rgba(0,112,192,0.12);
}

/* =====================================================
   SORTABLE TABLE HEADERS
   ===================================================== */
th[data-sort-col] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th[data-sort-col]:hover { background: #1a5a9a !important; }
th[data-sort-col].sort-asc  { background: #0a4a80 !important; }
th[data-sort-col].sort-desc { background: #0a4a80 !important; }
.sort-icon {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.75em;
  opacity: 0.7;
  font-style: normal;
}

/* EXT badge — dark grey with white text */
.hsp-badge-code.badge-ext {
  background: #555;
  color: #fff;
}

/* Contenedor principal */
#filterTecnico + .ts-wrapper .ts-control {
  min-width: 250px;
  max-width: 300px;
  white-space: nowrap;
  overflow-x: auto;
}

/* Texto seleccionado */
#filterTecnico + .ts-wrapper .ts-control .item {
  white-space: nowrap;
}

/* Opciones del dropdown */
#filterTecnico + .ts-wrapper .ts-dropdown {
  min-width: 280px !important;
}

#filterTecnico + .ts-wrapper .ts-dropdown .option {
  white-space: nowrap;
}
/* ── Sidebar toggle ── */
.hsp-sidebar { position: relative !important; transition: width 0.25s ease; }
.hsp-sidebar.collapsed { width: 0 !important; overflow: hidden !important; min-width: 0 !important; border: none !important; }
.hsp-layout.sidebar-collapsed .hsp-main { max-width: 100% !important; }
.sidebar-section:first-of-type { padding-top: 8px; }
#sidebarToggle {
  position: absolute; top: 8px; right: -14px; z-index: 100;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--hsp-border); background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); padding: 0;
  color: var(--hsp-blue-dark); font-size: 0.65rem;
}
#sidebarToggle:hover { background: var(--hsp-blue-pale); }

/* Fix sidebar overflow to show toggle button */
.hsp-sidebar { overflow: visible !important; }
.hsp-sidebar > *:not(#sidebarToggle) { overflow-y: auto; }
#sidebarToggle {
  position: absolute !important; top: 12px !important; right: -13px !important;
  left: auto !important; z-index: 999 !important;
}

/* Fix sidebar overflow to show toggle button */
.hsp-sidebar { overflow: visible !important; }
.hsp-sidebar > *:not(#sidebarToggle) { overflow-y: auto; }
#sidebarToggle {
  position: absolute !important; top: 12px !important; right: -13px !important;
  left: auto !important; z-index: 999 !important;
}

/* Toggle button final fix */
#sidebarToggle {
  position: fixed !important;
  top: 70px !important;
  left: 196px !important;
  right: auto !important;
  z-index: 9999 !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  border: 2px solid #dee2e6 !important;
  background: #fff !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.2) !important;
  padding: 0 !important;
  font-size: 0.6rem !important;
  color: #0d2b4e !important;
  transition: left 0.25s ease !important;
}
.hsp-sidebar.collapsed ~ * #sidebarToggle,
.sidebar-collapsed #sidebarToggle { left: 2px !important; }

/* Sidebar collapse - main content expand */
.hsp-sidebar.collapsed { width: 0 !important; min-width: 0 !important; overflow: hidden !important; border: none !important; }
.hsp-layout { position: relative; }
.hsp-main { flex: 1; transition: all 0.25s ease; }

/* Fix TomSelect overflow when many items selected */
.ts-wrapper.multi .ts-control {
    max-height: 80px !important;
    overflow-y: auto !important;
}

/* TomSelect single line */
.ts-wrapper.multi .ts-control {
    max-height: 36px !important;
    overflow: hidden !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}
.ts-wrapper.multi .ts-control .item {
    white-space: nowrap !important;
}

/* TomSelect single line fix v2 */
.ts-wrapper.multi .ts-control {
    max-height: 38px !important;
    overflow: hidden !important;
    flex-wrap: nowrap !important;
}
.ts-wrapper.multi .ts-dropdown {
    overflow: visible !important;
    max-height: 300px !important;
}
.ts-wrapper.multi.focus .ts-control {
    max-height: none !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
}

/* TomSelect max 2 lines */
.ts-wrapper.multi .ts-control {
    max-height: 38px !important;
    overflow: hidden !important;
    flex-wrap: nowrap !important;
}
.ts-wrapper.multi.focus .ts-control {
    max-height: 70px !important;
    flex-wrap: wrap !important;
    overflow-y: auto !important;
}
.ts-wrapper .ts-dropdown {
    z-index: 9999 !important;
}
