/* Paleta neutra: grises cálidos y casi negro. Solo la marca lleva color. */
:root {
  --bg: #F4F3F1;
  --panel: #FFFFFF;
  --ink: #1C1C1E;
  --ink-2: #5E5E63;
  --ink-3: #9A9AA0;
  --line: #E6E4E0;
  --head: #1C1C1E;
  --ok: #3FA672;
  --mid: #E2A93B;
  --off: #D9D7D3;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-3); }
.warn { color: #B26B00; cursor: help; }

/* Cabecera */
.top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: var(--head); color: #fff; position: sticky; top: 0; z-index: 20; }
/* Mismo estilo de logo que ventas.sharkevents.es */
.logo { font-family: var(--font); font-size: 26px; font-weight: 900; letter-spacing: -1px; }
.logo span { color: #8E8E93; font-size: .55em; vertical-align: super; margin-left: 1px; }
.top-title { color: #A9A9AE; font-size: 13px; border-left: 1px solid #3A3A3D; padding-left: 16px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.top .muted { color: #A9A9AE; }
.btn { background: #fff; color: var(--ink); border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: transparent; color: #CFCFD3; border: 1px solid #3A3A3D; }
.modal .btn.ghost { color: var(--ink-2); border-color: var(--line); }
.modal .btn:not(.ghost) { background: var(--ink); color: #fff; }

main { padding: 22px 28px 40px; max-width: 1500px; margin: 0 auto; }

/* Tarjetas resumen */
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-align: left; cursor: pointer; transition: .15s; }
.card b { display: block; font-size: 26px; font-weight: 700; color: var(--ink-3); }
.card.has b { color: var(--ink); }
.card span { font-size: 12px; color: var(--ink-2); }
.card:hover { border-color: #C9C6C0; }
.card.on { background: var(--ink); border-color: var(--ink); }
.card.on b, .card.on span { color: #fff; }

/* Filtros */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-right { margin-left: auto; display: flex; gap: 8px; }
.filter-right select, .filter-right input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.filter-right input { width: 210px; }
.active-card { font-size: 13px; color: var(--ink-2); margin: -2px 0 10px; }
.active-card button { background: none; border: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; margin-left: 6px; }

/* Tabla */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
th { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: center; line-height: 1.25; background: #FAFAF9; position: sticky; top: 0; }
th.c-date, th.c-brand, th.c-name { text-align: left; padding-left: 16px; }
td { border-bottom: 1px solid #F0EEEA; padding: 10px 8px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #FBFAF8; }
td small { display: block; font-size: 11px; color: var(--ink-3); }
.c-date { width: 92px; padding-left: 16px; white-space: nowrap; }
.c-brand { width: 110px; padding-left: 16px; }
.c-name { padding-left: 16px; min-width: 180px; }
.c-note { width: 40px; text-align: center; }
tr.closed td { opacity: .55; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: #F1F0EE; color: var(--ink-2); white-space: nowrap; }

td.st { text-align: center; cursor: pointer; width: 92px; }
td.st:hover { background: #F3F1EE !important; }
td.st small { margin-top: 3px; max-width: 90px; margin-inline: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; position: relative; vertical-align: middle; }
.dot.s1 { background: var(--ok); }
.dot.s2 { background: var(--mid); }
.dot.s0 { background: transparent; border: 2px solid var(--off); }
.dot.auto { background: repeating-linear-gradient(45deg, var(--off) 0 3px, transparent 3px 6px); border: 1px solid var(--off); }
.dot.man::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; }

.note { background: none; border: 0; cursor: pointer; color: #CFCCC6; font-size: 15px; }
.note.has { color: var(--ink); }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }

.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 14px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 12px; height: 12px; }

/* Menú emergente */
.pop { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 8px; min-width: 240px; max-width: 320px; }
.pop-title { font-weight: 700; font-size: 13px; padding: 6px 8px 8px; }
.pop-title small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.pop-detail { font-size: 12px; color: var(--ink-2); background: #F6F5F3; border-radius: 8px; padding: 7px 9px; margin: 0 4px 6px; word-break: break-word; }
.pop button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 8px; padding: 8px 9px; cursor: pointer; text-align: left; font-size: 13px; }
.pop button:hover { background: #F3F1EE; }
.pop button.cur { background: #EDEBE7; font-weight: 600; }
.pop .dot { width: 13px; height: 13px; }

/* Notas */
.modal { position: fixed; inset: 0; background: rgba(28,28,30,.35); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; padding: 20px; width: min(480px, 92vw); }
.modal-title { font-weight: 700; margin-bottom: 10px; }
.modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--head); }
.login-card { background: #fff; border-radius: 16px; padding: 34px 32px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.login-card .logo { color: var(--ink); text-align: center; font-size: 30px; }
.login-card .sub { text-align: center; color: var(--ink-3); margin-top: -10px; font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); }
.login-card input { border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 14px; }
.login-card button { background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 11px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.err { background: #FBEAEA; color: #A33; border-radius: 8px; padding: 8px 10px; font-size: 13px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  main { padding: 14px; }
  .top { padding: 12px 14px; }
  .top-title { display: none; }
  .filter-right { margin-left: 0; width: 100%; }
  .filter-right input { flex: 1; width: auto; }
}
