/* Slavjane Folk Ensemble -- shared styles (login, member, admin). Light "linen + red/black embroidery" theme. */
:root {
  --paper: #f8f3ea;
  --card: #fffdf8;
  --ink: #1f1a16;
  --muted: #6d6258;
  --line: #e4dacb;
  --red: #a3221b;
  --red-dark: #7d1913;
  --red-soft: #f6e3df;
  --black: #22201e;
  --gold: #b8892a;
  --yes: #2f7a3e;
  --yes-soft: #e1f0e3;
  --maybe: #a46d0c;
  --maybe-soft: #fbefd6;
  --no: #a3221b;
  --no-soft: #f6e3df;
  --none: #8a8178;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(40, 25, 15, .06), 0 4px 14px rgba(40, 25, 15, .06);
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--sans); }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: .4em 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* cross-stitch band (red/black diamonds) */
.band {
  height: 10px;
  background:
    linear-gradient(135deg, var(--red) 25%, transparent 25%) -5px 0 / 10px 10px,
    linear-gradient(225deg, var(--black) 25%, transparent 25%) -5px 0 / 10px 10px,
    linear-gradient(315deg, var(--red) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(45deg, var(--black) 25%, transparent 25%) 0 0 / 10px 10px,
    var(--paper);
  opacity: .9;
}

/* header */
.top { background: var(--black); color: #fff; }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .02em; flex: 1; min-width: 0; }
.brand small { display: block; font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #d9c9b4; }
.top a, .top button.link { color: #f1dccb; }
.who { font-size: .85rem; text-align: right; color: #e9ddd0; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 96px; }

/* tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px 0; max-width: 1100px; margin: 0 auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; font: 600 .95rem var(--sans); color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--red); border-bottom-color: var(--red); }
.bottom-tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.bottom-tabs .tab { flex: 1; border-bottom: 0; border-top: 3px solid transparent; padding: 10px 4px 12px; font-size: .82rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom-tabs .tab.on { border-top-color: var(--red); }
.bottom-tabs .ico { font-size: 1.2rem; line-height: 1; }

/* cards & lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.card.alert { border-left: 5px solid var(--red); }
.card.click { cursor: pointer; }
.card.click:hover { border-color: #d3c3ad; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.datebox { width: 54px; flex: none; text-align: center; border-radius: 10px; background: var(--red-soft); color: var(--red-dark); padding: 6px 0; line-height: 1.1; }
.datebox .m { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.datebox .d { font: 700 1.35rem var(--serif); }
.datebox .w { font-size: .7rem; }
.datebox.reh { background: #ece6dc; color: var(--black); }

/* chips */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee6da; color: var(--black); white-space: nowrap; }
.chip.yes { background: var(--yes-soft); color: var(--yes); }
.chip.maybe { background: var(--maybe-soft); color: var(--maybe); }
.chip.no { background: var(--no-soft); color: var(--no); }
.chip.red { background: var(--red); color: #fff; }
.chip.dark { background: var(--black); color: #fff; }
.chip.gold { background: #f3e6c7; color: #7a5a14; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; }

/* buttons & forms */
button, .btn { font: 600 .95rem var(--sans); border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; }
button:hover, .btn:hover { border-color: #cbb9a1; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--red); border-color: var(--red); color: #fff; }
.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.danger { color: var(--red); border-color: #e6b9b3; }
.ghost { background: transparent; border-color: transparent; color: var(--red); padding-left: 8px; padding-right: 8px; }
.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--red); text-decoration: underline; font-weight: 500; }
.sm { padding: 5px 10px; min-height: 32px; font-size: .85rem; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: 16px var(--sans); color: var(--ink); background: #fff; border: 1px solid #d6c9b6; border-radius: 9px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--red); vertical-align: middle; }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } .grid3.keep { grid-template-columns: 1fr 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: .95rem; margin: 6px 0; cursor: pointer; }
.search { max-width: 340px; }

/* yes / maybe / no picker */
.ans { display: inline-flex; border: 1px solid #d6c9b6; border-radius: 10px; overflow: hidden; }
.ans button { border: 0; border-radius: 0; min-width: 64px; background: #fff; border-right: 1px solid #e3d8c8; }
.ans button:last-child { border-right: 0; }
.ans button.on.yes { background: var(--yes); color: #fff; }
.ans button.on.maybe { background: var(--maybe); color: #fff; }
.ans button.on.no { background: var(--no); color: #fff; }
.ans.locked button { cursor: default; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f3ece1; font-weight: 600; font-size: .82rem; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.c, th.c { text-align: center; }
.cell { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; border-radius: 7px; font-weight: 700; border: 1px solid transparent; background: #f2ede5; color: var(--none); cursor: default; padding: 0; min-height: 0; }
button.cell { cursor: pointer; }
.cell.yes { background: var(--yes-soft); color: var(--yes); }
.cell.maybe { background: var(--maybe-soft); color: var(--maybe); }
.cell.no { background: var(--no-soft); color: var(--no); }
th.best, td.best { background: #fbf3df; }

/* modal (one at a time) */
.modal-bg { position: fixed; inset: 0; background: rgba(25, 18, 12, .5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 16px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.modal-head { background: var(--black); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; color: #fff; }
.modal-head .x { background: none; border: 0; color: #fff; font-size: 1.6rem; min-height: 0; padding: 0 6px; line-height: 1; }
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; background: #f3ece1; position: sticky; bottom: 0; }
@media (max-width: 600px) {
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; }
}
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; overflow-x: auto; }
.subtabs .tab { padding: 8px 12px; font-size: .9rem; }

/* toast */
.toast-box { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { background: var(--black); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: .92rem; }
.toast.err { background: var(--red); }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head h3 { flex: 1; text-align: center; margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cal .dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; text-align: center; padding: 6px 0; background: #f3ece1; color: var(--muted); }
.cal .day { min-height: 74px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; font-size: .8rem; cursor: pointer; position: relative; overflow: hidden; }
.cal .day:nth-child(7n+1) { border-left: 0; }
.cal .day.out { background: #f6f1e8; color: #b3a898; }
.cal .day.today .num { background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal .day.sel { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal .num { font-weight: 700; display: inline-block; }
.cal .ev { display: block; margin-top: 2px; padding: 1px 4px; border-radius: 4px; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--red); color: #fff; }
.cal .ev.reh { background: var(--black); }
.cal .ev.poll { background: transparent; color: var(--muted); border: 1px dashed #c5b8a5; }
.cal .ev.cancel { background: #d8cfc3; color: #6d6258; text-decoration: line-through; }
@media (max-width: 600px) {
  .cal .day { min-height: 52px; }
  .cal .ev { font-size: 0; height: 6px; width: 6px; padding: 0; border-radius: 99px; display: inline-block; margin: 2px 2px 0 0; }
  .cal .ev.poll { border-width: 1px; }
}

/* repertoire / media */
.media-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; margin-bottom: 8px; }
.media-item audio, .media-item video, .media-item img { width: 100%; margin-top: 8px; border-radius: 8px; }
.media-item video { max-height: 70vh; background: #000; }
.kind-ico { width: 30px; text-align: center; font-size: 1.2rem; flex: none; }
.lyrics { white-space: pre-wrap; font-family: var(--serif); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.progress { height: 6px; background: #eadfce; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; width: 0; background: var(--red); transition: width .2s; }
.setlist-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); background: var(--card); }
.setlist-row .pos { width: 26px; font-weight: 700; color: var(--red); text-align: right; flex: none; }
.setlist-row.drag-over { border-top: 3px solid var(--gold); }
.setlist-row .handle { cursor: grab; color: #b0a493; font-size: 1.1rem; user-select: none; }
.code { font-family: ui-monospace, Consolas, monospace; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; font-size: .9rem; }

/* login */
.login-wrap { max-width: 400px; margin: 0 auto; padding: 40px 16px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo h1 { font-size: 1.9rem; margin: 0; }
.login-logo .sub { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: .75rem; }
.err-msg { color: var(--red); font-weight: 600; margin: 8px 0; min-height: 1.2em; }

@media print {
  .top, .tabs, .bottom-tabs, .modal-foot, .no-print { display: none !important; }
  body { background: #fff; }
}
