:root {
  color-scheme: light;
  --ms-bg: #f3f3f3;
  --ms-surface: #ffffff;
  --ms-surface-2: #faf9f8;
  --ms-ink: #242424;
  --ms-muted: #616161;
  --ms-line: #e1dfdd;
  --ms-primary: #0f6cbd;
  --ms-primary-hover: #115ea3;
  --ms-danger: #d13438;
  --ms-success: #107c10;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Segoe UI Variable", Tahoma, Arial, sans-serif;
  color: var(--ms-ink);
  background: linear-gradient(180deg, #f8f8f8 0%, var(--ms-bg) 100%);
}

.auth-wrap,
.dash-wrap {
  max-width: 1240px;
  margin: 28px auto;
  padding: 18px;
}

.card {
  background: var(--ms-surface);
  border: 1px solid var(--ms-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-1);
}

.auth-wrap .card {
  max-width: 460px;
  margin: 52px auto;
}

h1 {
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 1.1rem;
}

label {
  display: block;
  margin: 10px 0;
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #c8c6c4;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ms-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--ms-primary);
  box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.2);
}

button,
.btn {
  background: var(--ms-primary);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 40px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn:hover {
  background: var(--ms-primary-hover);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

header a {
  color: var(--ms-primary);
  text-decoration: none;
  font-weight: 600;
}

header a:hover {
  text-decoration: underline;
}

.controls {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--ms-surface-2);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--ms-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

thead th {
  background: #f5f5f5;
  color: #323130;
  font-weight: 600;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--ms-line);
  padding: 10px 9px;
  font-size: 13px;
  vertical-align: top;
}

tbody tr:hover {
  background: #f9fbfd;
}

.meta {
  margin: 0;
  color: var(--ms-muted);
}

.ok {
  color: var(--ms-success);
  font-weight: 600;
}

.error {
  color: var(--ms-danger);
  font-weight: 600;
}

.pager {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

a {
  color: var(--ms-primary);
}

@media (max-width: 900px) {
  .dash-wrap {
    margin: 12px auto;
    padding: 10px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .search-form {
    grid-template-columns: 1fr;
  }
}
