:root {
    --belfor-blue: #003366;
    --belfor-light-blue: #0056b3;
    --belfor-red: #cc0000;
    --bg-gray: #f1f5f9;
    --card-bg: #ffffff;
    --border-col: #cbd5e1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg-gray);
    color: #1e293b;
    padding-bottom: 95px;
}

.hidden {
    display: none !important;
}

/* SPERRBILDSCHIRM */
#lockScreen {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #001f3f, #003366);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #fff;
    width: 100%;
    max-width: 390px;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.login-logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--belfor-blue);
    text-align: center;
    margin-bottom: 4px;
}

.login-sub {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin-bottom: 18px;
}

.login-err {
    display: none;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    text-align: center;
}

.btn-login {
    width: 100%;
    margin-top: 16px;
    background: var(--belfor-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

/* HEADER */
.app-header {
    background: var(--belfor-red);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.app-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.app-sub {
    font-size: 11px;
    margin-top: 2px;
}

.header-btns {
    display: flex;
    gap: 6px;
}

.btn-header {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* MODUS SCHALTER */
.mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 14px 4px 14px;
}

.mode-btn {
    padding: 12px;
    border: 2px solid var(--border-col);
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-weight: 800;
    color: #475569;
    cursor: pointer;
    text-align: center;
}

.mode-btn.active-ent {
    background: #fff7ed;
    border-color: #ea580c;
    color: #c2410c;
}

.mode-btn.active-rueck {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #15803d;
}

/* CARDS & LAYOUT */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    margin: 10px 14px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.card-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--belfor-blue);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.grid-2-wide {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 8px;
}

.inline-check {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.badge-count {
    background: var(--belfor-blue);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.empty-hint {
    text-align: center;
    padding: 18px;
    color: #94a3b8;
    font-size: 13px;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-top: 10px;
    margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--border-col);
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--belfor-light-blue);
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.15);
}

/* LIVE DROPDOWNS */
.search-wrap {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #94a3b8;
    border-radius: 0 0 8px 8px;
    max-height: 230px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.drop-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    cursor: pointer;
}

.drop-item:active,
.drop-item:hover {
    background: #e0f2fe;
}

.drop-sub {
    font-size: 12px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

/* CHIPS */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-col);
    font-size: 13px;
    font-weight: 600;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.chip.active {
    background: var(--belfor-light-blue);
    color: #fff;
    border-color: var(--belfor-light-blue);
}

/* SCANNER & ARTIKEL-EINGABE */
.scan-action-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
}

.btn-scan {
    background: linear-gradient(135deg, #003366, #0056b3);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 16px;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 86, 179, 0.3);
}

.btn-add-custom {
    background: #334155;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* ARTIKEL-LISTE */
.item-row {
    display: grid;
    grid-template-columns: 68px 65px 1fr 34px;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.item-row:last-child {
    border-bottom: none;
}

.item-qty {
    padding: 7px !important;
    text-align: center;
    font-weight: 800;
}

.item-unit {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
}

.item-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.item-code {
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
}

.btn-del {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    height: 34px;
    font-weight: 800;
    cursor: pointer;
}

/* STICKY FOOTER */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-col);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 0.8fr 1fr 1.3fr;
    gap: 8px;
    z-index: 150;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
    background: #64748b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-share {
    background: #0056b3;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-submit {
    background: var(--belfor-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-submit:disabled {
    opacity: 0.6;
}

/* MODALS */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.modal-head {
    background: var(--belfor-blue);
    color: #fff;
    padding: 12px 16px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 16px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-hint {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.modal-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

#reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.scan-feedback {
    margin-top: 10px;
    text-align: center;
    font-weight: 700;
    color: #0056b3;
    min-height: 20px;
}

.scanner-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
