/* Einheitliches Argon-Design, portiert aus der Desktop-Anwendung "Argon Tender Manager"
   (resources/styles/argon.qss), die es wiederum aus "Argon Tools" uebernommen hat -
   damit alle drei Anwendungen optisch identisch wirken. */

:root {
  --color-bg: #f3f6f8;
  --color-text: #243342;
  --color-accent: #376f96;
  --color-accent-hover: #407da7;
  --color-headline: #244e6c;
  --color-headline-alt: #1e5278;
  --color-tab-accent: #3c78a1;
  --color-border: #d4dde5;
  --radius-card: 9px;
  --radius-input: 5px;
  --radius-group: 7px;
  --color-table-header: #e7eef3;
  --color-zebra: #f6f8fa;
  --color-row-selected: #c8ddeb;
  --color-success: #34734a;
  --color-error: #9a4141;
  --color-statusbar-bg: #344d61;
  --font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  --font-size-base: 13px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
}

a { color: var(--color-accent); }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  padding: 20px 24px;
}

/* Zweistufige Tab-Navigation, wie QTabWidget#MainModuleTabs / #SubModuleTabs */
.main-tabs {
  display: flex;
  background: #e7edf2;
  border-bottom: 1px solid #cbd6df;
}

.main-tabs__item {
  min-width: 130px;
  padding: 9px 16px;
  font-weight: 600;
  color: #344a5d;
  text-decoration: none;
  border-right: 1px solid #c7d2dc;
}

.main-tabs__item:hover:not(.is-active) { background: #dce6ee; }

.main-tabs__item.is-active {
  background: #ffffff;
  color: var(--color-headline-alt);
  border-top: 3px solid var(--color-tab-accent);
  padding-top: 6px;
}

.main-tabs__item.is-disabled {
  color: #97a4af;
  cursor: default;
  pointer-events: none;
}

.sub-tabs {
  display: flex;
  margin-top: 6px;
  border-bottom: 1px solid #d7dfe6;
}

.sub-tabs__item {
  min-width: 110px;
  padding: 5px 14px;
  margin-right: 2px;
  font-size: 12px;
  color: #55636e;
  text-decoration: none;
  background: #eef2f5;
  border: 1px solid #dbe2e8;
  border-bottom: none;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  cursor: pointer;
}

.sub-tabs__item:hover:not(.is-active) { background: #e2e8ec; }

.sub-tabs__item.is-active {
  background: #ffffff;
  color: var(--color-headline-alt);
  font-weight: 600;
  border-bottom: 2px solid var(--color-tab-accent);
}

.page-title {
  color: var(--color-headline);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.page-subtitle, .hint {
  color: #637585;
}

.section-heading {
  color: var(--color-headline);
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 16px;
}

.group-box {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-group);
  padding: 14px;
  margin-bottom: 14px;
}

.group-box__title {
  color: var(--color-headline);
  font-weight: 600;
  margin: -6px 0 10px 0;
}

form .field {
  margin-bottom: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 20px;
  max-width: 900px;
}

.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Dashboard-Kacheln als echte Buttons, gleiche Optik wie QPushButton#PrimaryButton
   aus argon.qss (siehe .btn-primary) - nur groesser, da hier die Kachel selbst
   der Button ist. */
.dashboard-button {
  display: block;
  text-align: center;
  background: var(--color-accent);
  color: #ffffff;
  border: 1px solid #2c5d80;
  border-radius: var(--radius-input);
  padding: 16px 14px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-button:hover { background: var(--color-accent-hover); }

.dashboard-button.is-disabled {
  background: #edf1f4;
  color: #97a4af;
  border-color: #d7dfe5;
  cursor: default;
}

.dashboard-subheading {
  margin: 0 0 4px 14px;
  color: #637585;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-subitems {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 4px 14px;
}

/* Unterpunkte als sekundaere Schnellzugriff-Aktionen - bewusst im
   UtilityButton-Stil aus argon.qss (gestrichelter Rand statt farbig gefuellt,
   dort fuer "Aktionen ausserhalb der normalen Bearbeitung" vorgesehen), damit
   sie sich klar von der primaeren blauen Navigation absetzen. */
.dashboard-subbutton {
  display: block;
  text-align: left;
  background: #f3f6f8;
  color: #637585;
  border: 1px dashed #98adbd;
  border-radius: var(--radius-input);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-subbutton:hover { background: #e7edf2; border-color: #637585; }

.dashboard-subbutton.is-disabled {
  color: #b0bac2;
  border-color: #dde4e9;
  cursor: default;
}

.dashboard-subbutton.is-disabled:hover { background: #f3f6f8; border-color: #dde4e9; }

@media (max-width: 900px) {
  .dashboard-columns { grid-template-columns: 1fr; max-width: 420px; }
}

/* Hebt die Zeile hervor, die ueber einen Dashboard-Schnellzugriff-Unterpunkt
   angesteuert wurde (z.B. "Neuer Lieferschein" -> Lieferschein-Zeile in der
   Dokumente-Tabelle eines neu angelegten Belegs). */
tr.is-highlighted td {
  background: #eaf2f8;
  border-top: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
}
tr.is-highlighted td:first-child { border-left: 2px solid var(--color-accent); font-weight: 600; }
tr.is-highlighted td:last-child { border-right: 2px solid var(--color-accent); }

.nowrap { white-space: nowrap; }
.warnkasten { border-color: #d98c8c; background: #fbefef; margin-bottom: 14px; }
.warnkasten strong:first-child { color: var(--color-error); }
.zeile-warnung td { background: #fbefef; }
.filter-leiste { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-leiste a { padding: 4px 10px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff;
  text-decoration: none; color: var(--color-text); font-size: 12px; }
.filter-leiste a.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
code { font-size: 12px; background: #eef2f5; padding: 1px 4px; border-radius: 3px; }

@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #344a5d;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], select, textarea {
  width: 100%;
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid #b9c7d2;
  border-radius: var(--radius-input);
  min-height: 30px;
  padding: 4px 8px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

textarea { min-height: 90px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin-bottom: 0; }

button, .btn {
  background: #e7edf2;
  color: #263b4c;
  border: 1px solid #bcc9d3;
  border-radius: var(--radius-input);
  min-height: 30px;
  padding: 6px 14px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
}

button:hover, .btn:hover { background: #d9e5ed; border-color: #98adbd; }
button:disabled { background: #edf1f4; color: #97a4af; border-color: #d7dfe5; cursor: default; }

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  border-color: #2c5d80;
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-utility {
  background: var(--color-bg);
  color: #637585;
  border: 1px dashed #98adbd;
}
.btn-utility:hover { background: #e7edf2; border-color: #637585; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #d1dbe3;
  border-radius: var(--radius-input);
}

thead th {
  background: var(--color-table-header);
  color: #344b5d;
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #c5d0d9;
  font-weight: 600;
}

tbody td { padding: 7px 8px; border-bottom: 1px solid #e2e8ed; }
tbody tr:nth-child(even) { background: var(--color-zebra); }
tbody tr.is-selected { background: var(--color-row-selected); }
tbody tr:hover { background: #eef4f8; }

.flash {
  border-radius: var(--radius-input);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-weight: 600;
}
.flash-success { background: #e6f2e9; color: var(--color-success); border: 1px solid #bfe0c8; }
.flash-error { background: #f7e9e9; color: var(--color-error); border: 1px solid #e6c3c3; }

.status-bar {
  background: var(--color-statusbar-bg);
  color: #ffffff;
  padding: 6px 16px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.status-bar a { color: #ffffff; }

/* ---- ELG-Tool: Ergänzungen ------------------------------------------- */
.elg-brand { font-weight: 700; color: var(--color-headline) !important; min-width: 0; }
.card.narrow { max-width: 400px; margin: 48px auto; }
.card.mittel { max-width: 640px; }
.card.center { text-align: center; }
.feld { display: block; margin: 0 0 12px; font-weight: 600; }
.feld input, .feld select { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; font: inherit;
  border: 1px solid var(--color-border); border-radius: var(--radius-input); background: #fff; }
.feld input:focus, .feld select:focus { outline: 2px solid var(--color-accent); outline-offset: 0; }
.hilfe { color: #5f6f7d; font-size: 12px; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.status-actions { display: flex; gap: 16px; align-items: center; }
.kopfzeile { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.kopfzeile .page-title { margin: 0; }
.anzahl { font-size: 13px; font-weight: 400; color: #5f6f7d; margin-left: 6px; }
.suche { display: flex; gap: 6px; }
.suche input { min-width: 280px; padding: 6px 9px; border: 1px solid var(--color-border); border-radius: var(--radius-input); font: inherit; }
.knoepfe { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
a.btn-primary, a.btn-utility { display: inline-block; text-decoration: none; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
.kacheln.klein { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kachel { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-card); color: var(--color-text); text-decoration: none; }
.kachel strong { font-size: 15px; color: var(--color-headline); }
.kacheln.klein .kachel strong { font-size: 22px; }
a.kachel:hover { border-color: var(--color-accent); box-shadow: 0 2px 6px rgba(36, 78, 108, .12); }
.kachel.is-disabled { opacity: .55; }
.kachel em { font-size: 11px; color: #5f6f7d; }
.kachel.warnung { border-color: #d9a441; }

.tabelle-rahmen { overflow-x: auto; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-group); }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { background: var(--color-table-header); text-align: left; font-weight: 600; padding: 7px 10px; white-space: nowrap; }
.tabelle td { padding: 6px 10px; border-top: 1px solid #e6ecf1; vertical-align: top; }
.tabelle tbody tr:nth-child(even) { background: var(--color-zebra); }
.marke { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.marke.gruen { background: #e2f1e7; color: var(--color-success); }
.marke.gelb { background: #fbf1d9; color: #7a5a12; }
.marke.rot { background: #f6e1e1; color: var(--color-error); }
.rechte-info { margin: 4px 0 14px; }
.rechte-info summary { cursor: pointer; color: var(--color-accent); }
.import-box summary { cursor: pointer; }
.liste-kompakt { margin: 6px 0 0; padding-left: 18px; }

@media (max-width: 640px) {
  .app-content { padding: 14px 12px; }
  .main-tabs { overflow-x: auto; }
  .main-tabs__item { min-width: 0; }
  .suche, .suche input { width: 100%; min-width: 0; }
  .status-bar { flex-wrap: wrap; gap: 8px; }
}
