/* ═══════════════════════════════════════════════════════════
   PRAGMA SST — main.css
   Layout · Header · Horizontal Nav · Variables
═══════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --blue-dark:    #003366;
  --blue-mid:     #0055a5;
  --blue-light:   #1a7fd4;
  --blue-soft:    #e8f0fb;
  --green:        #28a745;
  --green-light:  #d4edda;
  --orange:       #fd7e14;
  --red:          #dc3545;
  --yellow:       #ffc107;
  --cyan:         #17a2b8;

  --text-primary:   #1a1d23;
  --text-secondary: #5a6270;
  --text-muted:     #9aa3af;
  --border:         #dee2e8;
  --border-light:   #f0f2f5;
  --bg-body:        #f4f6f9;
  --bg-card:        #ffffff;
  --bg-header:      #ffffff;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.12);

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;

  --font-main:  'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono:  'IBM Plex Mono', monospace;

  --header-h:   60px;
  --nav-h:      72px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--blue-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(255,255,255,.4));
  animation: spin 20s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}
.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-light);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 1px;
}

.company-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid rgba(255,255,255,.2);
  padding-left: 16px;
}
.company-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.company-nit {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-notif {
  position: relative;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;align-items: center; justify-content: center;
  transition: background .15s;
}
.btn-notif:hover { background: rgba(255,255,255,.2); }
.notif-icon { font-size: 16px; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 4px 12px;
}
.user-avatar { font-size: 14px; }
.user-email { font-size: 12px; color: rgba(255,255,255,.85); }

.btn-logout {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: var(--font-main);
}
.btn-logout:hover { background: #c82333; transform: translateY(-1px); }

/* ══════════════════════════════════════════
   NAVIGATION (HORIZONTAL TABS)
══════════════════════════════════════════ */
.app-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Degradado que indica scroll a la derecha */
.app-nav::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 48px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--bg-card));
  pointer-events: none;
  z-index: 1;
}

.nav-scroll-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-scroll-wrapper::-webkit-scrollbar { display: none; }

.nav-tabs {
  display: flex;
  align-items: stretch;
  min-width: max-content;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 88px;
  padding: 10px 14px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: var(--font-main);
  color: var(--text-secondary);
  position: relative;
}

.nav-tab:hover {
  background: var(--blue-soft);
  color: var(--blue-mid);
}

.nav-tab.active {
  background: var(--blue-soft);
  border-bottom-color: var(--blue-mid);
  color: var(--blue-dark);
}

.tab-icon { font-size: 18px; line-height: 1; }
.tab-label {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-tab.active .tab-label { font-weight: 700; color: var(--blue-dark); }

.nav-indicator {
  height: 3px;
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-light));
  transition: width .3s ease;
}

/* ══════════════════════════════════════════
   MAIN CONTENT AREA
══════════════════════════════════════════ */
.app-main {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Loading state ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 16px;
  color: var(--text-muted);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-mid);
  border-radius: 50%;
  animation: rotate .7s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .15s;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(680px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 12px 12px 0 0;
  background: var(--border-light);
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.modal-content { padding: 24px; }

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text-primary);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideLeft .25s ease;
  min-width: 280px;
}
@keyframes slideLeft { from { transform: translateX(20px); opacity: 0; } }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--orange); color: #fff; }
.toast.info    { background: var(--blue-mid); }

/* ══════════════════════════════════════════
   UTILITY
══════════════════════════════════════════ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-muted);
  gap: 12px;
  text-align: center;
}
.empty-state .empty-icon { font-size: 48px; opacity: .4; }
.empty-state p { font-size: 13px; max-width: 300px; line-height: 1.6; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
