/* Interne Oberflaechen (/pro, /admin, /approve) — gleicher Schliff wie site.css:
   Cormorant fuer Ueberschriften, Creme-Grund, Haarlinien, Pillen-Knoepfe. Ergaenzt brand.css. */
:root {
  --font-head: "Cormorant Garamond", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --muted: rgba(27, 27, 27, 0.66);
  --hair: rgba(31, 77, 58, 0.12);
  --green-10: rgba(31, 77, 58, 0.06);
  --green-20: rgba(31, 77, 58, 0.14);
  --green-30: rgba(31, 77, 58, 0.24);
  --green-60: rgba(31, 77, 58, 0.72);
  --space-4: 4px; --space-6: 6px; --space-8: 8px; --space-12: 12px;
  --space-16: 16px; --space-24: 24px; --space-32: 32px;
  --radius: 14px;
}

.inner { background: var(--cream); min-height: 100vh; }
.inner h1, .inner h2, .inner h3, .inner h4 { font-family: var(--serif); font-weight: 500; color: var(--green-dark); letter-spacing: -0.01em; line-height: 1.15; }
.inner h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 20px; }
.inner h2 { font-size: 28px; }
.inner h3 { font-size: 23px; }
.inner h4 { font-size: 20px; margin-bottom: 4px; }

/* Knoepfe: beide Namensschemata (button primary / btn btn-primary) */
.inner button, .inner .button, .inner .btn { border-radius: 999px; min-height: 46px; padding: 10px 22px; font-family: var(--font-body); font-weight: 600; font-size: 15px; }
.inner .primary, .inner .btn-primary { background: var(--green-dark); color: #fff; box-shadow: 0 6px 18px rgba(20, 53, 40, 0.16); }
.inner .primary:hover, .inner .btn-primary:hover { background: var(--green); color: #fff; }
.inner .secondary, .inner .btn-secondary, .inner .btn:not(.btn-primary):not(.btn-danger):not(.btn-warning) { background: rgba(255, 255, 255, 0.8); color: var(--green-dark); border: 1px solid var(--green-30); }
.inner .secondary:hover, .inner .btn-secondary:hover { background: #fff; border-color: var(--green); color: var(--green-dark); }
.inner .btn-danger { background: var(--error); color: #fff; }
.inner .btn-warning { background: rgba(200, 161, 90, 0.22); color: #5c481f; border: 1px solid rgba(200, 161, 90, 0.6); }
.inner .btn-small { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.inner button:disabled { opacity: 0.45; cursor: not-allowed; }
.inner .big { min-height: 56px; font-size: 17px; width: 100%; }

/* Formulare (Labels und Felder stehen dort ohne .form-field) */
.inner label { display: block; font-weight: 500; font-size: 14.5px; margin: 14px 0 6px; color: var(--ink); }
.inner input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .inner select, .inner textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--green-20); border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.inner input:focus, .inner select:focus, .inner textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.12); }
.inner textarea { min-height: 96px; resize: vertical; }
.inner input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }

/* Karten */
.inner .card { background: rgba(255, 255, 255, 0.86); border: 1px solid var(--hair); border-radius: 20px; box-shadow: 0 10px 40px rgba(20, 53, 40, 0.05); padding: 22px; }
.inner .empty { text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 20px; padding: 40px 12px; }
.inner .banner { border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; font-size: 15px; }
.inner .banner.warning { background: rgba(200, 161, 90, 0.16); border: 1px solid rgba(200, 161, 90, 0.5); color: #5c481f; }

/* Status-Pillen (pro: status-badge status-x) */
.status-badge { display: inline-flex; align-self: flex-start; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: var(--green-10); color: var(--green-dark); }
.status-accepted { background: rgba(200, 161, 90, 0.2); color: #5c481f; }
.status-checked_in { background: #e6f3ed; color: var(--green); }
.status-submitted { background: #e3ebf7; color: #1e3a6b; }
.status-approved { background: #dcf1e2; color: #166534; }
.status-disputed { background: #fbe3e1; color: var(--error); }
.status-paid { background: #efe7f6; color: #5b2a86; }
.status-cancelled { background: #efefec; color: #55564f; }

/* Anmeldung (pro + admin) */
.login-card, .login-box { max-width: 420px; margin: 8vh auto 0; }
.login-box { text-align: center; }
.login-box .card { text-align: left; margin-top: 20px; }
.brand-logo { font-size: 44px !important; margin-bottom: 4px !important; }
.login-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.login-card button, .login-box button { width: 100%; margin-top: 22px; }

/* ================= /pro ================= */
.pro { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.pro-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: rgba(246, 243, 236, 0.86); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.brandmark { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--green-dark); }
.brandmark .mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-dark); color: var(--cream); font-size: 15px; align-self: center; }
.pro .help-btn { min-height: 38px; padding: 6px 16px; background: #fff; color: var(--error); border: 1px solid rgba(179, 38, 30, 0.35); font-size: 14px; }
.pro .app { max-width: 640px; margin: 0 auto; padding: 20px 16px; }
.offline-banner { background: var(--ink); color: #fff; text-align: center; font-size: 14px; padding: 8px 12px; }

.pro-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--hair);
}
.pro-nav[hidden] { display: none; }
.nav-item { display: grid; place-items: center; min-height: 48px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); }
.nav-item.is-active { background: var(--green-dark); color: #fff; }
.nav-item:hover { color: var(--green-dark); }
.nav-item.is-active:hover { color: #fff; }

.job-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; text-decoration: none; color: inherit; }
a.job-card:hover { border-color: var(--green-30); }
.job-service { font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--green-dark); line-height: 1.15; }
.job-meta { grid-column: 1; color: var(--muted); font-size: 14.5px; }
.job-distance { grid-column: 2; grid-row: 1; justify-self: end; font-size: 13px; color: var(--muted); }
.job-payout { grid-column: 2; justify-self: end; align-self: end; font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--green-dark); }
.job-card .status-badge { grid-column: 1; margin-top: 6px; }
.job-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 14px; }

.pro .address { color: var(--ink); margin: 10px 0 14px; line-height: 1.5; }
.pro .checklist { list-style: none; margin: 8px 0 0; padding: 0; }
.pro .checklist li { border-top: 1px solid var(--hair); }
.pro .checklist label { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 0; font-weight: 400; cursor: pointer; }
.media-block { border-top: 1px solid var(--hair); padding-top: 16px; margin-top: 16px; }
.media-block .counter { color: var(--brass); font-family: var(--serif); font-style: italic; font-size: 18px; margin-bottom: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; }
.thumbs img, .thumbs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--green-10); }
.pro .stack > button.primary { width: 100%; min-height: 56px; font-size: 17px; }

.camera-overlay { position: fixed; inset: 0; z-index: 200; background: #0d0f0e; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.camera-overlay video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-shutter, .camera-cancel { position: relative; z-index: 1; }
.camera-overlay .camera-shutter { width: 78px; height: 78px; min-height: 0; padding: 0; margin-bottom: 14px; border-radius: 50%; background: #fff; color: transparent; font-size: 0; border: 5px solid rgba(255, 255, 255, 0.45); background-clip: padding-box; box-shadow: 0 0 0 2px #fff; }
.camera-overlay .camera-cancel { margin-bottom: calc(22px + env(safe-area-inset-bottom)); background: rgba(0, 0, 0, 0.45); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }
.camera-timer { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1; background: var(--error); color: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.sheet { position: fixed; inset: 0; z-index: 150; background: rgba(20, 30, 25, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-content { width: 100%; max-width: 560px; background: var(--cream); border-radius: 24px 24px 0 0; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15); }
.sheet-content > .button { width: 100%; background: var(--error); color: #fff; margin-top: 6px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ================= /admin ================= */
.admin-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 0 16px; background: rgba(246, 243, 236, 0.9); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.admin-topbar .logo { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--green-dark); }
.admin .menu-toggle { min-height: 40px; padding: 4px 14px; background: #fff; color: var(--green-dark); border: 1px solid var(--green-20); font-size: 18px; }
.admin-sidebar { display: none; flex-direction: column; gap: 2px; padding: 12px; background: #fff; border-bottom: 1px solid var(--hair); }
.admin-sidebar.is-open { display: flex; }
.admin-sidebar a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px; }
.admin-sidebar a:hover { background: var(--green-10); color: var(--green-dark); }
.admin-sidebar a.is-active { background: var(--green-dark); color: #fff; }
.admin-sidebar .nav-logout { margin-top: auto; color: var(--muted); }
.admin-main { padding: 24px 16px 64px; min-width: 0; }
.admin-main > * { max-width: 1120px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
.dashboard-tile { display: block; text-decoration: none; background: #fff; border: 1px solid var(--hair); border-radius: 18px; padding: 16px 18px; color: inherit; transition: border-color .15s ease, transform .15s ease; }
.dashboard-tile:hover { border-color: var(--green-30); transform: translateY(-1px); }
.tile-number { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; color: var(--green-dark); }
.tile-label { margin-top: 6px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile-alert { border-color: rgba(179, 38, 30, 0.35); background: #fdf5f4; }
.tile-alert .tile-number { color: var(--error); }
.dashboard-incidents, .dashboard-figures { margin-bottom: 28px; }
.incident-alert { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--hair); border-radius: 999px; padding: 8px 18px 8px 8px; }
.incident-number { display: grid; place-items: center; min-width: 38px; height: 38px; border-radius: 50%; background: var(--error); color: #fff; font-weight: 600; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.figure-card { background: #fff; border: 1px solid var(--hair); border-radius: 18px; padding: 18px; }
.figure-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.figure-value { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--green-dark); }

.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; align-items: end; margin-bottom: 18px; padding: 16px; background: #fff; border: 1px solid var(--hair); border-radius: 18px; }
.filter-bar label { margin-top: 0; font-size: 13px; color: var(--muted); }
.filter-bar button { align-self: end; }

.data-table { background: #fff; border: 1px solid var(--hair); border-radius: 16px; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 14.5px; display: block; overflow-x: auto; }
.data-table th { background: var(--cream); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--hair); }
.data-table tbody tr:hover td { background: rgba(246, 243, 236, 0.6); }
.data-table input { min-height: 38px !important; padding: 6px 10px !important; }
.inline-pence { max-width: 110px; }
.inline-min { max-width: 80px; }
.margin-cell { font-variant-numeric: tabular-nums; color: var(--green-dark); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager-info { color: var(--muted); font-size: 14px; }

.detail-header, .section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.detail-header h1, .section-header h1 { margin: 0; }
.detail-section { background: #fff; border: 1px solid var(--hair); border-radius: 20px; padding: 20px 22px; margin-bottom: 16px; }
.detail-section h2 { font-size: 24px; margin-bottom: 12px; }
.kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.kv-grid dt { color: var(--muted); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.kv-grid dd { margin: 0; font-weight: 500; }
.action-bar, .card-actions, .form-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.checklist-inline { list-style: none; padding: 0; margin: 0; }
.checklist-inline li { padding: 6px 0; border-bottom: 1px solid var(--hair); }
.media-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.inner .media-thumb, .inner .media-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--green-10); }
.signature-img { max-width: 320px; background: #fff; border: 1px solid var(--hair); border-radius: 12px; padding: 8px; }
.events-list { list-style: none; margin: 0; padding: 0; }
.events-list li { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14.5px; }
.event-type { font-weight: 600; color: var(--green-dark); margin-right: 8px; }
.event-data { color: var(--muted); font-size: 13px; word-break: break-word; }

.contractor-list, .incident-list, .payout-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.contractor-card, .incident-card, .payout-card { background: #fff; border: 1px solid var(--hair); border-radius: 20px; padding: 18px 20px; }
.contractor-card p, .incident-card p, .payout-card p { margin: 2px 0; color: var(--muted); font-size: 14.5px; }
.contractor-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contractor-header h3 { margin: 0; }
.insurance-light { font-size: 18px; line-height: 1; }
.light-green { color: #2f8a4f; }
.light-amber { color: var(--brass); }
.light-red { color: var(--error); }
.incident-card.open { border-color: rgba(179, 38, 30, 0.35); }
.incident-card.resolved { opacity: 0.7; }
.catalogue-category { margin-bottom: 28px; }
.photo-inputs { display: flex; gap: 6px; }
.qual-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; }
.qual-add input, .qual-add select { max-width: 240px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(20, 30, 25, 0.45); }
.modal { width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; background: var(--cream); border-radius: 22px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); }
.modal h3 { font-size: 26px; margin-bottom: 8px; }

@media (min-width: 900px) {
  .admin-shell { grid-template-columns: 232px 1fr; grid-template-rows: auto 1fr; }
  .admin-topbar { grid-column: 1 / -1; }
  .admin .menu-toggle { display: none; }
  .admin-sidebar { display: flex; position: sticky; top: 64px; height: calc(100vh - 64px); border-bottom: 0; border-right: 1px solid var(--hair); padding: 18px 12px; background: rgba(255, 255, 255, 0.6); }
  .admin-main { padding: 32px 36px 72px; }
}

/* ================= /approve ================= */
.brand-mark { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--green-dark); }
.brand-header { display: flex; align-items: center; justify-content: center; min-height: 68px; border-bottom: 1px solid var(--hair); background: rgba(246, 243, 236, 0.9); }
.approve-page .approve { padding: 28px 16px 64px; }
.approve-page .head h1, .approve-page .done h2, .approve-page .status-note h2 { font-family: var(--serif); font-weight: 500; }
.approve-page .head h1 { font-size: clamp(34px, 6vw, 46px); }
.approve-page .meta { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; background: #fff; border: 1px solid var(--hair); border-radius: 18px; padding: 16px 18px; }
.approve-page .section-title { font-family: var(--serif); font-weight: 500; font-size: 28px; color: var(--green-dark); }
.approve-page .sign-off { border-radius: 20px; border-color: var(--hair); padding: 22px; box-shadow: 0 10px 40px rgba(20, 53, 40, 0.05); }
.approve-page .pad { border-style: dashed; border-radius: 14px; }
.approve-page .actions .primary { width: 100%; min-height: 54px; font-size: 16px; }
.approve-page .complain h3 { font-family: var(--serif); font-size: 22px; }
.approve-page .status-note { background: #fff; border-color: var(--hair); border-radius: 20px; padding: 28px 20px; }
.approve-page .done h2 { font-size: 40px; }
.loader { text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 20px; padding: 60px 0; }
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 12, 0.88); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.hidden { display: none !important; }

/* Cormorant zeichnet Mediaevalziffern (1 wirkt wie I) — Kennzahlen mit Versalziffern */
.tile-number, .figure-value, .job-payout, .incident-number, .margin-cell, .kv-grid dd, .data-table td { font-variant-numeric: lining-nums tabular-nums; }
.inner a.btn, .inner a.button { text-decoration: none; }
.filter-bar { grid-template-columns: repeat(auto-fill, minmax(64px, max-content) minmax(150px, 1fr)); align-items: center; gap: 10px 12px; }
.filter-bar label { margin: 0; }
.filter-bar button { align-self: center; }
.data-table td { white-space: nowrap; }
.data-table tbody tr { cursor: pointer; }
.brand-header { position: sticky; top: 0; z-index: 40; background: rgba(246, 243, 236, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@media (min-width: 900px) { .data-table { display: table; } }
.data-table td { white-space: normal; }
.data-table td:first-child, .data-table td:nth-child(2), .data-table td:last-child { white-space: nowrap; }
