/* ============================================================
   VARIABLES  (tomadas del tailwind.config.js del proyecto original)
   ============================================================ */
:root {
  --color-primary:       #552863;
  --color-primary-light: #7a3d8a;
  --color-primary-dark:  #3d1d47;
  --color-orange:        #FC6821;
  --color-orange-dark:   #d9531a;
  --color-teal:          #0ea5a0;
  --color-teal-dark:     #0a7875;
  --color-bg:            #f1f5f9;
  --color-surface:       #ffffff;
  --color-border:        #e5e7eb;
  --color-border-light:  #f3f4f6;
  --color-text:          #111827;
  --color-text-muted:    #6b7280;
  --color-text-light:    #9ca3af;
  --radius-sm:           8px;
  --radius-md:           12px;
  --radius-lg:           16px;
  --radius-xl:           20px;
  --radius-full:         9999px;
  --shadow-card:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-md:      0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg:           0 8px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-nav:          0 2px 8px rgba(85,40,99,0.15);
  --tabbar-h:            48px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   TABBAR
   ============================================================ */
#tabbar {
  height: var(--tabbar-h);
  background: rgba(85, 40, 99, 0.95);
  backdrop-filter: blur(20px) saturate(2);
  -webkit-backdrop-filter: blur(20px) saturate(2);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-nav);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  flex-shrink: 0;
  z-index: 100;
}
.tabbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 4px;
}
.tabbar-logo-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.2);
}
.tabbar-divider {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

/* Pestaña */
.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  min-width: 80px;
  max-width: 180px;
}
.tab-item.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}
.tab-item:not(.active):hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.tab-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.4); }
.tab-dots { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tab-close {
  display: flex; align-items: center; justify-content: center;
  opacity: 0.5; cursor: pointer; margin-left: auto; flex-shrink: 0;
}
.tab-close:hover { opacity: 1; }
.tab-add-btn {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); background: none; border: none;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.tab-add-btn:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.tab-rename-input {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px; color: #fff; padding: 1px 5px; font-size: 12px;
  font-family: inherit; font-weight: 500; width: 90px; outline: none;
  min-width: 0;
}
#tabbar-tabs { display: flex; align-items: center; gap: 4px; overflow: hidden; }

/* Acciones derecha */
.tabbar-spacer { flex: 1; }
.tabbar-layout-selector {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 3px; flex-shrink: 0;
}
.layout-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.layout-btn.active {
  background: var(--color-orange);
  color: #fff;
  box-shadow: 0 2px 4px rgba(252,104,33,0.3);
}
.layout-btn:not(.active):hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }

.tabbar-search {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  padding: 5px 12px; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.tabbar-search:focus-within {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
.tabbar-search input {
  background: none; border: none; outline: none;
  color: #fff; font-family: inherit; font-size: 12px; width: 120px;
}
.tabbar-search input::placeholder { color: rgba(255,255,255,0.3); }
.tabbar-search i { color: rgba(255,255,255,0.4); flex-shrink: 0; }

.tabbar-action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65);
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.tabbar-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-orange);
  border: 1.5px solid rgba(85,40,99,0.95);
}

.user-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  cursor: pointer; flex-shrink: 0;
  transition: background 0.12s;
}
.user-btn:hover { background: rgba(255,255,255,0.1); }
.user-avatar {
  width: 26px; height: 26px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 500; color: #fff; }
.user-chevron { color: rgba(255,255,255,0.4); }

/* ============================================================
   MAIN + PANE WINDOW
   ============================================================ */
#app-main {
  flex: 1;
  overflow: hidden;
  padding: 10px;
  padding-bottom: 82px;
  display: flex;
}
#pane-window {
  flex: 1;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(229,231,235,0.8);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
#pane-window:hover { box-shadow: var(--shadow-card-md); }

#pane-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border-light);
  background: rgba(249,250,251,0.8);
  min-height: 36px;
  flex-shrink: 0;
  gap: 8px;
}
.titlebar-dots { display: flex; align-items: center; gap: 5px; }
.titlebar-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #28c840; }
#titlebar-name { font-size: 12px; font-weight: 500; color: var(--color-text-muted); flex: 1; }

#pane-content {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
}

/* ============================================================
   DOCK  (fiel al CSS del proyecto original)
   ============================================================ */
#bottom-dock {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: 12px;
  pointer-events: none;
}
.dock-wrapper { pointer-events: auto; }

.dock-container {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px 12px;
  background: rgba(53, 18, 63, 0.82);
  backdrop-filter: blur(28px) saturate(2);
  -webkit-backdrop-filter: blur(28px) saturate(2);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--radius-xl);
  box-shadow:
    0 8px 32px rgba(53,18,63,0.45),
    0 2px 8px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.15);
}

.dock-item-wrapper {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}

/* Tooltip */
.dock-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%; transform: translateX(-50%) translateY(4px);
  background: rgba(53, 18, 63, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff; font-size: 11px; font-weight: 500;
  padding: 5px 11px; border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(53,18,63,0.3);
}
.dock-tooltip::after {
  content: '';
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(53, 18, 63, 0.92);
}
.dock-item-wrapper:hover .dock-tooltip {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Botón del dock */
.dock-item {
  position: relative;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  background: rgba(255,255,255,0.07);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
  will-change: transform;
}
.dock-item:hover {
  transform: translateY(-5px) scale(1.12);
  background: rgba(255,255,255,0.14);
}
.dock-item:active { transform: translateY(-2px) scale(1.05); }

/* Activo naranja (pane izquierdo / único) */
.dock-item.active {
  background: rgba(252,104,33,0.28) !important;
  box-shadow:
    0 0 0 1.5px rgba(252,104,33,0.55),
    0 2px 8px rgba(252,104,33,0.2),
    inset 0 1px 0 rgba(255,255,255,0.12);
  color: #fff;
}
.dock-item.active:hover { background: rgba(252,104,33,0.38) !important; }

/* Punto activo inferior */
.dock-item.active::after {
  content: '';
  position: absolute; bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--color-orange);
}

/* Badge */
.dock-badge {
  position: absolute; top: -1px; right: -1px;
  min-width: 16px; height: 16px;
  background: var(--color-orange);
  border-radius: var(--radius-full);
  font-size: 9px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 1.5px solid rgba(53,18,63,0.82);
}

/* Separador */
.dock-sep {
  width: 1px; height: 24px; align-self: center;
  background: rgba(255,255,255,0.15);
  margin: 0 2px; flex-shrink: 0;
}

/* ============================================================
   MÓDULOS — COMPARTIDOS
   ============================================================ */
.module-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.module-title   { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.3px; }
.module-subtitle{ font-size: 13px; color: var(--color-text-muted); margin-top: 3px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.2s;
  white-space: nowrap; flex-shrink: 0;
}
.btn:active { transform: scale(0.97); }
.btn-primary  {
  background: var(--color-orange); color: #fff;
  box-shadow: 0 4px 20px rgba(252,104,33,0.3);
}
.btn-primary:hover { background: var(--color-orange-dark); box-shadow: 0 4px 20px rgba(252,104,33,0.4); }
.btn-secondary{
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
.btn-secondary:hover { background: var(--color-bg); }
.btn-ghost    { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-bg); }
.btn-danger   { background: rgba(239,68,68,0.08); color: #ef4444; }
.btn-danger:hover { background: rgba(239,68,68,0.14); }
.btn-sm       { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
}
.badge-activo     { background: rgba(34,197,94,0.1);  color: #16a34a; }
.badge-inactivo   { background: rgba(239,68,68,0.1);  color: #dc2626; }
.badge-vacaciones { background: rgba(252,104,33,0.1); color: #c2410c; }
.badge-pendiente  { background: rgba(234,179,8,0.1);  color: #a16207; }

/* Card */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.card-title {
  font-size: 13px; font-weight: 600; color: var(--color-text);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
  width: 100%;
}

/* ============================================================
   DASHBOARD — WELCOME BANNER
   ============================================================ */
.welcome-banner {
  background: linear-gradient(135deg, #552863 0%, #35123F 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card-md);
}
.welcome-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.welcome-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.welcome-sub   { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 4px; }
.welcome-active-badge {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  padding: 6px 14px;
}
.welcome-active-badge span { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.9); }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-teal);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}
.welcome-progress-wrap { margin-top: 18px; }
.welcome-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 7px;
}
.welcome-progress-head strong { color: #fff; font-weight: 700; }
.welcome-progress-track {
  height: 8px; background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full); overflow: hidden;
}
.welcome-progress-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--color-teal), #34d399);
  transition: width 0.7s ease;
}

/* ============================================================
   DASHBOARD — KPI GRID
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px; margin-bottom: 14px;
}
@media (max-width:1200px){ .kpi-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width:700px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-card-md); }
.kpi-top  { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.kpi-icon {
  width:34px; height:34px; border-radius:var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
}
.kpi-icon-primary{ background:rgba(85,40,99,0.09);  color:var(--color-primary); }
.kpi-icon-slate  { background:rgba(100,116,139,0.1); color:#475569;             }
.kpi-icon-teal   { background:rgba(14,165,160,0.1); color:var(--color-teal);   }
.kpi-icon-red    { background:rgba(239,68,68,0.1);  color:#dc2626;             }
.kpi-icon-green  { background:rgba(34,197,94,0.1);  color:#16a34a;             }
.kpi-icon-orange { background:rgba(252,104,33,0.1); color:var(--color-orange); }
.kpi-trend { font-size:10px; font-weight:700; padding:2px 7px; border-radius:var(--radius-full); display:flex; align-items:center; gap:2px; }
.trend-up  { background:rgba(34,197,94,0.1); color:#16a34a; }
.trend-down{ background:rgba(239,68,68,0.1); color:#dc2626; }
.kpi-value { font-size:26px; font-weight:700; line-height:1; letter-spacing:-0.5px; margin-top:2px; }
.kpi-label { font-size:11px; color:var(--color-text-muted); margin-top:4px; font-weight:500; }
.kpi-sub   { font-size:10px; color:var(--color-text-light); margin-top:2px; }

.dash-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 12px;
}
@media (max-width:860px){ .dash-grid { grid-template-columns:1fr; } }

.att-item {
  display:flex; align-items:center; gap:10px;
  padding:8px 0; border-bottom:1px solid var(--color-border-light);
}
.att-item:last-child{ border-bottom:none; }
.att-av {
  width:32px; height:32px; border-radius:50%;
  background:linear-gradient(135deg,var(--color-primary),var(--color-primary-light));
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; color:#fff; flex-shrink:0;
}
.att-info  { flex:1; min-width:0; }
.att-name  { font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.att-type  { font-size:11px; color:var(--color-text-muted); }
.att-right { text-align:right; flex-shrink:0; }
.att-time  { font-size:12px; font-weight:600; }
.att-status {
  font-size:10px; font-weight:600;
  padding:1px 7px; border-radius:var(--radius-full); display:inline-block;
}
.status-puntual{ background:rgba(34,197,94,0.1);  color:#16a34a; }
.status-retardo { background:rgba(252,104,33,0.1); color:#c2410c; }

.dept-row  { margin-bottom:13px; }
.dept-head { display:flex; align-items:center; justify-content:space-between; font-size:12px; margin-bottom:5px; }
.dept-name { font-weight:500; color:var(--color-text); }
.dept-emp  { font-size:11px; color:var(--color-text-light); margin-left:6px; }
.dept-pct  { color:var(--color-text-muted); font-weight:700; font-size:13px; }
.dept-track{ height:6px; background:var(--color-border); border-radius:var(--radius-full); overflow:hidden; }
.dept-fill { height:100%; border-radius:var(--radius-full); transition:width 0.7s ease; }

/* ============================================================
   EMPLEADOS
   ============================================================ */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.emp-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
}
.emp-card:hover { box-shadow: var(--shadow-card-md); transform: translateY(-2px); }
.emp-card-top   { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:12px; }
.emp-card-av    { width:42px; height:42px; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700; color:#fff; flex-shrink:0; }
.emp-card-name  { font-size:13px; font-weight:600; color:var(--color-text); margin-bottom:2px; line-height:1.3; }
.emp-card-puesto{ font-size:11px; color:var(--color-text-muted); margin-bottom:10px; }
.emp-card-foot  { display:flex; flex-wrap:wrap; gap:4px; }

/* Modal tabs */
.modal-tabs {
  display: flex; border-bottom: 2px solid var(--color-border-light);
  padding: 0 18px; gap: 0; overflow-x: auto;
}
.modal-tab {
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--color-text-muted); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab:hover { color: var(--color-text); }
.modal-tab.active { color: var(--color-orange); border-bottom-color: var(--color-orange); font-weight: 600; }

/* Step indicators inside new employee modal tabs */
.step-ind {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.step-ind-done    { background: var(--color-teal);   color: #fff; }
.step-ind-current { background: var(--color-orange); color: #fff; }
.step-ind-future  { background: var(--color-border); color: var(--color-text-muted); }

/* Close button on gradient modal headers */
.modal-close-grad:hover { background: rgba(255,255,255,0.2) !important; }

.toolbar { display:flex; align-items:center; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.search-box {
  display:flex; align-items:center; gap:7px;
  background:var(--color-surface); border:1px solid var(--color-border);
  border-radius:var(--radius-md); padding:7px 13px; flex:1; min-width:200px;
  box-shadow:var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(252,104,33,0.1);
}
.search-box input {
  border:none; background:none; outline:none;
  font-family:inherit; font-size:13px; color:var(--color-text); width:100%;
}
.search-box input::placeholder{ color:var(--color-text-light); }

.filter-chip {
  display:inline-flex; align-items:center; gap:4px;
  padding:5px 12px; border-radius:var(--radius-md);
  font-size:12px; font-weight:500;
  background:var(--color-surface); border:1px solid var(--color-border);
  cursor:pointer; color:var(--color-text-muted); flex-shrink:0;
  box-shadow:var(--shadow-card);
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--color-text-muted); }
.filter-chip.active {
  background:rgba(252,104,33,0.08); border-color:var(--color-orange);
  color:var(--color-orange);
  box-shadow: 0 0 0 3px rgba(252,104,33,0.08);
}

.data-table { width:100%; border-collapse:collapse; }
.data-table th {
  text-align:left; font-size:10px; font-weight:700;
  color:var(--color-text-muted); text-transform:uppercase;
  letter-spacing:0.06em; padding:8px 12px;
  border-bottom:2px solid var(--color-border);
  background:#f8f9fa; white-space:nowrap;
}
.data-table td {
  padding:9px 12px; font-size:13px;
  border-bottom:1px solid var(--color-border-light); vertical-align:middle;
}
.data-table tr:last-child td{ border-bottom:none; }
.data-table tbody tr:hover td{ background:rgba(252,104,33,0.025); }

.emp-av {
  width:28px; height:28px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:700; color:#fff; flex-shrink:0;
}
.emp-cell  { display:flex; align-items:center; gap:8px; }
.emp-name  { font-weight:500; font-size:13px; }
.emp-email { font-size:11px; color:var(--color-text-muted); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  z-index:500;
  display:flex; align-items:center; justify-content:center;
  padding:16px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal {
  background:var(--color-surface);
  border-radius:var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.1);
  width:100%; max-width:520px;
  max-height:90vh; overflow-y:auto;
  animation: slideUp 0.2s ease;
}
.modal-wide { max-width: 640px; }
@keyframes slideUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px; border-bottom:1px solid var(--color-border-light);
}
.modal-title  { font-size:15px; font-weight:700; }
.modal-close  {
  width:28px; height:28px; border-radius:var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:var(--color-text-muted); transition:background 0.12s;
}
.modal-close:hover{ background:var(--color-bg); }
.modal-body   { padding:18px; }
.modal-footer {
  padding:12px 18px; border-top:1px solid var(--color-border-light);
  display:flex; justify-content:flex-end; gap:8px;
}
.form-grid   { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.form-group  { display:flex; flex-direction:column; gap:5px; }
.full-col    { grid-column:1/-1; }
.form-label  { font-size:11px; font-weight:600; color:var(--color-text-muted); text-transform:uppercase; letter-spacing:0.04em; }
.form-value  { font-size:13px; padding:8px 0; }
.form-input, .form-select {
  padding:8px 11px;
  border:1px solid var(--color-border); border-radius:var(--radius-sm);
  font-family:inherit; font-size:13px; color:var(--color-text);
  outline:none; background:var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus {
  border-color:var(--color-orange);
  box-shadow:0 0 0 3px rgba(252,104,33,0.1);
}

/* ============================================================
   TIPOS EVENTOS
   ============================================================ */
.ev-row { transition: background 0.1s; }
.ev-row:hover { background: rgba(249,250,251,0.8); }
.ev-row-deleting { background: rgba(239,68,68,0.04) !important; }

.ev-action-btn {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; background: transparent;
  color: #d1d5db; font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.ev-action-btn:hover { background: rgba(20,184,166,0.08); color: #0d9488; }
.ev-action-btn-danger:hover { background: rgba(239,68,68,0.08) !important; color: #ef4444 !important; }

/* Legado — mantener por compatibilidad */
.ev-item {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border:1px solid var(--color-border-light);
  border-radius:var(--radius-lg); margin-bottom:8px;
  background:var(--color-surface); box-shadow:var(--shadow-card);
  transition: box-shadow 0.15s;
}
.ev-item:hover { box-shadow:var(--shadow-card-md); }
.ev-icon { width:38px; height:38px; border-radius:var(--radius-sm); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ev-info    { flex:1; }
.ev-name    { font-size:14px; font-weight:600; }
.ev-desc    { font-size:12px; color:var(--color-text-muted); }
.ev-actions { display:flex; gap:5px; }

/* ============================================================
   TRANSFERENCIAS
   ============================================================ */
.tr-tabs {
  display:flex; gap:2px; background:var(--color-bg);
  border-radius:var(--radius-md); padding:3px;
  width:fit-content; margin-bottom:16px;
}
.tr-tab {
  padding:6px 14px; border-radius:var(--radius-sm);
  font-size:13px; font-weight:500;
  cursor:pointer; color:var(--color-text-muted);
  transition: all 0.15s;
}
.tr-tab.active {
  background:var(--color-surface); color:var(--color-text);
  box-shadow:var(--shadow-card);
}
.tr-item {
  display:flex; align-items:center; gap:12px;
  padding:13px 14px; border:1px solid var(--color-border-light);
  border-radius:var(--radius-lg); margin-bottom:8px;
  box-shadow:var(--shadow-card);
  transition: box-shadow 0.15s;
}
.tr-item:hover { box-shadow:var(--shadow-card-md); }
.tr-icon {
  width:40px; height:40px; border-radius:var(--radius-sm);
  background:rgba(252,104,33,0.08);
  display:flex; align-items:center; justify-content:center;
  color:var(--color-orange); flex-shrink:0;
}
.tr-info      { flex:1; }
.tr-empresa   { font-size:14px; font-weight:600; }
.tr-meta      { font-size:12px; color:var(--color-text-muted); }
.tr-count     { font-size:20px; font-weight:700; text-align:right; }
.tr-count-lbl { font-size:10px; color:var(--color-text-muted); text-align:right; }

.stepper { display:flex; align-items:center; margin-bottom:22px; }
.step    { display:flex; align-items:center; gap:7px; }
.step-circle {
  width:26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700;
  background:var(--color-bg); color:var(--color-text-muted);
  border:2px solid var(--color-border);
}
.step.active .step-circle { background:var(--color-orange); color:#fff; border-color:var(--color-orange); }
.step.done   .step-circle { background:var(--color-teal);   color:#fff; border-color:var(--color-teal);   }
.step-lbl              { font-size:12px; font-weight:500; color:var(--color-text-muted); }
.step.active .step-lbl { color:var(--color-text); font-weight:600; }
.step-line { flex:1; height:2px; background:var(--color-border); margin:0 6px; }

/* ============================================================
   SINCRONIZAR — button-group tabs + device cards
   ============================================================ */
.sync-btn-group {
  display: flex; gap: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 5px; margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.sync-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; flex: 1; justify-content: center;
  color: var(--color-text-muted); cursor: pointer; border: none;
  font-family: inherit; background: transparent;
  transition: background 0.15s, color 0.15s;
}
.sync-btn:not(.active):hover { background: var(--color-bg); color: var(--color-text); }
.sync-btn.active {
  background: linear-gradient(135deg, #552863, #35123F);
  color: #fff; box-shadow: 0 2px 8px rgba(85,40,99,0.3);
}
.sync-btn span { display: none; }
@media (min-width: 500px) { .sync-btn span { display: inline; } }

.dev-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.dev-card {
  background: var(--color-bg); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); padding: 14px;
  transition: box-shadow 0.2s;
}
.dev-card:hover { box-shadow: var(--shadow-card-md); }
.dev-card-top { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:10px; }
.dev-card-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: rgba(85,40,99,0.07); display: flex; align-items: center; justify-content: center;
  color: var(--color-primary);
}

.dev-item {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border:1px solid var(--color-border-light);
  border-radius:var(--radius-lg); margin-bottom:8px;
  box-shadow:var(--shadow-card);
}
.dev-icon {
  width:40px; height:40px; border-radius:var(--radius-sm);
  background:rgba(85,40,99,0.07);
  display:flex; align-items:center; justify-content:center;
  color:var(--color-primary); flex-shrink:0;
}
.dev-info  { flex:1; }
.dev-name  { font-size:14px; font-weight:600; }
.dev-ip    { font-size:11px; color:var(--color-text-muted); font-family:monospace; }
.status-dot{ width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.dot-on    { background:#16a34a; box-shadow:0 0 6px rgba(22,163,74,0.4); }
.dot-off   { background:#dc2626; }

/* ============================================================
   TIPOS EVENTOS — extras
   ============================================================ */
.ev-item-deleting {
  background: rgba(239,68,68,0.04) !important;
  border-color: rgba(239,68,68,0.2) !important;
}

/* ============================================================
   GEOCERCAS — split panel
   ============================================================ */
.geo-split {
  display: flex; gap: 14px;
  height: calc(100vh - 226px); min-height: 380px;
}
.geo-panel-list {
  width: 268px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.geo-panel-map {
  flex: 1; position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-card-md);
  overflow: hidden;
}

/* Geocercas responsive — mobile */
@media (max-width: 680px) {
  .geo-split {
    flex-direction: column;
    height: auto;
    min-height: unset;
  }
  .geo-panel-map {
    order: -1;          /* mapa arriba en mobile */
    height: 240px;
    flex: none;
  }
  .geo-panel-list {
    width: 100%;
    order: 0;
  }
  .geo-selected-card {
    width: calc(100% - 28px);   /* card flotante ocupa más ancho en mobile */
  }
}

.geo-zone-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  border-bottom: 1px solid var(--color-border-light);
}
.geo-zone-item:last-child { border-bottom: none; }
.geo-zone-item:hover { background: var(--color-bg); }
.geo-zone-selected { background: rgba(252,104,33,0.04) !important; border-left-color: var(--color-orange) !important; }

.geo-zone-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.geo-zone-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-zone-meta { font-size: 11px; color: var(--color-text-muted); }

/* Controles flotantes del mapa */
.geo-controls {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(229,231,235,0.8);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-md);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.geo-ctrl-btn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(229,231,235,0.6);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text-muted);
  font-family: inherit; font-size: 14px;
  transition: background 0.12s;
}
.geo-ctrl-btn:hover { background: var(--color-bg); color: var(--color-text); }

/* Card flotante zona seleccionada */
.geo-selected-card {
  position: absolute; bottom: 14px; left: 14px;
  width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-md);
  padding: 14px;
}
@keyframes slideUpSm { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.animate-slide-up { animation: slideUpSm 0.2s ease; }
.animate-fade-in  { animation: fadeIn 0.2s ease; }

/* Legado — mantener por si acaso */
.map-ph {
  height: 240px;
  background: linear-gradient(145deg,#e6f4f3,#cce8e6);
  border-radius: var(--radius-lg); border: 1px solid #b8dedd;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 16px;
}
.map-ph-txt { font-size:14px; font-weight:500; color:var(--color-text-muted); }
.map-ph-sub { font-size:12px; color:var(--color-text-light); }

/* ============================================================
   CONFIGURACIÓN
   ============================================================ */
.cfg-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:12px; }
.cfg-card {
  border:1px solid var(--color-border-light); border-radius:var(--radius-lg);
  padding:18px; cursor:pointer; box-shadow:var(--shadow-card);
  transition: all 0.15s;
}
.cfg-card:hover {
  box-shadow: var(--shadow-card-md);
  transform: translateY(-1px);
}
.cfg-card:hover .cfg-arrow { opacity: 1 !important; }
.cfg-icon { width:40px; height:40px; border-radius:var(--radius-sm); display:flex; align-items:center; justify-content:center; margin-bottom:11px; }
.cfg-name { font-size:14px; font-weight:600; margin-bottom:4px; }
.cfg-desc { font-size:12px; color:var(--color-text-muted); line-height:1.5; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty { text-align:center; padding:52px 20px; color:var(--color-text-muted); }
.empty-title { font-size:15px; font-weight:500; margin-bottom:4px; }
.empty-sub   { font-size:13px; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar       { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#e5e7eb; border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:#d1d5db; }
