:root {
  --bg: #f4efe6;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #1f1a14;
  --muted: #756b5e;
  --line: #ded4c5;
  --brand: #75553a;
  --brand-dark: #4f3927;
  --accent: #d59f5c;
  --success: #27724a;
  --danger: #a73e38;
  --shadow: 0 18px 45px rgba(61, 43, 27, 0.10);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(213, 159, 92, 0.18), transparent 34%),
    linear-gradient(180deg, #f8f3ea 0%, var(--bg) 100%);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 { margin: 2px 0 0; font-size: 1.25rem; }
.eyebrow { margin: 0; color: var(--muted); font-size: .76rem; }
.hidden { display: none !important; }

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  font-size: 1.3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.icon-button img {
  width: 100%;
  height: 100%;
  margin-bottom: 3px;
  color: var(--brand-dark);
}
.hero-card {
  min-height: 260px;
  padding: 30px 24px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(140deg, rgba(31,26,20,.15), rgba(31,26,20,.7)),
    linear-gradient(135deg, #9a7049, #4e3928);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  border: 30px solid rgba(255,255,255,.07);
  border-radius: 50%;
  left: -70px;
  top: -80px;
}

.hero-icon { font-size: 3rem; margin-bottom: auto; }
.hero-card h2 { margin: 0 0 10px; font-size: 1.8rem; line-height: 1.45; }
.hero-card p { margin: 0; color: rgba(255,255,255,.78); line-height: 1.9; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.role-card {
  min-height: 155px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: rgba(255,255,255,.68);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  gap: 7px;
  box-shadow: 0 10px 30px rgba(61,43,27,.06);
}
.role-card.primary { background: var(--surface-strong); border-color: transparent; }
.role-icon { font-size: 1.7rem; color: var(--brand); }
.role-card strong { margin-top: auto; font-size: 1rem; }
.role-card small { color: var(--muted); line-height: 1.6; }

.section-head { margin: 30px 4px 18px; }
.section-head h2 { margin: 10px 0 8px; font-size: 1.55rem; }
.section-head p { margin: 0; color: var(--muted); line-height: 1.85; }
.step-pill {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eadbc7;
  color: var(--brand-dark);
  font-size: .76rem;
  font-weight: bold;
}

.panel {
  padding: 18px;
  border: 1px solid rgba(222,212,197,.9);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.form-stack { display: grid; gap: 18px; }
.field { display: grid; gap: 9px; border: 0; padding: 0; margin: 0; }
.field > span, .field legend { font-size: .86rem; font-weight: bold; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  transition: .18s ease;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(117,85,58,.10); }
textarea { resize: vertical; min-height: 92px; }

.shift-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card {
  min-height: 132px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #fff;
}
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border: 2px solid var(--brand); background: #f7eee2; }
.choice-icon { font-size: 1.45rem; color: var(--accent); }
.choice-card strong { margin-top: auto; }
.choice-card small { color: var(--muted); line-height: 1.5; }

.button {
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: bold;
}
.button.primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.button.secondary { color: var(--brand-dark); background: #eadbc7; }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button.danger { color: var(--danger); background: #f8e5e2; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.full { width: 100%; }

.summary-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: #252018;
  color: white;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.summary-card p, .summary-card h2 { margin: 0; }
.summary-card p { margin-top: 6px; color: rgba(255,255,255,.65); font-size: .83rem; }
.progress-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) var(--progress, 0%), rgba(255,255,255,.14) 0);
  position: relative;
  flex: 0 0 auto;
}
.progress-ring::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #252018; }
.progress-ring span { position: relative; z-index: 1; font-size: .78rem; font-weight: bold; }

.task-list { display: grid; gap: 10px; margin: 14px 0; }
.task-check {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 11px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 15px;
  background: rgba(255,255,255,.84);
}
.task-check input { position: absolute; opacity: 0; }
.fake-check {
  width: 26px;
  height: 26px;
  border: 2px solid #b9ad9d;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: .8rem;
  color: transparent;
}
.task-check:has(input:checked) { background: #eef7f1; border-color: #a7d1b6; }
.task-check:has(input:checked) .fake-check { background: var(--success); border-color: var(--success); color: white; }
.task-title { line-height: 1.8; }
.task-meta { margin-top: 4px; color: var(--muted); font-size: .76rem; }

.sticky-submit {
  position: sticky;
  bottom: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(244,239,230,.88);
  backdrop-filter: blur(12px);
}

.success-card { text-align: center; padding: 34px 20px; }
.success-mark { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: #e2f3e8; color: var(--success); font-size: 2.1rem; }
.success-card h2 { margin: 0 0 10px; }
.success-card p { color: var(--muted); line-height: 1.8; }

.admin-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.admin-tab { border: 0; border-radius: 12px; padding: 11px; background: #e8dfd2; color: var(--muted); font-weight: bold; }
.admin-tab.active { background: var(--brand); color: white; }

.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; }
.day-chip span { min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: .78rem; }
.day-chip:has(input:checked) span { background: var(--brand); border-color: var(--brand); color: white; }

.admin-list { display: grid; gap: 10px; margin-top: 14px; }
.admin-task, .log-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: rgba(255,255,255,.78); }
.admin-task.inactive { opacity: .55; }
.admin-task-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.admin-task h3 { margin: 0; font-size: .95rem; line-height: 1.7; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { border-radius: 999px; padding: 5px 8px; background: #eee5d8; color: var(--brand-dark); font-size: .7rem; }
.admin-actions { display: flex; gap: 8px; margin-top: 12px; }
.admin-actions .button { min-height: 38px; padding: 8px 11px; font-size: .75rem; }

.log-card h3 { margin: 0 0 8px; font-size: .95rem; }
.log-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .78rem; line-height: 1.8; }
.telegram-ok { color: var(--success); }
.telegram-fail { color: var(--danger); }
.empty-state { text-align: center; padding: 28px 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.loading { text-align: center; padding: 60px 20px; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  width: min(calc(100% - 32px), 520px);
  transform: translate(-50%, 120px);
  opacity: 0;
  z-index: 50;
  border-radius: 14px;
  padding: 13px 15px;
  background: #242018;
  color: #fff;
  box-shadow: var(--shadow);
  transition: .25s ease;
  text-align: center;
  font-size: .85rem;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); }

@media (max-width: 390px) {
  .action-grid, .shift-picker { grid-template-columns: 1fr; }
  .role-card { min-height: 120px; }
  .day-grid { grid-template-columns: repeat(3, 1fr); }
}


/* Partial-completion reporting */
.task-item {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.84);
  overflow: hidden;
  transition: .18s ease;
}
.task-item .task-check {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
}
.task-item.completed { background: #eef7f1; border-color: #a7d1b6; }
.task-item.completed .task-check { background: transparent; }
.task-reason {
  padding: 0 15px 15px;
  border-top: 1px dashed var(--line);
  background: rgba(167,62,56,.035);
}
.task-reason .field { padding-top: 12px; }
.task-reason textarea { min-height: 76px; border-color: #dfbbb6; }
.checklist-note { margin: 14px 0; box-shadow: none; }
.checklist-note small { color: var(--muted); font-weight: normal; }
.submit-summary {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.65;
  text-align: center;
}
.badge-success { background: #e2f3e8; color: var(--success); }
.badge-warning { background: #f8e5e2; color: var(--danger); }
.log-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.log-details summary { cursor: pointer; color: var(--brand); font-size: .8rem; font-weight: bold; }
.log-task-list { display: grid; gap: 8px; margin-top: 10px; }
.log-task { border-radius: 12px; padding: 10px; font-size: .78rem; line-height: 1.7; }
.log-task.done { background: #eef7f1; }
.log-task.missed { background: #fdf0ee; }
.log-task p { margin: 5px 0 0; color: var(--muted); white-space: pre-wrap; }
.log-task p span { color: var(--danger); font-weight: bold; }
.general-note-view { margin-top: 10px; padding: 10px; border-radius: 12px; background: #f2ece3; font-size: .78rem; line-height: 1.7; }
.general-note-view p { margin: 5px 0 0; color: var(--muted); white-space: pre-wrap; }

/* Night shift sections: bar / salon */
.task-section {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.45);
}
.task-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 3px 10px;
}
.task-section-head h3 { margin: 0; font-size: 1rem; }
.task-section-head p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }
.task-section-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eadbc7;
  font-size: 1.15rem;
  flex: 0 0 auto;
}
.task-section[data-section="bar"] .task-section-icon { background: #eadbc7; }
.task-section[data-section="salon"] .task-section-icon { background: #e3ece4; }
.task-section .task-list { margin: 0; }
.section-empty {
  padding: 16px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
  line-height: 1.8;
}
.field-hint { margin: -2px 0 10px; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.section-picker .choice-card { min-height: 126px; }
.section-badge.section-bar { background: #eadbc7; color: var(--brand-dark); }
.section-badge.section-salon { background: #e3ece4; color: #315c46; }
.log-section { margin-top: 12px; }
.log-section h4 {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: #eee5d8;
  font-size: .82rem;
}
.log-section .log-task-list { margin-top: 0; }


/* Customer feedback page */
.feedback-entry {
  grid-column: 1 / -1;
  min-height: 108px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}
.feedback-entry .role-icon {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: #eadbc7;
}
.feedback-entry strong, .feedback-entry small { margin: 0; }
.feedback-hero {
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(135deg, #8d6543, #4f3927);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 15px;
}
.feedback-hero-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.12);
  font-size: 1.8rem;
}
.feedback-hero .step-pill { color: #fff; background: rgba(255,255,255,.14); }
.feedback-hero h2 { margin: 12px 0 8px; font-size: 1.55rem; }
.feedback-hero p { margin: 0; color: rgba(255,255,255,.78); line-height: 1.9; }
.feedback-category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.feedback-category {
  position: relative;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  text-align: center;
  font-size: .78rem;
}
.feedback-category.wide { grid-column: 1 / -1; min-height: 64px; flex-direction: row; }
.feedback-category input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-category:has(input:checked) { border: 2px solid var(--brand); background: #f7eee2; }
.feedback-category > span { font-size: 1.35rem; }
.feedback-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field small { color: var(--muted); font-weight: normal; }
.privacy-note {
  margin: -2px 0 0;
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--muted);
  background: #f2ece3;
  font-size: .75rem;
  line-height: 1.75;
}
.success-actions { display: grid; gap: 9px; margin-top: 18px; }
@media (max-width: 390px) {
  .feedback-details-grid { grid-template-columns: 1fr; }
  .feedback-hero { grid-template-columns: 1fr; }
}
