/* Nail Salon System — simple yet modern, phone-first. Base font 18px, min tap target 48px. */
* { box-sizing: border-box; }
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 14px;
}
html { font-size: 18px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 .5rem; }
p { margin: .4rem 0; }
small, .muted { color: var(--muted); }
a { color: var(--blue); }

/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  position: sticky; top: 0; z-index: 20;
}
header .brand { font-weight: 800; font-size: 1.2rem; }
header .who { display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; }

/* Tabs */
nav.tabs {
  display: flex; gap: .4rem; padding: .6rem .8rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  overflow-x: auto; position: sticky; top: 57px; z-index: 19;
}
nav.tabs button {
  flex: 1 0 auto; min-height: 48px; padding: .5rem .9rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 1rem; font-weight: 600; color: var(--ink); cursor: pointer;
  position: relative; white-space: nowrap;
}
nav.tabs button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
nav.tabs .badge {
  position: absolute; top: -6px; right: -2px; background: var(--red); color: #fff;
  border-radius: 999px; min-width: 22px; height: 22px; line-height: 22px;
  font-size: .8rem; padding: 0 5px; text-align: center;
}

main { max-width: 1100px; margin: 0 auto; padding: 1rem .8rem 6rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }

/* Buttons & inputs — all >= 48px tall */
button, .btn {
  min-height: 52px; padding: .7rem 1.1rem; font-size: 1.05rem; font-weight: 700;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; font-family: inherit;
}
button.primary, .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:active { background: var(--blue-dark); }
button.danger { color: var(--red); border-color: #fecaca; }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: default; }
button.big { width: 100%; font-size: 1.2rem; min-height: 60px; }
button.small { min-height: 44px; padding: .4rem .8rem; font-size: .95rem; }
input, select, textarea {
  width: 100%; min-height: 52px; padding: .65rem .8rem; font-size: 1.05rem;
  border: 1.5px solid #d1d5db; border-radius: 12px; background: #fff; color: var(--ink);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 3px solid #bfdbfe; border-color: var(--blue); }
label { display: block; font-weight: 700; margin: .9rem 0 .35rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .95rem; }
textarea { min-height: 90px; resize: vertical; }

.empty {
  background: #f9fafb; border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 1.4rem 1rem; text-align: center; color: var(--muted); font-size: 1.05rem;
}
.error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 600;
}
.ok-msg { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.server-down {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 12px; padding: 1rem; margin-bottom: 1rem; font-weight: 600;
}

/* Sign-in chips + keypad */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 480px) { .chips { grid-template-columns: 1fr; } }
.chip {
  display: flex; align-items: center; gap: .7rem; min-height: 64px;
  padding: .7rem 1rem; border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: 1.15rem; font-weight: 700; cursor: pointer; text-align: left; width: 100%;
}
.chip.selected { border-color: var(--blue); background: #eff6ff; }
.chip .avatar { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 800; flex: 0 0 auto; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; max-width: 360px; margin: 0 auto; }
.keypad button { min-height: 64px; font-size: 1.5rem; border-radius: 14px; }
.pin-dots { font-size: 2rem; letter-spacing: .4rem; text-align: center; min-height: 48px; font-weight: 800; }
.linklike { background: none; border: none; color: var(--blue); font-size: 1rem; min-height: 48px; padding: .5rem; cursor: pointer; font-weight: 600; text-decoration: underline; }

/* Home */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #f9fafb; border-radius: 12px; padding: .9rem .7rem; text-align: center; }
.stat .num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .95rem; }
.person-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid #f3f4f6; }
.person-row:last-child { border-bottom: none; }
.pill { margin-left: auto; background: #eff6ff; color: var(--blue); border-radius: 999px; padding: .25rem .7rem; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.pill.off { background: #f3f4f6; color: var(--muted); }

/* Schedule */
.weekstrip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; }
.weekstrip button { flex: 1 0 52px; min-height: 60px; padding: .3rem; border-radius: 12px; font-size: .95rem; }
.weekstrip button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.weekstrip .dow { display: block; font-size: .8rem; font-weight: 600; }
.tray { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.client-chip {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; padding: .4rem .8rem;
  border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 700; cursor: grab; font-size: 1rem;
}
.client-chip.selected { border-color: var(--blue); background: #eff6ff; box-shadow: 0 0 0 3px #bfdbfe; }
.client-chip.dragging { opacity: .5; }
.grid-wrap { overflow-x: auto; }
.day-grid { display: flex; min-width: 640px; }
.time-col { flex: 0 0 64px; }
.time-cell { height: 56px; border-bottom: 1px solid #f3f4f6; font-size: .85rem; color: var(--muted); padding-top: 2px; text-align: right; padding-right: 6px; }
.tech-col { flex: 1; position: relative; border-left: 1px solid var(--line); min-width: 120px; }
.tech-col.off { background: #f3f4f6; }
.tech-col.drop-ok { background: #eff6ff; }
.tech-head { min-height: 56px; padding: .4rem .3rem; text-align: center; font-weight: 800; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.tech-head .off-tag { display: block; color: var(--muted); font-size: .85rem; }
.slot { height: 56px; border-bottom: 1px solid #f3f4f6; }
.slot.tap-target { cursor: pointer; }
.slot.tap-target:active { background: #eff6ff; }
.appt {
  position: absolute; left: 3px; right: 3px; border-radius: 10px; padding: 4px 6px;
  color: #fff; font-size: .9rem; font-weight: 700; overflow: hidden; cursor: pointer;
  border-left: 6px solid rgba(0,0,0,.35); z-index: 4; line-height: 1.25;
}
.appt .sub { font-weight: 500; font-size: .8rem; opacity: .95; display: block; }
.appt.done { opacity: .55; }
.appt.cancelled, .appt.no_show { opacity: .4; text-decoration: line-through; }
.appt.dragging { opacity: .4; }

/* Lists */
.item { display: flex; gap: .7rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid #f3f4f6; }
.item:last-child { border-bottom: none; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; }
.item .sub2 { color: var(--muted); font-size: .95rem; }
.tag { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; font-weight: 700; }
.tag.low { background: #fef2f2; color: var(--red); }
.tag.ok { background: #ecfdf5; color: var(--green); }
.tag.placed { background: #eff6ff; color: var(--blue); }
.tag.received { background: #ecfdf5; color: var(--green); }
.tag.cancelled { background: #f3f4f6; color: var(--muted); }
.tag.works { background: #ecfdf5; color: var(--green); }
.tag.clumsy { background: #fffbeb; color: var(--amber); }
.tag.broken { background: #fef2f2; color: var(--red); }
.tag.idea { background: #eff6ff; color: var(--blue); }
.unread { background: var(--red); color: #fff; border-radius: 999px; min-width: 26px; height: 26px; line-height: 26px; text-align: center; font-size: .9rem; font-weight: 800; padding: 0 6px; }
.msg { max-width: 85%; padding: .7rem .9rem; border-radius: 14px; margin-bottom: .6rem; }
.msg.salon { background: #eff6ff; margin-left: auto; }
.msg.client { background: #f3f4f6; }
.msg.system { background: #fffbeb; font-style: italic; color: var(--muted); }
.msg .meta { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: none; border-radius: 0; min-height: 48px; background: #fff; }
.seg button.active { background: var(--blue); color: #fff; }

/* Sheet (booking form / appointment detail) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 1.1rem 1rem 2rem; }
.sheet .close-x { float: right; }
.color-pick { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-pick button { width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; border: 3px solid transparent; }
.color-pick button.sel { border-color: var(--ink); }
.verdict-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.verdict-row button { min-height: 56px; font-size: .95rem; padding: .5rem .3rem; }
.verdict-row button.sel-works { background: #ecfdf5; border-color: var(--green); color: #065f46; }
.verdict-row button.sel-clumsy { background: #fffbeb; border-color: var(--amber); color: #92400e; }
.verdict-row button.sel-broken { background: #fef2f2; border-color: var(--red); color: #991b1b; }
.verdict-row button.sel-idea { background: #eff6ff; border-color: var(--blue); color: var(--blue-dark); }
.code-box { font-size: 2rem; font-weight: 800; letter-spacing: .3rem; text-align: center; background: #eff6ff; border: 2px dashed var(--blue); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.check-item { display: flex; gap: .7rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid #f3f4f6; }
.check-item:last-child { border-bottom: none; }
footer { text-align: center; color: var(--muted); font-size: .9rem; padding: 1rem; }
