:root {
  --bg: #f6f3ee;
  --ink: #1c1c1c;
  --muted: #8d877f;
  --teal: #0e4f46;
  --teal-dark: #0c3f3a;
  --gold: #c4a46a;
  --line: #ece7e0;
  --card: #ffffff;
  --amber-bg: #f8efd8;
  --amber: #8a5a12;
  --green-bg: #e5f6ec;
  --green: #1b7a45;
  --red-bg: #fde8e8;
  --red: #b42318;
  --shadow: 0 10px 30px rgba(28, 28, 28, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.45;
}
.wrap {
  width: min(440px, calc(100% - 28px));
  margin-inline: auto;
}
a { color: inherit; }
button, input, select { font: inherit; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.top {
  background: var(--teal-dark);
  color: white;
  padding: 16px 0 18px;
}
.top .wrap { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.top h1 { margin: 0; text-align: center; font-size: 28px; font-weight: 700; }
.logout-form { margin-top: 12px; }
.logout {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--teal-dark);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  padding: 14px 16px;
  cursor: pointer;
}
.icon-btn, .text-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--gold);
  color: white;
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
}
.text-btn { background: transparent; color: white; font-size: 14px; width: auto; }
.page { padding: 22px 0 40px; }
.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 16px;
}
.stack { display: grid; gap: 14px; }
.chalet {
  display: block;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
  border-inline-start: 7px solid var(--gold);
  text-decoration: none;
}
.chalet strong { display: block; font-size: 22px; margin-bottom: 6px; }
.chalet span { color: var(--teal); font-size: 16px; }
h2 { margin: 8px 0 0; font-size: 22px; font-weight: 700; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.row b { font-weight: 700; }
.pay-card { display: block; text-decoration: none; padding: 8px 0 4px; border-bottom: 1px solid var(--line); }
.pay-card:last-child { border-bottom: 0; }
.pay-card .kv { padding: 6px 0; }
.chip {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  white-space: nowrap;
}
.chip.pending { background: var(--amber-bg); color: var(--amber); }
.chip.paid { background: var(--green-bg); color: var(--green); }
.chip.failed, .chip.cancelled { background: var(--red-bg); color: var(--red); }
.login-mark { text-align: center; margin: 54px 0 22px; }
.login-mark i {
  display: block;
  width: 54px;
  height: 3px;
  margin: 0 auto 16px;
  background: var(--gold);
}
.login-mark strong { color: var(--teal); font-size: 32px; }
.login-card { padding: 28px 22px 22px; }
.login-card h1 { margin: 0 0 22px; text-align: center; font-size: 28px; }
label { display: block; margin: 14px 0 6px; color: #3a3a3a; }
input, select {
  width: 100%;
  border: 1px solid #e4ddd4;
  background: white;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
}
.btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  color: white;
  text-align: center;
  text-decoration: none;
  padding: 14px 16px;
  font-size: 20px;
  cursor: pointer;
}
.btn.ghost {
  background: white;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.fine { display: block; text-align: center; color: var(--muted); margin-top: 14px; font-size: 14px; }
.error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.pay-now { color: var(--teal); font-weight: 700; }
.entity {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f7f6;
  color: var(--teal-dark);
  text-align: center;
}
.success-title { color: var(--green); text-align: center; font-size: 32px; margin: 8px 0 14px; }
.receipt { border-top: 3px solid var(--gold); }
.receipt h2 { text-align: center; margin-bottom: 8px; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.back { color: white; text-decoration: none; font-size: 22px; }
.pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d7ebe7;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.admin-list { margin-top: 18px; }
.small-btn {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  padding: 0;
}
body.wide .wrap { width: min(980px, calc(100% - 24px)); max-width: 980px; min-width: 0; }
.manage { display: grid; gap: 12px; }
.panel { background: white; border-radius: 16px; box-shadow: var(--shadow); padding: 10px 12px 8px; max-width: 100%; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; font-size: 20px; }
.mini {
  border: 1px solid #e4ddd4;
  background: white;
  color: var(--teal);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.mini.solid { background: var(--teal); color: white; border-color: var(--teal); }
.mini.danger { background: var(--red-bg); color: var(--red); border-color: #f3c7c4; }
.m-head, .m-row, .c-head, .c-row {
  display: grid;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}
.m-head > *, .m-row > *, .c-head > *, .c-row > * { min-width: 0; }
.m-head, .m-row { grid-template-columns: minmax(130px, 1fr) 72px minmax(0, 1.6fr) max-content; }
.c-head, .c-row { grid-template-columns: minmax(160px, 1fr) 72px max-content; }
.m-head, .c-head { color: var(--muted); font-size: 13px; background: var(--bg); border-radius: 8px; border-bottom: 0; }
.who b { display: block; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; max-width: 100%; }
.check { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; }
.acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 250px; }
.acts form, .c-row > form, .add-line { margin: 0; }
.panel input.inline, .add-line input { width: auto; padding: 4px 8px; border-radius: 8px; font-size: 15px; }
.c-row > form:first-child, .add-line { display: flex; gap: 6px; align-items: center; }
.c-row > form:first-child input { flex: 1; min-width: 120px; width: 100%; }
.add-line input { width: 150px; }
.hint { display: block; color: var(--muted); font-size: 13px; margin: 8px 0 2px; text-align: start; text-decoration: none; }
dialog { border: 0; border-radius: 16px; width: min(380px, calc(100% - 28px)); padding: 14px; }
dialog::backdrop { background: rgba(12, 63, 58, 0.4); }
dialog .btn { margin-top: 10px; padding: 10px; font-size: 16px; }
@media (max-width: 760px) {
  .m-head, .c-head { display: none; }
  .m-row, .c-row { grid-template-columns: 1fr auto; }
  .m-row > form, .m-row .acts, .c-row > form:first-child, .c-row .acts { grid-column: 1 / -1; }
  .acts { justify-content: flex-start; max-width: none; }
  .panel-head { flex-wrap: wrap; }
  .add-line, .add-line input { width: 100%; }
}
@media (max-width: 380px) {
  .top h1, .login-mark strong, .login-card h1 { font-size: 26px; }
}
