/* === Arndt Bilanzbericht — Web-UI === */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&display=swap');

:root {
  --ci-blue:   #1f3a5f;
  --ci-orange: #d97b3d;
  --ci-text:   #2b2b2b;
  --ci-muted:  #6b6b6b;
  --ci-rule:   #c9d2dc;
  --ci-bg:     #fafbfc;
  --ci-card:   #ffffff;
}

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

/* Source Sans Pro / Source Sans 3 auf der gesamten App, inkl. Form-Elementen,
   die normalerweise nicht von body erben */
html, body, button, input, select, textarea, optgroup {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}
body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ci-text);
  background: var(--ci-bg);
}

/* === Briefkopf === */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--ci-rule);
}
.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.app-header .strich {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 42px;
  height: 1px;
  background: var(--ci-orange);
  z-index: 1;
}
.app-header .logo {
  z-index: 2;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ci-blue);
}
.app-header .logo img { height: 70px; background: #fff; padding: 0 8px 0 4px; }
.app-header .titel {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ci-muted);
  z-index: 2;
  background: #fff;
  padding: 0 10px;
}
.app-nav {
  z-index: 2;
  background: #fff;
  padding-left: 12px;
}
.app-nav a {
  color: var(--ci-blue);
  text-decoration: none;
  font-weight: 600;
  margin-left: 20px;
}
.app-nav a:hover { color: var(--ci-orange); }

/* === Container === */
main {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
}

/* === Seiten-Layout mit linker Sidebar-Navigation === */
.page-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
}
.page-main {
  min-width: 0;  /* damit Tabellen nicht das Grid sprengen */
}
.side-nav {
  position: sticky;
  top: 112px;            /* unter dem App-Header (96px Header + 16px Luft) */
  align-self: start;
  padding: 12px 0;
  border-left: 2px solid #e4e7ec;
  font-size: 13px;
  display: flex;
  flex-direction: column;
}
.side-nav-title {
  font-weight: 600;
  color: var(--ci-blue);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 11px;
  padding: 0 12px 8px;
}
.side-nav a {
  display: block;
  padding: 5px 12px;
  color: #475467;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  line-height: 1.35;
}
.side-nav a:hover {
  color: var(--ci-blue);
  border-left-color: var(--ci-orange);
}
.side-nav .side-off {
  display: inline-block;
  font-size: 10px;
  color: #98a2b3;
  background: #f2f4f7;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.side-nav-divider {
  height: 1px;
  background: #e4e7ec;
  margin: 10px 12px;
}
/* Sprungziele unter dem fixierten Header sichtbar halten */
[id] { scroll-margin-top: 112px; }

@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; border-left: none; border-bottom: 1px solid #e4e7ec; padding-bottom: 12px; }
  .side-nav a { display: inline-block; }
}

.side-count {
  display: inline-block;
  background: var(--ci-blue);
  color: #fff;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
  min-width: 18px;
  text-align: center;
}
.side-nav a:hover .side-count { background: var(--ci-orange); }

/* === Mandanten-Karten-Grid === */
.mandant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0 8px;
}
.mandant-card {
  background: var(--ci-card);
  border: 1px solid var(--ci-rule);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mandant-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.mandant-card-head h3 { color: var(--ci-blue); font-size: 16px; }
.mandant-card-body { font-size: 13px; color: var(--ci-text); flex: 1 1 auto; }
.mandant-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.mandant-card-actions .btn { flex: 1 1 auto; text-align: center; }

/* === Projekte-Tabellen === */
.projekt-block { padding: 14px 18px; }
.projekt-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--ci-rule);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.projekt-mandant-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ci-blue);
  text-decoration: none;
}
.projekt-mandant-name:hover { color: var(--ci-orange); }
.projekt-table { width: 100%; border-collapse: collapse; }
.projekt-table th {
  text-align: left;
  padding: 6px 4px;
  font-size: 12px;
  color: var(--ci-muted);
  font-weight: 600;
  border-bottom: 1px solid #eef0f3;
}
.projekt-table td {
  padding: 8px 4px;
  border-bottom: 1px solid #f5f6f8;
}
.projekt-table tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 32px 16px;
}
.empty-state .btn { margin-top: 12px; }

/* === Login/Setup-Seiten === */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--ci-bg);
  padding: 24px;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--ci-rule);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo img { height: 72px; }
.auth-titel {
  text-align: center;
  margin: 4px 0 16px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ci-muted);
  font-weight: 400;
}
.auth-subtitel {
  color: var(--ci-blue);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--ci-orange);
  padding-bottom: 6px;
}
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--ci-muted);
}
.auth-form input[type=text],
.auth-form input[type=password] {
  padding: 8px 10px;
  border: 1px solid var(--ci-rule);
  border-radius: 4px;
  font-size: 14px;
  color: var(--ci-text);
}
.auth-form input:focus { outline: none; border-color: var(--ci-blue); }
.auth-form .btn { margin-top: 8px; }
.auth-error {
  background: #fef2f2;
  border-left: 3px solid #b91c1c;
  color: #7f1d1d;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 4px;
  border-radius: 3px;
}
.auth-success {
  background: #f0fdf4;
  border-left: 3px solid #15803d;
  color: #14532d;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 4px;
  border-radius: 3px;
}
.auth-hint { margin-top: 16px; font-size: 12px; }

.app-nav-logout { color: var(--ci-muted) !important; }
.app-nav-logout:hover { color: var(--ci-orange) !important; }

h1 { color: var(--ci-blue); font-weight: 400; font-size: 28px; margin: 0 0 24px; }
h2 { color: var(--ci-blue); font-weight: 400; font-size: 20px; margin: 32px 0 16px; }
h3 { color: var(--ci-blue); font-weight: 600; font-size: 16px; margin: 16px 0 8px; }

a { color: var(--ci-blue); }
a:hover { color: var(--ci-orange); }

/* === Karten === */
.card {
  background: var(--ci-card);
  border: 1px solid var(--ci-rule);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-header h2 { margin: 0; }

/* === Tabellen === */
table.list {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--ci-rule);
  border-radius: 6px;
  overflow: hidden;
}
table.list th {
  background: #f1f5f9;
  color: var(--ci-blue);
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ci-rule);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.list td {
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
}
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover { background: #fafbfd; }

/* === Forms === */
form .row { display: flex; gap: 20px; margin-bottom: 12px; }
form .row > * { flex: 1; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--ci-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ci-rule);
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group textarea.tall { min-height: 200px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--ci-blue);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.1);
}
.form-group .hint { font-size: 12px; color: var(--ci-muted); margin-top: 4px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 4px;
  border: 1px solid var(--ci-blue);
  background: var(--ci-blue);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #2a4d7a; border-color: #2a4d7a; color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--ci-blue);
}
.btn-secondary:hover { background: #f1f5f9; }
.btn-accent {
  background: var(--ci-orange);
  border-color: var(--ci-orange);
}
.btn-accent:hover { background: #c66931; border-color: #c66931; color: #fff; }
.btn-danger {
  background: #fff;
  color: #b8364a;
  border-color: #b8364a;
}
.btn-danger:hover { background: #fdf4f6; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* === Status-Pills === */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill-ok    { background: #e6f4ea; color: #1e6b3a; }
.pill-warn  { background: #fef5e7; color: #8a5a00; }
.pill-info  { background: #eaeef5; color: #1f3a5f; }

/* === Layout Helpers === */
.flex { display: flex; gap: 16px; }
.flex-1 { flex: 1; }
.muted { color: var(--ci-muted); font-size: 13px; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.empty {
  padding: 40px;
  text-align: center;
  color: var(--ci-muted);
  background: #fff;
  border: 1px dashed var(--ci-rule);
  border-radius: 6px;
}

/* === Alerts === */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.alert-info {
  background: #f0f6fc;
  border-color: var(--ci-blue);
}
.alert-success {
  background: #e6f4ea;
  border-color: #1e6b3a;
}
.alert-warning {
  background: #fef5e7;
  border-color: var(--ci-orange);
}
