:root {
  --navy: #12284B;
  --navy-light: #1c3a6b;
  --gold: #C8A84B;
  --grey: #595959;
  --light: #F4F5F7;
  --border: #E1E4E8;
  --green: #2E7D4F;
  --red: #B3382C;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--light);
  color: #1A1A1A;
}

a { color: var(--navy); }

.hidden { display: none !important; }
.muted { color: var(--grey); }
.small { font-size: 0.85rem; }

/* Login */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #0a1830 100%);
}
.login-card {
  background: #fff; padding: 40px; border-radius: 12px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo-img { display: block; height: 56px; width: auto; margin-bottom: 6px; }
.login-card h1 { margin: 4px 0 4px; color: var(--navy); font-size: 1.5rem; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.login-card input, .login-card select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; }
.login-card button { background: var(--navy); color: #fff; border: none; padding: 12px; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.login-card button:hover { background: var(--navy-light); }
.alert { background: #FBE9E7; color: var(--red); padding: 10px 14px; border-radius: 6px; font-size: 0.9rem; margin-top: 14px; }
.alert-ok { background: #E6F4EA; color: var(--green); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

/* Topbar */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.brand span { color: var(--gold); font-weight: 400; font-size: 0.85rem; }
.brand-logo-wrap { display: inline-flex; align-items: center; background: #fff; padding: 5px 12px; border-radius: 6px; line-height: 0; }
.brand-logo { display: block; height: 22px; width: auto; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs a { color: #cdd6e3; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; }
.tabs a.active, .tabs a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.mes-selector select { padding: 6px 10px; border-radius: 6px; border: none; font-size: 0.85rem; }
.user-chip { font-size: 0.8rem; color: #cdd6e3; }
.logout-link { color: var(--gold); text-decoration: none; font-size: 0.85rem; font-weight: 600; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { color: var(--navy); margin-bottom: 4px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 22px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card h2 { color: var(--navy); font-size: 1.1rem; margin: 0 0 10px; }

.btn-sm {
  background: var(--navy); color: #fff; border: none; padding: 7px 14px;
  border-radius: 6px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.btn-sm:hover { background: var(--navy-light); }
.btn-secondary { background: #E1E4E8; color: #333; }
.btn-secondary:hover { background: #d2d6db; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f2c22; }
.btn-approve { background: var(--green); color: #fff; border: none; padding: 9px 16px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.btn-approve:hover { background: #235e3d; }

.edit-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; background: var(--light); padding: 14px; border-radius: 8px; }
.edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.edit-form input, .edit-form textarea, .edit-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.9rem; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form input { padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.inline-form button { background: var(--navy); color: #fff; border: none; padding: 9px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
form.inline { display: inline; }

/* Calendar */
.calendar { margin-top: 8px; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { color: var(--grey); font-size: 0.78rem; font-weight: 700; text-align: center; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  aspect-ratio: 1; background: var(--light); border-radius: 8px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; position: relative;
  font-size: 0.85rem; color: #333;
}
.cal-cell.empty { background: transparent; }
.cal-cell.has-post { background: #E9EEF6; cursor: pointer; font-weight: 700; color: var(--navy); }
.cal-cell.has-post:hover { background: #d8e2f0; }
.cal-cell.has-pauta { box-shadow: inset 0 0 0 2px var(--gold); }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--navy); margin-top: 2px; }
.day-detail { margin-top: 14px; background: var(--light); border-radius: 8px; padding: 12px 16px; }
.day-detail ul { margin: 6px 0 0; padding-left: 18px; }

/* Items */
.items-list { display: flex; flex-direction: column; gap: 16px; }
.item-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.formato-tag { display: inline-block; background: var(--navy); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-bottom: 4px; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.badge-pendiente { background: #FBF1DA; color: #8a6500; }
.badge-aprobado { background: #E6F4EA; color: var(--green); }

.item-body { display: grid; grid-template-columns: 280px 1fr; gap: 0; }
@media (max-width: 720px) { .item-body { grid-template-columns: 1fr; } }
.item-media { padding: 16px; border-right: 1px solid var(--border); }
@media (max-width: 720px) { .item-media { border-right: none; border-bottom: 1px solid var(--border); } }
.item-media img, .item-media video { width: 100%; border-radius: 8px; display: block; }
.media-placeholder { background: var(--light); border: 1px dashed var(--border); border-radius: 8px; height: 160px; display: flex; align-items: center; justify-content: center; color: var(--grey); font-size: 0.85rem; }
.upload-form { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.upload-form input[type=file] { font-size: 0.78rem; }

.carousel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.carousel-thumb { position: relative; border-radius: 8px; overflow: hidden; }
.carousel-thumb img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.carousel-del-form { position: absolute; top: 4px; right: 4px; margin: 0; }
.carousel-del-btn {
  background: rgba(18,40,75,0.75); color: #fff; border: none; width: 22px; height: 22px;
  border-radius: 50%; font-size: 0.95rem; line-height: 1; cursor: pointer; display: flex;
  align-items: center; justify-content: center; padding: 0;
}
.carousel-del-btn:hover { background: var(--red); }

.item-info { padding: 16px 18px; }
.field { margin-bottom: 10px; }
.field-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); }
.field p { margin: 4px 0 0; }

.approval-box { margin: 14px 0; padding-top: 14px; border-top: 1px solid var(--border); }
.approved-by { color: var(--green); font-weight: 600; margin: 0 0 8px; }

.comments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.comment { background: var(--light); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.comment p { margin: 4px 0 0; font-size: 0.9rem; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form textarea { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; resize: vertical; }

.site-footer { text-align: center; color: var(--grey); font-size: 0.8rem; padding: 20px; }
