*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f5f5;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 8px;
}

/* Setup & Login */

#setup-view,
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #f5f5f5;
}

.login-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 32px;
  width: 320px;
}

.login-box h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1a1a1a;
}

.login-box label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
  margin-top: 12px;
}

.login-box label:first-of-type {
  margin-top: 0;
}

.login-box input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.login-box input:focus {
  border-color: #555;
}

.login-box button[type="submit"] {
  margin-top: 20px;
  width: 100%;
  padding: 9px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.login-box button[type="submit"]:hover {
  background: #333;
}

/* Shell */

#shell-view {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 200px;
  min-width: 200px;
  background: #1a1a1a;
  color: #ccc;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.nav-brand {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  padding: 16px;
  border-bottom: 1px solid #333;
}

#nav-links {
  list-style: none;
  flex: 1;
  padding: 8px 0;
}

#nav-links li a {
  display: block;
  padding: 9px 16px;
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
}

#nav-links li a:hover,
#nav-links li.active a {
  color: #fff;
  background: #2a2a2a;
}

#logout-btn {
  margin: 12px;
  padding: 8px;
  background: transparent;
  color: #888;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

#logout-btn:hover {
  color: #ccc;
  border-color: #666;
}

#content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: #fafafa;
}

/* Tabs */

.tab-bar {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 16px;
}

.tab {
  padding: 8px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  margin-bottom: -1px;
}

.tab:hover {
  color: #1a1a1a;
}

.tab.active {
  color: #1a1a1a;
  font-weight: 600;
  border-bottom-color: #1a1a1a;
}

/* Tables */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 8px 10px;
  background: #f0f0f0;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
}

.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.data-table tr:hover td {
  background: #f9f9f9;
}

/* Filter form */

.filter-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  background: #f0f0f0;
  border-radius: 4px;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #555;
  gap: 4px;
}

.filter-form input {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}

.filter-form button {
  padding: 6px 14px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.filter-form button:hover {
  background: #333;
}

/* Configuration */

.config-section {
  margin-bottom: 28px;
}

.config-section h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
  color: #1a1a1a;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.config-row label {
  min-width: 260px;
  font-size: 13px;
  color: #333;
}

.config-row input[type="text"],
.config-row input[type="number"] {
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  width: 200px;
}

.save-btn {
  padding: 4px 12px;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.save-btn:hover {
  background: #f5f5f5;
}

.save-feedback {
  font-size: 12px;
  font-weight: 600;
}

/* Installer-determined DL */

.installer-list {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 6px 16px;
  font-size: 13px;
}

.installer-list dt {
  font-weight: 600;
  color: #555;
}

.installer-list dd {
  font-family: ui-monospace, monospace;
  color: #1a1a1a;
}

/* Custodial disclosures */

.disclosures {
  background: #fff8e1;
  border: 1px solid #f0c040;
  border-radius: 6px;
  padding: 16px 20px;
}

.disclosures h2 {
  border-bottom-color: #f0c040;
  color: #6b4c00;
}

.disclosure-item {
  margin-top: 16px;
}

.disclosure-item h3 {
  font-size: 13px;
  font-weight: 600;
  color: #6b4c00;
  margin-bottom: 4px;
}

.disclosure-item p {
  font-size: 13px;
  line-height: 1.65;
  color: #333;
}

/* Utility */

.empty-state {
  color: #888;
  font-style: italic;
  padding: 12px 0;
  font-size: 13px;
}

.loading {
  color: #888;
  font-style: italic;
  font-size: 13px;
  padding: 8px 0;
}
