  :root {
    --bg: #f5f4f0;
    --surface: #ffffff;
    --surface2: #f0ede8;
    --border: #ddd9d2;
    --border2: #ccc8c0;
    --text: #1a1916;
    --text2: #6b6760;
    --text3: #9e9b96;
    --accent: #1a1916;
    --blue: #1a4a8a; --blue-bg: #e8eef8;
    --green: #1a5c2e; --green-bg: #e4f2e8;
    --amber: #7a4a00; --amber-bg: #fdf0d8;
    --pink: #7a1a3a; --pink-bg: #fce8ef;
    --purple: #3a1a7a; --purple-bg: #ede8f8;
    --teal: #0a5c50; --teal-bg: #e0f2ef;
    --red: #8a1a1a; --red-bg: #fce8e8;
    --gray: #444; --gray-bg: #ebebeb;
    --radius: 10px;
    --radius-sm: 6px;
    font-size: 14px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

  /* LAYOUT */
  .app { display: flex; min-height: 100vh; }
  .sidebar { width: 190px; background: var(--text); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; padding: 0; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
  .sidebar-logo { padding: 16px 16px 12px; border-bottom: 1px solid #333; }
  .sidebar-logo h1 { font-size: 16px; font-weight: 700; letter-spacing: 2px; color: #fff; }
  .sidebar-logo p { font-size: 10px; color: #888; margin-top: 2px; letter-spacing: .5px; }
  .sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
  .nav-section { padding: 7px 14px 3px; font-size: 10px; color: #666; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }
  .nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 12px; color: #ccc; cursor: pointer; transition: all .15s; border-left: 3px solid transparent; }
  .nav-item:hover { background: #2a2a2a; color: #fff; }
  .nav-item.active { background: #2a2a2a; color: #fff; border-left-color: #fff; }
  .nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
  .main { margin-left: 190px; flex: 1; min-height: 100vh; }
  .topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 11px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
  .topbar h2 { font-size: 15px; font-weight: 600; }
  .topbar-actions { display: flex; gap: 8px; }
  .page { display: none; }
  .page.active { display: block; }

  /* COMPONENTS */
  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; font-family: inherit; transition: all .15s; font-weight: 500; }
  .btn:hover { background: var(--surface2); border-color: var(--border2); }
  .btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
  .btn-primary:hover { background: #333; }
  .btn-danger { background: var(--red-bg); color: var(--red); border-color: #f0b8b8; }
  .btn-danger:hover { background: #f8d0d0; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }

  .badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
  .badge-CORTE { background: var(--blue-bg); color: var(--blue); }
  .badge-PLEGADO { background: var(--green-bg); color: var(--green); }
  .badge-SCH { background: var(--amber-bg); color: var(--amber); }
  .badge-CAJISTA { background: var(--pink-bg); color: var(--pink); }
  .badge-MONTAJE { background: var(--purple-bg); color: var(--purple); }
  .badge-CIERRE { background: var(--red-bg); color: var(--red); }
  .badge-PINTURA { background: var(--teal-bg); color: var(--teal); }
  .badge-TERMINACION { background: var(--gray-bg); color: var(--gray); }
  .badge-FINALIZADA { background: #d4f0da; color: #155724; }
  .badge-DISPONIBLE { background: #fff8e1; color: #7a4a00; border: 1px dashed #c8960a; }
  .badge-TERMINADO { background: #d4f0da; color: #155724; }

  .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
  .card + .card { margin-top: 12px; }

  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }

  .grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
  .stat-card .val { font-size: 24px; font-weight: 700; line-height: 1; }
  .stat-card .lbl { font-size: 11px; color: var(--text2); margin-top: 4px; }

  .tag { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; font-size: 12px; color: var(--text); font-family: 'Courier New', monospace; font-weight: 700; }

  /* FORMS */
  .form-group { margin-bottom: 14px; }
  .form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
  input[type=text], input[type=date], input[type=number], select, textarea {
    width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
    transition: border .15s;
  }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border2); }
  textarea { resize: vertical; min-height: 72px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

  /* MODAL */
  .modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; align-items: center; justify-content: center; }
  .modal-bg.open { display: flex; }
  .modal { background: var(--surface); border-radius: var(--radius); width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
  .modal-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 1; }
  .modal-header h3 { font-size: 15px; font-weight: 600; }
  .modal-body { padding: 20px 22px; }
  .modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
  /* Modal pantalla completa */
  .modal-bg-fs { align-items: stretch !important; justify-content: stretch !important; }
  .modal-fs { width: 100vw !important; max-width: 100vw !important; height: 100vh !important; max-height: 100vh !important; border-radius: 0 !important; display: flex !important; flex-direction: column; overflow: hidden; }
  .modal-fs .modal-body { flex: 1; overflow-y: auto; max-height: none !important; }
  .modal-fs .modal-header { border-radius: 0; }

  /* TABLES */
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  thead th { background: var(--surface2); padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
  tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover td { background: var(--surface2); }
  .clickable { cursor: pointer; }

  /* PROCESS PIPELINE */
  .pipeline { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; }
  .pipe-stage { flex: 0 0 155px; min-width: 155px; }
  .pipe-stage-head { padding: 10px 14px; font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .6px; }
  .pipe-stage-body { min-height: 80px; border-right: 1px solid var(--border); padding: 5px 7px; }
  .pipe-stage:last-child .pipe-stage-body { border-right: none; }
  .pipe-ot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 6px; cursor: pointer; transition: all .12s; }
  .pipe-ot:hover { border-color: var(--border2); background: var(--surface2); }
  .pipe-ot.disponible { background: #fffdf0; border: 1px dashed #c8960a; opacity: .85; }
  .pipe-ot.disponible:hover { opacity: 1; background: #fff8e1; }
  .pipe-ot.pausado { background: #f5f0ff; border: 1px dashed #7a4ab0; opacity: .9; }
  .pipe-ot.pausado:hover { opacity: 1; background: #ede8f8; }
  .badge-PAUSADO { background: #ede8f8; color: #3a1a7a; }
  .proceso-row.pausado { background: #f8f5ff; border-color: #b8a0e0; border-style: dashed; }
  .pipe-ot .num { font-size: 13px; font-weight: 700; }
  .pipe-ot .cli { font-size: 12px; color: var(--text2); margin-top: 2px; }

  /* OPERARIO VIEW */
  .op-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all .15s; }
  .op-card:hover { border-color: var(--border2); background: var(--surface2); }
  .op-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
  .op-info h4 { font-size: 14px; font-weight: 600; }
  .op-info p { font-size: 12px; color: var(--text2); margin-top: 2px; }

  /* TIMELINE */
  .timeline { border-left: 2px solid var(--border); margin-left: 12px; padding-left: 16px; }
  .tl-item { position: relative; padding-bottom: 16px; }
  .tl-item::before { content: ''; position: absolute; left: -21px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
  .tl-item.done::before { background: var(--green); }
  .tl-item.active-proc::before { background: var(--blue); }
  .tl-date { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
  .tl-text { font-size: 13px; }
  .tl-obs { font-size: 12px; color: var(--text2); margin-top: 3px; font-style: italic; }

  /* SEARCH BAR */
  .search-wrap { position: relative; }
  .search-wrap input { padding-left: 34px; }
  .search-wrap .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }

  .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
  .filters select, .filters input { width: auto; font-size: 13px; padding: 6px 10px; }

  .empty-state { text-align: center; padding: 48px 24px; color: var(--text3); }
  .empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: .4; }
  .empty-state p { font-size: 14px; }

  .section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text2); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

  .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
  .dot-active { background: var(--blue); }
  .dot-done { background: var(--green); }
  .dot-pending { background: var(--border2); }

  .chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 12px; cursor: pointer; transition: all .12s; }
  .chip:hover, .chip.active { background: var(--text); color: #fff; border-color: var(--text); }

  .proceso-row { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
  .proceso-stage-label { width: 110px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; text-align: center; }
  .proceso-body { flex: 1; padding: 10px 14px; background: var(--surface); border-left: 1px solid var(--border); }
  .proceso-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text2); margin-top: 4px; }
  .proceso-obs { font-size: 12px; color: var(--text2); font-style: italic; margin-top: 4px; }

  .tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
  .tab-btn { padding: 9px 18px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: none; color: var(--text2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; transition: all .15s; }
  .tab-btn.active { color: var(--text); border-bottom-color: var(--text); }
  .tab-btn:hover:not(.active) { color: var(--text); }
  .tab-panel { display: none; }
  .tab-panel.active { display: block; }
  /* ── MOBILE ─────────────────────────────────────────────── */
  @media (max-width: 768px) {
    body { font-size: 14px; }
    .sidebar { display: none; }
    .main { margin-left: 0; padding-bottom: 70px; }
    .topbar { padding: 10px 14px; }
    .topbar h2 { font-size: 14px; }

    /* Stats */
    #dash-stats { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
    .stat-card .val { font-size: 20px; }
    .stat-card .lbl { font-size: 10px; }

    /* Pipeline → vertical list */
    .pipeline { flex-direction: column; overflow-x: visible; }
    .pipe-stage { min-width: 100%; flex: none; border-bottom: 1px solid var(--border); }
    .pipe-stage-body { border-right: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; min-height: auto; }
    .pipe-ot { min-width: 140px; flex: 1; }

    /* Grids */
    .grid-2, .grid-3, .grid-6 { grid-template-columns: 1fr !important; }
    .form-row, .form-row-3 { grid-template-columns: 1fr !important; }

    /* Tables → hide less important cols */
    .hide-mobile { display: none !important; }
    tbody td { padding: 8px 8px; font-size: 12px; }
    thead th { padding: 7px 8px; font-size: 10px; }

    /* Modal */
    .modal { width: 100% !important; max-width: 100vw; border-radius: var(--radius) var(--radius) 0 0; margin-top: auto; max-height: 92vh; }
    .modal-bg { align-items: flex-end; }

    /* Operarios grid */
    .grid-3 { grid-template-columns: 1fr !important; }

    /* Proceso row */
    .proceso-row { flex-direction: column; }
    .proceso-stage-label { width: 100% !important; padding: 6px 12px; flex-direction: row; justify-content: flex-start; }
    .proceso-body { padding: 8px 12px; }

    /* Buttons smaller */
    .btn { padding: 7px 12px; font-size: 12px; }
    .btn-sm { padding: 4px 8px; font-size: 11px; }

    /* Filters wrap */
    .filters { gap: 6px; }
    .filters select, .filters input { font-size: 12px; }
    .search-wrap { max-width: 100% !important; }
  }

  /* Bottom navbar for mobile */
  .mobile-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--text); z-index: 200;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid #333;
  }
  .mobile-nav-inner { display: flex; justify-content: space-around; }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #888; cursor: pointer; padding: 4px 12px; border-radius: 8px; flex: 1; }
  .mobile-nav-item.active { color: #fff; }
  .mobile-nav-item svg { width: 22px; height: 22px; }
  .mobile-nav-item span { font-size: 9px; letter-spacing: .3px; }
  @media (max-width: 768px) { .mobile-nav { display: block; } .plan-grid { grid-template-columns: 1fr !important; } }

  /* ── LOGIN ──────────────────────────────────────────────── */
  #login-screen {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    align-items: center; justify-content: center;
  }
  #login-screen.visible { display: flex; }
  .login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 40px 36px;
    width: 360px; max-width: 92vw;
    box-shadow: 0 8px 40px rgba(0,0,0,.10);
  }
  .login-logo { text-align: center; margin-bottom: 28px; }
  .login-logo h1 { font-size: 28px; font-weight: 800; letter-spacing: 4px; color: var(--text); }
  .login-logo p { font-size: 12px; color: var(--text3); letter-spacing: .5px; margin-top: 4px; }
  .login-box .form-group { margin-bottom: 16px; }
  .login-box label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 5px; }
  .login-box input { font-size: 15px; padding: 10px 13px; }
  .login-btn { width: 100%; padding: 11px; font-size: 15px; font-weight: 600; margin-top: 6px; border-radius: 8px; }
  .login-error { background: var(--red-bg); color: var(--red); border: 1px solid #f0b8b8; border-radius: 6px; padding: 9px 13px; font-size: 13px; margin-bottom: 14px; display: none; }
  .login-error.visible { display: block; }
  /* Ocultar app si no logueado */
  .app-hidden { display: none !important; }

  /* SYNC STATUS INDICATOR */
  #sync-status { padding:3px 12px; border-radius:20px; font-size:11px; font-weight:500; pointer-events:none; }
  #sync-status.sync-saving { background:rgba(224,184,64,.25); color:#e0c040; border:1px solid rgba(224,184,64,.4); }
  #sync-status.sync-saved  { background:rgba(80,180,100,.2); color:#6fca8e; border:1px solid rgba(80,180,100,.35); }
  #sync-status.sync-error  { background:rgba(220,80,80,.2); color:#f08080; border:1px solid rgba(220,80,80,.35); }

/* PERMISOS */
.readonly-page .edit-action { display: none !important; }

/* BADGES VENTAS */
.badge-venta-pendiente       { background: var(--amber-bg);  color: var(--amber);  border: 1px solid #e0b840; }
.badge-venta-en_produccion   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid #90c4f8; }
.badge-venta-concluida       { background: var(--green-bg);  color: var(--green);  border: 1px solid #8fca9e; }
.badge-venta-entregada       { background: #f0f0f0;          color: #888;          border: 1px solid #ccc; }

/* BADGES INGRESOS */
.badge-ing-pendiente_ot  { background: var(--red-bg);    color: var(--red);    border: 1px solid #f0b8b8; }
.badge-ing-asignado      { background: var(--amber-bg);  color: var(--amber);  border: 1px solid #e0b840; }
.badge-ing-en_proceso    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid #90c4f8; }
.badge-ing-terminado     { background: var(--green-bg);  color: var(--green);  border: 1px solid #8fca9e; }

/* CHECKLIST */
.chk-label { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:14px; cursor:pointer; border-bottom:1px solid var(--border); }
.chk-label:last-child { border-bottom: none; }
.chk-label input[type=checkbox] { width:16px; height:16px; accent-color: var(--primary); cursor:pointer; flex-shrink:0; }

/* ── HOME SCREEN (selector de módulos) ─────────────────────── */
#home-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 24px 32px;
  overflow-y: auto;
}
#home-screen.visible { display: flex; }

.home-logo {
  text-align: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.home-logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}
.home-logo p {
  font-size: 12px;
  color: var(--text3);
  letter-spacing: 1px;
  margin-top: 6px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 640px;
  width: 100%;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.module-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(0,0,0,.13);
  border-color: var(--border2);
}
.module-card:active { transform: translateY(-2px); }

.module-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.module-icon svg {
  width: 42px;
  height: 42px;
}

.module-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.module-desc {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
}

/* Botón volver al inicio en sidebar */
.home-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  border-bottom: 1px solid #333;
  margin-bottom: 4px;
  transition: color .15s;
}
.home-back-btn:hover { color: #fff; }

/* ── REPORTES SCREEN ─────────────────────────────────────────── */
#reportes-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 40px 24px;
}
#reportes-screen.visible { display: flex; }

.reportes-screen-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: 1px;
}

.reportes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 480px;
  width: 100%;
}

.reporte-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px 22px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.reporte-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.1);
  border-color: #1a4a8a;
}
.reporte-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reporte-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.reporte-desc {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.4;
}

/* ── TOPBAR NAVIGATION (todos los módulos) ──────────────────── */
#no-sidebar-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: #1a1a1a;
  align-items: center;
  padding: 0 12px;
  gap: 0;
  z-index: 150;
  border-bottom: 1px solid #333;
}
#main-app.no-sidebar #no-sidebar-bar { display: flex; }
#main-app.no-sidebar .sidebar { display: none; }
#main-app.no-sidebar .main { margin-left: 0; padding-top: 48px; }
#main-app.no-sidebar .topbar { top: 48px; }

.no-sidebar-back {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.no-sidebar-back:hover { background: #2a2a2a; color: #fff; }

.topnav-sep {
  width: 1px;
  height: 22px;
  background: #333;
  margin: 0 8px;
  flex-shrink: 0;
}

.topnav-items {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav-items::-webkit-scrollbar { display: none; }

.topnav-item {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.topnav-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.topnav-item:hover { background: #2a2a2a; color: #ddd; }
.topnav-item.active { background: #2e2e2e; color: #fff; }

#no-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

/* ── TOPBAR SEARCH (dashboard) ──────────────────────────────── */
.topbar-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 220px;
}
.topbar-search-wrap svg { color: var(--text3); flex-shrink: 0; }
.topbar-search-input {
  border: none;
  background: none;
  outline: none;
  font-size: 12px;
  color: var(--text);
  width: 100%;
}
.topbar-search-input::placeholder { color: var(--text3); }

@media (max-width: 600px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .home-logo-img { width: 100px; height: 100px; }
  .module-icon { width: 68px; height: 68px; border-radius: 16px; }
  .module-icon svg { width: 34px; height: 34px; }
  .module-name { font-size: 14px; }
  .reportes-grid { grid-template-columns: 1fr; max-width: 280px; }
}