:root {
    --wood: #5c4033;
    --wood-light: #8b6f47;
    --green: #2f5d3a;
    --green-soft: #e8f2ea;
    --bg: #f6f4f1;
    --text: #1e1e1e;
    --muted: #5c5c5c;
    --border: #d8d2c8;
    --danger: #a40000;
    --warn-bg: #fff4e0;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    overflow-x: hidden;
}
a { color: var(--green); }
.site-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(90deg, #3b2f28, var(--green));
    color: #fff;
    flex-wrap: wrap;
}
.site-header a { color: #e8fff0; text-decoration: none; margin-right: 0.75rem; }
.brand { display: flex; gap: 0.6rem; align-items: center; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 6px;
    background: repeating-linear-gradient(90deg, #c9a06c, #c9a06c 4px, #8b5a2b 4px, #8b5a2b 8px);
    border: 1px solid rgba(255,255,255,0.25);
}
.main-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
}
.userbox { display: flex; align-items: center; gap: 0.5rem; }
.pill {
    background: rgba(255,255,255,0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
}
.container {
    padding: 1rem 1.25rem 3rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.site-footer { padding: 1rem; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.mt { margin-top: 1rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; max-width: 100%; min-width: 0; }
.toolbar.wrap { align-items: flex-end; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }
.stack label { display: block; margin-bottom: 0.5rem; }
.stack input, .stack textarea, .stack select {
    width: 100%; padding: 0.45rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
}
.btn {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.btn.primary { background: var(--green); color: #fff; border-color: #244832; }
.btn.danger { background: #fff0f0; border-color: #e7bcbc; color: var(--danger); }
.btn.small { font-size: 0.8rem; padding: 0.25rem 0.45rem; }
.linkish { background: transparent; border: none; color: #e8fff0; cursor: pointer; text-decoration: underline; }
.alert { padding: 0.6rem 0.75rem; border-radius: 6px; margin-bottom: 0.75rem; }
.alert-success { background: var(--green-soft); border: 1px solid #bcd8c2; }
.alert-error { background: #ffecec; border: 1px solid #f0bcbc; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.data-table th, .data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.35rem 0.45rem;
    font-size: 0.9rem;
    vertical-align: middle;
}
.data-table thead th { background: #ece7df; position: relative; }
.data-table.sticky thead th { position: sticky; top: 0; z-index: 2; }
.data-table input.cell, .data-table select.cell {
    width: 100%;
    min-width: 5rem;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.25rem;
    font: inherit;
}
.data-table input.cell:focus, .data-table select.cell:focus {
    outline: 2px solid rgba(47,93,58,0.35);
    background: #fff;
    border-color: #bcd8c2;
}
.data-table input.mini { min-width: 2.5rem; width: 3.75rem; max-width: 5rem; }
.data-table .tight { white-space: nowrap; }

/* Breite Tabelle: horizontal nur im Kasten scrollen, nicht die ganze Seite */
.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.table-scroll .data-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
}
/* Kundenkonditionen: natürliche Spaltenbreiten + Mindestbreiten (colgroup); Scroll nur im Kasten */
.table-scroll .data-table.cc-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}
.cc-sheet .cc-table-scroll {
    margin-top: 0;
    border: 0;
    border-radius: 0;
    border-top: 1px solid var(--border);
}

/* Kundenkonditionen: lesbare Mindestbreiten pro Spalte (colgroup) + kompaktes Padding */
.excel-like.cc-table col.cc-col-sb { min-width: 5.5rem; }
.excel-like.cc-table col.cc-col-nr { min-width: 5.25rem; }
.excel-like.cc-table col.cc-col-kunde { min-width: 12rem; }
.excel-like.cc-table col.cc-col-ap { min-width: 7.5rem; }
.excel-like.cc-table col.cc-col-tel { min-width: 7.5rem; }
.excel-like.cc-table col.cc-col-artikel { min-width: 13rem; }
.excel-like.cc-table col.cc-col-hm { min-width: 8.5rem; }
.excel-like.cc-table col.cc-col-price { min-width: 5.5rem; }
.excel-like.cc-table col.cc-col-skonto { min-width: 7rem; }
.excel-like.cc-table col.cc-col-fracht { min-width: 5.25rem; }
.excel-like.cc-table col.cc-col-netto { min-width: 6.75rem; }
.excel-like.cc-table col.cc-col-menge { min-width: 7.5rem; }
.excel-like.cc-table col.cc-col-ende { min-width: 10rem; }
.excel-like.cc-table col.cc-col-status { min-width: 4.5rem; }
.excel-like.cc-table col.cc-col-over { min-width: 7rem; }
.excel-like.cc-table col.cc-col-tools { min-width: 15rem; }

.excel-like.cc-table {
    font-size: 0.875rem;
}
.excel-like.cc-table thead th,
.excel-like.cc-table tbody td {
    padding: 0.38rem 0.4rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.excel-like.cc-table input.cell,
.excel-like.cc-table select.cell {
    min-width: 0;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    font-size: inherit;
}
.excel-like.cc-table input[data-f="customer_name"] { min-width: 10rem; }
.excel-like.cc-table select[data-f="article_id"] { min-width: 10rem; }
.excel-like.cc-table select[data-f="hm_price_list_id"] { min-width: 6.5rem; }
.excel-like.cc-table input[data-f="change_reason"] { min-width: 9rem; }

.cc-ref-stack,
.cc-contact-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.cc-kunde-cell { min-width: 0; }
.cc-qty-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.cc-qty-val,
.cc-qty-unit {
    width: 100%;
    min-width: 0;
}
.cc-input-date {
    min-width: 9.5rem;
    max-width: none;
    font-size: 0.8125rem;
}
.cc-filter-pair {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.cc-table .cc-filter-pair .cc-filter-input {
    max-width: none;
    width: 100%;
}
.cc-th-merged { text-align: left; vertical-align: bottom; }
.cc-th-narrow,
.cc-th-status,
.cc-th-over,
.cc-th-tools { white-space: nowrap; }

/* Kundenkonditionen: weniger erzwungene Mindestbreiten, damit weniger „Rausscrollen“ */
.excel-like.data-table:not(.cc-table) input.cell,
.excel-like.data-table:not(.cc-table) select.cell {
    min-width: 2.75rem;
    max-width: 11rem;
}
.excel-like.data-table:not(.cc-table) input[data-f="customer_name"] { max-width: 14rem; }
.excel-like.data-table:not(.cc-table) select[data-f="article_id"] { max-width: 13rem; }
.excel-like.data-table:not(.cc-table) select[data-f="hm_price_list_id"] { max-width: 12rem; }
.excel-like.data-table:not(.cc-table) input[data-f="change_reason"] { max-width: 9rem; }
.excel-like.data-table:not(.cc-table) input[type="date"].cell {
    max-width: 10rem;
    min-width: 0;
}
.excel-like.data-table:not(.cc-table) .calc {
    white-space: nowrap;
    min-width: 4.5rem;
}

.alert-warn {
    background: var(--warn-bg);
    border: 1px solid #e6c28a;
    color: var(--text);
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}
.cc-dirty { outline: 2px dashed #c9a06c; outline-offset: -2px; }
.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.75rem 0 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; }
.tabs a {
    padding: 0.35rem 0.65rem;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    color: var(--muted);
}
.tabs a.active { background: #fff; border: 1px solid var(--border); border-bottom-color: #fff; margin-bottom: -1px; color: var(--text); font-weight: 600; }
.row-warn-low { background: #ffecec !important; }
.row-warn-freight { box-shadow: inset 0 0 0 2px #ffb84d; }
.row-warn-runtime { background: var(--warn-bg) !important; }
.warn { color: var(--danger); font-weight: 600; }
.status { padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.78rem; background: #eee; }
.status-draft, .status-entwurf { background: #eee; }
.status-active, .status-aktiv { background: #d9f4df; }
.status-pending_approval { background: #fff2cc; }
.status-scheduled { background: #e6f0ff; }
.status-expired, .status-erledigt { background: #f0f0f0; }
.status-archived, .status-archiviert { background: #e8e8e8; }
.grid.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.kpi-value { font-size: 2rem; margin: 0.25rem 0; }
.hero-price { font-size: 2.4rem; margin: 0.25rem 0; color: var(--wood); }
.t-up { color: var(--danger); }
.t-down { color: var(--green); }
.auth-card { max-width: 420px; margin: 3rem auto; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem; align-items: end; }
.print-body { padding: 1rem; }

/* ——— Kundenkonditionen (cc-*) ——— */
.cc-page { max-width: 1400px; margin: 0 auto; }
.cc-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.cc-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--green);
}
.cc-title {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--wood);
    letter-spacing: -0.02em;
}
.cc-lead {
    margin: 0;
    max-width: 42rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.cc-hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cc-month-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, var(--green-soft), #fff);
    border: 1px solid #bcd8c2;
    color: var(--green);
    box-shadow: 0 1px 2px rgba(47, 93, 58, 0.12);
}
.cc-count-chip {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
}

.cc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cc-toolbar-form { display: flex; flex-direction: column; gap: 0.25rem; }
.cc-field-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cc-field-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cc-input-month {
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    min-width: 11rem;
    background: #fff;
}
.btn-accent {
    background: linear-gradient(180deg, #3d7a4a, var(--green));
    color: #fff !important;
    border-color: #244832;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(47, 93, 58, 0.25);
}
.btn-accent:hover { filter: brightness(1.05); }
.btn-lg { padding: 0.55rem 1.1rem; font-size: 1rem; }
.cc-btn-ghost {
    background: #faf9f7;
    border-color: var(--border);
}
.cc-toolbar-divider {
    width: 1px;
    min-height: 2.5rem;
    background: var(--border);
    align-self: stretch;
}
.cc-toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cc-inline-form { display: inline; margin: 0; }

.cc-filter-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: linear-gradient(90deg, #fff8e8, #fff);
    border: 1px solid #e6c28a;
    font-size: 0.92rem;
}
.cc-filter-banner-icon { opacity: 0.55; font-size: 1rem; }
.cc-filter-banner-link { font-weight: 600; margin-left: auto; }

.cc-sheet { padding: 0; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.cc-sheet-head {
    padding: 0.85rem 1.1rem;
    background: linear-gradient(180deg, #faf8f5, #fff);
    border-bottom: 1px solid var(--border);
}
.cc-sheet-title { margin: 0; font-size: 1.1rem; color: var(--wood); }
.cc-sheet-hint { margin: 0.35rem 0 0; max-width: 52rem; }

/* Kundenkonditionen: Positionen als Karten (ohne horizontales Tabellen-Scrollen) */
.cc-pos-list-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
.cc-pos-filters {
    padding: 0.65rem 1rem;
    background: linear-gradient(180deg, #f6f2eb, #faf8f5);
    border-bottom: 1px solid var(--border);
}
.cc-pos-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
    gap: 0.5rem 0.85rem;
    align-items: end;
}
.cc-pos-filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.cc-pos-filter-grow {
    grid-column: span 2;
}
@media (max-width: 720px) {
    .cc-pos-filter-grow { grid-column: span 1; }
}
.cc-pos-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem 1.15rem;
    max-height: min(72vh, 54rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.cc-pos-row {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
    min-width: 0;
}
.cc-pos-row:nth-child(even) { background: #fdfcfa; }
.cc-pos-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.55rem 0.75rem 0.6rem;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(180deg, #fff, #faf9f7);
}
.cc-pos-head-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    min-width: 0;
    flex: 1 1 12rem;
}
.cc-pos-status {
    flex: 0 0 auto;
    max-width: 10.5rem;
    font-size: 0.8rem !important;
}
.cc-pos-kunde {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--wood);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc-pos-ort { font-size: 0.78rem; font-weight: 500; }
.cc-pos-head-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-variant-numeric: tabular-nums;
    flex: 0 1 auto;
}
.cc-pos-net {
    font-size: 0.88rem;
    white-space: nowrap;
}
.cc-margin-inline {
    margin-left: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}
.cc-pos-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
    gap: 0.55rem 0.75rem;
    padding: 0.65rem 0.85rem 0.75rem;
    border-top: 1px solid #ece8e2;
}
.cc-pos-field {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}
.cc-pos-field--wide { grid-column: span 2; }
@media (max-width: 560px) {
    .cc-pos-field--wide { grid-column: span 1; }
}
.cc-pos-field .cc-pos-lbl,
.cc-pos-filter-item .cc-pos-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.cc-pos-field input.cell,
.cc-pos-field select.cell {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    padding: 0.38rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.84rem;
    background: #fff;
}
.cc-pos-field--skonto .cc-pos-inline2 {
    display: grid;
    grid-template-columns: 4.25rem 1fr;
    gap: 0.35rem;
    align-items: stretch;
}
.cc-pos-readonly {
    padding: 0.38rem 0.45rem;
    border-radius: 8px;
    background: rgba(232, 242, 234, 0.35);
    border: 1px solid #dce8df;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cc-pos-foot {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem 0.7rem;
    border-top: 1px solid #ece8e2;
    border-radius: 0 0 12px 12px;
    background: #faf9f7;
}
.cc-pos-over {
    font-size: 0.78rem;
    line-height: 1.35;
    min-width: 0;
}
.cc-pos-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.cc-pos-actions .cc-reason {
    flex: 1 1 10rem;
    min-width: 0;
}
.cc-pos-meta {
    margin: 0.15rem 0 0;
    padding: 0;
    font-size: 0.62rem;
    line-height: 1.35;
    color: var(--muted);
    opacity: 0.92;
    letter-spacing: 0.01em;
    word-break: break-word;
}
.cc-empty--inlist {
    border: 1px dashed var(--border);
    border-radius: 10px;
    margin: 0.25rem 0 0;
    background: #faf9f7;
}

.cc-table { border: 0; }
.cc-table .cc-filter-row th {
    background: #f3efe8;
    padding: 0.4rem 0.45rem;
    vertical-align: middle;
}
.cc-filter-input {
    width: 100%;
    min-width: 4rem;
    max-width: 10rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
}
.cc-filter-input:focus {
    outline: 2px solid rgba(47, 93, 58, 0.25);
    border-color: #8fbc9a;
}
.cc-table .cc-filter-input {
    max-width: none;
}
.cc-col-labels th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: #ece7df;
    padding: 0.45rem 0.45rem;
    border-bottom: 2px solid #d4cdc2;
}

.cc-row { transition: background 0.12s ease; }
.cc-row:hover { background: rgba(47, 93, 58, 0.04) !important; }
.cc-knr-cell { vertical-align: middle; }
.cc-knr {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: #ede8e0;
    color: var(--wood);
    border: 1px solid #d8d0c4;
}
.cc-calc {
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: rgba(232, 242, 234, 0.45);
    white-space: nowrap;
}
.cc-currency { font-weight: 700; color: var(--green); }
.cc-eur { font-size: 0.75rem; color: var(--muted); margin-left: 0.15rem; }
.cc-input-num { font-variant-numeric: tabular-nums; }

.cc-select-status {
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 0.82rem !important;
    border-left: 4px solid #999 !important;
}
.cc-select-status--entwurf { border-left-color: #888 !important; background: rgba(240,240,240,0.5) !important; }
.cc-select-status--aktiv { border-left-color: var(--green) !important; background: rgba(232, 242, 234, 0.6) !important; }
.cc-select-status--erledigt { border-left-color: #7a7a7a !important; }
.cc-select-status--archiviert { border-left-color: #555 !important; opacity: 0.9; }

.cc-over-cell {
    max-width: none;
    font-size: 0.72rem;
    vertical-align: middle;
    text-align: center;
}
.cc-over-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    margin-right: 0.2rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    background: #fff4e0;
    color: #8a5a00;
    border: 1px solid #e6c28a;
    vertical-align: middle;
}
.cc-over-text { vertical-align: middle; word-break: break-word; }

.cc-row-tools {
    min-width: 0;
    max-width: none;
    vertical-align: top;
}
.cc-tool-stack { display: flex; flex-direction: column; gap: 0.35rem; }
.cc-reason { font-size: 0.82rem !important; max-width: none !important; width: 100% !important; }
.cc-tool-btns { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.btn-save { font-weight: 600; }
.cc-btn-icon {
    min-width: 2.25rem;
    padding: 0.25rem 0.4rem;
    font-size: 1rem;
    line-height: 1;
    border-radius: 8px;
    background: #faf9f7;
}
.cc-warn-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.cc-warn-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    background: #fff0e0;
    color: #a45c00;
    border: 1px solid #f0d4b8;
}
.cc-deviation { font-variant-numeric: tabular-nums; }

.cc-empty {
    padding: 2rem 1.25rem 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: #faf9f7;
}
.cc-empty-title { margin: 0 0 0.35rem; font-weight: 600; color: var(--wood); }

.cc-new-card { margin-top: 1.25rem; padding: 1.15rem 1.25rem 1.35rem; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.cc-new-head { margin-bottom: 1rem; }
.cc-new-title { margin: 0 0 0.35rem; font-size: 1.2rem; color: var(--wood); }
.cc-new-intro { margin: 0; max-width: 48rem; }

.cc-new-form { display: flex; flex-direction: column; gap: 1.25rem; }
.cc-fieldset {
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fdfcfa;
}
.cc-legend {
    padding: 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green);
}
.cc-new-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.65rem 1rem;
    margin-top: 0.65rem;
}
.cc-block-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}
.cc-span-2 { grid-column: span 2; }
@media (max-width: 640px) {
    .cc-span-2 { grid-column: span 1; }
}
.cc-input, .cc-select {
    width: 100%;
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.cc-input:focus, .cc-select:focus {
    outline: none;
    border-color: #8fbc9a;
    box-shadow: 0 0 0 3px rgba(47, 93, 58, 0.12);
}
.cc-split { display: flex; gap: 0.5rem; align-items: stretch; }
.cc-split .cc-select { max-width: 5rem; flex: 0 0 auto; }
.cc-split .cc-input { flex: 1; min-width: 0; }

.cc-new-actions { padding-top: 0.25rem; }
.cc-req { color: var(--danger); font-weight: 700; text-decoration: none; cursor: help; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tabelle: Zebra mit cc-row */
.excel-like.cc-table tbody tr:nth-child(even) { background: #faf8f5; }
.excel-like.cc-table tbody tr:nth-child(odd) { background: #fff; }

/* Legacy .calc Zelle (falls noch vorhanden) */
.excel-like.data-table:not(.cc-table) .calc {
    white-space: nowrap;
    min-width: 4.5rem;
}

/* Skonto / Fracht: untereinander + Mindestbreiten, kein Überlappen */
.excel-like.cc-table .cc-skonto-cell {
    white-space: normal;
    vertical-align: top;
    min-width: 0;
    max-width: none;
}
.cc-skonto-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
}
.excel-like.cc-table .cc-skonto-cell .cc-skonto-type,
.excel-like.cc-table .cc-skonto-cell .cc-skonto-val {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.excel-like.cc-table .cc-fracht-cell {
    white-space: normal;
    vertical-align: top;
    min-width: 0;
    max-width: none;
}
.excel-like.cc-table .cc-fracht-cell .cell {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* ——— Kundenkonditionen Hub (Arbeit / Freigabe / Steuerung) ——— */
.cc-hub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}
.cc-hub-tab {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--wood);
    text-decoration: none;
    border: 1px solid transparent;
}
.cc-hub-tab:hover { background: rgba(47, 93, 58, 0.06); }
.cc-hub-tab.is-active {
    background: rgba(47, 93, 58, 0.12);
    border-color: #bcd8c2;
    color: var(--green);
}

.cc-quick-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.cc-quick-label { margin-right: 0.25rem; }
.cc-chip {
    display: inline-block;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--wood);
    border: 1px solid var(--border);
    background: #faf9f7;
}
.cc-chip:hover { border-color: #8fbc9a; }
.cc-chip.is-active {
    background: rgba(47, 93, 58, 0.14);
    border-color: var(--green);
    color: var(--green);
}

.cc-hub-split {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}
.cc-hub-main {
    min-width: 0;
    width: 100%;
}

.cc-detail-panel {
    position: static;
    width: 100%;
    max-height: min(20rem, 38vh);
    overflow: auto;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}
.cc-detail-title { margin: 0 0 0.35rem; font-size: 1rem; color: var(--wood); }
.cc-detail-body { font-size: 0.88rem; }
.cc-detail-sec { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.cc-detail-sec:last-child { border-bottom: 0; }
.cc-detail-sec h4 { margin: 0 0 0.4rem; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.cc-dl { display: grid; grid-template-columns: 8rem 1fr; gap: 0.25rem 0.5rem; margin: 0; }
.cc-dl dt { color: var(--muted); font-size: 0.8rem; }
.cc-dl dd { margin: 0; font-weight: 600; }
.cc-flag-list { margin: 0; padding-left: 1.1rem; }
.cc-flag-list li { margin-bottom: 0.25rem; }

.cc-ref-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.cc-city-hint { margin-top: 0.15rem; }
.cc-margin-hint {
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 0.12rem;
    font-weight: 600;
}

.cc-risk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    border: 1px solid #ccc;
    background: #f5f5f5;
}
.cc-risk--unkritisch { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.cc-risk--pruefen { background: #fff8e1; border-color: #ffe082; color: #6d4c41; }
.cc-risk--kritisch { background: #ffebee; border-color: #ef9a9a; color: #b71c1c; }
.cc-risk--gf_erforderlich { background: #ede7f6; border-color: #b39ddb; color: #4527a0; }

.cc-risk-tier--unkritisch { }
.cc-risk-tier--pruefen { box-shadow: inset 3px 0 0 #ffc107; }
.cc-risk-tier--kritisch { box-shadow: inset 3px 0 0 #e53935; }
.cc-risk-tier--gf_erforderlich { box-shadow: inset 3px 0 0 #5e35b1; }

.cc-row-selected { outline: 2px solid rgba(47, 93, 58, 0.45); outline-offset: -1px; }

.cc-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.75rem 0 1rem;
}
.cc-kpi {
    min-width: 6.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #faf8f5;
    border: 1px solid var(--border);
}
.cc-kpi-warn { border-color: #e6a89a; background: #fff5f3; }
.cc-kpi-val { display: block; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--wood); }
.cc-kpi-lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.cc-steer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.cc-steer-sub { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--wood); }
.cc-steer-span { grid-column: 1 / -1; }

.data-table.compact th,
.data-table.compact td { padding: 0.28rem 0.4rem; font-size: 0.82rem; }

.cc-workflow-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: #ece7df;
    color: var(--wood);
}

.cc-approval-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.btn-sm { padding: 0.22rem 0.5rem; font-size: 0.78rem; border-radius: 6px; }
.cc-btn-danger {
    border: 1px solid #e57373;
    color: #b71c1c;
    background: #fff5f5;
}
.cc-btn-danger:hover { background: #ffebee; }

.cc-wf-form { margin-top: 1rem; padding: 1rem; }
.cc-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: inherit;
}
.cc-wf-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
