@import url('/fonts/400.css');
@import url('/fonts/700.css');
@import url('/fonts/800.css');

:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --ink: #16302e;
  --muted: #5d7472;
  --line: #dde6e4;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e3f3f0;
  --warn: #b45309;
  --warn-soft: #fdf1e2;
  --danger: #b91c1c;
  --danger-soft: #fdeaea;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 48, 46, 0.06), 0 4px 16px rgba(16, 48, 46, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1000px; }

header.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
header.bar h1 { font-size: 1.1rem; margin: 0; font-weight: 800; }
header.bar .sub { font-size: .85rem; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
}
.card h2 { font-size: 1rem; margin: 0 0 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .05s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.warn { background: var(--warn-soft); color: var(--warn); border-color: #f3d3a8; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: #f3c0c0; }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: #bfe3dc; }
.btn.block { width: 100%; }
.btn.big { min-height: 64px; font-size: 1.25rem; }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: .9rem; border-radius: 10px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label.f { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
input.in, select.in {
  width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
}
input.in:focus, select.in:focus, .btn:focus-visible { outline: 3px solid #99d5cb; outline-offset: 1px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand);
}
.pill.off { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.num { font-weight: 800; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 50; max-width: 520px; margin: 0 auto;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: all .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }

dialog {
  border: 0; border-radius: var(--radius); padding: 20px; width: min(420px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(10, 30, 28, .45); }
