/* ================================================================
   IBI International — Master Brand Stylesheet  v2.0 — 2026
   Servido desde /static/ibi_styles.css (app.py puerto 5000)
   ================================================================ */

/* ── Google Fonts ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  /* Brand palette */
  --ibi-navy:    #0F2044;
  --ibi-navy-2:  #1A3260;
  --ibi-navy-3:  #243A6E;
  --ibi-gold:    #B8860B;
  --ibi-gold-l:  #DAA520;
  --ibi-gold-p:  #FDF6E3;

  /* Semantic colors */
  --ibi-white:   #FFFFFF;
  --ibi-bg:      #F1F5F9;
  --ibi-bg-2:    #F8FAFC;
  --ibi-text:    #1E293B;
  --ibi-dim:     #64748B;
  --ibi-border:  #E2E8F0;

  /* Status */
  --ibi-green:   #15803D;
  --ibi-green-l: #DCFCE7;
  --ibi-amber:   #B45309;
  --ibi-amber-l: #FEF3C7;
  --ibi-red:     #DC2626;
  --ibi-red-l:   #FEE2E2;
  --ibi-blue:    #1D4ED8;
  --ibi-blue-l:  #DBEAFE;
  --ibi-purple:  #6D28D9;
  --ibi-purple-l:#EDE9FE;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Spacing scale */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem;
  --space-4: 1rem;   --space-6: 1.5rem; --space-8: 2rem;

  /* Radii */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(15,32,68,.08);
  --shadow-md: 0 4px 16px rgba(15,32,68,.12);
  --shadow-lg: 0 8px 32px rgba(15,32,68,.18);
}

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--ibi-text);
  background: var(--ibi-bg);
  line-height: 1.6;
}

/* ── Scroll behaviour ────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Scrollbar — light ───────────────────────────────────────── */
::-webkit-scrollbar              { width: 10px; height: 10px; }
::-webkit-scrollbar-track        { background: #e2e8f0; border-radius: 6px; }
::-webkit-scrollbar-thumb        { background: #94a3b8; border-radius: 6px; border: 2px solid #e2e8f0; }
::-webkit-scrollbar-thumb:hover  { background: #64748b; }
::-webkit-scrollbar-corner       { background: #e2e8f0; }

/* ── Scrollbar — dark (Admin, VMS) ──────────────────────────── */
.bg-slate-900::-webkit-scrollbar-track,
.bg-slate-950::-webkit-scrollbar-track,
.bg-slate-900 ::-webkit-scrollbar-track,
.bg-slate-950 ::-webkit-scrollbar-track { background: #1e293b; border-radius: 6px; }
.bg-slate-900::-webkit-scrollbar-thumb,
.bg-slate-950::-webkit-scrollbar-thumb,
.bg-slate-900 ::-webkit-scrollbar-thumb,
.bg-slate-950 ::-webkit-scrollbar-thumb { background: #475569; border-radius: 6px; border: 2px solid #1e293b; }
.bg-slate-900::-webkit-scrollbar-thumb:hover,
.bg-slate-950::-webkit-scrollbar-thumb:hover,
.bg-slate-900 ::-webkit-scrollbar-thumb:hover,
.bg-slate-950 ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Firefox */
* { scrollbar-width: auto; scrollbar-color: #94a3b8 #e2e8f0; }
.bg-slate-900, .bg-slate-950,
.bg-slate-900 *, .bg-slate-950 * { scrollbar-color: #475569 #1e293b; }

/* ── Scrollbar — horizontal (wide tables) ────────────────────── */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar       { height: 8px; }
.scroll-x::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 4px; }
.scroll-x::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; border: 2px solid #e2e8f0; }

/* ── Selection ───────────────────────────────────────────────── */
::selection { background: rgba(184,134,11,.18); color: var(--ibi-navy); }

/* ── Transitions ─────────────────────────────────────────────── */
a, button, input, select, textarea {
  transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;
}

/* ── Alpine.js compat ────────────────────────────────────────── */
[x-cloak] { display: none !important; }


/* ================================================================
   NAV BAR  — clase .ibi-nav
   ================================================================ */
.ibi-nav {
  background: var(--ibi-navy);
  border-bottom: 3px solid var(--ibi-gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(15,32,68,.2);
}
.ibi-nav-in {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ibi-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ibi-nav-brand img {
  height: 34px;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
}
.ibi-nav-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
}
.ibi-nav-title span {
  color: var(--ibi-gold-l);
  font-weight: 400;
  font-size: .75rem;
  margin-left: 6px;
}
.ibi-nav-link {
  font-size: .7rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
}
.ibi-nav-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.06);
}
.ibi-nav-link.active {
  color: var(--ibi-gold-l);
  border-color: rgba(184,134,11,.4);
  background: rgba(184,134,11,.08);
}


/* ================================================================
   TYPOGRAPHY UTILITIES
   ================================================================ */
.ibi-display {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ibi-navy);
}
.ibi-display em { color: var(--ibi-gold); font-style: italic; }

.ibi-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ibi-gold);
}
.ibi-mono { font-family: var(--font-mono); }


/* ================================================================
   CARD
   ================================================================ */
.ibi-card {
  background: var(--ibi-white);
  border: 1px solid var(--ibi-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
}
.ibi-card-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ibi-navy);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ibi-card-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: var(--ibi-border);
}


/* ================================================================
   BUTTONS
   ================================================================ */
.ibi-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  padding: .5rem 1.1rem;
  text-decoration: none;
  white-space: nowrap;
}
.ibi-btn-primary {
  background: var(--ibi-navy);
  color: #fff;
}
.ibi-btn-primary:hover { background: var(--ibi-navy-2); }

.ibi-btn-gold {
  background: var(--ibi-gold);
  color: var(--ibi-navy);
}
.ibi-btn-gold:hover { background: var(--ibi-gold-l); }

.ibi-btn-amber {
  background: var(--ibi-amber);
  color: #fff;
}
.ibi-btn-amber:hover { background: #92400E; }

.ibi-btn-danger {
  background: var(--ibi-red);
  color: #fff;
}
.ibi-btn-danger:hover { background: #b91c1c; }

.ibi-btn-ghost {
  background: var(--ibi-bg);
  color: var(--ibi-dim);
  border: 1px solid var(--ibi-border);
}
.ibi-btn-ghost:hover { color: var(--ibi-navy); border-color: var(--ibi-navy); }

.ibi-btn-sm { font-size: .65rem; padding: .35rem .75rem; }
.ibi-btn-lg { font-size: .85rem; padding: .65rem 1.5rem; }


/* ================================================================
   STATUS BADGES  — service statuses
   ================================================================ */
.ibi-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .03em;
}
.ibi-status-curso    { background: var(--ibi-green-l);  color: #166534; border: 1px solid #a7f3d0; }
.ibi-status-espera   { background: var(--ibi-amber-l);  color: #92400E; border: 1px solid #fde68a; }
.ibi-status-facturar { background: var(--ibi-blue-l);   color: #1e40af; border: 1px solid #bfdbfe; }
.ibi-status-compl    { background: #f1f5f9;             color: #475569; border: 1px solid #cbd5e1; }
.ibi-status-cancel   { background: var(--ibi-red-l);    color: #991b1b; border: 1px solid #fca5a5; }

/* Indicator dots */
.ibi-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.ibi-dot-green  { background: var(--ibi-green); }
.ibi-dot-amber  { background: var(--ibi-amber); }
.ibi-dot-red    { background: var(--ibi-red);   }
.ibi-dot-blue   { background: var(--ibi-blue);  }
.ibi-dot-gray   { background: #94a3b8;          }


/* ================================================================
   RECONCILIATION BADGE  — cuadre DAE vs Factura
   ================================================================ */
.ibi-cuadre {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}
.ibi-cuadre-ok         { background: var(--ibi-green-l);  color: #166534; }
.ibi-cuadre-delta-leve { background: var(--ibi-amber-l);  color: #92400E; }
.ibi-cuadre-delta-alto { background: var(--ibi-red-l);    color: #991b1b; }


/* ================================================================
   FORMS
   ================================================================ */
.ibi-label-text {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ibi-dim);
  display: block;
  margin-bottom: 3px;
}
.ibi-input, .ibi-select {
  width: 100%;
  border: 1px solid var(--ibi-border);
  border-radius: var(--r-sm);
  padding: .5rem .75rem;
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--ibi-text);
  background: var(--ibi-white);
  outline: none;
}
.ibi-input:focus, .ibi-select:focus { border-color: var(--ibi-gold); }
.ibi-input::placeholder { color: #94a3b8; }


/* ================================================================
   ALERTS / NOTIFICATIONS
   ================================================================ */
.ibi-alert {
  padding: .75rem 1.25rem;
  border-radius: var(--r-md);
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.ibi-alert-ok  { background: var(--ibi-green-l); border-left: 4px solid var(--ibi-green); color: #166534; }
.ibi-alert-err { background: var(--ibi-red-l);   border-left: 4px solid var(--ibi-red);   color: #991b1b; }
.ibi-alert-warn{ background: var(--ibi-amber-l); border-left: 4px solid var(--ibi-amber); color: #92400E; }
.ibi-alert-info{ background: var(--ibi-blue-l);  border-left: 4px solid var(--ibi-blue);  color: #1e40af; }


/* ================================================================
   PILL / SECTION DIVIDER
   ================================================================ */
.ibi-pill {
  font-family: var(--font-body);
  font-size: .58rem;
  font-weight: 700;
  background: var(--ibi-gold-p);
  color: var(--ibi-gold);
  border: 1px solid rgba(184,134,11,.25);
  padding: 2px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ibi-section-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ibi-navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ibi-section-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: var(--ibi-border);
}


/* ================================================================
   TABLE — standard IBI table style
   ================================================================ */
.ibi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.ibi-table thead tr {
  background: #F8FAFC;
  border-bottom: 2px solid var(--ibi-border);
}
.ibi-table thead th {
  padding: .6rem .9rem;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ibi-dim);
  text-align: left;
  white-space: nowrap;
}
.ibi-table tbody tr {
  border-bottom: 1px solid #F1F5F9;
  transition: background .12s;
}
.ibi-table tbody tr:hover { background: #FAFBFD; }
.ibi-table tbody td {
  padding: .65rem .9rem;
  vertical-align: middle;
}


/* ================================================================
   WATERMARK / BADGE
   ================================================================ */
.ibi-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--ibi-navy);
  color: var(--ibi-gold);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 4px;
  white-space: nowrap;
}


/* ================================================================
   PRINT
   ================================================================ */
@media print {
  nav, .ibi-nav, .no-print { display: none !important; }
  body { background: white; color: black; }
  .ibi-card { box-shadow: none; border: 1px solid #e2e8f0; }
}


/* ================================================================
   RESPONSIVE HELPERS
   ================================================================ */
@media (max-width: 768px) {
  .ibi-nav-in { padding: 0 1rem; }
  .hide-mobile { display: none !important; }
}
