:root {
    --olive-950: #14261b;
    --olive-900: #1c3324;
    --olive-800: #2a4a34;
    --olive-700: #3d6b48;
    --gold: #c4a35a;
    --gold-dark: #a6863d;
    --cream: #f4efe4;
    --paper: #fffdf8;
    --ink: #1a241c;
    --muted: #5d6b61;
    --line: #e2d9c8;
    --danger: #9b2c2c;
    --ok: #2f6b45;
}

* { box-sizing: border-box; }

body.zp-body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-weight: 700;
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

body.zp-body input,
body.zp-body select,
body.zp-body textarea,
body.zp-body button,
body.zp-body .btn,
body.zp-body .form-control,
body.zp-body .badge {
    font-weight: 700;
    font-family: inherit;
}

a { color: var(--olive-800); text-decoration: none; }
a:hover { color: var(--olive-700); }

.zp-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, #3d6b48 0, transparent 42%),
        linear-gradient(160deg, var(--olive-950), #243a2c 55%, #1c3324);
}

.zp-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--paper);
    border-radius: 18px;
    padding: 36px 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.zp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.zp-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--olive-800);
    color: var(--gold);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
}

.zp-brand h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: .02em;
    line-height: 1.2;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zp-brand small { color: var(--muted); }

.zp-demo {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}
.zp-demo strong { display: block; color: var(--ink); margin-bottom: 6px; }
.zp-demo p { margin: 0 0 8px; }
.zp-demo ul { margin: 0; padding-left: 18px; }
.zp-demo code {
    font-size: 12px;
    background: var(--cream);
    padding: 1px 5px;
    border-radius: 4px;
}

.zp-login-card p.lead {
    color: var(--muted);
    margin: 0 0 24px;
    font-size: 14px;
}

.zp-field { margin-bottom: 16px; position: relative; }
.zp-name-uc { text-transform: uppercase; }
.zp-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.zp-field input, .zp-field select, .zp-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 15px;
}

.zp-check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0 18px; }
.zp-perms { margin: 8px 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf8; }
.zp-perms-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.zp-perm-group { margin-top: 12px; }
.zp-perm-item { margin: 4px 0; }

.zp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--olive-800);
    color: #fff;
}

.zp-btn:hover { background: var(--olive-700); color: #fff; }
.zp-btn-gold { background: var(--gold-dark); }
.zp-btn-outline { background: transparent; color: var(--olive-800); border: 1px solid var(--line); }
.zp-btn-danger { background: var(--danger); color: #fff; }
.zp-btn-block { width: 100%; }
.zp-btn-sm { padding: 8px 12px; font-size: 13px; }

.zp-alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.zp-alert-error { background: #fde8e8; color: var(--danger); }
.zp-alert-ok { background: #e8f5ee; color: var(--ok); }

.zp-shell { display: flex; min-height: 100vh; }

.zp-mobile-bar { display: none; }

.zp-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}
.zp-hamburger span {
    display: block;
    height: 2px;
    width: 22px;
    background: #f4efe4;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.zp-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.zp-hamburger.active span:nth-child(2) { opacity: 0; }
.zp-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.zp-nav-backdrop { display: none; }

.zp-sidebar {
    width: 250px;
    background: var(--olive-900);
    color: #e8efe9;
    padding: 22px 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.zp-sidebar .zp-brand { color: #fff; margin-bottom: 20px; }
.zp-sidebar .zp-brand h1 { font-size: 20px; color: #fff; }
.zp-sidebar .zp-brand small { color: #b7c8bb; }
.zp-nav { flex: 1; }
.zp-nav a {
    display: block;
    color: #d5e2d8;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
}
.zp-nav a:hover, .zp-nav a.active { background: var(--olive-800); color: #fff; }
.zp-nav .nav-label {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #93aa98;
    margin: 18px 12px 8px;
}
.zp-sidebar-user { display: none; }
.zp-sidebar-user .zp-badge { margin-left: 4px; }
.zp-sidebar-user .zp-actions { margin-top: 10px; }
.zp-sidebar-user .zp-btn-outline { color: #e8efe9; border-color: rgba(255,255,255,.25); }

.zp-main { flex: 1; padding: 24px 28px; min-width: 0; }
.zp-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.zp-user { font-size: 14px; color: var(--muted); text-align: right; }
.zp-badge {
    display: inline-block;
    background: #efe6d0;
    color: #6d5420;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}

.zp-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    min-width: 0;
}

.zp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.zp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.zp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.zp-table th, .zp-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.zp-table tr.zp-job-wait-tare td { background: #e8f5ee; color: #1a5c32; }
.zp-table tr.zp-job-wait-settle td { background: #fde8e8; color: #9b2c2c; }
.zp-table tr.zp-job-wait-tare .zp-btn-outline,
.zp-table tr.zp-job-wait-settle .zp-btn-outline { background: #fff; }

.zp-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.zp-muted { color: var(--muted); font-size: 14px; }
.zp-oran { color: #111; font-weight: 800; }

.zp-page-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.zp-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.zp-oil-acid { display:grid; grid-template-columns:minmax(0,1fr) 108px; gap:12px; align-items:end; }
.zp-oil-buy { margin: 12px 0; }
.zp-oil-panel { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.zp-oil-buy-row { display:grid; grid-template-columns:72px minmax(0,1fr) minmax(0,1fr) auto; gap:8px; align-items:end; margin-bottom:8px; }
.zp-oil-size { font-weight: 700; padding-bottom: 10px; }
.zp-oil-line-total { padding-bottom: 10px; white-space: nowrap; }
.zp-oil-acid-field { max-width: 140px; margin-top: 4px; }
.zp-kpi h2 { margin:8px 0 0; }
.zp-search { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; align-items:center; }
.zp-search input, .zp-search select { flex:1; min-width: 140px; }
.zp-search input[type="datetime-local"] { min-width: 210px; }
.zp-partner-list { display:flex; flex-direction:column; gap:12px; margin:12px 0; }
.zp-partner-row {
    padding:12px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fffdf8;
}
.zp-row-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.zp-dara-inline { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.zp-dara-inline input { width: 92px; min-width: 0; padding: 8px 10px; font-size: 14px; }
.zp-cancel-inline { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.zp-cancel-inline input { width: 120px; min-width: 0; padding: 8px 10px; font-size: 14px; }

.zp-steps {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex-wrap: wrap;
}
.zp-steps li {
    flex: 1;
    min-width: 120px;
    background: #efe6d0;
    color: #6d5420;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.zp-steps li.done { background: #e8f5ee; color: var(--ok); }
.zp-steps li.current { background: var(--olive-800); color: #fff; }
#zp-step-1, #zp-step-2, #zp-step-3 { scroll-margin-top: 80px; }
.zp-fill-actions { margin: 12px 0 4px; align-items: center; }

.zp-intake { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.zp-intake-mixed { margin: 12px 0 0; padding: 12px 14px; background: #f7f3ea; border-radius: 12px; }
.zp-pick-chosen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 12px;
    background: #e8f5ee;
    border-radius: 10px;
    margin-bottom: 10px;
}
.zp-pick-chosen[hidden], .zp-pick-new[hidden] { display: none !important; }
.zp-pick-new { margin-top: 8px; }
.zp-picker { position: relative; z-index: 5; }
.zp-picker-list {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: auto;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(20, 38, 27, .16);
    max-height: 280px;
    overflow-y: auto;
}
.zp-picker-empty { padding: 12px 14px; color: var(--muted); font-size: 14px; }
.zp-picker-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
}
.zp-picker-item:last-child { border-bottom: 0; }
.zp-picker-item:hover,
.zp-picker-item.active { background: #f7f3ea; }
.zp-picker-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.zp-picker-bal { font-size: 13px; font-weight: 700; white-space: nowrap; }
.zp-picker-bal.borc { color: var(--danger); }
.zp-picker-bal.alacak { color: var(--ok); }
.zp-debt {
    background: #f7f3ea;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 18px;
}
.zp-debt h2 { margin: 4px 0 6px; }
.zp-debt.alacak h2 { color: var(--ok); }
.zp-debt.sifir h2 { color: var(--muted); }

.zp-pay-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .9fr);
    gap: 16px;
    align-items: start;
}
.zp-filter-by {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    width: 100%;
    margin-bottom: 4px;
}
.zp-pick-row { cursor: pointer; }
.zp-pick-row:hover { background: #f7f3ea; }
.zp-pick-row.selected { background: #e8f5ee; }
.zp-list-cards { display: none; }
.zp-mobile-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(20, 38, 27, .08);
}
.zp-mobile-item.selected { background: #e8f5ee; border-color: #c5d9cc; }
.zp-mobile-item h3 { margin: 0 0 8px; font-size: 16px; }
.zp-mobile-meta { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.zp-mobile-item .zp-btn,
.zp-mobile-item form { width: 100%; }
.zp-mobile-item .zp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.zp-mobile-item .zp-actions .zp-btn,
.zp-mobile-item .zp-actions form {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}
.zp-mobile-item .zp-actions .zp-btn { text-align: center; }
.zp-pay-customers-cards { display: none; }
.zp-row-muted { opacity: .62; }
.zp-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.zp-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.zp-tabs a {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    font-size: 14px;
}
.zp-tabs a.active { background: var(--olive-800); color: #fff; border-color: var(--olive-800); }
.zp-st-pending { background: #efe6d0; color: #6d5420; }
.zp-st-paid { background: #e8f5ee; color: var(--ok); }
.zp-st-cancelled { background: #fde8e8; color: var(--danger); }
.zp-inline-pay { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.zp-inline-pay input[type="number"] { width: 110px; }

.zp-report-back {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin: -8px 0 12px;
}

.zp-scenario { display: flex; flex-wrap: wrap; gap: 10px 18px; width: 100%; }
.zp-scenario .zp-check { margin: 0; }
.zp-pl-form { align-items: flex-start; }
.zp-pl-table td:last-child, .zp-pl-table th:last-child { text-align: right; white-space: nowrap; }
.zp-pl-table th:nth-child(n+2), .zp-pl-table td:nth-child(n+2) { text-align: right; }
.zp-pl-on td { background: #e8f5ee; }
.zp-pl-ok { color: var(--ok); }
.zp-pl-bad { color: var(--danger); }

@media (max-width: 900px) {
    .zp-shell { flex-direction: column; }
    .zp-mobile-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 40;
        background: var(--olive-900);
        color: #fff;
        padding: 8px 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,.18);
    }
    .zp-mobile-bar .zp-brand { margin: 0; color: #fff; }
    .zp-mobile-bar .zp-brand h1 { font-size: 18px; color: #fff; }
    .zp-mobile-bar .zp-brand small { color: #b7c8bb; font-size: 12px; }
    .zp-mobile-bar .zp-mark { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }

    .zp-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 38, 27, .45);
        z-index: 45;
    }
    .zp-nav-backdrop[hidden] { display: none; }

    .zp-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 300px);
        z-index: 50;
        transform: translateX(-105%);
        transition: transform .22s ease;
        overflow-y: auto;
        box-shadow: 8px 0 28px rgba(0,0,0,.28);
        padding-top: 16px;
    }
    body.zp-nav-open .zp-sidebar { transform: translateX(0); }
    body.zp-nav-open { overflow: hidden; }

    .zp-sidebar-brand { display: none; }
    .zp-user-desktop { display: none; }
    .zp-sidebar-user {
        display: block;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255,255,255,.12);
        font-size: 13px;
        color: #d5e2d8;
    }
    .zp-main { padding: 16px 14px 28px; }
    .zp-top { margin-bottom: 14px; align-items: flex-start; flex-wrap: wrap; }
    .zp-top > .zp-btn { width: 100%; }
    .zp-page-head { align-items: stretch; }
    .zp-page-head > .zp-btn { width: 100%; }
    .zp-search { width: 100%; }
    .zp-search input,
    .zp-search select,
    .zp-field input,
    .zp-field select,
    .zp-field textarea { font-size: 16px; }
    .zp-grid { grid-template-columns: 1fr 1fr; }
    .zp-row { grid-template-columns: 1fr; }
    .zp-oil-buy-row { grid-template-columns: 72px 1fr; }
    .zp-oil-line-total { grid-column: 1 / -1; padding-bottom: 0; }
    .zp-steps li { min-width: calc(50% - 8px); flex: 1 1 calc(50% - 8px); }
    .zp-dara-inline { width: 100%; }
    .zp-dara-inline input { flex: 1; width: auto; min-width: 80px; }
    .zp-login-card { padding: 24px 18px; }
    .zp-pay-grid { grid-template-columns: 1fr; }
    .zp-search .zp-btn,
    .zp-search .zp-btn-outline { width: 100%; }
    .zp-inline-pay { flex-direction: column; align-items: stretch; }
    .zp-inline-pay input[type="number"],
    .zp-inline-pay select { width: 100%; }
    .zp-list-table { display: none !important; }
    .zp-list-cards { display: block; }
    .zp-pay-customers-table { display: none; }
    .zp-pay-customers-cards { display: flex; flex-direction: column; gap: 10px; }
    .zp-tabs a { flex: 1 1 calc(50% - 8px); text-align: center; }
    .zp-filter-by .zp-check { width: 100%; }
}

@media (max-width: 560px) {
    .zp-grid { grid-template-columns: 1fr; }
    .zp-steps li { min-width: 100%; flex: 1 1 100%; }
}
