/* ============================================================
   GoUp Planner — Estilos principales
   Paleta: Azul oscuro, Azul claro, Blanco
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --blue-dark:    #1565C0;
  --blue-mid:     #1E88E5;
  --blue-light:   #42A5F5;
  --blue-bg:      #E3F2FD;
  --blue-subtle:  #F0F7FF;
  --white:        #FFFFFF;
  --gray-50:      #F8FAFC;
  --gray-100:     #F1F5F9;
  --gray-200:     #E2E8F0;
  --gray-400:     #94A3B8;
  --gray-600:     #475569;
  --gray-800:     #1E293B;
  --green:        #22C55E;
  --yellow:       #F59E0B;
  --red:          #EF4444;
  --orange:       #F97316;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12);
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  16px;

  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --sidebar-w: 240px;
  --topbar-h:  60px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--gray-50); color: var(--gray-800); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Layout principal ──────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--blue-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.3px;
}

.sidebar-logo .logo-text span {
  color: var(--blue-light);
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: var(--white);
}

.nav-item.active {
  background: rgba(255,255,255,.15);
  color: var(--white);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.user-info .user-role {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  text-transform: capitalize;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  width: 100%;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all .2s;
  margin-top: 6px;
}

.btn-logout:hover {
  background: rgba(239,68,68,.15);
  color: #FCA5A5;
}

/* ── Main content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 4px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin: 0;
}

/* ── Botones ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  line-height: 1;
}

.btn-primary {
  background: var(--blue-mid);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(30,136,229,.3);
}

.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(21,101,192,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.btn-danger {
  background: #FEF2F2;
  color: var(--red);
  border: 1px solid #FECACA;
}

.btn-danger:hover { background: #FEE2E2; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  transition: all .2s;
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body { padding: 22px; }

/* ── Badges de estado ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: capitalize;
}

.badge-planeado   { background: #EFF6FF; color: #3B82F6; }
.badge-grabado    { background: #FFF7ED; color: #EA580C; }
.badge-editado    { background: #FFFBEB; color: #D97706; }
.badge-cargado    { background: #F0FDF4; color: #16A34A; }
.badge-programado { background: #F5F3FF; color: #7C3AED; }
.badge-publicado  { background: #DCFCE7; color: #15803D; }
.badge-asignado   { background: #EFF6FF; color: #2563EB; }
.badge-pendiente  { background: #FFFBEB; color: #B45309; }
.badge-default    { background: var(--gray-100); color: var(--gray-600); }

/* ── Semáforo ───────────────────────────────────────────── */
.semaforo {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.semaforo-verde   { background: var(--green);  box-shadow: 0 0 6px rgba(34,197,94,.4); }
.semaforo-amarillo{ background: var(--yellow); box-shadow: 0 0 6px rgba(245,158,11,.4); }
.semaforo-rojo    { background: var(--red);    box-shadow: 0 0 6px rgba(239,68,68,.4); }

/* ── Formularios ────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(30,136,229,.12);
}

.form-control::placeholder { color: var(--gray-400); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-info    { background: var(--blue-bg); color: var(--blue-dark); border: 1px solid #BFDBFE; }

/* ── Tabla ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table.goup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.goup-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.goup-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}

.goup-table tbody tr:last-child td { border-bottom: none; }
.goup-table tbody tr:hover { background: var(--blue-subtle); }

/* ── Utilities ──────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm   { font-size: 13px; }
.text-xs   { font-size: 11px; }
.text-muted { color: var(--gray-400); }
.text-right { text-align: right; }
.font-bold  { font-weight: 600; }
.w-full { width: 100%; }

/* ── Login page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-dark) 0%, #0D47A1 50%, #1565C0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  top: -200px; right: -100px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  bottom: -150px; left: -100px;
  pointer-events: none;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,.25);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .brand {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1;
}

.login-logo .brand span { color: var(--blue-mid); }

.login-logo .brand-sub {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-top: 4px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 28px;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--blue-dark);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(21,101,192,.35);
}

.btn-login:hover {
  background: var(--blue-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30,136,229,.4);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-content {
    padding: 16px;
  }

  .menu-toggle {
    display: flex !important;
  }
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  transition: all .2s;
}

.menu-toggle:hover {
  background: var(--gray-100);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

.sidebar-overlay.active { display: block; }
