/* ═══════════════════════════════════════════════════════════
   RESKYT DASHBOARD · main.css
   Colores de marca, layout principal, login, header, nav.
   Para cambiar colores principales, modifica las variables :root
═══════════════════════════════════════════════════════════ */

:root {
  --brand:      #E8172C;
  --brand-dark: #b01020;
  --bg:         #e8edf2;
  --bg-card:    #ffffff;
  --text:       #1a1a2a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border:     #dde2e8;
  --success:    #16a34a;
  --warning:    #d97706;
  --danger:     #dc2626;
  --radius:     12px;
  --shadow:     0 1px 4px rgba(0,0,0,.08), 0 2px 12px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ─── LOGIN ───────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.login-project  { text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--text-muted); text-transform: uppercase; }
.login-subtitle { text-align: center; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.login-error    { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); padding: 8px 12px; border-radius: 8px; font-size: 13px; text-align: center; }
.login-input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.login-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232,23,44,.1); }
.login-btn {
  background: var(--brand); color: white; border: none; border-radius: 8px;
  padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%;
  transition: background .2s;
}
.login-btn:hover { background: var(--brand-dark); }

/* ─── HEADER ──────────────────────────────────────────── */
#app-header {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.header-left    { display: flex; align-items: center; gap: 10px; }
.header-tagline { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.header-center  {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center;
  pointer-events: none;
}
.header-center img { pointer-events: auto; }
.header-proyecto{ font-size: 10px; font-weight: 600; letter-spacing: .15em; color: var(--text-muted); text-transform: uppercase; }
.header-right   { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-updated { font-size: 11px; color: var(--text-muted); }

.btn-actualizar {
  background: var(--brand); color: white; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-actualizar:hover    { background: var(--brand-dark); }
.btn-actualizar:disabled { opacity: .7; pointer-events: none; }
.btn-salir {
  background: none; border: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; padding: 6px 4px; transition: color .2s;
}
.btn-salir:hover { color: var(--text); }

/* ─── NAVEGACIÓN ──────────────────────────────────────── */
#app-nav {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex;
  position: sticky; top: 64px; z-index: 99; overflow-x: auto;
}
.nav-tab {
  padding: 14px 18px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; text-decoration: none; user-select: none;
}
.nav-tab:hover  { color: var(--text); }
.nav-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ─── CONTENIDO PRINCIPAL ─────────────────────────────── */
#app-content { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* ─── SUB-PESTAÑAS ────────────────────────────────────── */
.sub-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.sub-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.sub-tab:hover  { color: var(--text); }
.sub-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ─── FILTROS ─────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.filter-select {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; color: var(--text); cursor: pointer; outline: none;
}
.filter-select:focus { border-color: var(--brand); }
.filter-toggle { display: flex; gap: 4px; }
.filter-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  transition: all .15s;
}
.filter-btn.active { background: #1e40af; color: white; border-color: #1e40af; }
.toggle-btn {\n  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;\n  cursor: pointer; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);\n  transition: all .15s;\n}
.toggle-btn.active { background: #1e40af; color: white; border-color: #1e40af; }
.toggle-btn.blue   { background: #3b82f6; color: white; border-color: #3b82f6; }
.toggle-btn.yellow { background: #f59e0b; color: white; border-color: #f59e0b; }

/* ─── SECCIÓN VACÍA ───────────────────────────────────── */
.empty { padding: 60px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ─── TÍTULOS DE SECCIÓN ──────────────────────────────── */
.section-label { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.section-title { font-size: 22px; font-weight: 700; color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet
   Breakpoints: 768px (tablet), 480px (mobile)
═══════════════════════════════════════════════════════════ */

/* ─── TABLET (≤ 768px) ────────────────────────────────── */
@media (max-width: 768px) {

  /* Header: ocultar "Actualizado" y comprimir */
  #app-header {
    padding: 0 12px;
    height: 56px;
  }
  .header-updated { display: none; }
  .header-left img { height: 30px; }
  .header-center img { height: 40px; }
  .btn-actualizar { padding: 6px 10px; font-size: 12px; }
  .btn-salir { font-size: 12px; }

  /* Nav: scroll horizontal touch */
  #app-nav {
    top: 56px;
    padding: 0 0;
    gap: 0;
    overflow-x: scroll;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    cursor: grab;
    justify-content: flex-start !important;
  }
  #app-nav::-webkit-scrollbar { display: none; }
  #app-nav:active { cursor: grabbing; }
  .nav-tab {
    padding: 10px 12px;
    font-size: 12px;
    flex-shrink: 0;
    min-width: fit-content;
  }

  /* Contenido principal */
  #app-content { padding: 12px; }

  /* Sub-pestañas scroll horizontal */
  .sub-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab { padding: 8px 12px; font-size: 12px; white-space: nowrap; }

  /* Títulos de sección */
  .section-title { font-size: 18px; }

  /* Login */
  .login-card { width: 90vw; padding: 32px 24px; }
}

/* ─── MOBILE (≤ 480px) ────────────────────────────────── */
@media (max-width: 480px) {

  /* Header mínimo */
  #app-header { padding: 0 10px; height: 52px; }
  .header-center { display: none; } /* ocultar logo central en móvil muy pequeño */
  .header-left img { height: 28px; }
  .btn-actualizar { display: none; } /* ocultar en móvil pequeño */

  /* Nav pestañas: scroll horizontal */
  #app-nav {
    top: 52px;
    padding: 0;
    justify-content: flex-start !important;
  }
  .nav-tab { padding: 10px 10px; font-size: 11px; gap: 3px; flex-shrink: 0; }

  /* Contenido */
  #app-content { padding: 8px; }

  /* Login */
  .login-card { width: 95vw; padding: 28px 20px; gap: 12px; }
  .login-subtitle { font-size: 16px; }
}
