:root {
    --bg: #f4f6f8;
    --text: #1f2937;
    --card-bg: #e8ebef;
    --card-border: #d7dde5;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --table-border: #e5e7eb;
    --thead-bg: #f8fafc;
    --row-alt: #f3f4f6;
    --row-active: #dbeafe;
    --muted: #6b7280;
    --neutral-bg: #cbd2db;
    --neutral-text: #111827;
}
body[data-theme="dark"] {
    --bg: #111827;
    --text: #e5e7eb;
    --card-bg: #1f2937;
    --card-border: #334155;
    --input-bg: #0f172a;
    --input-border: #475569;
    --table-border: #334155;
    --thead-bg: #0f172a;
    --row-alt: #172034;
    --row-active: #1e3a5f;
    --muted: #9ca3af;
    --neutral-bg: #334155;
    --neutral-text: #e5e7eb;
}
body { font-family: Arial, Helvetica, sans-serif; font-size: 13px; margin: 0; background: var(--bg); color: var(--text); }
.page { max-width: 1400px; margin: 0 auto; padding: 12px; }
h1 { margin: 0 0 8px; font-size: 22px; }
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; padding: 8px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.settings-area { width: 60%; box-sizing: border-box; margin-left: auto; margin-right: auto; }
.msg { padding: 5px 6px; border-radius: 8px; margin-bottom: 6px; }
.msg.ok { background: #e7f8ee; color: #146b3a; }
.msg.err { background: #fdecec; color: #9b1c1c; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.field { display: flex; flex-direction: column; gap: 3px; }
label { font-size: 11px; font-weight: 400; }
input, textarea, button { font: inherit; }
input, textarea { border: 1px solid var(--input-border); border-radius: 8px; padding: 5px 6px; background: var(--input-bg); color: var(--text); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { width: 100%; padding-right: 22px; box-sizing: border-box; }
.input-clear { position: absolute; right: 5px; background: none; border: none; cursor: pointer; font-size: 12px; color: var(--muted); padding: 0; line-height: 1; display: none; }
.input-clear.visible { display: inline; }
body[data-theme="dark"] .input-clear { background: var(--neutral-bg); color: var(--neutral-text); border-radius: 4px; }
#WBS2_ID { font-family: Consolas, "Courier New", monospace; }
textarea { min-height: 220px; resize: vertical; grid-column: 1 / -1; }
.actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
button, .btn { border: 0; border-radius: 8px; padding: 5px 7px; cursor: pointer; text-decoration: none; display: inline-block; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.nav-tile { aspect-ratio: 1; min-height: 140px; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; border-radius: 20px; text-align: center; text-transform: uppercase; text-decoration: none; font-size: 16px; font-weight: 700; line-height: 1.2; }
.nav-tile:visited, .nav-tile:hover, .nav-tile:focus { text-decoration: none; }
.icon-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
}
.primary { background: #1d4ed8; color: #fff; }
.danger { background: #b91c1c; color: #fff; }
.neutral { background: var(--neutral-bg); color: var(--neutral-text); }
.header-user-link,
button.primary[type="submit"],
button.primary[type="submit"] .filter-btn-icon,
.header-user-icon {
    color: #fff;
}
.header-user-link,
button.primary[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-user-icon,
.filter-btn-icon {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}
body[data-theme="dark"] .header-user-icon,
body[data-theme="dark"] .filter-btn-icon {
    fill: #fff !important;
    color: #fff !important;
}
.toolbar { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toolbar form { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.site-header { display: flex; align-items: stretch; gap: 10px; width: 100%; }
.site-header-content { order: 2; flex: 1 1 auto; min-width: 0; }
.header-company-logo { order: 1; display: flex; align-items: center; justify-content: center; }
.header-company-logo img { display: block; width: auto; max-height: 45px; max-width: 100%; object-fit: contain; }
.header-logo { order: 3; display: flex; align-items: center; justify-content: center; margin-left: auto; }
.header-logo img { display: block; width: 96px; max-height: 96px; height: auto; object-fit: contain; }
.index-company-name { display: inline-flex; align-items: center; gap: 8px; }
.index-company-logo { display: inline-flex; align-items: center; justify-content: center; }
.index-company-logo img { display: block; width: auto; max-height: 45px; max-width: 100%; object-fit: contain; }
.header-company-logo:focus-visible, .header-logo:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 4px; }
.header-logo-dark { display: none !important; }
.header-user-link { display: inline-flex; align-items: center; justify-content: center; }
.header-user-icon { width: 14px; height: 14px; display: block; color: var(--neutral-text); }
body[data-theme="dark"] .header-user-icon { color: #fff !important; }
body[data-theme="dark"] .header-logo-light { display: none !important; }
body[data-theme="dark"] .header-logo-dark { display: block !important; }
.start-logo { position: relative; display: flex; justify-content: center; margin: 48px auto; }
.company-divider { border: 0; border-top: 1px solid var(--card-border); margin: 4px 0 8px; }
.start-logo img { display: block; max-width: min(100%, 420px); height: auto; margin-left: auto; margin-right: auto; }
.start-logo-dark { display: none !important; }
body[data-theme="dark"] .start-logo-light { display: none !important; }
body[data-theme="dark"] .start-logo-dark { display: block !important; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); gap: 8px; align-items: start; }
.content-layout > .column-stack:first-child { order: 2; }
.content-layout > .column-stack:last-child { order: 1; }
.column-stack { display: flex; flex-direction: column; gap: 8px; }
.content-layout .card { margin-bottom: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--table-border); padding: 4px 5px; text-align: left; vertical-align: top; }
th { background: var(--thead-bg); position: sticky; top: 0; z-index: 1; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr.active-row td { background: var(--row-active) !important; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.right { text-align: right; }
.small { font-size: 12px; color: var(--muted); }
.bild-link {
    display: inline-block;
    text-decoration: none;
}
.bild-thumb {
    max-width: 200px;
    max-height: 200px;
    display: block;
    cursor: zoom-in;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 40px 16px 16px;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: min(92vw, 1400px);
    max-height: 86vh;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
@media (max-width: 1200px) {
    .content-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .settings-area { width: 100%; } }
@media (max-width: 900px) {
    .lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
}
@media print { .no-print { display: none; } body { background: #fff; color: #000; } .card { box-shadow: none; border: 0; } }
