:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #d9e1ec;
  --text: #122033;
  --muted: #607086;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

body.login-mode .shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.login-mode .topbar {
  justify-content: center;
  text-align: center;
}

body.login-mode main.grid {
  place-items: center;
}

body.login-mode #loginCard {
  width: 100%;
}

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

.topbar h1 {
  margin: 0 0 6px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.topbar p,
.muted {
  margin: 0;
  color: var(--muted);
}

.grid,
.dashboard-grid {
  display: grid;
  gap: 20px;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid rgba(217, 225, 236, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.narrow {
  max-width: 420px;
}

.form {
  display: grid;
  gap: 14px;
}

.form.inline,
.inline {
  display: flex;
  gap: 12px;
  align-items: end;
}

.grow {
  flex: 1;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

label span {
  font-size: 0.92rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--primary);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

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

.primary:hover {
  background: var(--primary-strong);
}

.ghost {
  background: #eef3fb;
  color: var(--text);
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  align-items: end;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-weight: 700;
}

.summary {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #dbe7ff;
  background: #f6f9ff;
  border-radius: 14px;
  color: #1e3a8a;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #122033;
  color: #fff;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .dashboard-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .section-header,
  .form.inline,
  .inline,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}
