/* TechService Pro — estilos principales */
  :root {
    --bg: #0a0b0f;
    --bg2: #111318;
    --bg3: #181b22;
    --card: #1c1f28;
    --border: #252933;
    --accent: #f0a500;
    --accent2: #ff6b35;
    --accent3: #00d4aa;
    --text: #e8eaf0;
    --text2: #8b8fa8;
    --text3: #5a5e72;
    --danger: #ff4757;
    --success: #2ed573;
    --info: #1e90ff;
    --purple: #a855f7;
    --sidebar-w: 260px;
    --radius: 12px;
    --radius-sm: 8px;
  }

  /* ===== LIGHT THEME ===== */
  body.light {
    --bg:      #eef0f8;
    --bg2:     #f5f6fc;
    --bg3:     #e4e7f2;
    --card:    #ffffff;
    --border:  #d0d5e8;
    --accent:  #c97000;
    --accent2: #d44d12;
    --accent3: #008f6e;
    --text:    #191c2e;
    --text2:   #505778;
    --text3:   #8f97b8;
    --danger:  #d92f3f;
    --success: #159c4a;
    --info:    #1260c8;
    --purple:  #7228d8;
  }
  body.light .login-grid {
    border: 1px solid var(--border);
  }
  body.light #login-screen {
    background-image:
      radial-gradient(ellipse 80% 60% at 20% 80%, rgba(201,112,0,0.10) 0%, transparent 60%),
      radial-gradient(ellipse 60% 80% at 80% 20%, rgba(0,143,110,0.08) 0%, transparent 60%);
  }
  body.light .sidebar {
    border-right: 1px solid var(--border);
  }
  body.light .topbar {
    border-bottom: 1px solid var(--border);
  }
  body.light .modal {
    border: 1px solid var(--border);
  }
  body.light .modal-overlay {
    background: rgba(20,25,60,0.45);
  }
  body.light .table-card,
  body.light .stat-card,
  body.light .rs-card {
    border-color: rgba(0,10,60,0.12);
  }
  body.light .nav-item:hover,
  body.light .nav-item.active {
    background: rgba(201,112,0,0.10);
  }
  body.light .badge-efectivo     { background: rgba(21,156,74,0.13);  color: var(--success); }
  body.light .badge-tarjeta      { background: rgba(18,96,200,0.12);  color: var(--info); }
  body.light .badge-transferencia{ background: rgba(114,40,216,0.11); color: var(--purple); }
  body.light .badge-credito      { background: rgba(201,112,0,0.13);  color: var(--accent); }
  body.light .badge-mixto        { background: rgba(212,77,18,0.12);  color: var(--accent2); }
  body.light .sp-pending    { background: rgba(201,112,0,0.13);  color: var(--accent); }
  body.light .sp-done       { background: rgba(21,156,74,0.13);  color: var(--success); }
  body.light .sp-progress   { background: rgba(18,96,200,0.12);  color: var(--info); }
  body.light .sp-delivered  { background: rgba(0,143,110,0.12);  color: var(--accent3); }
  body.light .sp-cancelled  { background: rgba(217,47,63,0.12);  color: var(--danger); }
  body.light .f-input,
  body.light .f-select,
  body.light .filter-select,
  body.light .form-input {
    background: var(--card);
    border-color: var(--border);
    color: var(--text);
  }
  body.light .f-input:focus,
  body.light .f-select:focus,
  body.light .filter-select:focus,
  body.light .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201,112,0,0.12);
  }
  body.light .btn-outline {
    border-color: var(--border);
    color: var(--text2);
  }
  body.light .btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(201,112,0,0.06);
  }
  body.light .pos-pay-btn {
    background: var(--bg3);
    border-color: var(--border);
  }
  body.light .pos-pay-btn.selected {
    background: rgba(201,112,0,0.12);
    border-color: var(--accent);
    color: var(--accent);
  }
  body.light .cfg-collapse {
    border-color: rgba(0,10,60,0.10);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body { height: 100%; overflow: hidden; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
  }

  /* ===== LOGIN ===== */
  #login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    background-image: 
      radial-gradient(ellipse 80% 60% at 20% 80%, rgba(240,165,0,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 60% 80% at 80% 20%, rgba(0,212,170,0.06) 0%, transparent 60%);
  }

  .login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    width: 90%;
    min-height: 520px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  }

  .login-brand {
    background: linear-gradient(135deg, #0d0e14 0%, #1a1d28 100%);
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }

  .login-brand::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,165,0,0.15) 0%, transparent 70%);
    top: -80px; left: -80px;
  }

  .login-brand::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,170,0.1) 0%, transparent 70%);
    bottom: -40px; right: -40px;
  }

  .brand-logo {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
  }

  .brand-logo span { color: var(--text); }

  .brand-tagline {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.7;
    position: relative;
    z-index: 1;
    max-width: 240px;
  }

  .brand-stats {
    display: flex;
    gap: 24px;
    margin-top: 48px;
    position: relative;
    z-index: 1;
  }

  .brand-stat { text-align: left; }
  .brand-stat-num {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
  }
  .brand-stat-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

  .login-form-area {
    background: var(--bg2);
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .login-form-area h2 {
    font-family: 'Syne', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
  }
  .login-form-area p { font-size: 14px; color: var(--text2); margin-bottom: 36px; }

  .form-group { margin-bottom: 20px; }
  .form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
  }

  .input-wrap {
    position: relative;
  }

  .input-wrap i.icon-left {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    font-size: 14px;
  }

  .form-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 42px 13px 40px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    outline: none;
  }

  .form-input:focus {
    border-color: var(--accent);
    background: var(--card);
    box-shadow: 0 0 0 3px rgba(240,165,0,0.1);
  }

  .toggle-pass {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
  }
  .toggle-pass:hover { color: var(--accent); }

  .btn-primary {
    width: 100%;
    background: var(--accent);
    color: #0a0b0f;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.3px;
    margin-top: 8px;
  }
  .btn-primary:hover { background: #ffc107; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(240,165,0,0.3); }
  .btn-primary:active { transform: translateY(0); }

  .login-hint { font-size: 12px; color: var(--text3); text-align: center; margin-top: 16px; }

  /* ===== APP SHELL ===== */
  #app {
    display: none;
    height: 100vh;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
  }

  .sidebar-logo {
    padding: 28px 24px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .sidebar-logo .brand {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
  }
  .sidebar-logo .brand span { color: var(--text); }
  .sidebar-logo .sub { font-size: 11px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

  .sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
  }

  .nav-section-label {
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin: 20px 0 8px;
    font-weight: 600;
  }
  .nav-section-label:first-child { margin-top: 0; }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: var(--text2);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    margin-bottom: 2px;
    border: 1px solid transparent;
    text-decoration: none;
  }

  .nav-item i { width: 18px; font-size: 15px; flex-shrink: 0; }

  .nav-item:hover { background: var(--bg3); color: var(--text); }

  .nav-item.active {
    background: rgba(240,165,0,0.12);
    color: var(--accent);
    border-color: rgba(240,165,0,0.2);
    font-weight: 500;
  }

  .nav-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: #0a0b0f;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
  }

  .sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
  }

  .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #0a0b0f;
    flex-shrink: 0;
  }

  .user-name { font-size: 13px; font-weight: 500; }
  .user-role { font-size: 11px; color: var(--text3); }

  .btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,71,87,0.1);
    border: 1px solid rgba(255,71,87,0.2);
    color: var(--danger);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s;
  }
  .btn-logout:hover { background: rgba(255,71,87,0.2); }

  /* ===== MAIN CONTENT ===== */
  .main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 50;
  }

  /* ===== NOTIFICATION FILTER BANNER ===== */
  .notif-filter-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: linear-gradient(90deg, rgba(201,112,0,0.14), rgba(201,112,0,0.06));
    border-bottom: 1px solid rgba(201,112,0,0.35);
    color: var(--text);
    font-size: 13px;
    flex-shrink: 0;
    animation: nfbSlideIn 0.22s ease-out;
  }
  .notif-filter-banner[hidden] { display: none !important; }

  @keyframes nfbSlideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
  }

  .nfb-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    border-radius: 8px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .nfb-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }
  .nfb-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    line-height: 1.2;
  }
  .nfb-detail {
    font-size: 11.5px;
    color: var(--text2);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nfb-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(201,112,0,0.5);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }
  .nfb-close:hover {
    background: rgba(201,112,0,0.12);
    border-color: var(--accent);
  }
  .nfb-close i { font-size: 11px; }

  @media (max-width: 600px) {
    .notif-filter-banner { padding: 8px 14px; gap: 10px; }
    .nfb-close span { display: none; }
    .nfb-close { padding: 6px 10px; }
  }

  /* Filas resaltadas por alerta de notificación */
  tbody tr.row-alerted {
    background: linear-gradient(90deg, rgba(201,112,0,0.10), transparent 70%);
    box-shadow: inset 3px 0 0 var(--accent);
    position: relative;
  }
  tbody tr.row-alerted:hover {
    background: linear-gradient(90deg, rgba(201,112,0,0.18), rgba(201,112,0,0.04) 70%);
  }
  tbody tr.row-alerted td:first-child::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 3px rgba(201,112,0,0.18);
    animation: rowAlertPulse 1.6s ease-in-out infinite;
  }
  @keyframes rowAlertPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(201,112,0,0.18); }
    50%      { box-shadow: 0 0 0 5px rgba(201,112,0,0.08); }
  }

  .topbar-title {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
  }
  .topbar-subtitle {
    font-size: 11px;
    color: var(--text3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
  }

  .topbar-actions { display: flex; align-items: center; gap: 12px; }

  .icon-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: border-color 0.15s, color 0.15s;
  }
  .icon-btn:hover { border-color: var(--accent); color: var(--accent); }

  .notif-dot { position: relative; }
  .notif-badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--danger);
    color: #fff; font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg2); pointer-events: none;
    line-height: 1;
  }
  .notif-badge.hidden { display: none; }

  /* Notification panel */
  .notif-panel {
    position: fixed; top: 60px; right: 14px; z-index: 1200;
    width: 360px; max-height: calc(100vh - 80px);
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.28);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .notif-panel-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    background: var(--bg3);
  }
  .notif-panel-header h4 { margin: 0; font-size: 14px; font-weight: 700; flex: 1; }
  .notif-panel-body { overflow-y: auto; flex: 1; }
  .notif-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.1s;
  }
  .notif-item:hover { background: var(--bg3); }
  .notif-item:last-child { border-bottom: none; }
  .notif-icon {
    width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
  }
  .notif-icon.alta    { background: rgba(255,71,87,0.12);  color: var(--danger); }
  .notif-icon.media   { background: rgba(240,165,0,0.12);  color: var(--accent); }
  .notif-icon.baja    { background: rgba(30,144,255,0.12); color: var(--info); }
  .notif-item-body { flex: 1; min-width: 0; }
  .notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .notif-item-detail { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .notif-item-count {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 12px; padding: 2px 8px; font-size: 11px;
    font-weight: 700; color: var(--text2); flex-shrink: 0; align-self: center;
  }
  .notif-item-dismiss {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text3);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0; align-self: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    font-size: 11px;
    padding: 0;
  }
  .notif-item-dismiss:hover {
    background: rgba(255,71,87,0.12);
    color: var(--danger);
    border-color: rgba(255,71,87,0.35);
  }
  .notif-empty { padding: 32px 16px; text-align: center; color: var(--text3); }
  .notif-panel-footer {
    padding: 10px 16px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg3);
  }

  /* Notif config in accordion */
  .notif-estado-row {
    display: grid; grid-template-columns: 1fr auto auto; align-items: center;
    gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
  }
  .notif-estado-row:last-child { border-bottom: none; }
  .notif-estado-row .estado-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
  .notif-horas-input { width: 72px; text-align: center; padding: 6px 8px; font-size: 13px; }

  .page { display: none; }
  .page.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 32px;
  }
  .page-header { flex-shrink: 0; }
  .page-content {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .page-content > .table-card { flex: 1; min-height: 0; }

  /* Suppress transitions during page/panel show to prevent flickering */
  .notransition,
  .notransition * {
    transition: none !important;
  }

  /* ===== DASHBOARD ===== */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
  }

  .stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
  }
  .stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }

  .stat-card::before {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: 0.06;
  }

  .stat-card.orange::before { background: var(--accent); }
  .stat-card.teal::before { background: var(--accent3); }
  .stat-card.red::before { background: var(--danger); }
  .stat-card.purple::before { background: var(--purple); }

  .stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
  }
  .stat-icon.orange { background: rgba(240,165,0,0.15); color: var(--accent); }
  .stat-icon.teal { background: rgba(0,212,170,0.15); color: var(--accent3); }
  .stat-icon.red { background: rgba(255,71,87,0.15); color: var(--danger); }
  .stat-icon.purple { background: rgba(168,85,247,0.15); color: var(--purple); }

  .stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 6px;
  }

  .stat-label { font-size: 13px; color: var(--text2); margin-bottom: 12px; }

  .stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .stat-change.up { color: var(--success); }
  .stat-change.down { color: var(--danger); }

  .dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }

  .widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: clip;
  }

  .widget-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .widget-title {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
  }

  .widget-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
  }
  .wb-orange { background: rgba(240,165,0,0.15); color: var(--accent); }
  .wb-teal { background: rgba(0,212,170,0.15); color: var(--accent3); }

  .chart-area {
    padding: 20px 24px 24px;
  }

  /* Simple bar chart via CSS */
  .bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
  }

  .bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
  }

  .bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: var(--accent);
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
    position: relative;
  }
  .bar:hover { opacity: 1; transform: scaleY(1.03); transform-origin: bottom; }
  .bar.teal { background: var(--accent3); }

  .bar-label { font-size: 10px; color: var(--text3); }

  .recent-list { padding: 0 24px 24px; }

  .recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .recent-item:last-child { border-bottom: none; }

  .ri-avatar {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg3);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
  }

  .ri-name { font-size: 13px; font-weight: 500; }
  .ri-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
  .ri-price {
    margin-left: auto;
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent3);
  }

  .status-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .sp-pending { background: rgba(240,165,0,0.15); color: var(--accent); }
  .sp-done { background: rgba(46,213,115,0.15); color: var(--success); }
  .sp-progress { background: rgba(30,144,255,0.15); color: var(--info); }
  .sp-delivered { background: rgba(0,212,170,0.15); color: var(--accent3); }
  .sp-cancelled { background: rgba(255,71,87,0.15); color: var(--danger); }

  .status-pill.clickable { cursor: pointer; }
  .status-pill.clickable::after { content: ' ▾'; opacity: 0.6; font-size: 9px; }
  .status-pill.clickable:hover { filter: brightness(1.15); }

  .status-popover {
    position: fixed; z-index: 9999;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    padding: 6px; min-width: 190px; display: none;
  }
  .status-popover.open { display: block; }
  .status-popover-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 6px; cursor: pointer;
    font-size: 13px; color: var(--text2); transition: background 0.12s;
  }
  .status-popover-item:hover { background: var(--bg2); color: var(--text); }
  .status-popover-item.current { opacity: 0.4; cursor: default; pointer-events: none; }
  .status-popover-item .sp-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }

  .sd-status-selector {
    display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px;
  }
  .sd-status-btn {
    cursor: pointer; padding: 4px 11px; border-radius: 20px; font-size: 10px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    border: 2px solid transparent; transition: filter 0.12s, transform 0.1s, border-color 0.12s;
    opacity: 0.45;
  }
  .sd-status-btn:hover { filter: brightness(1.15); opacity: 0.75; transform: scale(1.05); }
  .sd-status-btn.active { opacity: 1; border-color: currentColor; }

  .donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 24px;
  }

  .donut-svg { width: 120px; height: 120px; }

  .donut-legend { display: flex; flex-direction: column; gap: 10px; }
  .dl-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
  .dl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .dl-label { color: var(--text2); }
  .dl-val { font-weight: 600; margin-left: auto; font-size: 13px; }

  /* ===== SERVICES MODULE ===== */
  .page-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
  }

  .btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #0a0b0f;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
  }
  .btn-accent:hover { background: #ffc107; box-shadow: 0 6px 16px rgba(240,165,0,0.3); }

  .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
  }
  .btn-outline:hover { border-color: var(--accent); color: var(--accent); }

  /* Modal */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 500;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
  }
  .modal-overlay.open { display: flex; }

  .modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 760px;
    overflow: hidden;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-header {
    padding: 28px 32px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
  }

  .modal-close {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: border-color 0.15s, color 0.15s;
  }
  .modal-close:hover { border-color: var(--danger); color: var(--danger); }

  .modal-body { padding: 28px 32px; }

  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .form-grid .full { grid-column: 1 / -1; }

  .form-group { display: flex; flex-direction: column; gap: 6px; }

  .f-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }

  .f-input, .f-select, .f-textarea {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .f-input:focus, .f-select:focus, .f-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240,165,0,0.08);
  }

  .f-select { appearance: none; cursor: pointer; }
  .f-select option { background: var(--bg3); }

  .f-textarea { resize: vertical; min-height: 80px; }

  /* Garantia checkboxes */
  .garantia-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .garantia-option {
    position: relative;
  }

  .garantia-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .garantia-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
    background: var(--bg3);
    color: var(--text2);
  }

  .garantia-option input:checked + .garantia-label {
    border-color: var(--accent);
    background: rgba(240,165,0,0.1);
    color: var(--accent);
  }

  /* Image upload */
  .img-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
    overflow: hidden;
  }
  .img-upload:hover { border-color: var(--accent); background: rgba(240,165,0,0.03); }
  .img-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
  .img-upload i { font-size: 28px; color: var(--text3); margin-bottom: 8px; display: block; }
  .img-upload p { font-size: 13px; color: var(--text2); }
  .img-upload span { font-size: 11px; color: var(--text3); }

  #preview-img {
    max-height: 80px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: none;
  }

  .modal-footer {
    padding: 20px 32px 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
  }

  /* ===== TABLE ===== */
  .table-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .table-toolbar {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    flex-shrink: 0;
  }

  .search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
  }

  .search-wrap i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    font-size: 14px;
  }

  .search-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px 10px 40px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
  }
  .search-input:focus { border-color: var(--accent); }

  .filter-select {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    color: var(--text2);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
  }
  .filter-select:focus { border-color: var(--accent); }
  .filter-select option { background: var(--bg3); }

  .table-wrap { overflow-x: auto; overflow-y: auto; flex: 1; min-height: 0; }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
  }
  thead th:hover { color: var(--text); }
  thead th .sort-icon { margin-left: 4px; opacity: 0.4; font-style: normal; }
  thead th[data-sort] { cursor: pointer; user-select: none; }
  thead th[data-sort]:hover { color: var(--accent); }
  thead th[data-sort].sort-active .sort-icon { opacity: 1; color: var(--accent); }

  tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
  }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--bg3); }

  tbody td {
    padding: 14px 16px;
    color: var(--text);
    vertical-align: middle;
  }

  .td-name { font-weight: 500; }
  .td-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }

  .td-actions { display: flex; gap: 8px; }

  .act-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  }
  .act-btn.edit:hover { border-color: var(--info); color: var(--info); background: rgba(30,144,255,0.1); }
  .act-btn.del:hover { border-color: var(--danger); color: var(--danger); background: rgba(255,71,87,0.1); }
  .act-btn.view-btn:hover { border-color: var(--accent3); color: var(--accent3); background: rgba(0,212,170,0.1); }
  .act-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(240,165,0,0.08); }

  /* Badges de método de pago */
  .badge-metodo { display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
  .badge-efectivo     { background:rgba(46,213,115,0.12); color:#2ed573; }
  .badge-tarjeta      { background:rgba(30,144,255,0.12); color:#1e90ff; }
  .badge-transferencia{ background:rgba(168,85,247,0.12); color:#a855f7; }
  .badge-credito      { background:rgba(240,165,0,0.12);  color:#f0a500; }
  .badge-mixto        { background:rgba(255,107,53,0.12); color:#ff6b35; }

  .table-pagination {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text2);
    flex-shrink: 0;
  }

  .pag-btns { display: flex; gap: 4px; }
  .pag-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  }
  .pag-btn:hover:not(:disabled), .pag-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(240,165,0,0.1); }
  .pag-btn.disabled, .pag-btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
  .pag-btns { flex-wrap: wrap; }

  /* ===== REPORTS ===== */
  .report-filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
  }

  .report-filters h3 {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
  }

  .filter-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
  }

  .filter-row .form-group { flex: 1; min-width: 160px; }

  .report-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  .rs-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    position: relative;
    overflow: clip;
  }
  .rs-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
  }
  .rs-card.income::after { background: var(--success); }
  .rs-card.expenses::after { background: var(--danger); }
  .rs-card.profit::after { background: var(--accent3); }
  .rs-card.services::after { background: var(--purple); }

  .rs-label { font-size: 12px; color: var(--text2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
  .rs-value {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 800;
  }
  .rs-card.income .rs-value { color: var(--success); }
  .rs-card.expenses .rs-value { color: var(--danger); }
  .rs-card.profit .rs-value { color: var(--accent3); }
  .rs-card.services .rs-value { color: var(--purple); }

  .report-table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: clip;
  }

  .rtw-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .rtw-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
  }

  .btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,212,170,0.1);
    color: var(--accent3);
    border: 1px solid rgba(0,212,170,0.25);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
  }
  .btn-export:hover { background: rgba(0,212,170,0.2); }

  /* Confirm dialog */
  .confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 600;
    align-items: center;
    justify-content: center;
  }
  .confirm-overlay.open { display: flex; }

  .confirm-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.2s ease;
  }

  .confirm-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255,71,87,0.1);
    border: 1px solid rgba(255,71,87,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--danger);
    margin: 0 auto 20px;
  }

  .confirm-box h3 {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
  }
  .confirm-box p { font-size: 13px; color: var(--text2); margin-bottom: 28px; }

  .confirm-actions { display: flex; gap: 12px; justify-content: center; }

  .btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 24px;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
  }
  .btn-danger:hover { background: #ff6b7a; }

  /* Toast */
  .toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
  }

  .toast {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
    pointer-events: all;
  }

  @keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
  }

  /* ── Skeleton / loading ─────────────────────────────────────── */
  @keyframes skel-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
  }
  .skel-cell {
    height: 12px; border-radius: 4px; display: inline-block; width: 80%;
    background: linear-gradient(90deg, var(--bg3) 25%, color-mix(in srgb, var(--bg3) 60%, var(--bg2)) 50%, var(--bg3) 75%);
    background-size: 1200px 100%;
    animation: skel-shimmer 1.5s infinite linear;
  }
  .skel-row td { padding: 12px 10px; border-top: 1px solid var(--border); }
  .btn-loading { opacity: .7 !important; pointer-events: none !important; }
  .btn-loading i.fa-spin-on-load { animation: spin .7s linear infinite; }

  .toast i { font-size: 16px; }
  .toast.success { border-left: 3px solid var(--success); }
  .toast.success i { color: var(--success); }
  .toast.error { border-left: 3px solid var(--danger); }
  .toast.error i { color: var(--danger); }
  .toast.info { border-left: 3px solid var(--info); }
  .toast.info i { color: var(--info); }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text3); }

  /* ===== HAMBURGER BUTTON ===== */
  .hamburger-btn {
    display: none;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
  }
  .hamburger-btn:hover { border-color: var(--accent); color: var(--accent); }

  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 99;
  }
  .sidebar-overlay.open { display: block; }

  /* ===== CONFIG TABS ===== */
  .config-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
  }
  .config-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 8px;
    position: sticky;
    top: 96px;
  }
  .config-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px; color: var(--text2);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s; border: 1px solid transparent; margin-bottom: 2px;
  }
  .config-nav-item:hover { background: var(--bg3); color: var(--text); }
  .config-nav-item.active {
    background: rgba(240,165,0,0.12); color: var(--accent);
    border-color: rgba(240,165,0,0.2); font-weight: 500;
  }
  .config-nav-item i { width: 18px; font-size: 14px; text-align: center; }
  .config-section { display: none; }

  /* Config tab bar */
  .cfg-tab {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px; border-radius: var(--radius-sm);
    border: none; cursor: pointer; font-size: 13px; font-family: inherit;
    font-weight: 500; color: var(--text2); background: transparent;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; white-space: nowrap;
  }
  .cfg-tab:hover { background: var(--bg3); color: var(--text); }
  .cfg-tab.active {
    background: var(--card); color: var(--accent);
    border: 1px solid var(--border);
  }
  .config-section.active { display: block; }

  /* ===== CFG ACCORDION ===== */
  .cfg-collapse {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card); margin-bottom: 8px; overflow: hidden;
  }
  .cfg-collapse-header {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; cursor: pointer; user-select: none;
    transition: background 0.15s;
  }
  .cfg-collapse-header:hover { background: var(--bg3); }
  .cfg-collapse-icon {
    width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
  }
  .cfg-collapse-chevron { color: var(--text3); font-size: 12px; transition: transform 0.3s ease; margin-left: auto; }
  .cfg-collapse.open > .cfg-collapse-header .cfg-collapse-chevron { transform: rotate(180deg); }
  .cfg-collapse-body {
    display: block;
    border-top: 0px solid var(--border);
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease, border-top-width 0.25s ease;
  }
  .cfg-collapse.open > .cfg-collapse-body {
    max-height: 3000px;
    padding: 24px 24px 20px;
    border-top-width: 1px;
  }
  /* Toggles compactos para configuración del ticket */
  .cfg-tk-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
  }
  .cfg-tk-toggle:last-child { border-bottom: none; }
  .cfg-tk-toggle input[type="checkbox"] { flex-shrink: 0; }
  .cfg-tk-toggle i { width: 16px; color: var(--text3); font-size: 12px; }
  .cfg-tk-toggle:hover { color: var(--text); }
  /* ===== NAV SUB-ITEM ===== */
  .nav-sub-item {
    padding-left: 36px !important;
    font-size: 13px !important;
  }
  .nav-sub-item i { font-size: 12px !important; }

  /* ===== IMPORT PAGE ===== */
  .imp-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--bg);
  }
  .imp-drop-zone:hover, .imp-drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(240,165,0,.05);
  }
  .imp-stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 110px;
    flex: 1;
  }
  .imp-stat-num { font-size: 28px; font-weight: 800; font-family: 'Syne', sans-serif; }
  .imp-stat-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .8px; }
  .imp-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; padding: 3px 9px;
    border-radius: 99px; white-space: nowrap;
  }
  .imp-badge.nuevo     { background: rgba(46,213,115,.15); color: #2ed573; }
  .imp-badge.actualizar{ background: rgba(240,165,0,.15);  color: #f0a500; }
  .imp-badge.sin_cambio{ background: rgba(150,150,150,.12);color: var(--text3); }
  .imp-badge.error     { background: rgba(255,71,87,.15);  color: var(--danger); }
  .imp-change-pill {
    display: inline-block; font-size: 10px; background: rgba(240,165,0,.12);
    color: var(--accent); border-radius: 4px; padding: 1px 5px; margin: 1px;
  }

  .cfg-section-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 6px;
  }
  .cfg-section-sep span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text3);
    white-space: nowrap;
  }
  .cfg-section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  /* ===== SERVICE DETAIL MODAL ===== */
  .sd-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
  .sd-section:last-child { border-bottom: none; }
  .sd-section-title { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text2); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
  .sd-section-title i { color: var(--accent); font-size: 14px; }
  .sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
  .sd-grid .full { grid-column: 1 / -1; }
  .sd-field { }
  .sd-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); margin-bottom: 4px; }
  .sd-value { font-size: 14px; color: var(--text); line-height: 1.4; }
  .sd-value.accent { color: var(--accent); font-weight: 700; font-size: 16px; }
  .sd-value.muted { color: var(--text3); font-style: italic; }
  .sd-img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 8px; }
  .btn-success { background: var(--success); color: #fff; border: none; border-radius: var(--radius-sm); padding: 13px 24px; font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
  .btn-success:hover { filter: brightness(1.1); }

  /* Ticket template dropdown */
  .ticket-dropdown { position: relative; display: inline-block; }
  .ticket-dropdown-btn { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 13px 24px; font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
  .ticket-dropdown-btn:hover { filter: brightness(1.1); }
  .ticket-dropdown-menu { display: none; position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); z-index: 1001; overflow: hidden; }
  .ticket-dropdown-menu.open { display: block; }
  .ticket-dropdown-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 16px; background: none; border: none; color: var(--text); font-size: 14px; font-family: 'Syne', sans-serif; cursor: pointer; text-align: left; transition: background .15s; }
  .ticket-dropdown-menu button:hover { background: var(--hover); }
  .ticket-dropdown-menu button i { color: var(--accent); font-size: 13px; }

  /* ===== COLUMN PRIORITY (responsive tables) ===== */
  @media (max-width: 1400px) {
    .col-priority-5 { display: none !important; }
  }
  @media (max-width: 1200px) {
    .col-priority-2 { display: none !important; }
  }

  /* ===== RESPONSIVE: TABLET (≤900px) ===== */
  @media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .report-summary { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: 1; }
    .login-brand { display: none; }
    .login-grid { grid-template-columns: 1fr; max-width: 480px; }
    .col-priority-3 { display: none !important; }
    .profile-layout { grid-template-columns: 1fr !important; }
    .config-layout { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; min-height: 0; }
    .pos-right { min-height: 400px; }
    .config-sidebar {
      position: static; display: flex; gap: 4px;
      padding: 8px; overflow-x: auto;
    }
    .config-nav-item { white-space: nowrap; margin-bottom: 0; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .search-wrap { min-width: unset; width: 100%; }
  }

  /* ===== RESPONSIVE: MOBILE (≤768px) ===== */
  @media (max-width: 768px) {
    .hamburger-btn { display: flex; }
    .sidebar {
      transform: translateX(-100%);
      transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .page.active { padding: 16px; }
    .page-content > .table-card { flex: 1; min-height: 0; }
    .page-header {
      flex-direction: column; align-items: stretch; gap: 12px;
    }
    .page-header .btn-accent,
    .page-header .btn-export {
      width: 100%; justify-content: center; text-align: center;
    }
    .modal-overlay { padding: 16px 8px; }
    .modal { border-radius: 14px; }
    .sandbox-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .pos-layout { gap: 12px; }
    .pos-cobrar-btn { font-size: 16px; padding: 14px; }
  }

  .pos-ac-item:hover { background: var(--bg2); }

  /* ===== RESPONSIVE: SMALL MOBILE (≤640px) ===== */
  @media (max-width: 640px) {
    .col-priority-4 { display: none !important; }
    .stats-grid { grid-template-columns: 1fr; }
    .report-summary { grid-template-columns: 1fr; }
  }

  .empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text3);
  }
  .empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
  .empty-state p { font-size: 14px; }

  .modal-section-label {
    font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1px;
    color:var(--accent);margin-bottom:12px;margin-top:4px;
    display:flex;align-items:center;gap:7px;
    padding-bottom:8px;border-bottom:1px solid var(--border);
  }

  /* Autocomplete dropdown */
  .autocomplete-wrap { position: relative; }
  .autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
  }
  .autocomplete-list.show { display: block; }
  .autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
  }
  .autocomplete-item:last-child { border-bottom: none; }
  .autocomplete-item:hover { background: var(--bg3); }
  .autocomplete-item .ac-name { font-weight: 500; color: var(--text); }
  .autocomplete-item .ac-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
  .autocomplete-item.ac-new { color: var(--accent); font-style: italic; }

  /* Permisos table */
  .permisos-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .permisos-table th, .permisos-table td { padding: 10px 14px; text-align: center; border-bottom: 1px solid var(--border); }
  .permisos-table th:first-child, .permisos-table td:first-child { text-align: left; }
  .permisos-table th { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg3); }
  .permisos-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

  /* Tipo badge */
  .tipo-badge { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
  .tipo-root { background: rgba(168,85,247,0.15); color: var(--purple); }
  .tipo-admin { background: rgba(240,165,0,0.15); color: var(--accent); }
  .tipo-empleado { background: rgba(30,144,255,0.15); color: var(--info); }

  .text-right { text-align: right; }
  .font-mono { font-family: monospace; }
  .text-accent { color: var(--accent); }
  .text-success { color: var(--success); }
  .text-danger { color: var(--danger); }
  .text-muted { color: var(--text2); }
  .fw-bold { font-weight: 600; }

  /* ===== POS TERMINAL ===== */
  .pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    flex: 1;
    min-height: 0;
  }
  .pos-left { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
  #pos-panel-productos { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 12px; overflow: hidden; }
  .pos-tables-wrapper { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
  .pos-table-label {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 14px; border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text2); flex-shrink: 0;
  }
  .pos-scan-bar {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    display: flex; gap: 12px; align-items: center;
  }
  .pos-scan-input {
    flex: 1; width: 100%; background: var(--bg3); border: 2px solid var(--accent);
    border-radius: var(--radius-sm); padding: 14px 18px 14px 44px;
    color: var(--text); font-family: 'DM Sans', sans-serif;
    font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  }
  .pos-scan-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(240,165,0,0.15); }
  .pos-scan-input::placeholder { color: var(--text3); }
  .pos-items-table {
    flex: 1; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column; min-height: 0;
  }
  .pos-items-table .table-wrap { flex: 1; overflow-y: auto; min-height: 0; }
  .pos-right {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
  }
  .pos-summary { padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; justify-content: space-between; }
  .pos-summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--text2); }
  .pos-summary-row.total {
    font-size: 24px; font-family: 'Syne', sans-serif; font-weight: 800;
    color: var(--text); padding-top: 12px; border-top: 2px solid var(--border);
  }
  .pos-summary-row.total .pos-amount { color: var(--accent); }
  .pos-amount { font-family: 'Syne', sans-serif; font-weight: 700; }
  .pos-payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pos-pay-btn {
    padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg3); color: var(--text2); cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  }
  .pos-pay-btn:hover { border-color: var(--accent); color: var(--text); }
  .pos-pay-btn.selected { border-color: var(--accent); background: rgba(240,165,0,0.12); color: var(--accent); font-weight: 600; }
  .pos-credit-fields {
    display: none; flex-direction: column; gap: 12px; padding: 12px;
    background: rgba(240,165,0,0.04); border: 1px solid rgba(240,165,0,0.15);
    border-radius: var(--radius-sm);
  }
  .pos-credit-fields.show { display: flex; }
  .pos-cobrar-btn {
    background: var(--accent); color: #0a0b0f; border: none;
    border-radius: var(--radius-sm); padding: 16px; width: 100%;
    font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
    cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s; letter-spacing: 0.5px;
  }
  .pos-cobrar-btn:hover { background: #ffc107; box-shadow: 0 8px 24px rgba(240,165,0,0.4); transform: translateY(-1px); }
  .pos-qty-input {
    width: 60px; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 8px; color: var(--text);
    font-size: 14px; text-align: center; outline: none;
  }
  .pos-qty-input:focus { border-color: var(--accent); }
  .pos-price-input {
    width: 90px; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 8px; color: var(--accent);
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 14px; text-align: right; outline: none;
  }
  .pos-price-input:focus { border-color: var(--accent); }

  /* Split payment */
  .pos-split-row {
    display: flex; align-items: center; gap: 8px;
  }
  .pos-split-toggle {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
  }
  .pos-split-toggle-btn {
    font-size: 12px; padding: 5px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg3); color: var(--text2);
    cursor: pointer; transition: border-color 0.15s, color 0.15s, background-color 0.15s; display: flex; align-items: center; gap: 6px;
  }
  .pos-split-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
  .pos-split-toggle-btn.active { border-color: var(--accent); background: rgba(240,165,0,0.12); color: var(--accent); }
  .pos-split-add-btn {
    width: 100%; padding: 8px; border-radius: var(--radius-sm); margin-top: 8px;
    border: 1px dashed var(--border); background: transparent; color: var(--text2);
    cursor: pointer; font-size: 13px; transition: border-color 0.15s, color 0.15s; display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .pos-split-add-btn:hover { border-color: var(--accent); color: var(--accent); }
  .pos-pendiente {
    font-size: 13px; font-weight: 600; padding: 6px 10px;
    border-radius: var(--radius-sm); background: var(--bg3);
    text-align: center;
  }


  /* ===== COBRAR SERVICIO MODAL ===== */
  .csrv-info-card { background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; display:flex; flex-direction:column; gap:6px; }
  .csrv-info-row { display:flex; align-items:center; gap:8px; font-size:13px; }
  .csrv-info-label { color:var(--text3); min-width:64px; flex-shrink:0; }
  .csrv-resumen { background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; }
  .csrv-resumen-row { display:flex; justify-content:space-between; font-size:13px; color:var(--text2); padding:3px 0; }
  .csrv-resumen-row.total { font-weight:700; font-size:15px; color:var(--text1); border-top:1px solid var(--border); padding-top:8px; margin-top:4px; }
  .csrv-resumen-row.saldo { font-weight:700; font-size:16px; color:var(--accent); }
  .csrv-pago-hist { max-height:120px; overflow-y:auto; display:flex; flex-direction:column; gap:4px; margin-top:8px; }
  .csrv-pago-item { display:flex; justify-content:space-between; align-items:center; font-size:12px; padding:5px 8px; background:var(--bg3); border-radius:4px; }
  .csrv-search-result { padding:10px 14px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .15s; }
  .csrv-search-result:hover { background:var(--bg3); }
  .csrv-search-result:last-child { border-bottom:none; }
  .csrv-search-list { border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; max-height:280px; overflow-y:auto; }
  .concepto-pill { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; padding:2px 8px; border-radius:20px; }
  .concepto-anticipo   { background:rgba(240,165,0,.15); color:var(--accent); }
  .concepto-saldo      { background:rgba(46,213,115,.15); color:var(--success); }
  .concepto-refaccion  { background:rgba(99,102,241,.15); color:#6366f1; }
  .concepto-mano_obra  { background:rgba(6,182,212,.15);  color:#06b6d4; }
  .concepto-otro       { background:var(--bg3); color:var(--text2); }

  /* Toggle switch */
  .toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 24px; transition: background-color 0.2s, border-color 0.2s;
  }
  .toggle-slider:before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; bottom: 3px;
    background: var(--text3); border-radius: 50%; transition: transform 0.2s, background-color 0.2s;
  }
  .toggle-switch input:checked + .toggle-slider { background: rgba(240,165,0,0.2); border-color: var(--accent); }
  .toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: var(--accent); }

  /* Cortes */
  .corte-bar {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 18px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-shrink: 0; flex-wrap: wrap;
  }
  .corte-bar-info { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
  .corte-stat { display: flex; align-items: center; gap: 6px; font-size: 13px; }
  .corte-stat-val { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--accent); }
  .corte-stat-other { color: var(--text2); }
  .corte-actions { display: flex; align-items: center; gap: 8px; }

  /* Venta success modal */
  .venta-success-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(46,213,115,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--success);
    margin: 0 auto 20px;
  }

  /* Report card variants for POS */
  .rs-card.ventas::after { background: var(--accent); }
  .rs-card.ventas .rs-value { color: var(--accent); }
  .rs-card.tickets::after { background: var(--info); }
  .rs-card.tickets .rs-value { color: var(--info); }
