/* Hakiour · Clientes potenciales. Sencillo y pensado para el móvil: se llama desde él. */
:root {
  --ink: #0B1220; --ink-2: #39435A; --muted: #6B7385; --line: #E6E9F0; --bg: #FAFAFC;
  --violet: #7C3AED; --violet-deep: #5B21B6; --violet-soft: #F3EFFE;
  --mint: #1F7A57; --danger: #C2410C; --amber: #B45309;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--violet-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: .2rem 0 .2rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.8rem 0 .6rem; font-weight: 700; }
[hidden] { display: none !important; }
.wrap { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.sub { color: var(--muted); font-size: .92rem; margin: 0; }
.empty { color: var(--muted); padding: 1rem 0; }
.notice { background: #FEF6E7; border-radius: 10px; padding: .6rem .8rem; color: #7A3A06; }
.warn { color: var(--amber); font-size: .82rem; font-weight: 600; white-space: nowrap; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.tabs { display: flex; gap: .2rem; flex: 1; }
.tabs a { color: var(--muted); padding: .4rem .75rem; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); background: #F0F1F5; }
.tabs b { color: var(--violet); }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
@media (max-width: 640px) {
  .brand span { display: none; }
  .top { justify-content: space-between; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
    padding: .35rem .5rem max(.35rem, env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabs a { flex: 1; text-align: center; padding: .6rem .2rem; }
}

/* Controles */
button, .btn { font: inherit; font-size: .92rem; font-weight: 600; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); padding: .45rem .8rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; }
button:hover, .btn:hover { border-color: #C9CEDA; text-decoration: none; }
.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.primary:hover { background: var(--violet-deep); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.ok { color: var(--mint); }
button.bad { color: var(--danger); }
.big { width: 100%; min-height: 48px; font-size: 1rem; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem;
  background: #fff; width: 100%; min-height: 40px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
label > input, label > select, label > textarea, label > .two { margin-top: .25rem; font-weight: 400; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.fields { display: grid; gap: .8rem; }

/* Hoy */
.week { margin: .3rem 0 0; color: var(--muted); }
.week b { color: var(--ink); }
.items { display: grid; gap: .6rem; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; }
.item-head { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.item .name { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.item time { color: var(--muted); font-size: .88rem; white-space: nowrap; text-align: right; }
.item time.late { color: var(--danger); font-weight: 600; }
.step { margin: .4rem 0 0; font-size: .92rem; color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .3rem; font-size: .92rem; }
.outcomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-top: .7rem; }
.outcomes button { font-size: .85rem; padding: .4rem .3rem; }
@media (max-width: 520px) { .outcomes { grid-template-columns: 1fr 1fr; } }

/* Clientes */
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.count { color: var(--muted); font-size: .85rem; margin: .8rem 0 .3rem; }
.rows { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .9rem; color: var(--ink); }
.rows a:hover { background: #F7F7FA; text-decoration: none; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main b { font-weight: 600; }
.row-side { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.foot { margin-top: 1.5rem; font-size: .9rem; }

/* Ficha */
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .2rem .9rem .9rem; margin-top: 1rem; }
.box h2 { margin-top: .8rem; }
details.box > summary { cursor: pointer; list-style: none; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary h2 { display: inline-block; margin-bottom: .2rem; }
details.box > summary h2::after { content: " ▸"; }
details.box[open] > summary h2::after { content: " ▾"; }
.next { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; }
@media (max-width: 520px) { .next { grid-template-columns: 1fr; } }
#next-warn { margin-top: .3rem; }
.history { list-style: none; margin: .8rem 0 0; padding: 0; font-size: .92rem; }
.history li { padding: .35rem 0; border-top: 1px solid var(--line); }
.history .when { color: var(--muted); font-size: .85rem; }

/* Diálogo y avisos */
dialog { border: 0; border-radius: 14px; padding: 1.1rem; width: min(420px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(11, 18, 32, .25); }
dialog::backdrop { background: rgba(11, 18, 32, .4); }
dialog form { display: grid; gap: .8rem; }
dialog h2 { margin: 0; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
#toast { position: fixed; left: 50%; bottom: 5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .55rem 1rem;
  border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 2rem); }
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }

/* Acceso */
.login { max-width: 340px; margin: 14vh auto 0; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.login > * { width: 100%; }
.login img { width: 48px; }
.login form { display: grid; gap: .6rem; }
.login .notice { text-align: left; margin: 0; }
