/* =========================================================
   Winni Automation – Pico CSS Overrides
   ========================================================= */

:root {
  --winni-primary: #0b74b5;
  --winni-primary-dark: #075985;
  --winni-secondary: #536684;
  --winni-text: #273142;
  --winni-muted: #667085;
  --winni-border: #dfe5ec;
  --winni-background: #f5f7fa;
  --winni-surface: #ffffff;
  --winni-surface-soft: #f8fafc;

  --pico-primary: var(--winni-primary);
  --pico-primary-hover: var(--winni-primary-dark);
  --pico-primary-focus: rgba(11, 116, 181, 0.2);
  --pico-color: var(--winni-text);
  --pico-muted-color: var(--winni-muted);
  --pico-background-color: var(--winni-background);
  --pico-card-background-color: var(--winni-surface);
  --pico-card-border-color: var(--winni-border);
  --pico-border-radius: 0.6rem;
  --pico-font-size: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--winni-text);
  background: var(--winni-background);
}

/* =========================================================
   Grundlayout
   ========================================================= */

body > header,
body > main,
body > footer {
  width: 100%;
}

body > main {
  flex: 1;
}

.container {
  max-width: 1240px;
}

/* =========================================================
   Header und Navigation
   ========================================================= */

body > header {
  padding: 0;
  background: var(--winni-surface);
  border-bottom: 1px solid var(--winni-border);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

body > header > nav {
  min-height: 76px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

body > header nav ul {
  gap: 0.25rem;
}

body > header nav li {
  padding: 0;
}

body > header nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  text-decoration: none;
  white-space: nowrap;
}

body > header nav a:hover {
  background: var(--winni-surface-soft);
  text-decoration: none;
}

body > header nav img {
  display: block;
  height: 2.4rem !important;
}

body > header nav h4 {
  margin: 0 0 0 0.5rem;
  color: #48505e;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

body > header nav a.secondary {
  color: var(--winni-muted);
}

/* Sprach-Buttons */

.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  padding: 0.35rem !important;
}

.language-link svg {
  display: block;
}

.linklike{background:none;border:none;padding:0;margin:0;color:inherit;text-decoration:underline;cursor:pointer;
    font:inherit;opacity:.85;
}
.linklike:hover{opacity:1;}

/* =========================================================
   Hauptbereich
   ========================================================= */

body > main.container {
  padding-top: 2rem !important;
  padding-bottom: 3rem !important;
}

main > h1:first-child,
main > h2:first-child {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.5rem;
  color: var(--winni-text);
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.2;
}

h2 {
  margin-top: 2rem;
  margin-bottom: 0.9rem;
  color: var(--winni-text);
  font-size: 1.35rem;
}

h3 {
  color: var(--winni-text);
  font-size: 1.1rem;
}

/* =========================================================
   Manage Cases
   ========================================================= */
.case-header {
    display: flex;
    justify-content: space-between;
    
    align-items: center;
    gap: 1rem;
    background-color: #fff;
    padding: 10px
}
.result-summary {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.result-summary-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.result-summary-left small:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-summary time {
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
  text-align: right;
}
.case-actions form {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.case-actions button {
    max-width: 30%
}



/* =========================================================
   Karten und Artikel
   ========================================================= */

article {
  overflow: hidden;
  margin-bottom: 1.5rem;
  padding: 0;
  background: var(--winni-surface);
  border: 1px solid var(--winni-border);
  border-radius: 0.75rem;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 8px 24px rgba(16, 24, 40, 0.05);
}

article > header {
  margin: 0;
  padding: 1.1rem 1.35rem;
  background: var(--winni-surface-soft);
  border-bottom: 1px solid var(--winni-border);
}

article > header h1,
article > header h2,
article > header h3,
article > header h4 {
  margin: 0;
}

article > section,
article > .article-body {
  padding: 1.25rem 1.35rem;
}

article > footer {
  margin: 0;
  padding: 1rem 1.35rem;
  background: var(--winni-surface-soft);
  border-top: 1px solid var(--winni-border);
}

/* Für Artikel, deren Inhalt noch direkt ohne section steht */

article > form,
article > p:not(header p):not(footer p) {
  margin-right: 1.35rem;
  margin-left: 1.35rem;
}

article > form {
  margin-top: 1.35rem;
  margin-bottom: 1.35rem;
}

/* =========================================================
   Buttons
   ========================================================= */

button,
[role="button"],
input[type="submit"],
input[type="button"] {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: none;
}

button.secondary,
[role="button"].secondary {
  background: var(--winni-secondary);
  border-color: var(--winni-secondary);
  color: #ffffff;
}

button.secondary:hover,
[role="button"].secondary:hover {
  background: #42536f;
  border-color: #42536f;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.actions > * {
  margin: 0;
}

/* =========================================================
   Formulare
   ========================================================= */

form label {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input,
select,
textarea {
  background: #ffffff;
  border-color: #cfd7e3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--winni-primary);
  box-shadow: 0 0 0 0.2rem rgba(11, 116, 181, 0.12);
}

.form-card {
  max-width: 520px;
  margin-right: auto;
  margin-left: auto;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* =========================================================
   Dashboard-Bereiche
   ========================================================= */

.page-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-header p {
  margin: 0;
  color: var(--winni-muted);
}

.dashboard-section {
  margin-top: 2rem;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.dashboard-section-header h2 {
  margin: 0;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat-item {
  min-width: 160px;
  padding: 1rem;
  background: var(--winni-surface-soft);
  border: 1px solid var(--winni-border);
  border-radius: 0.55rem;
}

.stat-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--winni-muted);
  font-size: 0.85rem;
}

.stat-value {
  display: block;
  color: var(--winni-text);
  font-size: 1.3rem;
  font-weight: 700;
}

/* =========================================================
   Tabellen
   ========================================================= */

.table-wrapper {
  overflow-x: auto;
  background: var(--winni-surface);
  border: 1px solid var(--winni-border);
  border-radius: 0.65rem;
}

table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
}

table thead th {
  padding: 0.85rem 1rem;
  color: #475467;
  background: var(--winni-surface-soft);
  border-bottom: 1px solid var(--winni-border);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

table tbody td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #edf0f4;
}

table tbody tr:last-child td {
  border-bottom: 0;
}

table tbody tr:hover {
  background: #fafbfd;
}

.table-actions {
  width: 1%;
  white-space: nowrap;
}

/* =========================================================
   Footer
   ========================================================= */

body > footer {
  padding: 0;
  background: var(--winni-surface);
  border-top: 1px solid var(--winni-border);
}

body > footer nav {
  min-height: 80px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

body > footer a {
  color: var(--winni-muted);
  text-decoration: none;
}

body > footer a:hover {
  color: var(--winni-primary);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 768px) {
  body > header nav {
    align-items: flex-start;
  }

  body > header nav,
  body > header nav ul {
    flex-wrap: wrap;
  }

  body > header nav ul:last-child {
    width: 100%;
    justify-content: flex-start;
  }

  .page-header {
    flex-direction: column;
  }

  .actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions > *,
  .form-actions > * {
    width: 100%;
  }

  article > header,
  article > section,
  article > .article-body,
  article > footer {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .case-actions button {
    max-width: 50%
  }
}


/* Full-width header and footer */

body > header,
body > footer {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--winni-surface);
}

body > header {
  border-bottom: 1px solid var(--winni-border);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

body > footer {
  border-top: 1px solid var(--winni-border);
}

body > header > nav,
body > footer > nav {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--pico-spacing);
}

/* Navigation links, including logout */

body > header nav a,
body > header nav a[role="button"],
body > header nav a.secondary {
  display: inline-block;
  margin: 0;
  padding: 0.55rem 0.75rem;
  color: var(--pico-primary);
  background: transparent;
  border: 0;
  border-radius: 0.45rem;
  box-shadow: none;
  font-weight: 400;
  text-decoration: none;
}

body > header nav a:hover,
body > header nav a[role="button"]:hover,
body > header nav a.secondary:hover {
  color: var(--pico-primary-hover);
  background: var(--winni-surface-soft);
  border: 0;
  box-shadow: none;
}

body > header nav a.language-link {
  display: inline-flex;
  padding: 0.3rem;
}

/* Cancel links */

.cancel-link,
a.cancel,
a.cancel[role="button"],
a.cancel.secondary {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  color: var(--winni-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.cancel-link:hover,
a.cancel:hover,
a.cancel[role="button"]:hover,
a.cancel.secondary:hover {
  color: var(--winni-primary);
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Article spacing */

article {
  overflow: hidden;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--winni-surface);
  border: 1px solid var(--winni-border);
  border-radius: 0.75rem;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 8px 24px rgba(16, 24, 40, 0.05);
}

article > header {
  margin:
    -1.25rem
    -1.35rem
    1.25rem;
  padding: 1.1rem 1.35rem;
  background: var(--winni-surface-soft);
  border-bottom: 1px solid var(--winni-border);
}

article > footer {
  margin:
    1.25rem
    -1.35rem
    -1.25rem;
  padding: 1rem 1.35rem;
  background: var(--winni-surface-soft);
  border-top: 1px solid var(--winni-border);
}


/* ==================================================
   Spinner waiting or answer in case-manage
================================================== */
.research-status {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: #f8f9fa;
    margin-bottom: 1rem;
}

.research-status small {
    display: block;
    margin-top: .2rem;
    color: #666;
}

.research-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin .9s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}