* { box-sizing: border-box; }

body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #f4f5f7;
    color: #222;
}

.topbar {
    background: #1c2b3a;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h1 {
    font-size: 18px;
    margin: 0;
}

.fehler {
    color: #ff8080;
    font-size: 13px;
}

.layout {
    display: flex;
    min-height: calc(100vh - 48px);
}

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #ddd;
    padding: 16px;
}

.sidebar h2, .sidebar h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin: 16px 0 8px;
}

.baustellen-liste {
    list-style: none;
    margin: 0;
    padding: 0;
}

.baustellen-liste li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 4px;
}

.baustellen-liste li.aktiv {
    background: #e8f0fe;
}

.baustellen-liste a {
    text-decoration: none;
    color: #1c2b3a;
    flex: 1;
}

.sidebar form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar input, .content input:not([type=number]) {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.sidebar button, .content button {
    padding: 6px 10px;
    border: 1px solid #1c2b3a;
    background: #1c2b3a;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.content {
    flex: 1;
    padding: 20px 28px;
}

.meta {
    color: #666;
    margin-top: -8px;
}

.gesamt-flaeche {
    background: #1c2b3a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 20px;
}

.bereich-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.bereich-kopf {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.bereich-name {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
}

.bereich-summen {
    font-size: 13px;
    color: #444;
}

table.raster {
    border-collapse: collapse;
    width: 100%;
    font-variant-numeric: tabular-nums;
    background: #fff;
    font-size: 13px;
}

table.raster th, table.raster td {
    border: 1px solid #000;
    padding: 0;
    text-align: center;
    min-width: 56px;
    height: 26px;
}

table.raster thead th {
    background: #fff;
    font-weight: 700;
    padding: 2px;
    position: relative;
}

table.raster th.ecke {
    background: #f4f5f7;
    border: 1px solid #000;
}

/* Lösch-Buttons sollen die schlichte Tabellenoptik nicht stören -
   nur sichtbar, wenn man mit der Maus über der Spalte/Zeile ist */
table.raster th .loesch-btn,
table.raster .lage-label .loesch-btn {
    opacity: 0;
    transition: opacity .1s;
}
table.raster th:hover .loesch-btn,
table.raster tr:hover .lage-label .loesch-btn {
    opacity: 1;
}

/* Zahlenzellen: keine Box-in-Box-Optik, Eingabe füllt die Zelle wie in Excel */
table.raster td input[type=number] {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: right;
    padding: 0 8px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

table.raster td input[type=number]:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #fbfdff;
}

/* Spinner-Pfeile der Zahlenfelder ausblenden */
table.raster input[type=number]::-webkit-outer-spin-button,
table.raster input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
table.raster input[type=number] {
    -moz-appearance: textfield;
}

table.raster .achse-breite {
    width: 100%;
    font-weight: 700;
    text-align: center;
    background: transparent;
    border: none;
    padding: 4px 2px;
}

table.raster .achse-breite:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #fbfdff;
}

.lage-label {
    white-space: nowrap;
    font-size: 12px;
    color: #555;
    text-align: left !important;
    padding-left: 6px !important;
}

.spaltensumme {
    font-weight: 700;
    background: #eef0f2;
    border-top: 2px solid #333 !important;
    text-align: right !important;
    padding-right: 8px !important;
}

.loesch-btn {
    background: none;
    border: none;
    color: #b33;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

.loesch-btn.klein {
    font-size: 11px;
}

.neuer-bereich {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.neuer-bereich input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.hinweis {
    color: #888;
    margin-top: 40px;
    text-align: center;
}