:root {
    --bg: #f5f5f3;
    --surface: #ffffff;
    --surface-soft: #f8f8f6;
    --text: #171717;
    --muted: #747474;
    --border: #e4e4e0;
    --dark: #161616;
    --dark-soft: #242424;
    --accent: #b8d637;
    --accent-dark: #879f18;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --radius: 18px;
    --shadow: 0 8px 30px rgba(0,0,0,.045);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

/* -------------------------------------------------------
   Gemeinsame Elemente
------------------------------------------------------- */

.eyebrow {
    display: block;
    margin-bottom: 7px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;

    color: var(--muted);
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    border-radius: 15px;

    background: var(--dark);
    color: #fff;

    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.brand-mark-small {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: #fff;
    color: var(--dark);

    font-size: 15px;
}

.brand-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .08em;
}

.brand-subtitle {
    margin-top: 3px;

    font-size: 12px;

    color: var(--muted);
}

.brand-name-light {
    color: #fff;
}

.brand-subtitle-light {
    color: #929292;
}

/* -------------------------------------------------------
   Login
------------------------------------------------------- */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;

    padding: 35px 20px;

    background:
        radial-gradient(
            circle at 75% 15%,
            rgba(184,214,55,.12),
            transparent 30%
        ),
        var(--bg);
}

.login-shell {
    width: 100%;
    max-width: 460px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 28px;
}

.login-card {
    padding: 42px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 24px;

    box-shadow: var(--shadow);
}

.login-heading {
    margin-bottom: 30px;
}

.login-heading h1 {
    margin: 0 0 10px;

    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -.035em;
}

.login-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;
    font-weight: 700;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.coming-soon {
    font-size: 12px;
    color: #999;
}

.form-group input {
    width: 100%;
    height: 50px;

    padding: 0 15px;

    border: 1px solid #d9d9d5;
    border-radius: 11px;

    background: #fff;
    color: var(--text);

    outline: none;

    transition:
        border-color .2s,
        box-shadow .2s;
}

.form-group input:focus {
    border-color: #999;

    box-shadow:
        0 0 0 4px rgba(0,0,0,.04);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 50px;

    padding: 0 22px;

    border: 0;
    border-radius: 11px;

    cursor: pointer;

    font-weight: 750;
}

.btn-primary {
    background: var(--dark);
    color: #fff;

    transition:
        background .2s,
        transform .1s;
}

.btn-primary:hover {
    background: #292929;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-full {
    width: 100%;
}

.alert {
    margin-bottom: 22px;
    padding: 13px 15px;

    border-radius: 10px;

    font-size: 13px;
    line-height: 1.45;
}

.alert-error {
    border: 1px solid #fecdca;

    background: var(--danger-bg);
    color: var(--danger);
}

.login-footer {
    margin-top: 20px;

    text-align: center;

    color: #999;

    font-size: 11px;
    letter-spacing: .08em;
}

/* -------------------------------------------------------
   App Layout
------------------------------------------------------- */

.app-body {
    min-height: 100vh;
}

.app-shell {
    display: flex;

    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;

    width: 260px;

    padding: 26px 18px 20px;

    background: var(--dark);
    color: #fff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 8px 25px;
}

.nav {
    flex: 1;

    overflow-y: auto;
}

.nav-section {
    display: block;

    margin: 25px 12px 9px;

    color: #686868;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;

    min-height: 44px;

    margin-bottom: 3px;
    padding: 0 12px;

    border-radius: 10px;

    color: #aaa;

    font-size: 13px;
    font-weight: 600;
}

.nav-item.active {
    background: var(--dark-soft);
    color: #fff;
}

.nav-item.active::after {
    width: 6px;
    height: 6px;

    margin-left: auto;

    border-radius: 50%;

    background: var(--accent);

    content: "";
}

.nav-item.disabled {
    cursor: default;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;

    font-size: 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 17px 8px 2px;

    border-top: 1px solid #303030;
}

.avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    width: 37px;
    height: 37px;

    border-radius: 50%;

    background: var(--accent);
    color: #151515;

    font-size: 11px;
    font-weight: 900;
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.sidebar-user-info strong,
.sidebar-user-info span {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info strong {
    font-size: 12px;
}

.sidebar-user-info span {
    margin-top: 3px;

    color: #777;

    font-size: 10px;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 8px;

    color: #777;
}

.logout-link:hover {
    background: #292929;
    color: #fff;
}

.main-content {
    width: calc(100% - 260px);

    margin-left: 260px;
    padding: 36px 42px 50px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 32px;
}

.topbar h1 {
    margin: 0;

    font-size: 31px;
    letter-spacing: -.035em;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 650;
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 0 4px rgba(184,214,55,.14);
}

/* -------------------------------------------------------
   Dashboard
------------------------------------------------------- */

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;

    margin-bottom: 24px;
    padding: 31px 34px;

    overflow: hidden;

    border-radius: var(--radius);

    background: var(--dark);
    color: #fff;

    box-shadow: var(--shadow);
}

.welcome-panel h2 {
    margin: 0 0 9px;

    font-size: 27px;
    letter-spacing: -.035em;
}

.welcome-panel p {
    max-width: 620px;

    margin: 0;

    color: #aaa;

    font-size: 13px;
    line-height: 1.6;
}

.welcome-panel .eyebrow {
    color: var(--accent);
}

.campaign-pill {
    flex: 0 0 190px;

    padding: 18px 20px;

    border: 1px solid #343434;
    border-radius: 14px;

    background: #202020;
}

.campaign-pill span,
.campaign-pill strong,
.campaign-pill small {
    display: block;
}

.campaign-pill span {
    margin-bottom: 7px;

    color: #777;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;

    text-transform: uppercase;
}

.campaign-pill strong {
    margin-bottom: 4px;

    font-size: 14px;
}

.campaign-pill small {
    color: var(--accent);

    font-size: 11px;
}

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 24px;
}

.stat-card {
    min-height: 140px;

    padding: 21px 22px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: var(--surface);

    box-shadow: 0 3px 14px rgba(0,0,0,.025);
}

.stat-label {
    display: block;

    margin-bottom: 16px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 750;
}

.stat-card > strong {
    display: block;

    margin-bottom: 7px;

    font-size: 31px;
    line-height: 1;

    letter-spacing: -.04em;
}

.stat-card small {
    color: #aaa;

    font-size: 10px;
}

.stat-card-highlight {
    border-color: rgba(184,214,55,.55);

    background:
        linear-gradient(
            145deg,
            #fff,
            rgba(184,214,55,.09)
        );
}

.stat-card-highlight > strong {
    color: var(--accent-dark);
}

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, .85fr);

    gap: 18px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 23px 25px;

    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    margin: 0;

    font-size: 17px;
    letter-spacing: -.02em;
}

.empty-state {
    padding: 58px 30px 64px;

    text-align: center;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 50px;

    margin: 0 auto 16px;

    border-radius: 50%;

    background: var(--surface-soft);

    font-size: 21px;
}

.empty-state h4 {
    margin: 0 0 8px;

    font-size: 14px;
}

.empty-state p {
    max-width: 390px;

    margin: 0 auto;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.6;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 15px 20px;

    border-bottom: 1px solid #efefec;

    text-align: left;

    font-size: 12px;
}

th {
    color: #999;

    font-size: 10px;
    letter-spacing: .05em;

    text-transform: uppercase;
}

td strong,
.table-sub {
    display: block;
}

.table-sub {
    margin-top: 4px;

    color: #999;

    font-size: 10px;
}

.status-badge {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 7px;

    background: #f0f0ed;

    font-size: 10px;
    font-weight: 700;
}

.campaign-active {
    padding: 5px 9px;

    border-radius: 20px;

    background: rgba(184,214,55,.16);
    color: var(--accent-dark);

    font-size: 10px;
    font-weight: 800;
}

.campaign-info {
    padding: 8px 25px;
}

.campaign-info > div {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 15px 0;

    border-bottom: 1px solid #efefec;
}

.campaign-info span {
    color: var(--muted);

    font-size: 11px;
}

.campaign-info strong {
    font-size: 12px;
}

.campaign-note {
    margin: 14px 20px 20px;
    padding: 16px;

    border-radius: 11px;

    background: var(--surface-soft);
}

.campaign-note strong {
    font-size: 11px;
}

.campaign-note p {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.55;
}

/* -------------------------------------------------------
   Responsive
------------------------------------------------------- */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {

    .sidebar {
        position: static;

        width: 100%;

        padding-bottom: 15px;
    }

    .app-shell {
        display: block;
    }

    .nav {
        display: flex;
        gap: 5px;

        overflow-x: auto;

        padding-bottom: 5px;
    }

    .nav-section,
    .nav-item.disabled {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
    }

    .sidebar-user {
        margin-top: 10px;
    }

    .main-content {
        width: 100%;

        margin-left: 0;
        padding: 25px 18px 40px;
    }

    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .campaign-pill {
        width: 100%;
        flex: auto;
    }

    .topbar {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {

    .login-card {
        padding: 30px 23px;
    }

    .login-heading h1 {
        font-size: 27px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .welcome-panel {
        padding: 25px;
    }

    .topbar-status {
        display: none;
    }
}

/* -------------------------------------------------------
   Leads
------------------------------------------------------- */

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-soft);
}

.field-help {
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.form-panel {
    padding: 25px;
}

.lead-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr);
    gap: 18px;
    margin-bottom: 18px;
}

.info-list {
    padding: 8px 25px;
}

.info-list > div {
    padding: 15px 0;
    border-bottom: 1px solid #efefec;
}

.info-list > div:last-child {
    border-bottom: 0;
}

.info-list strong,
.info-list span {
    display: block;
}

.info-list strong {
    margin-bottom: 4px;
    font-size: 12px;
}

.info-list span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.inspection-result {
    margin-top: 18px;
}

.result-ok,
.result-warning {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
}

.result-ok {
    background: rgba(184,214,55,.16);
    color: var(--accent-dark);
}

.result-warning {
    background: #fff4e5;
    color: #9a6700;
}

.inspection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.inspection-item {
    min-height: 92px;
    padding: 19px 22px;
    background: #fff;
}

.inspection-item span,
.inspection-item strong {
    display: block;
}

.inspection-item span {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.inspection-item strong {
    font-size: 13px;
    line-height: 1.4;
}

.inspection-detail {
    padding: 18px 24px;
    border-bottom: 1px solid #efefec;
}

.inspection-detail > span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.inspection-detail strong,
.inspection-detail p {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
}

.save-lead-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin: 22px;
    padding: 21px 23px;
    border: 1px solid rgba(184,214,55,.5);
    border-radius: 13px;
    background: rgba(184,214,55,.07);
}

.save-lead-box strong {
    display: block;
    font-size: 13px;
}

.save-lead-box p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

@media (max-width: 1000px) {

    .lead-create-grid {
        grid-template-columns: 1fr;
    }

    .inspection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {

    .inspection-grid {
        grid-template-columns: 1fr;
    }

    .save-lead-box {
        align-items: stretch;
        flex-direction: column;
    }

    .save-lead-box .btn {
        width: 100%;
    }
}
