:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0b1220;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 20px;
}

header.topbar h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
}

nav.tabs {
  display: flex;
  gap: 8px;
}

nav.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}

nav.tabs a.active {
  background: var(--accent);
  color: var(--bg);
}

nav.tabs a:not(.active):hover {
  background: var(--bg-card);
  color: var(--text);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 14px;
  margin-bottom: 16px;
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status.ok .dot { background: var(--green); }
.status.warn .dot { background: var(--amber); }
.status.err .dot { background: var(--red); }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--bg);
  transition: background 0.15s, transform 0.05s;
}

button:hover, .btn:hover { background: var(--accent-hover); }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

button.secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover { background: var(--border); }

button.danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}

button.danger:hover { background: rgba(248, 113, 113, 0.12); }

form.schedule-form .field {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

input[type='text'],
input[type='date'],
input[type='time'],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

textarea { resize: vertical; min-height: 64px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.row .field-inline { flex: 0 0 auto; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.schedule-list { display: flex; flex-direction: column; gap: 12px; }

.schedule-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.schedule-item .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.schedule-item .head h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.welcome { background: rgba(56, 189, 248, 0.15); color: var(--accent); }
.badge.weekly { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.badge.off { background: rgba(148, 163, 184, 0.15); color: var(--muted); }

.schedule-item .meta {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 4px;
}

.schedule-item .body-text { font-size: 14px; margin: 4px 0 10px; }

.schedule-item .actions { display: flex; gap: 8px; }
.schedule-item .actions button { padding: 6px 12px; font-size: 13px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0;
  font-size: 14px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .row { flex-direction: column; gap: 0; }
  header.topbar { flex-direction: column; align-items: stretch; }
  nav.tabs a { text-align: center; }
}