:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  --bg: #eef3f8;
  --panel: #ffffff;
  --soft: #f7fafc;
  --text: #172033;
  --muted: #657287;
  --line: #d9e2ee;
  --blue: #315df4;
  --blue-soft: #e8eeff;
  --green: #15835f;
  --green-soft: #ddf8eb;
  --amber: #9a6400;
  --amber-soft: #fff1cf;
  --red: #c53b3b;
  --red-soft: #ffe3e3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 10%, rgba(49, 93, 244, 0.14), transparent 34%),
    linear-gradient(135deg, #f9fbfd, #e8eef6);
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 24px 80px rgba(28, 44, 73, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  background: var(--blue);
  box-shadow: 0 12px 30px rgba(49, 93, 244, 0.22);
}

.brand small,
.muted {
  color: var(--muted);
}

.shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px);
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #263349;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  border-color: #cbd8ec;
  background: var(--blue-soft);
  color: #123aaf;
}

.content {
  min-width: 0;
  padding: 28px 34px 44px;
}

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

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 32px; letter-spacing: 0; margin-bottom: 6px; }
h2 { font-size: 22px; margin-bottom: 8px; }
h3 { font-size: 17px; margin-bottom: 6px; }

.grid {
  display: grid;
  gap: 16px;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 16px 46px rgba(37, 48, 73, 0.07);
}

.card-pad { padding: 20px; }

.metric {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric strong {
  font-size: 28px;
}

.table-card {
  overflow: hidden;
}

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

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid #e7edf5;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: #edf4ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.ok { color: var(--green); background: var(--green-soft); }
.pill.warn { color: var(--amber); background: var(--amber-soft); }
.pill.bad { color: var(--red); background: var(--red-soft); }
.pill.info { color: #2341b2; background: var(--blue-soft); }
.pill.gray { color: #64748b; background: #eef2f7; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(49, 93, 244, 0.18);
}

button:hover, .button:hover { background: #244cd2; }
.button.secondary, button.secondary {
  color: #23304a;
  background: #e7edf5;
  box-shadow: none;
}

.button.secondary:hover, button.secondary:hover { background: #d8e2ef; }

form { margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #4b5870;
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8e8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f9fbfd;
  color: var(--text);
  font: inherit;
}

.lookup-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lookup-line button {
  min-width: 142px;
  white-space: nowrap;
}

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

.rate-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.check-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #cbd8e8;
  border-radius: 10px;
  background: #f9fbfd;
  color: #263349;
}

.check-tile input {
  width: 18px;
  min-height: 18px;
}

.month-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.month-switch a {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbd8e8;
  border-radius: 9px;
  background: #fff;
  font-weight: 800;
  color: #2c3950;
}

.month-switch a.active,
.month-switch a:hover {
  color: #123aaf;
  background: var(--blue-soft);
}

.notice {
  padding: 13px 15px;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  background: #f7fbff;
  color: #2c3950;
}

.notice.warn {
  border-color: #f5d17e;
  background: #fff8e6;
}

.notice.ok {
  border-color: #a6e6c4;
  background: #effcf5;
}

.notice.bad {
  border-color: #f0b5b5;
  background: #fff1f1;
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e9f2;
  border-radius: 12px;
  background: #fff;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.setting-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e3f0;
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
}

.setting-toggle:hover {
  border-color: #b9c9e3;
  background: #edf4ff;
}

.setting-toggle input {
  width: 20px;
  min-height: 20px;
}

.setting-toggle small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.step {
  min-height: 36px;
  padding: 9px 10px;
  border: 1px solid #d8e3f0;
  border-radius: 10px;
  background: #f8fbfe;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.step.done {
  border-color: #b9c7ff;
  background: var(--blue-soft);
  color: #123aaf;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .form-grid { grid-template-columns: 1fr; }
  .settings-grid, .step-strip { grid-template-columns: 1fr; }
  .rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 22px 16px 34px; }
}
