/* 4201 Salinas — panel admin. Paleta caribeña: turquesa + terracota. */
:root {
  --brand: #0e7c8c;
  --brand-dark: #0a5d69;
  --accent: #c96f4a;
  --ink: #212b36;
  --muted: #6b7885;
  --bg: #f4f7f8;
  --card: #ffffff;
  --rule: #dde5e8;
  --ok: #2e7d54;
  --warn: #b3701f;
  --bad: #b3402e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 10px; }
.error { color: var(--bad); }
a { color: var(--brand); }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
code { background: #eef2f4; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card); padding: 34px 38px; border-radius: 12px; box-shadow: 0 8px 30px rgba(14, 124, 140, .12); width: 360px; }
.login-card h1 { color: var(--brand); }
.login-card label { display: block; margin: 14px 0 0; font-weight: 600; font-size: 12px; }
.login-card input { width: 100%; margin-top: 4px; }
.login-card button { width: 100%; margin-top: 18px; }
.totp-secret { display: block; text-align: center; font-size: 13px; letter-spacing: 1.5px; padding: 8px; margin: 8px 0; word-break: break-all; }
.totp-qr { display: flex; justify-content: center; margin: 12px 0; }
.totp-qr svg { width: 210px; height: 210px; border: 1px solid var(--rule); border-radius: 8px; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: var(--brand-dark); color: #fff; display: flex; flex-direction: column; padding: 18px 0; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { font-weight: 800; font-size: 17px; padding: 0 20px 14px; letter-spacing: .3px; }
.sidebar a { color: #cfe6ea; text-decoration: none; padding: 8px 20px; font-size: 13px; }
.sidebar a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar a.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 14px 20px 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-footer .muted { color: #9fc3ca; }
main { flex: 1; padding: 26px 32px; max-width: 1200px; }

/* Componentes */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 800; color: var(--brand); }
.stat .l { font-size: 12px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--rule); }
td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:hover td { background: #f8fbfc; }

input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14, 124, 140, .3); border-color: var(--brand); }
input[type="number"] { width: 130px; }
input[type="date"] { width: 150px; }

button { font: inherit; font-weight: 600; padding: 8px 14px; border: 0; border-radius: 7px; background: var(--brand); color: #fff; cursor: pointer; }
button:hover { background: var(--brand-dark); }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--rule); }
button.ghost:hover { background: #eef4f5; }
button.danger { background: var(--bad); }
button.small { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge.pendiente { background: #fdf1dc; color: var(--warn); }
.badge.pendiente_pago { background: #e2f0fb; color: #1c5f96; }
.badge.confirmada, .badge.aprobada, .badge.ok { background: #e2f3e9; color: var(--ok); }
.badge.rechazada, .badge.expirada, .badge.cancelada, .badge.no_show { background: #fbe5e1; color: var(--bad); }
.badge.borrador { background: #ececec; color: #555; }
.badge.enviada { background: #e2f0fb; color: #1c5f96; }
.badge.aceptada { background: #e8e4f7; color: #5b4a9e; }
.badge.draft { background: #ececec; color: #555; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Fotos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-card { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.photo-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.photo-card .meta { padding: 7px 9px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; }
.flag { cursor: pointer; opacity: .35; }
.flag.on { opacity: 1; }
.dropzone { border: 2px dashed var(--rule); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); background: #fbfdfd; }
.dropzone.over { border-color: var(--brand); background: #eef7f8; }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 50; max-width: 420px; }
.toast.bad { background: var(--bad); }

/* Calendario mensual */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.cal-wd { text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 52px; border: 1px solid var(--rule); border-radius: 8px; padding: 5px 7px; font-size: 12px; font-weight: 600; background: #fff; }
.cal-day.empty { border: 0; background: transparent; }
.cal-day.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-day.firm { background: #d7ecef; border-color: #9fcdd5; color: var(--brand-dark); }
.cal-day.soft { background: #fdf1dc; border-color: #ecd3a4; color: var(--warn); }
.cal-day.manual { background: #ececec; border-color: #d4d4d4; color: #555; }
.cal-day.external { background: #e8e4f7; border-color: #cbc2ea; color: #5b4a9e; }
.cal-legend { margin-top: 12px; }
.cal-key { font-size: 11px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--rule); }
.cal-key.firm { background: #d7ecef; }
.cal-key.soft { background: #fdf1dc; }
.cal-key.manual { background: #ececec; }
.cal-key.external { background: #e8e4f7; }
