/* basicCRM — main.css
   Stil: Courier New · weiß · monochrom · kompakt */

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

body {
  font-family: 'Courier New', Courier, monospace;
  background: #ffffff;
  color: #111;
  min-height: 100vh;
  padding-top: 52px;
}

/* ══════════════════════════════════════
   TOPBAR
══════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  z-index: 200;
}

.topbar-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #111;
  text-transform: uppercase;
}

.topbar-brand span {
  font-weight: 400;
  color: #999;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #555;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn:hover {
  background: #f0f0f0;
  border-color: #888;
}

.btn-dark {
  background: #333;
  color: #fff;
  border-color: #333;
}

.btn-dark:hover {
  background: #000;
  border-color: #000;
}

.btn-danger {
  border-color: #c00;
  color: #c00;
}

.btn-danger:hover {
  background: #c00;
  color: #fff;
  border-color: #c00;
}

.btn-sm {
  font-size: 12px;
  padding: 3px 9px;
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
#main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
#login-wrap {
  display: flex;
  justify-content: center;
  padding-top: 60px;
}

.login-box {
  width: 340px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  padding: 32px 28px;
}

.login-box h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.login-box .sub {
  font-size: 12px;
  color: #999;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  padding: 6px 9px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #555;
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.link-btn {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-btn:hover {
  color: #333;
}

/* ══════════════════════════════════════
   KUNDENLISTE
══════════════════════════════════════ */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.list-header h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
}

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

.customer-table th {
  text-align: left;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 10px;
  border-bottom: 1px solid #e8e8e8;
  font-weight: 700;
}

.customer-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.customer-table tr:hover td {
  background: #fafafa;
}

/* Status-Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-0 { color: #aaa; border-color: #ddd; }
.badge-1 { color: #b07000; border-color: #f0c060; background: #fffbf0; }
.badge-2 { color: #005ab0; border-color: #90c0f0; background: #f0f6ff; }
.badge-3 { color: #007a30; border-color: #80d0a0; background: #f0fff5; }

/* ══════════════════════════════════════
   KUNDENDETAIL
══════════════════════════════════════ */
.back-row {
  margin-bottom: 18px;
}

.detail-block {
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-block label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  min-width: 80px;
  flex-shrink: 0;
}

.detail-block input,
.detail-block select {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
}

.detail-block input:focus,
.detail-block select:focus {
  border-color: #555;
}

.detail-block .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* ══════════════════════════════════════
   TABS
══════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 20px;
  margin-top: 6px;
}

.tab-btn {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 18px;
  border: none;
  background: none;
  color: #aaa;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: #111;
  border-bottom-color: #111;
}

.tab-btn:hover:not(.active) {
  color: #555;
}

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

/* ══════════════════════════════════════
   DATA GRID (Basic Data)
══════════════════════════════════════ */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.data-grid .span2 {
  grid-column: 1 / -1;
}

.field-block label {
  display: block;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.field-block input {
  width: 100%;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  padding: 6px 9px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
}

.field-block input:focus {
  border-color: #555;
}

.save-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  gap: 8px;
}

/* ══════════════════════════════════════
   RECORD CARDS (Infos / Contacts)
══════════════════════════════════════ */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.record-card {
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  padding: 10px 14px;
}

.record-card .rc-meta {
  font-size: 11px;
  color: #aaa;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.record-card .rc-body {
  font-size: 13px;
  white-space: pre-wrap;
  color: #222;
}

.record-card .rc-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 460px;
  max-width: 95vw;
  padding: 24px 24px 20px;
}

.modal h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 18px;
  color: #333;
}

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

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 3px;
  border-left: 3px solid;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  animation: toastIn 0.15s ease;
  max-width: 300px;
}

.toast.ok    { border-color: #007a30; color: #007a30; }
.toast.err   { border-color: #c00;    color: #c00; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   UTILS
══════════════════════════════════════ */
.hidden    { display: none !important; }
.muted     { color: #aaa; }
.err-msg   { font-size: 12px; color: #c00; margin-top: 5px; }
.divider   { border: none; border-top: 1px solid #e8e8e8; margin: 12px 0; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 620px)
  {
  .data-grid { grid-template-columns: 1fr; }
  .data-grid .span2 { grid-column: 1; }
  .detail-block { flex-direction: column; align-items: flex-start; }
  .detail-block .right { margin-left: 0; }
  }
