/* =====================================================================
   Bhajan Audition Manager — Apple-inspired light theme
   ===================================================================== */

:root {
  --bg:        #fbfbfd;
  --surface:   #ffffff;
  --surface-2: #f5f5f7;
  --ink:       #1d1d1f;
  --ink-soft:  #6e6e73;
  --line:      #d2d2d7;
  --line-soft: #e8e8ed;
  --blue:      #0071e3;
  --blue-ink:  #0066cc;
  --green:     #1a8f45;
  --green-bg:  #e7f6ec;
  --red:       #c8102e;
  --red-bg:    #fdecee;
  --amber:     #8a6d00;
  --amber-bg:  #fbf3d6;
  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top bar ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,253,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 20px; color: var(--blue); line-height: 1; }
.brand-text { font-size: 15px; letter-spacing: -.01em; }
.topnav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.topnav a { color: var(--ink); }
.topnav a:hover { color: var(--blue-ink); text-decoration: none; }
.topnav a.active { color: var(--blue-ink); font-weight: 600; }
.topnav .who { color: var(--ink-soft); font-size: 13px; }

/* ---- Bottom tab bar (phones) -------------------------------------- */
.tabbar { display: none; }
@media (max-width: 720px) {
  .topnav { display: none; }                 /* destinations move to the tab bar */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; justify-content: space-around; align-items: stretch;
    background: rgba(255,255,255,.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line-soft);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 9px 4px 7px; min-height: 56px;
    color: var(--ink-soft); font-size: 11px; font-weight: 500; text-decoration: none;
  }
  .tab svg { width: 24px; height: 24px; }
  .tab span { line-height: 1; }
  .tab.active { color: var(--blue); }
  .tab.active svg { stroke: var(--blue); }
  .tab:active { background: rgba(0,0,0,.04); }
  .tab-exit { color: var(--ink-soft); }
  body.has-tabbar .wrap { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.has-tabbar .footer { display: none; }   /* tab bar replaces footer on phones */
}

/* ---- Layout -------------------------------------------------------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 40px 22px 64px; }
.wrap-narrow { max-width: 480px; }

.page-head { margin: 0 0 28px; }
.page-head h1 {
  font-size: 40px; line-height: 1.08; letter-spacing: -.02em;
  font-weight: 600; margin: 0 0 6px;
}
.page-head p { color: var(--ink-soft); margin: 0; font-size: 19px; }
.eyebrow { color: var(--blue-ink); font-weight: 600; font-size: 14px;
  letter-spacing: .01em; text-transform: uppercase; margin: 0 0 8px; }

h2 { font-size: 26px; letter-spacing: -.015em; font-weight: 600; margin: 36px 0 14px; }
h3 { font-size: 20px; letter-spacing: -.01em; font-weight: 600; margin: 0 0 10px; }

.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---- Cards --------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 18px;
}
.card.tight { padding: 18px 20px; }
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font); font-size: 16px; font-weight: 400; line-height: 1;
  padding: 13px 22px; min-height: 46px; border-radius: 980px; border: 1px solid transparent;
  cursor: pointer; transition: background .2s, opacity .2s, transform .05s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0077ed; color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #ececf0; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #d81c36; color: #fff; }
.btn-plain { color: var(--blue-ink); font-size: 14px; padding: 6px 4px; }
.btn-plain:hover { text-decoration: underline; }
.btn-small { font-size: 14px; padding: 9px 16px; min-height: 40px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn.is-busy { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- Forms --------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
label.lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

input[type=text], input[type=password], input[type=tel], input[type=date],
input[type=number], input[type=file], select, textarea {
  width: 100%; font-family: var(--font); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,113,227,.14);
}
select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236e6e73' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input[type=file] { padding: 10px 12px; background: var(--surface-2); cursor: pointer; }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px){ .two-col { grid-template-columns: 1fr; } }

/* Segmented control (morning/evening) */
.segment { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; }
.segment label { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span { display: block; padding: 8px 20px; border-radius: 8px; font-size: 15px; color: var(--ink-soft); transition: .15s; }
.segment input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

/* ---- Flash / alerts ------------------------------------------------ */
.flash { border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 18px; font-size: 15px; border: 1px solid transparent; }
.flash-success { background: var(--green-bg); color: var(--green); border-color: #bfe6cc; }
.flash-error   { background: var(--red-bg);   color: var(--red);   border-color: #f4c7cd; }
.flash-info    { background: #eaf3fe;          color: var(--blue-ink); border-color: #cfe4fb; }

/* ---- Badges -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 980px; letter-spacing: .01em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-pending  { background: var(--surface-2); color: var(--ink-soft); }
.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-rejected { background: var(--red-bg); color: var(--red); }
.badge-changes  { background: var(--amber-bg); color: var(--amber); }
.badge-morning  { background: #fff4e0; color: #9a6400; }
.badge-evening  { background: #e9e7ff; color: #4b3fb0; }
.badge-off      { background: var(--surface-2); color: var(--ink-soft); }
.badge-live     { background: var(--green-bg); color: var(--green); }

/* ---- Lists / rows -------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.row-item:last-child { border-bottom: none; }
.row-main { min-width: 0; }
.row-title { font-weight: 600; font-size: 17px; }
.row-sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.row-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.meta b { color: var(--ink); font-weight: 600; }

.stat-row { display: flex; gap: 34px; flex-wrap: wrap; }
.stat { }
.stat .num { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.stat .cap { font-size: 13px; color: var(--ink-soft); }

/* ---- Bhajan / audition player ------------------------------------- */
.bhajan {
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px;
}
.bhajan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 12px; }
.bhajan-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.bhajan-meta { margin-top: 5px; }
.bhajan-num { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2);
  color: var(--ink-soft); font-size: 13px; font-weight: 600; margin-right: 10px; flex-shrink: 0; }
.player { padding: 4px 22px 18px; }
.player audio { width: 100%; height: 40px; }
.bhajan-review { border-top: 1px solid var(--line-soft); background: var(--surface-2); padding: 18px 22px; }
.bhajan-review.readonly { background: #fcfcfe; }

.feedback-shown { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 15px; font-size: 15px; }
.feedback-shown .lbl-inline { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); display:block; margin-bottom: 3px; }

/* status pick (approve / reject radios as chips) */
.pick { display: flex; gap: 8px; flex-wrap: wrap; }
.pick label { cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick span { display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  padding: 8px 18px; border-radius: 980px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface); transition: .15s; }
.pick input:checked + span.ok   { background: var(--green); color: #fff; border-color: var(--green); }
.pick input:checked + span.no   { background: var(--red);   color: #fff; border-color: var(--red); }
.pick input:checked + span.hold { background: var(--amber); color: #fff; border-color: var(--amber); }
.pick input:focus-visible + span { box-shadow: 0 0 0 4px rgba(0,113,227,.18); }

.save-note { font-size: 13px; color: var(--green); opacity: 0; transition: opacity .2s; }
.save-note.show { opacity: 1; }

/* ---- Auth screens -------------------------------------------------- */
.auth { max-width: 420px; margin: 6vh auto 0; }
.auth .card { padding: 34px 30px; }
.auth h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth .sub { color: var(--ink-soft); margin: 0 0 26px; }

/* ---- Countdown (invite / register) --------------------------------- */
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.link-box { display: flex; gap: 10px; }
.link-box input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }

/* ---- Divider / empty ---------------------------------------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty .big { font-size: 44px; margin-bottom: 8px; opacity: .5; }
hr.sep { border: none; border-top: 1px solid var(--line-soft); margin: 26px 0; }

/* ---- Footer -------------------------------------------------------- */
.footer { border-top: 1px solid var(--line-soft); margin-top: 40px; }
.footer p { max-width: 1040px; margin: 0 auto; padding: 22px; color: var(--ink-soft); font-size: 12.5px; }

/* ---- Home role cards ---------------------------------------------- */
.roles { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-top: 30px; }
@media (max-width: 620px){ .roles { grid-template-columns: 1fr; } }
.role-card { text-align: center; padding: 38px 26px; }
.role-card .ic { font-size: 40px; margin-bottom: 12px; }
.role-card h3 { font-size: 22px; }
.role-card p { color: var(--ink-soft); font-size: 15px; margin: 6px 0 22px; }

/* ---- Utilities ----------------------------------------------------- */
.btn-wide { }                          /* full-width on phones (see below) */

@media (max-width: 560px){
  body { font-size: 16px; }
  .page-head h1 { font-size: 28px; }
  .page-head p { font-size: 17px; }
  .wrap { padding: 22px 16px 48px; }
  .card { padding: 20px 18px; border-radius: var(--radius-sm); }

  /* Primary calls-to-action span the width for easy thumb tapping. */
  .btn-wide { display: flex; width: 100%; }

  /* Morning / evening: big, full-width segmented control. */
  .segment { display: flex; width: 100%; }
  .segment label { flex: 1; }
  .segment span { text-align: center; padding: 12px 10px; }

  /* Approve / reject chips: comfortable and full-width-ish. */
  .pick span { min-height: 46px; font-size: 15px; }

  /* Invite link + copy button stack vertically. */
  .link-box { flex-direction: column; }
  .link-box .btn { width: 100%; }

  /* Row actions drop below their text instead of crowding it. */
  .row-item { flex-wrap: wrap; }
  .row-side { width: 100%; justify-content: flex-start; }

  /* Bhajan card: title and status stack cleanly. */
  .bhajan-head { flex-direction: column; }
  .bhajan-head .badge { align-self: flex-start; }

  .stat-row { gap: 22px 30px; }
}
