:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1e2430;
  --muted: #657086;
  --line: #dce2ee;
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --danger: #dc3545;
  --ok: #198754;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

body.dark-theme {
  --bg: #121417;
  --panel: #1b1f24;
  --text: #e6edf7;
  --muted: #a8b0bd;
  --line: #2d353f;
  --primary: #3b82f6;
  --primary-dark: #79a8ff;
  --danger: #ff6d7a;
  --ok: #60d394;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

nav a {
  margin-left: 1rem;
  font-weight: 600;
}

nav {
  display: flex;
  align-items: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
}

.hero p {
  color: var(--muted);
}

.moscow-time {
  margin-top: 1rem;
  font-weight: 600;
}

.moscow-time strong {
  color: var(--text);
}

.actions,
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.button,
button {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.button.secondary {
  background: #fff;
  color: var(--primary);
}

.theme-toggle {
  margin-left: 1rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

body.dark-theme .button.secondary {
  background: #1f2630;
  color: #c8ddff;
  border-color: #3f4d60;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
  max-width: 540px;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
select {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--panel);
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
}

.messages {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.msg {
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
}

.msg-error {
  background: #fdecef;
  color: var(--danger);
}

.msg-success {
  background: #e9f7ef;
  color: var(--ok);
}

body.dark-theme .msg-error {
  background: #3a1f24;
}

body.dark-theme .msg-success {
  background: #1d3327;
}

body.dark-theme a {
  color: #9fc2ff;
}

@media (max-width: 700px) {
  .row {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
