/* WTB Büro – eigenes Design-System.
   Farben und Schriften aus dem wetastebetter-theme (style.css) uebernommen,
   damit die Buchhaltung zur Marke passt statt nach Bootstrap-Default auszusehen.
   Bewusst NICHT wie die Lager-App: dort reicht eine Top-Navbar, hier kommen
   noch Belege, Bank, Steuern, Auswertungen und Einstellungen dazu - das
   skaliert nur mit einer Sidebar. */

:root {
  --wtb-black:      #0a0a0a;
  --wtb-off-white:  #f8f6f2;
  --wtb-warm-white: #faf8f4;
  --wtb-text:       #1a1a1a;
  --wtb-text-muted: #6b6b6b;
  --wtb-border:     #e8e4df;
  --wtb-gold:       #c8941a;
  --wtb-gold-light: #d4962a;
  --wtb-gold-soft:  #f5e6d0;

  --wtb-green:      #2f7a4f;
  --wtb-green-soft: #e6f2eb;
  --wtb-red:        #a33232;
  --wtb-red-soft:   #f7e9e9;
  --wtb-blue-soft:  #e8f3f7;

  --font-sans: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --radius:    6px;
  --radius-sm: 4px;
  --sidebar-w: 232px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .05);
  --shadow-md: 0 4px 16px rgba(10, 10, 10, .08);
  --shadow-lg: 0 12px 40px rgba(10, 10, 10, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--wtb-text);
  background: var(--wtb-off-white);
}

a { color: var(--wtb-text); }

/* ---------- Layout: Sidebar + Content ---------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--wtb-black);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-brand a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}
.sidebar-version {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, .4);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-version:hover { color: var(--wtb-gold-light); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav .nav-section {
  padding: 14px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255, 255, 255, .35);
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 20px;
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-nav a.active {
  background: rgba(200, 148, 26, .13);
  border-left-color: var(--wtb-gold);
  color: #fff;
  font-weight: 500;
}
.sidebar-nav a .ico { width: 16px; text-align: center; opacity: .85; }

.sidebar-foot {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}
.sidebar-foot a { color: rgba(255, 255, 255, .55); text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }

.content { flex: 1; min-width: 0; padding: 26px 32px 60px; }

/* ---------- Seitenkopf ---------- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 21px; font-weight: 600; margin: 0 0 3px; letter-spacing: -.01em; }
.page-head .sub { color: var(--wtb-text-muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--wtb-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--wtb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--wtb-text-muted);
}
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------- Formulare ---------- */

.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.form-field { flex: 1 1 200px; min-width: 0; }
.form-field.narrow { flex: 0 0 130px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--wtb-text-muted);
  margin-bottom: 5px;
}
label .req { color: var(--wtb-red); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  padding: 8px 11px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--wtb-text);
  background: #fff;
  border: 1px solid var(--wtb-border);
  border-radius: var(--radius-sm);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--wtb-gold);
  box-shadow: 0 0 0 3px rgba(200, 148, 26, .13);
}
input::placeholder { color: #b3aca4; }
textarea { resize: vertical; }

.check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.check input { width: auto; }
.check label { margin: 0; font-size: 13.5px; color: var(--wtb-text); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  background: #fff;
  color: var(--wtb-text);
  border-color: var(--wtb-border);
}
.btn:hover { background: var(--wtb-warm-white); }
.btn-primary { background: var(--wtb-black); color: #fff; border-color: var(--wtb-black); }
.btn-primary:hover { background: #262626; }
.btn-gold { background: var(--wtb-gold); color: #fff; border-color: var(--wtb-gold); }
.btn-gold:hover { background: var(--wtb-gold-light); }
.btn-danger { color: var(--wtb-red); border-color: var(--wtb-border); }
.btn-danger:hover { background: var(--wtb-red-soft); border-color: var(--wtb-red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1;
  color: var(--wtb-text-muted);
}
.btn-icon:hover { color: var(--wtb-text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--wtb-text-muted);
  background: var(--wtb-warm-white);
  border-bottom: 1px solid var(--wtb-border);
  white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--wtb-text); }
table.data th .arrow { opacity: .3; margin-left: 3px; font-size: 9px; }
table.data th.sorted .arrow { opacity: 1; color: var(--wtb-gold); }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--wtb-border); }
table.data tbody tr:hover { background: var(--wtb-warm-white); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data a { color: var(--wtb-text); text-decoration: none; font-weight: 500; }
table.data a:hover { color: var(--wtb-gold); text-decoration: underline; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

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

/* ---------- Suchfeld ---------- */

.search-box { position: relative; }
.search-box input { padding-left: 32px; }
.search-box .search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #b3aca4;
  font-size: 13px;
  pointer-events: none;
}

/* ---------- Badges / Pills ---------- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 100px;
  background: var(--wtb-warm-white);
  border: 1px solid var(--wtb-border);
  color: var(--wtb-text-muted);
}
.badge-gold  { background: var(--wtb-gold-soft); border-color: #e8d3ab; color: #8a6410; }
.badge-green { background: var(--wtb-green-soft); border-color: #c3e0d0; color: var(--wtb-green); }
.badge-red   { background: var(--wtb-red-soft); border-color: #e6c9c9; color: var(--wtb-red); }
.badge-blue  { background: var(--wtb-blue-soft); border-color: #c5dfe8; color: #1f5f73; }

/* ---------- Tabs / Filterleiste ---------- */

.tabs { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
  padding: 6px 13px;
  font-size: 13px;
  border-radius: 100px;
  text-decoration: none;
  color: var(--wtb-text-muted);
  border: 1px solid transparent;
}
.tabs a:hover { background: #fff; color: var(--wtb-text); }
.tabs a.active {
  background: #fff;
  border-color: var(--wtb-border);
  color: var(--wtb-text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, .45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--wtb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close {
  background: none;
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--wtb-text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--wtb-text); }
.modal-search { padding: 14px 20px; border-bottom: 1px solid var(--wtb-border); }
.modal-body { overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--wtb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--wtb-text-muted);
}

/* ---------- Meldungen ---------- */

.flash {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13.5px;
  border: 1px solid;
}
.flash-success { background: var(--wtb-green-soft); border-color: #c3e0d0; color: #1e5535; }
.flash-danger  { background: var(--wtb-red-soft); border-color: #e6c9c9; color: #7d2626; }
.flash-warning { background: var(--wtb-gold-soft); border-color: #e8d3ab; color: #7a5810; }
.flash-info    { background: var(--wtb-blue-soft); border-color: #c5dfe8; color: #1f5f73; }

/* ---------- Detail-Ansicht ---------- */

.detail-grid { display: flex; gap: 40px; flex-wrap: wrap; }
.detail-block { flex: 1 1 240px; }
.detail-block .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--wtb-text-muted);
  margin-bottom: 5px;
}
.detail-block .val { font-size: 13.5px; white-space: pre-line; }
.kv { display: flex; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.kv .k { color: var(--wtb-text-muted); min-width: 120px; }

.totals { margin-left: auto; width: 260px; font-size: 13.5px; }
.totals .line { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .line.sum {
  border-top: 1px solid var(--wtb-text);
  margin-top: 5px;
  padding-top: 9px;
  font-weight: 600;
  font-size: 15px;
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--wtb-black);
}
.login-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 34px;
  width: 100%;
  max-width: 370px;
}
.login-card h1 { font-size: 19px; font-weight: 600; margin: 0 0 4px; }
.login-card .sub { color: var(--wtb-text-muted); font-size: 13px; margin-bottom: 22px; }

/* ---------- Hilfsklassen ---------- */

.muted { color: var(--wtb-text-muted); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-end { text-align: right; }
.text-green { color: var(--wtb-green); }
.text-red { color: var(--wtb-red); }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 6px; }
  .sidebar-nav .nav-section { display: none; }
  .sidebar-nav a { border-left: 0; border-radius: var(--radius-sm); padding: 7px 12px; }
  .sidebar-nav a.active { border-left: 0; }
  .content { padding: 18px 16px 40px; }
}
