:root {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-border: #dddddd;
  --color-text: #151515;
  --color-text-muted: #404040;
  --color-text-subtle: #303030;

  --color-success-bg: #e6f4ea;
  --color-success-text: #1e6b34;
  --color-success-border: #b7e0c3;

  --color-error-bg: #fbe9e9;
  --color-error-text: #a12626;
  --color-error-border: #f0bcbc;

  --color-button-bg: #151515;
  --color-button-bg-hover: #303030;
  --color-button-text: #ffffff;
}

body {
  font-family: system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 1rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: normal;
  color: var(--color-text-muted);
  margin-top: 0;
}

ul {
  margin: 0.25rem 0;
}

/* cards and notices */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.notice {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.notice.success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.notice.error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}

.contacts {
  font-size: 0.9rem;
  color: var(--color-text-subtle);
}

/* buttons and links */

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn:hover {
  background: var(--color-button-bg-hover);
}

button {
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: var(--color-button-bg-hover);
}

/* forms */

form label {
  display: block;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

form input[type="text"],
form input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
}

select {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
}

.group-list label,
.tree-select label {
  display: block;
  font-weight: normal;
  margin: 0.25rem 0;
}

/* org tree */

.org-tree,
.org-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 1.25rem;
}

.org-tree li {
  margin: 0.2rem 0;
}

.org-tree > li {
  padding-left: 0;
}

.org-tree label {
  display: inline;
  font-weight: normal;
  margin-top: 0;
}

/* tables */

table {
  border-collapse: collapse;
  background: var(--color-surface);
  margin-top: 1rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
}

th {
  background: var(--color-bg);
  font-weight: 600;
}

/* language switcher */

.lang-switcher {
  text-align: right;
  margin-bottom: 1rem;
}

.lang-switcher a {
  margin-left: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
}

.lang-switcher.compact a {
  margin-left: 0.5rem;
  text-decoration: none;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.lang-switcher.compact a:first-child {
  margin-left: 0;
}

/* admin nav bar */

.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}

.admin-nav-right {
  align-items: center;
}

.admin-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
}

.admin-nav a:hover {
  color: var(--color-text);
}

.admin-nav a.current {
  color: var(--color-text);
  border-bottom: 2px solid var(--color-button-bg);
  padding-bottom: 0.5rem;
}
