:root {
  /* Marca PC BOX */
  --brand-green: #007549;
  --brand-green-d: #00623d;
  --brand-yellow: #FBB814;
  --brand-gray: #929291;
  /* Naranja de la app de reparaciones (logo) */
  --brand-orange: #ff5a00;
  --brand-orange-d: #e64e00;

  --bg: #eceef1;
  --card: #ffffff;
  --card2: #f2f4f6;
  --text: #212630;
  --muted: #6f7680;
  --primary: #007549;
  --green: #007549;
  --amber: #FBB814;
  --red: #d23b2c;
  --border: #e2e6ec;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
/* Logo PC BOX Expert's Center (imagen con fondo transparente, flotando) */
.brand-img { height: 58px; width: auto; display: block; }
header.top h1 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -.2px; }
header.top .sub { color: var(--muted); font-size: 13px; }

.clock { text-align: center; margin: 6px 0 20px; }
.clock .time { font-size: 54px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--text); }
.clock .date { color: var(--muted); font-size: 15px; text-transform: capitalize; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

label.field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
select, input[type="text"], input[type="password"], input[type="date"], input[type="number"] {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  outline: none;
}
select { background: var(--card2); }
select:focus, input:focus { border-color: var(--brand-green); box-shadow: 0 0 0 3px rgba(0,117,73,.12); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
  margin: 6px 0 2px;
}
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; }
.st-out   { background: #eceef1; color: var(--muted); }
.st-out .dot { background: var(--muted); }
.st-working { background: #e1f2ea; color: var(--brand-green); }
.st-working .dot { background: var(--brand-green); }
.st-paused { background: #fef1d5; color: #9a6b00; }
.st-paused .dot { background: var(--amber); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 17px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: transform .06s ease, opacity .2s, filter .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-in { background: var(--brand-green); }
.btn-out { background: var(--red); }
.btn-pause { background: var(--amber); color: #4a3400; }
.btn-primary { background: var(--brand-green); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn:hover { filter: brightness(1.04); }

.hint { color: var(--muted); font-size: 13px; text-align: center; margin-top: 8px; }
.spacer { flex: 1; }

.timeline { margin-top: 6px; }
.timeline .ev {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.timeline .ev:last-child { border-bottom: none; }
.timeline .ev .t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 52px; }
.timeline .ev .badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.b-in { background: #e1f2ea; color: var(--brand-green); }
.b-out { background: #fbe4e1; color: #b3271a; }
.b-bs { background: #fef1d5; color: #9a6b00; }
.b-be { background: #e6eef6; color: #2f5d86; }

.foot-link { text-align: center; margin-top: 10px; }
.foot-link a { color: var(--muted); font-size: 13px; text-decoration: none; }
.foot-link a:hover { color: var(--brand-green); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #fff; color: var(--text); padding: 13px 18px; border-radius: 12px;
  border: 1px solid var(--border); font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 50; max-width: 90%;
  box-shadow: 0 8px 24px rgba(17,24,39,.14);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-left: 4px solid var(--red); }
.toast.ok { border-left: 4px solid var(--brand-green); }

/* Modal PIN */
.overlay {
  position: fixed; inset: 0; background: rgba(20,28,24,.45);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 40;
}
.overlay.show { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(17,24,39,.25);
}
.modal h3 { margin: 0 0 14px; }
.pin-display { text-align: center; font-size: 32px; letter-spacing: 10px; margin: 10px 0 18px; min-height: 40px; font-variant-numeric: tabular-nums; color: var(--brand-green); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button {
  background: var(--card2); border: 1px solid var(--border); color: var(--text);
  font-size: 22px; padding: 16px; border-radius: 12px; cursor: pointer; font-weight: 600;
}
.keypad button:active { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td.num { font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--card2); }
.table-wrap { overflow-x: auto; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.badge-open { background: #fef1d5; color: #9a6b00; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-closed { background: #e1f2ea; color: var(--brand-green); padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip { display:inline-flex; gap:6px; align-items:center; background: var(--card); border:1px solid var(--border); padding:8px 12px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); }
.chip button { background:none; border:none; color: var(--red); cursor:pointer; font-size:16px; }
.mini { font-size: 13px; color: var(--muted); }
.stat-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom: 16px; }
.stat { background: var(--card2); border:1px solid var(--border); border-radius:12px; padding:14px 16px; flex:1; min-width: 120px; }
.stat .n { font-size: 24px; font-weight:800; color: var(--brand-green); }
.stat .l { color: var(--muted); font-size: 12px; }

/* Barra superior de marca (franja verde fina) */
.brandbar { height: 4px; background: linear-gradient(90deg, var(--brand-yellow) 0 33%, var(--brand-gray) 33% 66%, var(--brand-green) 66% 100%); }
