:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5f6b7a;
  --border: #d8dee6;
  --accent: #1f4e79;
  --danger: #b42318;
  --danger-bg: #fef2f0;
  --row-hover: #f0f4f8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card,
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.page {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 24px 48px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  flex: 1;
  min-width: 180px;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

label span {
  display: block;
  margin-bottom: 4px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

button {
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

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

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5c2c0;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
}

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

th {
  font-weight: 600;
  background: #eef2f6;
}

tbody tr:hover {
  background: var(--row-hover);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  padding: 4px 8px;
  font-size: 13px;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 31, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--card);
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  font-weight: 500;
}
