/* ============================================================
   BLUEOUT ADMIN — Estilos globales
   Fuente: Barlow Condensed + Barlow (Google Fonts)
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0a0a0a;
  --gray-900: #1a1a1a;
  --gray-800: #2d2d2d;
  --gray-700: #444;
  --gray-600: #666;
  --gray-500: #888;
  --gray-400: #999;
  --gray-300: #bbb;
  --gray-200: #e0e0e0;
  --gray-100: #f2f2f2;
  --gray-50:  #f8f8f8;
  --white:    #ffffff;
  --danger:   #c0392b;
  --success:  #27ae60;
  --warning:  #e67e22;
  --info:     #2980b9;
  --radius:   8px;
  --radius-lg: 12px;
  --shadow:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.14);
}

body {
  font-family: 'Barlow', sans-serif;
  background: var(--white);
  color: var(--black);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* Panel izquierdo — negro */
.login-left {
  flex: 1;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: 'BLUE\AOUT';
  white-space: pre;
  position: absolute;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 220px;
  font-weight: 800;
  color: rgba(255,255,255,.03);
  bottom: -40px;
  right: -30px;
  line-height: .9;
  pointer-events: none;
  text-align: right;
}
.ll-top  { position: relative; z-index: 1; }
.ll-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 52px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 4px;
  line-height: 1;
}
.ll-gym {
  font-size: 11px;
  color: rgba(255,255,255,.35);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 300;
}
.ll-bar {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,.3);
  margin: 36px 0 28px;
}
.ll-frase {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  line-height: 1.25;
  max-width: 340px;
  letter-spacing: .3px;
}
.ll-autor {
  font-size: 12px;
  color: rgba(255,255,255,.3);
  margin-top: 12px;
  letter-spacing: 1px;
  font-weight: 300;
}
.ll-bottom { position: relative; z-index: 1; }
.ll-tagline {
  font-size: 11px;
  color: rgba(255,255,255,.2);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Panel derecho — formulario */
.login-right {
  width: 460px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 52px;
  background: var(--white);
  border-left: 1px solid var(--gray-100);
}
.lr-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.lr-sub {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 32px;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.tb-brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--black);
  text-decoration: none;
}
.tb-brand span { color: var(--gray-400); }
.tb-sep { width: 1px; height: 18px; background: var(--gray-200); }
.tb-section { font-size: 13px; color: var(--gray-600); font-weight: 500; }
.tb-spacer { flex: 1; }
.tb-user { display: flex; align-items: center; gap: 9px; }
.tb-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.tb-name { font-size: 13px; font-weight: 600; }
.tb-role { font-size: 11px; color: var(--gray-600); }
.tb-logout {
  padding: 6px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--white);
  color: var(--gray-700);
  text-decoration: none;
  transition: all .15s;
}
.tb-logout:hover { border-color: var(--black); color: var(--black); }

/* LAYOUT BODY */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 56px);
}

/* SIDEBAR */
.sidebar {
  width: 220px;
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 0;
}
.nav-sec {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-400);
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  border-left: 2px solid transparent;
  transition: all .12s;
  text-decoration: none;
  user-select: none;
}
.nav-item:hover  { background: var(--gray-100); color: var(--black); }
.nav-item.active {
  background: var(--white);
  color: var(--black);
  border-left-color: var(--black);
  font-weight: 600;
}
.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.nav-badge {
  margin-left: auto;
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: 'Barlow Condensed', sans-serif;
}
.nav-badge.red { background: var(--danger); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--white);
}

/* ============================================================
   COMPONENTES COMPARTIDOS
   ============================================================ */

/* Page header */
.page-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1;
}
.page-sub { font-size: 12px; color: var(--gray-600); margin-top: 3px; }

/* Buttons */
.btn {
  padding: 8px 15px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  transition: all .15s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-black  { background: var(--black); color: var(--white); }
.btn-black:hover { background: var(--gray-800); color: var(--white); }
.btn-outline {
  background: var(--white);
  color: var(--black);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover { border-color: var(--black); color: var(--black); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #a93226; color: var(--white); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* Login button */
.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  margin-top: 4px;
}
.btn-login:hover { background: var(--gray-800); }

/* Form elements */
.form-group  { margin-bottom: 16px; }
.form-label  {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-700);
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  color: var(--black);
  background: var(--white);
  transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--black); }
.form-input::placeholder { color: var(--gray-300); }
select.form-input { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  margin-bottom: 14px;
}
.card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Stat cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-card.dark { background: var(--black); border-color: var(--black); }
.stat-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-600);
  margin-bottom: 7px;
}
.stat-card.dark .stat-lbl { color: rgba(255,255,255,.45); }
.stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.stat-card.dark .stat-val { color: var(--white); }
.stat-delta { font-size: 11px; margin-top: 5px; color: var(--gray-600); }
.stat-card.dark .stat-delta { color: rgba(255,255,255,.5); }
.up  { color: var(--success); }
.dn  { color: var(--danger); }

/* Grids */
.g2   { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.g3   { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 15px; }
.g3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-bottom: 15px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-600);
  padding: 0 11px 9px;
  border-bottom: 1.5px solid var(--gray-200);
}
.tbl td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--gray-50); }
.tname { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.mini-av {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  font-family: 'Barlow Condensed', sans-serif;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.b-black   { background: var(--black); color: var(--white); }
.b-gray    { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.b-ok      { background: rgba(39,174,96,.1); color: var(--success); }
.b-warn    { background: rgba(230,126,34,.1); color: var(--warning); }
.b-err     { background: rgba(192,57,43,.1); color: var(--danger); }
.b-info    { background: rgba(41,128,185,.1); color: var(--info); }

/* Activity feed */
.act-list { display: flex; flex-direction: column; }
.act-row  { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.act-row:last-child { border-bottom: none; }
.act-dot  { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.act-txt  { font-size: 13px; line-height: 1.4; }
.act-time { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* Tabs */
.tab-bar { display: flex; border-bottom: 1.5px solid var(--gray-200); margin-bottom: 18px; }
.tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: all .15s;
}
.tab:hover { color: var(--black); }
.tab.active { color: var(--black); border-bottom-color: var(--black); font-weight: 600; }

/* Modal */
.modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-ov.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 460px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 18px;
}
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  padding: 11px 17px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s;
  box-shadow: var(--shadow-md);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Validation errors */
.field-validation-error { font-size: 11px; color: var(--danger); margin-top: 3px; display: block; }
.input-validation-error { border-color: var(--danger) !important; }
.validation-summary-errors ul { list-style: none; padding: 0; margin: 0; }
.validation-summary-errors {
  background: rgba(192,57,43,.08);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 16px;
}

/* Login separator */
.login-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-size: 12px;
  color: var(--gray-400);
}
.login-sep::before, .login-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ============================================================
   RESPONSIVE — móvil / tablet
   ============================================================ */
.tb-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--black);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tb-hamburger svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; display: block; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 90;
  cursor: pointer;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
  .tb-hamburger { display: flex; }
  .tb-sep, .tb-section { display: none; }
  .tb-name, .tb-role { display: none; }
  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    z-index: 95;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }
  .app-body { height: calc(100vh - 56px); }
  .main-content { padding: 14px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .g2   { grid-template-columns: 1fr; }
  .g3   { grid-template-columns: 1fr; }
  .g3-1 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .login-page { flex-direction: column; }
  .login-left { flex: none; min-height: 180px; padding: 28px 22px; }
  .login-right { width: 100%; padding: 28px 22px; }
  .ll-frase { font-size: 22px; }
  .ll-logo  { font-size: 38px; }
  .topbar   { padding: 0 14px; }
  .tb-brand { font-size: 18px; }
}

/* ============================================================
   PRINT — facturas
   ============================================================ */
@media print {
  .topbar, .sidebar, .sidebar-overlay, .no-print { display: none !important; }
  .main-content { padding: 0 !important; overflow: visible !important; }
  .app-body { height: auto !important; overflow: visible !important; display: block !important; }
  .app-shell { min-height: auto !important; display: block !important; }
  body { background: white !important; }
}
.factura-print { max-width: 760px; margin: 0 auto; font-family: 'Barlow', sans-serif; color: #111; }
.fact-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid #111; }
.fact-logo   { font-family: 'Barlow Condensed', sans-serif; font-size: 36px; font-weight: 800; letter-spacing: 3px; }
.fact-logo span { color: #888; }
.fact-title  { text-align: right; }
.fact-title h2 { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; }
.fact-num    { font-size: 13px; color: #555; }
.fact-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.fact-party-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-bottom: 5px; }
.fact-party-name { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.fact-party-data { font-size: 12px; color: #555; line-height: 1.6; }
.fact-items { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.fact-items th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: #888; padding: 6px 10px 8px; border-bottom: 1.5px solid #ddd; }
.fact-items td { padding: 9px 10px; border-bottom: 1px solid #eee; font-size: 13px; }
.fact-items td.r { text-align: right; }
.fact-total { text-align: right; }
.fact-total-row { display: flex; justify-content: flex-end; gap: 40px; font-size: 13px; padding: 4px 0; }
.fact-total-row.big { font-size: 18px; font-weight: 700; padding-top: 8px; border-top: 1.5px solid #111; margin-top: 4px; }
.fact-footer { margin-top: 32px; padding-top: 14px; border-top: 1px solid #eee; font-size: 11px; color: #888; text-align: center; }
.fact-estado { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.fact-estado.pagada   { background: rgba(39,174,96,.12); color: #27ae60; border: 1px solid rgba(39,174,96,.3); }
.fact-estado.pendiente{ background: rgba(230,126,34,.1);  color: #e67e22; border: 1px solid rgba(230,126,34,.3); }
.fact-estado.anulada  { background: rgba(192,57,43,.1);   color: #c0392b; border: 1px solid rgba(192,57,43,.3); }

/* Demo buttons */
.demo-list { display: flex; flex-direction: column; gap: 7px; }
.demo-btn {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .15s;
  text-align: left;
  text-decoration: none;
}
.demo-btn:hover { border-color: var(--black); background: var(--white); }
.d-ic {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.d-ic span {
  font-size: 11px;
  color: var(--white);
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
}
.d-name { font-size: 13px; font-weight: 600; color: var(--black); }
.d-role { font-size: 11px; color: var(--gray-600); }
