/* Back-Office (Control-Plane). Eigenes, schlankes Stylesheet – bewusst getrennt
   von der Produkt-CSS, damit die App unter php -S und Apache identisch aussieht. */
:root {
    --olive: #556b2f;
    --olive-d: #44561f;
    --ink: #1f2328;
    --muted: #6b7280;
    --line: #e2e5ea;
    --bg: #f4f5f3;
    --radius: 8px;
}
* { box-sizing: border-box; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--olive-d); }

/* Topbar */
.topbar { background: var(--olive); color: #fff; }
.topbar__inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 54px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.topnav { flex: 1; display: flex; gap: 18px; }
.topnav a { color: #eef1e8; text-decoration: none; }
.navbadge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--olive-d); font-size: .72rem; font-weight: 700; text-align: center; }
.topbar__logout { display: flex; align-items: center; gap: 12px; }
.topbar__user { color: #dfe6d2; font-size: .9rem; }
.topbar .linkbtn { color: #fff; }

/* Container */
.container { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.container--narrow { max-width: 420px; }

/* Page head */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }

/* Pipeline pills */
.pipeline { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.pill { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); }
.pill__n { font-size: 1.25rem; font-weight: 700; }
.pill__l { font-size: .8rem; color: var(--muted); }
.pill--on { outline: 2px solid var(--olive); }

/* Filterbar */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filterbar input[type=search], .filterbar select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; }
.filterbar__reset { color: var(--muted); text-decoration: none; font-size: .9rem; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #fafbf9; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.rowlink { font-weight: 600; text-decoration: none; color: var(--olive-d); }
.rowlink:hover { text-decoration: underline; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef0f2; color: #434a52; }
.badge--ok        { background: #e3f1e0; color: #2f6f2a; }
.badge--lead      { background: #eef0f2; color: #4b525a; }
.badge--demo      { background: #e2ecfb; color: #2a5aa0; }
.badge--aktiv     { background: #e3f1e0; color: #2f6f2a; }
.badge--gekuendigt{ background: #fbe3e3; color: #a23030; }
.badge--abgelehnt { background: #e7e3e0; color: #6b5d52; }
.badge--art       { background: #efece4; color: #6b5b2f; }

/* Buttons */
.button { display: inline-block; background: var(--olive); color: #fff; border: 0; border-radius: 6px;
    padding: 9px 16px; font-size: .95rem; cursor: pointer; text-decoration: none; }
.button:hover { background: var(--olive-d); }
.button--secondary { background: #fff; color: var(--olive-d); border: 1px solid var(--olive); }
.button--danger { background: #fff; color: #a23030; border: 1px solid #e0b4b4; }
.button--danger:hover { background: #fbe3e3; }
.linkbtn { background: none; border: 0; color: var(--olive-d); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* H3 Demo/Tenant-Cockpit */
.panel__h { margin: 0 0 8px; font-size: 1.05rem; }
.cockpit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.cockpit form { margin: 0; }
.cockpit__row { display: flex; gap: 6px; align-items: center; }
.cockpit__days { width: 66px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* Forms */
.form-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.form-section--tight { padding: 14px; gap: 8px; margin-bottom: 16px; }
.form-section label { display: grid; gap: 4px; font-size: .9rem; color: #444; }
.form-section input, .form-section select, .form-section textarea {
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label--btn { align-self: end; }
.label--btn .button { width: 100%; }

/* Akte layout */
.akte { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.akte__side h2 { font-size: 1.1rem; margin: 0 0 10px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline__item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.timeline__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .82rem; }
.timeline__text { white-space: normal; }

/* Panel / misc */
.panel { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.panel--info { border-left: 4px solid var(--olive); }
.muted { color: var(--muted); }
.empty { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.alert--success { background: #e3f1e0; color: #2f6f2a; }
.alert--error { background: #fbe3e3; color: #a23030; }

/* Login */
.login { margin-top: 6vh; }
.login h1 { margin: 0 0 2px; color: var(--olive-d); }
.login .form-section { margin-top: 16px; }

/* Tickets (H5) */
.badge--ti-offen          { background: #e2ecfb; color: #2a5aa0; }
.badge--ti-in_bearbeitung { background: #fdf0d8; color: #8a5a12; }
.badge--ti-wartet         { background: #efece4; color: #6b5b2f; }
.badge--ti-geschlossen    { background: #e7e3e0; color: #6b5d52; }
.badge--prio-niedrig { background: #eef0f2; color: #4b525a; }
.badge--prio-normal  { background: #e3f1e0; color: #2f6f2a; }
.badge--prio-hoch    { background: #fbe3e3; color: #a23030; }
.badge--msg-intern    { background: #efece4; color: #6b5b2f; }
.badge--msg-an_kunde  { background: #e3f1e0; color: #2f6f2a; }
.badge--msg-von_kunde { background: #e2ecfb; color: #2a5aa0; }
.ticket__betreff { margin: 0 0 14px; font-size: 1.25rem; }
.msg { border-left: 4px solid var(--line); }
.msg--an_kunde  { border-left-color: #2f6f2a; }
.msg--von_kunde { border-left-color: #2a5aa0; }
.label--check { display: flex; align-items: center; gap: 8px; align-self: end; font-weight: 400; }
.label--check input { width: auto; margin: 0; }
.page-head--tight { margin-bottom: 8px; }
.ticketlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ticketlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

@media (max-width: 800px) {
    .akte { grid-template-columns: 1fr; }
    .grid2 { grid-template-columns: 1fr; }
}
