:root {
  color-scheme: light;
  --blue: #176494;
  --blue-dark: #104b70;
  --text: #243746;
  --muted: #536675;
  --border: #d5dfe7;
  --surface: #ffffff;
  --background: #f3f6f9;
}
.customer-contact-list { list-style: none; padding: 0; }
.customer-contact-list li { padding: 16px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.customer-contact-list li span { color: var(--muted); font-size: 0.875rem; }

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
  border-radius: 4px;
}
.logo {
  display: block;
  align-self: flex-start;
  width: 180px;
  max-width: calc(100% - 40px);
  height: auto;
  margin: 24px max(20px, calc((100% - 1120px) / 2));
}
header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
nav { max-width: 1160px; margin: 0 auto; padding: 8px 20px; }
nav ul { list-style: none; margin: 0; padding: 0; }
nav > ul { display: flex; flex-wrap: wrap; gap: 4px 12px; }
nav li { position: relative; }
nav a { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; border-radius: 6px; }
nav > ul > li > a { font-weight: 600; }
nav > ul > li > a::after { content: "⌄"; margin-left: 10px; color: var(--muted); }
nav a:hover, nav li:focus-within > a { color: var(--blue-dark); background: #edf4fa; }
nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  min-width: 210px;
  max-width: calc(100vw - 40px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgb(25 50 75 / 12%);
}
nav > ul > li:last-child ul { left: auto; right: 0; }
nav li:hover > ul, nav li:focus-within > ul { display: block; }
nav li ul a { padding: 10px 12px; overflow-wrap: anywhere; }
.nav-logout { margin: 0; }
.nav-logout button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.nav-logout button:hover { color: var(--blue-dark); background: #edf4fa; }
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 48px 24px 64px;
}
.inhalt, .contact {
  width: 100%;
  max-width: 880px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgb(25 50 75 / 4%);
  overflow-wrap: anywhere;
}
h1 { margin: 0 0 20px; color: var(--blue-dark); font-size: clamp(26px, 4vw, 34px); line-height: 1.25; letter-spacing: -0.025em; }
p { margin: 0 0 18px; }
.contact { max-width: 720px; }
.login-panel { max-width: 480px; }
.login-reset-link { margin-top: 24px; font-size: 0.9375rem; }
.password-strength { display: grid; gap: 6px; }
.password-strength meter { width: 100%; height: 16px; }
.password-strength > span { font-size: 0.875rem; color: var(--muted); }
.customer-details { margin: 28px 0; }
.customer-details dt { margin-top: 16px; color: var(--muted); font-size: 0.875rem; }
.customer-details dd { margin: 2px 0 0; }
.customer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.customer-heading h1 { margin-bottom: 0; }
.customer-actions { position: relative; margin-left: auto; }
.customer-actions summary { padding: 10px 16px; border: 1px solid var(--border); border-radius: 6px; color: var(--blue-dark); background: white; cursor: pointer; font-weight: 600; }
.customer-actions summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.customer-actions ul { position: absolute; right: 0; z-index: 5; width: 190px; max-width: calc(100vw - 80px); margin: 6px 0 0; padding: 6px; list-style: none; background: white; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px rgb(25 50 75 / 12%); }
.customer-actions a { display: block; padding: 10px 12px; border-radius: 4px; text-decoration: none; }
.customer-actions a:hover, .customer-actions a[aria-current="page"] { background: #edf4fa; }
.customer-action-content { padding: 20px; margin: 24px 0; background: var(--background); border-radius: 6px; }
.customer-action-content h2 { margin: 0 0 12px; font-size: 1.25rem; color: var(--blue-dark); }
.customer-action-content p { margin: 0; }
.billing-document-list { list-style: none; margin: 24px 0 0; padding: 0; }
.billing-document-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 16px 0; border-top: 1px solid var(--border); }
.billing-document-name { flex: 1 1 100%; font-weight: 600; overflow-wrap: anywhere; }
.billing-document-date { color: var(--muted); font-size: 0.875rem; }
.billing-document-list a { margin-left: auto; }
.time-records-table-wrap { margin-top: 20px; overflow-x: auto; }
.time-groups { display: grid; gap: 12px; margin-top: 20px; }
.time-group { min-width: 0; border: 1px solid var(--border); border-radius: 6px; background: white; }
.time-group > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--blue-dark); font-weight: 600; cursor: pointer; }
.time-group > summary::before { content: '▸'; flex-shrink: 0; }
.time-group[open] > summary::before { content: '▾'; }
.time-group > summary span:last-child { margin-left: auto; white-space: nowrap; }
.time-group > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.time-group[open] > summary { background: #edf4fa; border-bottom: 1px solid var(--border); }
.time-month-groups { display: grid; gap: 10px; }
.time-year-group > .time-month-groups { padding: 16px; }
.time-month-group > .time-records-table-wrap { margin: 0; padding: 12px; }
.time-cost-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin: 24px 0 16px; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: #eaf3fb; color: var(--blue-dark); }
.time-entry-panel { margin: 24px 0; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: white; }
.time-entry-panel summary { color: var(--blue); cursor: pointer; font-weight: 600; }
.time-entry-panel summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.time-entry-panel #entry-other-fields label { display: block; margin-bottom: 8px; }
.time-records-table td { overflow-wrap: anywhere; }
.time-records-table .time-edit-cell { padding: 0; text-align: left; }
.time-inline-edit > summary { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr) auto; gap: 16px; padding: 14px 16px; cursor: pointer; }
.time-inline-edit > summary:hover, .time-inline-edit[open] > summary { background: #edf4fa; }
.time-inline-edit > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.time-inline-edit .contact-form { padding: 0 16px 20px; text-align: left; }
.time-inline-edit .time-edit-cancel { background: var(--background); color: var(--blue-dark); }
.time-inline-other label { display: block; margin-bottom: 8px; }
.time-inline-edit .time-entry-delete { border-top: 1px solid var(--border); margin-top: 12px; }
.time-delete-confirm { display: flex; align-items: flex-start; gap: 10px; }
.time-delete-confirm input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 4px; }
.time-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.time-filter label { display: block; margin-bottom: 8px; }
@media (max-width: 640px) { .time-filter { grid-template-columns: minmax(0, 1fr); } }
.time-records-table { width: 100%; border-collapse: collapse; background: white; }
.time-records-table caption { padding-bottom: 12px; text-align: left; color: var(--muted); font-size: 0.875rem; }
.time-records-table th, .time-records-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.time-records-table th { background: #eaf3fb; color: var(--blue-dark); }
.time-records-table th:last-child, .time-records-table td:last-child { text-align: right; }
.admin-customer-list { list-style: none; margin: 24px 0 0; padding: 0; }
.admin-customer-list li + li { border-top: 1px solid var(--border); }
.admin-customer-list a { display: block; padding: 14px 12px; border-radius: 6px; text-decoration: none; }
.admin-customer-list a:hover { background: #edf4fa; }
.customer-search-form { margin-top: 0; }
.customer-page-info { margin-top: 20px; color: var(--muted); font-size: 0.875rem; }
.customer-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.customer-pagination a, .customer-pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; background: white; }
.customer-pagination a:hover { background: #edf4fa; }
.customer-pagination [aria-current="page"] { background: var(--blue); color: white; border-color: var(--blue); }
#customer-results[aria-busy="true"] { opacity: 0.65; }
.customer-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; width: 100%; max-width: 1120px; }
.customer-sidebar { position: sticky; top: 24px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.customer-nav { padding: 0; margin: 0; max-width: none; }
.customer-nav > ul { display: flex; flex-direction: column; gap: 6px; }
.customer-nav > ul > li > a { padding: 12px 16px; font-weight: 500; }
.customer-nav > ul > li > a::after { display: none; }
.customer-nav a[aria-current="page"] { background: #edf4fa; color: var(--blue-dark); font-weight: 600; }
.customer-content { max-width: none; min-width: 0; }
.customer-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.customer-section h2 { margin: 0 0 12px; color: var(--blue-dark); font-size: 1.25rem; scroll-margin-top: 24px; }
.customer-section p { margin-bottom: 0; color: var(--muted); }
@media (max-width: 760px) {
  .customer-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .customer-sidebar { position: static; }
}
.login-panel .contact-form button { margin-top: 16px; width: 100%; }
.contact > p { color: var(--muted); }
.contact > p:last-child { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.contact-form { display: grid; gap: 8px; margin-top: 28px; }
.contact-form label { margin-top: 12px; font-size: 0.9375rem; font-weight: 600; }
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #aebfcd;
  border-radius: 6px;
  background: #fcfdff;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}
.contact-form textarea { resize: vertical; min-height: 180px; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: 3px solid #d6e9f7;
  outline-offset: 1px;
  border-color: var(--blue);
  background: var(--surface);
}
.contact-form #answer { max-width: 140px; }
.receipt-upload { padding-top: 24px; border-top: 1px solid var(--border); }
#receipt-period-fields:not([hidden]) { display: grid; gap: 8px; }
.customer-delete-form { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.customer-delete-form h3 { margin: 0; color: #802626; }
.customer-delete-form .delete-confirm { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; }
.customer-delete-form input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 4px 0 0; padding: 0; }
.contact-form .button-danger { background: #a12828; }
.contact-form .button-danger:hover { background: #802020; }
.contact-form p { margin: 14px 0; color: var(--muted); font-size: 0.875rem; }
.contact-form button {
  justify-self: start;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.contact-form button:hover { background: var(--blue-dark); }
.contact-errors, .contact-success { margin: 24px 0; padding: 16px 20px; border-radius: 6px; }
.contact-errors { color: #802626; background: #fff3f2; border: 1px solid #edc5c2; }
.contact-errors ul { margin: 0; padding-left: 20px; }
.contact-errors li + li { margin-top: 6px; }
.contact .contact-success { color: #245c37; background: #edf8ef; border: 1px solid #bcdcc5; }
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
footer { flex-shrink: 0; padding: 24px; background: var(--surface); border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 0.875rem; }
footer p { margin: 0; }
.legal { margin-left: 8px; }
.legal-page { max-width: 960px; }
.legal-page h2 { margin: 0 0 24px; color: var(--blue-dark); font-size: clamp(23px, 3vw, 28px); line-height: 1.3; }
.legal-page h3 { margin: 0 0 14px; color: var(--text); font-size: 1.125rem; line-height: 1.45; }
.legal-page address { font-style: normal; }
.legal-page .legal-address { margin: 16px 0; }
.legal-page .legal-block { margin-top: 28px; }
.legal-page .legal-block p { margin-bottom: 14px; }
.legal-page .legal-block p:last-child { margin-bottom: 0; }
.legal-page ul { margin: 16px 0; padding-left: 24px; }
.legal-page li + li { margin-top: 8px; }
.legal-page #datenschutz { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--border); }
.legal-page [id] { scroll-margin-top: 24px; }
.legal-jump { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 16px 20px; margin: 24px 0 32px; background: var(--background); border-radius: 6px; }
.legal-page .legal-date { margin-top: 24px; font-size: 0.875rem; color: var(--muted); }

@media (max-width: 640px) {
  .logo { width: 150px; margin: 20px; }
  nav { padding: 8px 12px; }
  nav > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  nav a { padding: 10px 8px; }
  nav li ul, nav > ul > li:last-child ul {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 4px 0 8px;
    padding: 4px;
    box-shadow: none;
    background: #f5f8fb;
  }
  nav li ul { display: block; }
  nav li ul a { font-size: 0.875rem; }
  .nav-logout button { font-size: 0.875rem; }
  nav > ul > li > a::after { display: none; }
  main { padding: 24px 16px 36px; }
  .inhalt, .contact { padding: 24px 20px; border-radius: 8px; }
  .contact-form button { width: 100%; }
}
