/* ─── RESET & BASE ───────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #e8f0fe;
  color: #1e3a5f;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

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

/* ─── SIDEBAR ────────────────────────────────────── */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: #1a3a6b;
  border-right: 1px solid #1e4080;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 24px;
  border-bottom: 1px solid #1e4080;
  margin-bottom: 12px;
}
.sidebar-icon { font-size: 28px; }
.sidebar-brand { font-weight: 800; font-size: 16px; color: #fff; }
.sidebar-sub { font-size: 11px; color: #93c5fd; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }

.sidebar-nav { padding: 0 12px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #bfdbfe;
  transition: all .15s;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover { background: #1e4d9b; color: #fff; }
.nav-item.active { background: #2563eb; color: #fff; font-weight: 600; }
.nav-icon { font-size: 16px; min-width: 20px; }

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #60a5fa;
  padding: 16px 20px 8px;
}
.sidebar-actions { padding: 12px; }
.btn-sidebar {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  text-align: left;
  margin-bottom: 6px;
}
.btn-sidebar:hover { opacity: .88; }
.btn-sidebar-orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.btn-sidebar-green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.sidebar-footer { padding: 16px 12px 0; margin-top: auto; border-top: 1px solid #1e4080; }
.nav-logout { color: #fca5a5 !important; }
.nav-logout:hover { background: #7f1d1d40 !important; }

/* ─── MAIN ───────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── TOPBAR ─────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid #bfdbfe;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 18px; font-weight: 700; color: #1e3a5f; }
.user-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
}

/* ─── CONTENT ────────────────────────────────────── */
.content { padding: 28px; overflow-y: auto; flex: 1; }

/* ─── ALERTS ─────────────────────────────────────── */
.alert-error {
  background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b;
  padding: 12px 20px; border-radius: 8px; margin: 0 28px 16px; font-size: 14px;
}
.alert-success {
  background: #dcfce7; border: 1px solid #86efac; color: #166534;
  padding: 12px 20px; border-radius: 8px; margin: 0 28px 16px; font-size: 14px;
}
.alert-info {
  background: #dbeafe; border: 1px solid #93c5fd; color: #1d4ed8;
  padding: 12px 20px; border-radius: 8px; margin: 0 28px 16px; font-size: 14px;
}
.alert-warning {
  background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
  padding: 12px 20px; border-radius: 8px; margin: 0 28px 16px; font-size: 14px;
}

/* ─── STATS ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s;
  cursor: pointer;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { font-size: 22px; }
.stat-value { font-size: 32px; font-weight: 800; color: #1e3a5f; }
.stat-label { font-size: 12px; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-total   { border-top: 3px solid #2563eb; }
.stat-warning { border-top: 3px solid #f59e0b; }
.stat-info    { border-top: 3px solid #3b82f6; }
.stat-success { border-top: 3px solid #10b981; }
.stat-danger  { border-top: 3px solid #ef4444; }
.stat-purple  { border-top: 3px solid #6366f1; }

/* ─── QUICK ACTIONS ──────────────────────────────── */
.quick-actions { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.btn-action-lg {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all .15s;
  flex: 1;
  color: #1e3a5f;
  min-width: 200px;
  font-family: inherit;
}
.btn-action-lg:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.12); }
.btn-action-lg strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.btn-action-lg small { font-size: 12px; color: #64748b; }
.btn-icon { font-size: 24px; }
.btn-blue-left  { border-left: 3px solid #2563eb; }
.btn-orange-left { border-left: 3px solid #f59e0b; }
.btn-green-left { border-left: 3px solid #10b981; }

/* ─── PANEL ──────────────────────────────────────── */
.panel {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-header h3 { font-size: 15px; font-weight: 700; color: #1e3a5f; }
.panel-link { font-size: 13px; color: #2563eb; }
.panel-link:hover { text-decoration: underline; }

/* ─── TOOLBAR ────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.search-form { flex: 1; min-width: 240px; }
.search-wrap { display: flex; gap: 0; }
.search-input {
  flex: 1;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-right: none;
  color: #1e3a5f;
  padding: 10px 16px;
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  outline: none;
}
.search-input::placeholder { color: #93c5fd; }
.search-input:focus { border-color: #2563eb; }
.search-btn {
  background: #2563eb; border: none; color: #fff;
  padding: 10px 16px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px;
}
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtro-select {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
.filtro-select:focus { border-color: #2563eb; }
.filtro-btn {
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: #fff; border: 1px solid #bfdbfe; color: #3b82f6; cursor: pointer; transition: all .15s;
}
.filtro-btn:hover, .filtro-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.vista-btn {
  padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: #fff; border: 1px solid #bfdbfe; color: #64748b; cursor: pointer; transition: all .15s;
  text-decoration: none; display: inline-block;
}
.vista-btn.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.result-count { font-size: 13px; color: #64748b; margin-bottom: 12px; }

/* ─── IDEA CARDS LIST ────────────────────────────── */
.ideas-list { display: flex; flex-direction: column; gap: 12px; }
.idea-card {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.idea-card:hover { border-color: #2563eb; box-shadow: 0 2px 12px rgba(37,99,235,.1); }

.idea-card-media {
  width: 90px; min-width: 90px; position: relative; background: #dbeafe;
}
.idea-card-img { width: 90px; height: 90px; object-fit: cover; display: block; }
.idea-card-img-empty {
  width: 90px; height: 90px; display: flex; align-items: center;
  justify-content: center; font-size: 28px; background: #dbeafe;
}
.idea-card-status {
  position: absolute; bottom: 4px; left: 4px;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .3px;
}
.status-aprobado  { background: #16a34acc; color: #fff; }
.status-publicado { background: #7c3aedcc; color: #fff; }
.status-pendiente, .status- { background: #64748bcc; color: #fff; }
.status-rechazado { background: #dc2626cc; color: #fff; }
.status-reemplazado { background: #94a3b8cc; color: #fff; }

.idea-card-body { flex: 1; padding: 14px 16px; }
.idea-card-id { font-size: 11px; color: #93c5fd; font-family: monospace; margin-bottom: 4px; }
.idea-card-titulo { font-size: 14px; font-weight: 600; color: #1e3a5f; margin-bottom: 8px; line-height: 1.4; }
.idea-card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.idea-card-caption { font-size: 12px; color: #64748b; line-height: 1.5; margin-bottom: 6px; }
.idea-card-fecha { font-size: 11px; color: #93c5fd; }
.idea-card-pub-mode { font-size: 11px; color: #94a3b8; margin-top: 4px; }

.idea-card-actions {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px; justify-content: center; min-width: 130px;
}

/* ─── BADGES ─────────────────────────────────────── */
.badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; display: inline-block;
}
.badge-aprobado  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge-publicado { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.badge-pendiente { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-rechazado { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-plat { background: #dbeafe; color: #1d4ed8; }
.badge-auto { background: #dcfce7; color: #166534; }
.badge-telegram { background: #fef3c7; color: #92400e; }
.badge-semana { background: #f1f5f9; color: #64748b; }

/* ─── BUTTONS ────────────────────────────────────── */
.btn-sm {
  padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; transition: opacity .15s; white-space: nowrap;
  text-align: center; display: inline-block; font-family: inherit;
}
.btn-sm:hover { opacity: .85; }
.btn-blue  { background: #2563eb; color: #fff; }
.btn-green { background: #10b981; color: #fff; }
.btn-red   { background: #ef4444; color: #fff; }
.btn-gray  { background: #e2e8f0; color: #1e3a5f; }
.btn-orange { background: #f59e0b; color: #fff; }

/* ─── UPCOMING TABLE ─────────────────────────────── */
.upcoming-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.upcoming-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: #64748b;
  border-bottom: 1px solid #bfdbfe; background: #f8faff;
}
.upcoming-table td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; color: #1e3a5f; }
.upcoming-table tr:last-child td { border-bottom: none; }
.upcoming-table tr:hover td { background: #f8faff; }

/* ─── EMPTY ──────────────────────────────────────── */
.empty-big { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 16px; color: #93c5fd; }

/* ─── TOAST ──────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px; padding: 14px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 9999;
  max-width: 360px; box-shadow: 0 8px 30px rgba(37,99,235,.2); transition: all .3s;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(10px); }
.toast.toast-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.toast.toast-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.toast.toast-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.toast.toast-loading { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.toast.toast-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ─── LOGIN ──────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a3a6b 0%, #1d4ed8 100%);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 40px; width: 100%;
  max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: #1e3a5f; }
.login-logo p { font-size: 13px; color: #64748b; margin-top: 4px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; font-weight: 600; color: #1e3a5f; margin-bottom: 6px; }
.login-field input {
  width: 100%; background: #f8faff; border: 1.5px solid #bfdbfe; color: #1e3a5f;
  padding: 11px 14px; border-radius: 8px; font-size: 14px; outline: none; transition: border-color .15s;
}
.login-field input:focus { border-color: #2563eb; }
.login-pwd-wrap {
  display: flex; align-items: stretch; background: #f8faff; border: 1.5px solid #d1d9f0;
  border-radius: 8px; overflow: hidden; transition: border-color .15s;
}
.login-pwd-wrap:focus-within { border-color: #2563eb; }
.login-pwd-wrap input {
  flex: 1; width: 0 !important; min-width: 0 !important; border: none !important;
  border-radius: 0 !important; background: transparent !important; outline: none;
}
.login-pwd-eye {
  flex-shrink: 0; width: 40px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-left: 1.5px solid #d1d9f0; cursor: pointer;
  color: #94a3b8; transition: color .15s;
}
.login-pwd-eye:hover { color: #2563eb; }
.login-btn {
  width: 100%; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
  border: none; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 8px; transition: opacity .2s; font-family: inherit;
}
.login-btn:hover { opacity: .9; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { flex-direction: column; }
  .idea-card-actions { min-width: 100px; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}
