/* Moved from static/index.html <style> block — no changes */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── WORKSPACE (dark header) ───────────────────────────── */
#workspace {
  background: #0f172a;
  color: #f8fafc;
  padding: 16px 24px 18px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

/* ── Hauptbereich-Navigation ──────────────────────────────── */
.nav-areas {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.area-btn {
  padding: 5px 18px;
  background: transparent;
  border: 1px solid #1e293b;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: all 0.12s;
}

.area-btn:hover { color: #64748b; border-color: #334155; }

.area-btn.active {
  background: #1e293b;
  border-color: #60a5fa;
  color: #f8fafc;
}

.area-btn .area-key {
  display: inline-block;
  font-size: 9px;
  color: #1e3a5f;
  margin-right: 5px;
  font-weight: 400;
  letter-spacing: 0;
}

.area-btn.active .area-key { color: #475569; }

/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.tab-btn {
  padding: 5px 15px;
  background: transparent;
  border: 1px solid #1e293b;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: all 0.12s;
}
.tab-btn:hover { color: #94a3b8; border-color: #334155; }
.tab-btn.active { background: #1e293b; color: #f8fafc; border-color: #334155; }
.tab-btn .tab-key {
  display: inline-block;
  font-size: 9px;
  color: #334155;
  margin-right: 5px;
  font-weight: 400;
  letter-spacing: 0;
}
.tab-btn.active .tab-key { color: #475569; }

/* form row */
#form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}
.field input, .field select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  height: 34px;
}
.field input:focus, .field select:focus { border-color: #60a5fa; }
.field input::placeholder { color: #475569; }
.field select option { background: #1e293b; }

.f-name { flex: 1; min-width: 150px; }
.f-name input { width: 100%; }
.f-desc { flex: 2; min-width: 180px; }
.f-desc input { width: 100%; }
.f-sm select { min-width: 130px; }
.f-dir { }

/* direction toggle */
.dir-group { display: flex; gap: 5px; }
.dir-btn {
  width: 40px; height: 34px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.12s;
}
.dir-btn:hover { border-color: #64748b; color: #94a3b8; }
.dir-btn.sel-I { background: #1e3a8a; border-color: #3b82f6; color: #93c5fd; }
.dir-btn.sel-O { background: #064e3b; border-color: #10b981; color: #6ee7b7; }

#add-btn {
  height: 34px;
  padding: 0 18px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
#add-btn:hover { background: #2563eb; }
#add-btn:disabled { background: #1e3a8a; color: #475569; cursor: default; }

/* ── CONTENT AREA ──────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
#content::-webkit-scrollbar { width: 5px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid;
}
.section-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.section-count {
  font-size: 11px;
  color: #94a3b8;
  background: #e2e8f0;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* colors per tab */
.c-sh  { --col: #8b5cf6; }
.c-doc { --col: #3b82f6; }
.c-ch  { --col: #06b6d4; }
.c-cap { --col: #f59e0b; }
.c-tx  { --col: #10b981; }
.section-header { border-color: var(--col); }
.section-dot    { background: var(--col); }
.section-label  { color: var(--col); }

/* card grid */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* card */
.card {
  background: white;
  border-radius: 8px;
  padding: 11px 44px 11px 14px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--col);
  position: relative;
  transition: all 0.12s;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  border-color: #cbd5e1;
  border-left-color: var(--col);
}
.card-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.card-sub  { font-size: 12px; color: #64748b; margin-top: 3px; line-height: 1.4; }
.card-meta {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-role-Kunde   { background: #ede9fe; color: #7c3aed; }
.badge-role-Nutzer  { background: #dbeafe; color: #1d4ed8; }
.badge-role-Partner { background: #fce7f3; color: #be185d; }
.badge-dt-Md { background: #dbeafe; color: #1d4ed8; }
.badge-dt-Td { background: #fef3c7; color: #b45309; }
.badge-dir-I { background: #dbeafe; color: #1d4ed8; }
.badge-dir-O { background: #d1fae5; color: #065f46; }
.badge-link  { background: #f1f5f9; color: #475569; }

.card-del {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  transition: all 0.1s;
}
.card:hover .card-del { color: #cbd5e1; }
.card-del:hover { color: #ef4444 !important; background: #fef2f2; }

.empty {
  font-size: 12px;
  color: #cbd5e1;
  text-align: center;
  padding: 24px 10px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 8px;
}

/* transactions table */
.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tx-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0 10px 8px;
  border-bottom: 1px solid #e2e8f0;
}
.tx-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
  vertical-align: top;
}
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tr:hover td { background: #f8fafc; }
.tx-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
}

/* shortcut hint */
#hint {
  font-size: 10px;
  color: #334155;
  margin-top: 10px;
  letter-spacing: 0.02em;
}
#hint kbd {
  display: inline-block;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 9px;
  font-family: monospace;
  color: #64748b;
}
