/* ============================================================
   Autos Paint - Estilos del panel de taller
   Unificado de los 4 bloques <style> del HTML, en su orden original.
   ============================================================ */

/* ---------- Bloque 1 ---------- */
  :root {
    --bg: #F2EFE8;
    --surface: #FDFCF9;
    --surface2: #EDEAE2;
    --border: #DDD9CF;
    --border2: #C9C4B8;
    --text: #1C1A16;
    --text2: #6B6558;
    --text3: #A09890;
    --accent: #C9A227;
    --accent-light: #FBF5E0;
    --accent-dark: #8A6D10;
    --accent2: #C4562A;
    --accent2-light: #FAF0EB;
    --blue: #1B4F8A;
    --blue-light: #EBF1F8;
    --amber: #8A5A1B;
    --amber-light: #F8F2EB;
    --purple: #5A2B8A;
    --purple-light: #F2EBFA;
    --sidebar-bg: #1C1A16;
    --sidebar-accent: #C9A227;
    --shadow: 0 1px 3px rgba(28,26,22,0.1), 0 4px 12px rgba(28,26,22,0.06);
    --radius: 10px;
    --radius-lg: 14px;
    --font: 'DM Sans', sans-serif;
    --mono: 'DM Mono', monospace;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
  }

  /* ── Sidebar ── */
  .layout { display: flex; min-height: 100vh; width: 100%; }

  .sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: #F2EFE8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    padding: 0;
    border-right: 1px solid rgba(201,162,39,0.15);
  }

  .sidebar-logo {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(201,162,39,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .sidebar-logo img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid rgba(201,162,39,0.4);
  }

  .sidebar-logo .logo-texts { display: flex; flex-direction: column; }

  .sidebar-logo .logo-mark {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sidebar-accent);
    opacity: 0.8;
  }

  .sidebar-logo .logo-name {
    font-size: 14px;
    font-weight: 600;
    color: #F2EFE8;
    line-height: 1.2;
  }

  .sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(201,162,39,0.45);
    padding: 0.75rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
  }

  .nav-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(201,162,39,0.45);
    padding: 0.75rem 0.5rem 0.3rem;
    margin-top: 0.5rem;
    text-align: left;
    transition: color 0.15s;
  }
  .nav-group-label:hover { color: rgba(201,162,39,0.75); }
  .nav-group-chevron { font-size: 11px; opacity: 0.8; transition: transform 0.2s; }
  .nav-group-label.collapsed .nav-group-chevron { transform: rotate(-90deg); }

  .nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    max-height: 600px;
    transition: max-height 0.25s ease;
  }
  .nav-group.collapsed { max-height: 0; }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    color: rgba(242,239,232,0.55);
    font-size: 13.5px;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }

  .nav-item:hover { color: #F2EFE8; background: rgba(201,162,39,0.1); }
  .nav-item.active { color: var(--sidebar-accent); background: rgba(201,162,39,0.12); border-left: 2px solid var(--sidebar-accent); padding-left: 8px; }

  .nav-item .nav-icon { font-size: 15px; opacity: 0.8; }
  .nav-item .nav-count {
    margin-left: auto;
    background: var(--accent2);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
  }

  /* ── Main ── */
  .main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; }

  .topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
    border-left: none;
  }

  .topbar-title { font-size: 16px; font-weight: 600; flex: 1; }

  .search-wrap {
    position: relative;
    flex: 1;
    max-width: 360px;
  }

  .search-wrap input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px 7px 34px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text);
    transition: border 0.15s;
  }

  .search-wrap input:focus { outline: none; border-color: var(--border2); }
  .search-wrap .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    font-size: 14px;
    pointer-events: none;
  }

  .btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
  }

  .btn-dark {
    background: var(--accent);
    color: var(--sidebar-bg);
    font-weight: 600;
  }
  .btn-dark:hover { background: #B8911F; }

  .btn-outline {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text);
  }
  .btn-outline:hover { background: var(--surface2); }

  .btn-danger {
    background: transparent;
    border: 1px solid #E0B0A0;
    color: var(--accent2);
    padding: 6px 12px;
    font-size: 12px;
  }
  .btn-danger:hover { background: var(--accent2-light); }

  /* ── Content ── */
  .content { padding: 2rem; flex: 1; }

  /* ── Stats ── */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 1.75rem;
  }

  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s;
  }

  .stat-card:hover { border-color: var(--border2); box-shadow: var(--shadow); }
  .stat-card.active { border-color: var(--accent); background: var(--accent); }
  .stat-card.active .stat-label { color: rgba(28,26,22,0.65); }
  .stat-card.active .stat-value { color: var(--sidebar-bg); }
  .stat-card.active .stat-sub { color: rgba(28,26,22,0.45); }

  .stat-label { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; }
  .stat-value { font-size: 28px; font-weight: 600; line-height: 1; font-family: var(--mono); }
  .stat-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

  /* ── Filter bar ── */
  .filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
  }

  .filter-pill {
    padding: 5px 13px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .filter-pill:hover { border-color: var(--border2); color: var(--text); }
  .filter-pill.active { background: var(--text); border-color: var(--text); color: var(--bg); }

  /* ── Table ── */
  .table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  table { width: 100%; border-collapse: collapse; }

  thead th {
    background: var(--surface2);
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  #th-inspeccion:hover { color: var(--accent); background: var(--accent-light); }

  tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    cursor: pointer;
  }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--bg); }

  td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 13.5px;
  }

  .cell-main { font-weight: 500; }
  .cell-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
  .cell-mono { font-family: var(--mono); font-size: 12.5px; }

  /* ── Badges ── */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
  }
  .badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }

  .badge-gray    { background: var(--surface2); color: var(--text2); }
  .badge-blue    { background: var(--blue-light); color: var(--blue); }
  .badge-amber   { background: var(--amber-light); color: var(--amber); }
  .badge-purple  { background: var(--purple-light); color: var(--purple); }
  .badge-teal    { background: var(--accent-light); color: var(--accent); }
  .badge-green   { background: var(--accent-light); color: var(--accent); border: 1px solid #B8D9C5; }
  .badge-orange  { background: var(--accent2-light); color: var(--accent2); }
  /* ── Progress dots ── */
  .progress-dots { display: flex; gap: 4px; align-items: center; }
  .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
  }
  .dot.done { background: var(--accent); }
  .dot.pending { background: var(--accent2); }

  /* ── Row actions ── */
  .row-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s;
  }
  tbody tr:hover .row-actions { opacity: 1; }

  .act-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text2);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.1s;
  }
  .act-btn:hover { background: var(--accent); color: var(--sidebar-bg); border-color: var(--accent); }

  /* ── Empty state ── */
  .empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text3);
  }
  .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
  .empty-text { font-size: 14px; }

  /* ── Modal ── */
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,24,21,0.5);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    backdrop-filter: blur(2px);
  }
  .overlay.hidden { display: none; }

  .modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(26,24,21,0.2);
    animation: slideUp 0.2s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  .modal-title { font-size: 15px; font-weight: 600; }

  .modal-close {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    transition: all 0.1s;
  }
  .modal-close:hover { background: var(--surface2); color: var(--text); }

  .modal-body { padding: 1.5rem; }

  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-full { grid-column: 1 / -1; }

  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-label { font-size: 11.5px; font-weight: 500; color: var(--text2); letter-spacing: 0.03em; text-transform: uppercase; }

  input[type=text], input[type=date], input[type=tel], textarea, select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border2);
    border-radius: 7px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 13.5px;
    transition: border 0.15s, box-shadow 0.15s;
    outline: none;
  }
  input.pagos-search {
    width: auto;
    flex: 1 1 120px;
    min-width: 70px;
    max-width: 230px;
    margin: 0 10px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 7px;
  }

  input:focus, textarea:focus, select:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 2px rgba(26,24,21,0.08);
  }

  textarea { resize: vertical; min-height: 72px; }

  .section-sep {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }

  .checklist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

  .fact-tri { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 14px; }
  @media (max-width: 600px) { .fact-tri { grid-template-columns: 1fr 1fr; } }

  .check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.1s;
  }
  .check-row:hover { border-color: var(--border2); }
  .check-row.checked { border-color: var(--accent); background: var(--accent-light); }

  .check-row input[type=checkbox] {
    width: 15px; height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  .check-row input:focus { box-shadow: none; border-color: transparent; }

  .check-label { font-size: 13px; color: var(--text); pointer-events: none; }

  .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  /* ── Detail modal ── */
  .detail-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 8px 32px rgba(26,24,21,0.2);
    animation: slideUp 0.2s ease;
  }

  .detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
  }

  .detail-id { font-family: var(--mono); font-size: 12px; color: var(--text3); margin-bottom: 4px; }
  .detail-name { font-size: 20px; font-weight: 600; }
  .detail-vehicle { font-size: 14px; color: var(--text2); margin-top: 3px; }

  .detail-grid { padding: 1.25rem 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

  .detail-field { }
  .detail-field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-bottom: 3px; }
  .detail-field-val { font-size: 14px; }

  .stage-grid {
    padding: 0 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .stage-item {
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
  }
  .stage-item.done { background: var(--accent-light); border-color: #B8D9C5; }
  .stage-item.pending { background: var(--bg); }

  .stage-icon { font-size: 16px; margin-bottom: 4px; }
  .stage-name { font-size: 12px; font-weight: 500; color: var(--text2); }
  .stage-item.done .stage-name { color: var(--accent); }
  .stage-status { font-size: 11px; color: var(--text3); margin-top: 2px; }
  .stage-item.done .stage-status { color: #5A9C78; }

  /* ── Scrollbar ── */
  ::-webkit-scrollbar { width: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

  /* ── Responsive tablet ── */
  @media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* ── Móvil completo ── */
  @media (max-width: 768px) {

    /* Ocultar sidebar de escritorio */
    .sidebar { display: none !important; }
    .main { margin-left: 0 !important; }

    /* Topbar móvil — dos líneas */
    .topbar {
      padding: 0.75rem 0.875rem 0.5rem;
      position: fixed;
      top: 0; left: 0; right: 0;
      z-index: 40;
      flex-wrap: wrap;
      gap: 8px;
    }
    .topbar-title { display: none; }

    /* Buscador ocupa toda la primera línea */
    .search-wrap {
      order: 1;
      flex: 1 1 100%;
      max-width: 100%;
    }
    .search-wrap input { font-size: 14px; padding: 9px 12px 9px 34px; }

    /* Segunda línea: campana + botón nuevo turno juntos */
    #notif-wrap { order: 2; flex-shrink: 0; }
    #btn-nuevo-wrap { order: 2; flex: 1; }
    #btn-nuevo {
      width: 100%;
      padding: 11px;
      font-size: 15px;
      font-weight: 700;
      border-radius: 10px;
      text-align: center;
      justify-content: center;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    #nuevo-menu { left: 0; right: 0; width: 100%; }

    /* Panel de notificaciones centrado en móvil */
    #notif-panel {
      position: fixed !important;
      left: 12px !important;
      right: 12px !important;
      top: auto !important;
      width: auto !important;
      max-height: 70vh;
      overflow-y: auto;
    }

    /* Contenido — espacio para topbar (2 líneas ~100px) + navbar inferior */
    .content { padding: 7rem 0.75rem calc(6.5rem + env(safe-area-inset-bottom)); }

    /* Stats en móvil — 2 columnas, compactas */
    .stats-grid {
      display: grid !important;
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 8px;
      margin-bottom: 1rem;
    }
    .stat-card { padding: 10px 12px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 10px; }
    .stat-sub { font-size: 10px; }

    /* Ocultar tabla desktop */
    #section-table { display: none !important; }

    /* Mostrar vista móvil */
    #mobile-view { display: block !important; }

    /* Calendario en móvil — mismo formato que PC pero compacto */
    #section-calendario.mobile-visible { display: block !important; }
    #section-calendario { padding: 0; overflow-x: hidden; }
    #section-calendario .cal-header { margin-bottom: 0.5rem; }
    #section-calendario .cal-month-title { font-size: 14px; }
    #section-calendario .cal-nav { width: 28px; height: 28px; font-size: 14px; }
    #section-calendario .cal-grid {
      gap: 1px;
      grid-template-columns: repeat(7, 1fr);
    }
    #section-calendario .cal-dow {
      font-size: 8px;
      padding: 2px 0 3px;
      letter-spacing: 0;
    }
    #section-calendario .cal-cell {
      min-height: 44px;
      padding: 3px 2px;
      border-radius: 4px;
      border-width: 1px;
    }
    #section-calendario .cal-day-num {
      font-size: 10px;
      margin-bottom: 1px;
      font-weight: 600;
    }
    #section-calendario .cal-turno-chip {
      font-size: 7px;
      padding: 1px 2px;
      border-radius: 2px;
      margin-bottom: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
    #section-calendario .cal-more { font-size: 8px; }
    #section-calendario #cal-day-detail { margin-top: 0.75rem; }
    #section-calendario .cal-day-title { font-size: 13px; }
    #section-calendario .cal-event-card { padding: 8px 10px; }
    #section-calendario .cal-event-name { font-size: 13px; }
    #section-calendario .cal-event-sub { font-size: 11px; }

    /* Navbar inferior */
    #mobile-nav { display: flex !important; }

    /* Modales full bottom sheet */
    .overlay { padding: 0; align-items: flex-end; background: rgba(0,0,0,0.5); }
    .modal {
      border-radius: 20px 20px 0 0;
      max-width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      animation: slideUpModal 0.25s ease;
    }
    .detail-modal {
      border-radius: 20px 20px 0 0;
      max-width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      animation: slideUpModal 0.25s ease;
    }
    @keyframes slideUpModal {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }

    /* Status popover full width en móvil */
    #status-popover {
      left: 8px !important;
      right: 8px !important;
      width: auto !important;
      bottom: 70px;
      top: auto !important;
    }
  }

  /* ── Tarjetas móvil ── */
  .mobile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .mobile-card-left { flex: 1; min-width: 0; }
  .mobile-patente {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.05em;
  }
  .mobile-vehiculo {
    font-size: 13px;
    color: var(--text2);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-compania {
    font-size: 12px;
    color: var(--accent-dark);
    font-weight: 500;
    margin-top: 2px;
  }
  .mobile-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
  }
  .mobile-eye-btn {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text2);
  }

  /* ── Navbar inferior ── */
  #mobile-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--sidebar-bg);
    border-top: 1px solid rgba(201,162,39,0.2);
    z-index: 50;
    padding: 2px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .mnav-grid {
    display: grid;
    gap: 0;
  }
  .mnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 12px 5px;
    background: none;
    border: none;
    color: rgba(242,239,232,0.45);
    font-family: var(--font);
    font-size: 10px;
    cursor: pointer;
    transition: color 0.15s;
  }
  .mnav-btn.active { color: var(--accent); }
  .mnav-btn span { font-size: 12px; line-height: 1.2; text-align: center; }

  /* ── Calendario ── */
  .cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:1.25rem; }
  .cal-month-title { font-size:18px; font-weight:600; text-transform:capitalize; }
  .cal-nav {
    background:var(--surface); border:1px solid var(--border); border-radius:8px;
    width:34px; height:34px; font-size:18px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    transition:all 0.12s; color:var(--text2);
  }
  .cal-nav:hover { background:var(--surface2); color:var(--text); }
  .cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
  .cal-dow {
    text-align:center; font-size:11px; font-weight:600;
    letter-spacing:0.07em; text-transform:uppercase;
    color:var(--text3); padding:4px 0 8px;
  }
  .cal-cell {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--radius); min-height:80px; padding:8px;
    cursor:pointer; transition:all 0.12s;
  }
  .cal-cell:hover { border-color:var(--border2); box-shadow:var(--shadow); }
  .cal-cell.empty { background:transparent; border-color:transparent; cursor:default; pointer-events:none; }
  .cal-cell.today { border-color:var(--accent); background:var(--accent-light); }
  .cal-cell.selected { border-color:var(--text); background:var(--text); }
  .cal-cell.has-turnos { border-color:var(--blue); }
  .cal-cell.weekend {
    background: var(--surface2);
    border-color: transparent;
    cursor: default;
    pointer-events: none;
  }
  .cal-cell.weekend .cal-day-num { color: var(--text3); opacity: 0.5; }
  .cal-day-num { font-size:13px; font-weight:600; color:var(--text2); margin-bottom:5px; }
  .cal-cell.today .cal-day-num { color:var(--accent); }
  .cal-cell.selected .cal-day-num { color:var(--bg); }
  .cal-turno-chip {
    background:var(--blue-light); color:var(--blue); border-radius:4px;
    font-size:10px; font-weight:500; padding:2px 5px; margin-bottom:3px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block;
  }
  .cal-cell.selected .cal-turno-chip { background:rgba(255,255,255,0.15); color:rgba(244,241,236,0.9); }
  .cal-more { font-size:10px; color:var(--text3); margin-top:2px; }
  .cal-cell.selected .cal-more { color:rgba(244,241,236,0.5); }
  .cal-day-title {
    font-size:15px; font-weight:600; margin-bottom:12px;
    text-transform:capitalize; padding-bottom:10px; border-bottom:1px solid var(--border);
  }
  .cal-event-card {
    background:var(--surface); border:1px solid var(--border);
    border-left:3px solid var(--blue); border-radius:var(--radius);
    padding:10px 14px; margin-bottom:8px;
    display:flex; align-items:center; justify-content:space-between; gap:1rem;
    cursor:pointer; transition:all 0.12s;
  }
  .cal-event-card:hover { box-shadow:var(--shadow); border-left-color:var(--blue); }
  .cal-event-name { font-weight:500; font-size:14px; }
  .cal-event-sub { font-size:12px; color:var(--text3); margin-top:2px; }

  .ingreso-btn {
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 7px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--border2);
    transition: all 0.12s;
  }
  .ingreso-btn.ingreso-no { background: var(--surface); color: var(--text2); }
  .ingreso-btn.ingreso-no:hover { border-color: #6FAE85; color: #2E7D4F; background: #EAF5EE; }
  .ingreso-btn.ingreso-si { background: #EAF5EE; color: #2E7D4F; border-color: #B8D9C5; }
  .ingreso-btn.ingreso-si:hover { background: #DCEEE2; }
  .cal-event-card.ingresado { border-left-color: #2E7D4F !important; }
  .cal-turno-chip.chip-ingresado { background:#EAF5EE; color:#2E7D4F; }

/* ---------- Bloque 2 ---------- */
          .midia-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
          @media(max-width:680px){ .midia-grid{grid-template-columns:1fr;} }
          .midia-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:18px 20px; }
          .midia-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
          .midia-card-title { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.08em; color:var(--text3); }
          .midia-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
          .midia-stat { background:var(--surface2); border-radius:var(--radius); padding:10px 12px; text-align:center; }
          .midia-stat-num { font-size:24px; font-weight:600; font-family:var(--mono); }
          .midia-stat-lbl { font-size:11px; color:var(--text3); margin-top:2px; }
          .midia-prog-bar { height:8px; background:var(--surface2); border-radius:4px; overflow:hidden; margin-bottom:6px; }
          .midia-prog-fill { height:100%; background:#3D2F8F; border-radius:4px; transition:width 0.4s ease; }
          .midia-prog-lbl { font-size:12px; color:var(--text3); display:flex; justify-content:space-between; }
          .midia-task-item { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
          .midia-task-item:last-child { border-bottom:none; }
          .midia-task-cb { width:16px; height:16px; accent-color:#3D2F8F; cursor:pointer; flex-shrink:0; }
          .midia-task-text { flex:1; font-size:13.5px; }
          .midia-task-text.done { text-decoration:line-through; color:var(--text3); }
          .midia-prio { font-size:10px; padding:2px 7px; border-radius:10px; font-weight:600; }
          .midia-prio-alta  { background:#FDF0EC; color:#C53B1E; }
          .midia-prio-media { background:#FEF4E3; color:#A0650A; }
          .midia-prio-baja  { background:#EBF6EF; color:#2E7D4F; }
          .midia-add-row { display:flex; gap:8px; margin-top:14px; }
          .midia-add-row input { flex:1; }
          .midia-add-row select { width:100px; }
          .midia-note-item { padding:9px 0; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
          .midia-note-item:last-child { border-bottom:none; }
          .midia-note-text { font-size:13.5px; flex:1; }
          .midia-note-time { font-size:11px; color:var(--text3); white-space:nowrap; }
          .midia-del { background:none; border:none; cursor:pointer; color:var(--text3); font-size:14px; padding:2px 4px; }
          .midia-del:hover { color:var(--accent2); }
          .midia-close-btn { background:#3D2F8F; color:white; border:none; padding:9px 18px; border-radius:8px; font-family:var(--font); font-size:13px; font-weight:500; cursor:pointer; transition:opacity 0.15s; }
          .midia-close-btn:hover { opacity:0.85; }
          .midia-hist-btn { background:transparent; border:1px solid var(--border2); color:var(--text2); padding:9px 14px; border-radius:8px; font-family:var(--font); font-size:13px; cursor:pointer; }
          .midia-hist-btn:hover { background:var(--surface2); }
          .midia-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-top:12px; }
          .midia-cal-dow { text-align:center; font-size:11px; color:var(--text3); font-weight:600; padding:4px 0; }
          .midia-cal-day { text-align:center; padding:6px 4px; border-radius:6px; font-size:13px; cursor:default; position:relative; }
          .midia-cal-day.has-rec { background:rgba(61,47,143,0.1); cursor:pointer; font-weight:500; color:#3D2F8F; }
          .midia-cal-day.is-today { border:2px solid #3D2F8F; font-weight:600; }
          .midia-empty { text-align:center; padding:2rem; color:var(--text3); font-size:13px; }
        

/* ---------- Bloque 3 ---------- */
  /* ── Cobro de seguro (transferencia) ── */
  .cs-list {
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface2);
  }
  .cs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
  }
  .cs-row:last-child { border-bottom: none; }
  .cs-row:hover { background: var(--accent-light); }
  .cs-row.checked { background: var(--accent-light); }
  .cs-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent-dark); flex-shrink: 0; cursor: pointer; }
  .cs-row .cs-main { flex: 1; min-width: 0; }
  .cs-row .cs-pat { font-weight: 600; font-size: 13px; color: var(--text); }
  .cs-row .cs-sub { font-size: 11.5px; color: var(--text2); margin-top: 1px; }
  .cs-row .cs-neto { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
  .cs-empty { padding: 18px 12px; text-align: center; color: var(--text3); font-size: 12.5px; }
  .cs-tally {
    margin-top: 12px;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12.5px;
  }
  .cs-tally .cs-tally-row { display: flex; justify-content: space-between; padding: 2px 0; }
  .cs-tally .cs-tally-row.dif { border-top: 1px dashed var(--border2); margin-top: 5px; padding-top: 6px; font-weight: 600; }
  .cs-tally .cs-mono { font-family: var(--mono); }

  /* ── Ficha de ingreso / gasto ── */
  .ingd-hero { text-align: center; padding: 6px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
  .ingd-hero .ingd-monto { font-family: var(--mono); font-size: 30px; font-weight: 600; }
  .ingd-hero .ingd-monto.ing { color: var(--accent-dark); }
  .ingd-hero .ingd-monto.gas { color: var(--accent2); }
  .ingd-hero .ingd-concepto { font-size: 14px; color: var(--text2); margin-top: 4px; }
  .ingd-field { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .ingd-field:last-child { border-bottom: none; }
  .ingd-field .ingd-k { color: var(--text2); font-weight: 500; flex-shrink: 0; }
  .ingd-field .ingd-v { color: var(--text); text-align: right; word-break: break-word; }
  .ingd-field .ingd-v.mono { font-family: var(--mono); }
  .ingd-sub-title { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text3); margin: 16px 0 6px; }
  .ingd-sin { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .ingd-sin-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s; }
  .ingd-sin-row:last-child { border-bottom: none; }
  .ingd-sin-row:hover { background: var(--accent-light); }
  .ingd-sin-row .ingd-sin-main { flex: 1; min-width: 0; }
  .ingd-sin-row .ingd-sin-pat { font-weight: 600; font-size: 13px; }
  .ingd-sin-row .ingd-sin-sub { font-size: 11.5px; color: var(--text2); margin-top: 1px; }
  .ingd-sin-row .ingd-sin-neto { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

  /* ── Pagos ── */
  .pagos-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 1.75rem;
  }
  .pagos-sum-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
  }
  .pagos-sum-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text2); margin-bottom: 6px; }
  .pagos-sum-value { font-size: 26px; font-weight: 600; font-family: var(--mono); }
  .pagos-sum-card.ing .pagos-sum-value { color: var(--accent); }
  .pagos-sum-card.gas .pagos-sum-value { color: var(--accent2); }
  .pagos-sum-card.bal .pagos-sum-value { }
  .pagos-sum-card.bal.pos .pagos-sum-value { color: var(--accent); }
  .pagos-sum-card.bal.neg .pagos-sum-value { color: var(--accent2); }

  .pagos-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
  @media (max-width: 700px) { .pagos-cols { grid-template-columns: 1fr; } .pagos-summary { grid-template-columns: 1fr; } }

  .pagos-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .pagos-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
  }
  .pagos-col-title { font-size: 14px; font-weight: 600; }
  .pagos-col-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

  .mov-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 11px 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    transition: background 0.1s;
  }
  .mov-item:last-child { border-bottom: none; }
  .mov-item:hover { background: var(--bg); }
  .mov-concepto { font-size: 13.5px; font-weight: 500; }
  .mov-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; display: flex; gap: 8px; }
  .mov-cat-tag {
    font-size: 11px; padding: 1px 7px; border-radius: 10px;
    background: var(--surface2); color: var(--text2); border: 1px solid var(--border);
  }
  .mov-monto-ing { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; font-family: var(--mono); }
  .mov-monto-gas { font-size: 14px; font-weight: 600; color: var(--accent2); white-space: nowrap; font-family: var(--mono); }
  .mov-del {
    background: none; border: none; cursor: pointer; color: var(--text3);
    font-size: 14px; padding: 2px 4px; border-radius: 4px; transition: color 0.1s;
    flex-shrink: 0;
  }
  .mov-del:hover { color: var(--accent2); }
  .mov-auto-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; background: var(--blue-light); color: var(--blue); padding: 1px 6px; border-radius: 8px; margin-left: 6px; white-space: nowrap; }
  .pagos-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text3); font-size: 13px; }

/* ---------- Bloque 4 ---------- */
@keyframes popIn {
  from { transform: scale(0.95) translateY(-4px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── Cuentas pendientes ── */
.cuenta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.cuenta-item:last-child { border-bottom: none; }
.cuenta-item:hover { background: var(--bg); }
.cuenta-item.saldada { opacity: 0.45; }

.cuenta-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; margin-top: 2px;
  transition: all 0.15s; font-size: 11px; color: transparent;
  background: transparent;
}
.cuenta-check:hover { border-color: var(--accent); }
.cuenta-check.pagada  { background: var(--accent2); border-color: var(--accent2); color: white; }
.cuenta-check.cobrada { background: var(--accent);  border-color: var(--accent);  color: white; }

.cuenta-main { flex: 1; min-width: 0; }
.cuenta-quien    { font-size: 13.5px; font-weight: 600; }
.cuenta-concepto { font-size: 13px; color: var(--text2); margin-top: 1px; }
.cuenta-meta     { font-size: 11.5px; color: var(--text3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cuenta-cat-tag  { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.cuenta-vencido  { color: var(--accent2); font-weight: 500; }
.cuenta-hoy      { color: var(--amber);   font-weight: 500; }

.cuenta-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.cuenta-monto-pagar  { font-size: 14px; font-weight: 600; color: var(--accent2); font-family: var(--mono); }
.cuenta-monto-cobrar { font-size: 14px; font-weight: 600; color: var(--accent);  font-family: var(--mono); }
.cuenta-del { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 13px; padding: 2px 4px; border-radius: 4px; }
.cuenta-del:hover { color: var(--accent2); }

.cuentas-mini-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 2px;
}
.cuentas-mini-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); margin-bottom: 3px; }
.cuentas-mini-value { font-size: 18px; font-weight: 600; font-family: var(--mono); }
.sp-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s;
  background: var(--bg);
  user-select: none;
}
.sp-step:hover { border-color: var(--border2); }
.sp-step.done { background: var(--accent-light); border-color: #B8D9C5; }
.sp-step.done .sp-step-label { color: var(--accent); }
.sp-step-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  transition: all 0.12s;
  color: transparent;
}
.sp-step.done .sp-step-check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.sp-step-label { font-size: 13px; flex: 1; }
.sp-step-icon { font-size: 14px; }

.sp-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 2px 26px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--accent-light);
  border: 1px dashed #B8D9C5;
  animation: popIn 0.12s ease;
}
.sp-date-row .sp-date-label { font-size: 11.5px; color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.sp-date-row input[type=date] { flex: 1; font-size: 12.5px; padding: 5px 8px; }