* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #1c1e21;
}

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { margin: 0; font-size: 20px; }
.login-card .subtitle { margin: 0 0 8px; color: #666; font-size: 14px; }

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #444;
}

input, select, textarea, button {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #d0d3d8;
  border-radius: 6px;
}

button {
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
}
button.secondary {
  background: #e9eaec;
  color: #1c1e21;
}
button.danger {
  background: #dc2626;
  color: white;
}

/* Layout */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-bottom: 1px solid #e2e4e8;
}
.topbar h1 { font-size: 18px; margin: 0; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  color: #555;
  border-radius: 0;
}
.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

main { padding: 24px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.panel-header h2 { margin: 0; font-size: 16px; }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
th { background: #fafafa; font-weight: 600; }

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.off { background: #f3f4f6; color: #6b7280; }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[hidden] {
  display: none;
}
.modal-content {
  background: white;
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content.modal-wide { max-width: 640px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
}

fieldset {
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
legend { padding: 0 6px; color: #555; font-size: 13px; }

pre {
  background: #f5f6f8;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
}

.error {
  color: #dc2626;
  font-size: 13px;
}

.hint {
  font-weight: normal;
  color: #8a94a6;
  font-size: 12px;
}

.pdf-link {
  color: #2563eb;
  text-decoration: none;
}
.pdf-link:hover {
  text-decoration: underline;
}

#secret-modal-value {
  width: 100%;
  font-family: monospace;
  resize: none;
}

#customer-search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 160px;
  overflow-y: auto;
}
.customer-result {
  padding: 6px 8px;
  border: 1px solid #e2e4e8;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.customer-result:hover {
  background: #f5f6f8;
}
#customer-selected {
  padding: 6px 8px;
  background: #eff6ff;
  border-radius: 6px;
  color: #1c1e21;
}
