/* =========================================================
   Ajánlatkészítő – felület
   ========================================================= */
:root {
    --brand: #2563eb;
    --brand-ink: color-mix(in srgb, var(--brand) 82%, #000);
    --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
    --brand-ring: color-mix(in srgb, var(--brand) 28%, transparent);

    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e5e9f2;
    --line-2: #eef1f7;

    --side: #0f1b2d;
    --side-2: #16263d;

    --ok: #16a34a;
    --danger: #dc2626;

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px -4px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px -12px rgba(15, 23, 42, .22);
    --side-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { flex: none; display: block; }
.mono { font-weight: 500; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Oldalsáv ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--side-w);
    background:
        radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 60%),
        linear-gradient(180deg, var(--side), var(--side-2));
    color: #cbd5e1;
    display: flex; flex-direction: column;
    padding: 20px 14px;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #a855f7));
    color: #fff;
    box-shadow: 0 6px 18px -6px var(--brand);
}
.brand-mark.lg { width: 54px; height: 54px; border-radius: 15px; }
.brand-logo { width: 42px; height: 42px; border-radius: 11px; background: #fff; display: grid; place-items: center; padding: 4px; flex: none; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { color: #8aa0bd; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.new-btn {
    display: none; /* csak mobilon */
}
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #64748b; padding: 10px 12px 6px; font-weight: 600; }
.nav a, .logout {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #b6c3d5;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav a:hover, .logout:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--brand);
}
.nav a.active .ic { color: color-mix(in srgb, var(--brand) 60%, #fff); }
.logout { margin-top: auto; color: #8193ab; }

/* ---------- Fő terület ---------- */
.main { margin-left: var(--side-w); min-height: 100vh; }
.container { max-width: 1440px; margin: 0 auto; padding: 30px 32px 60px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.back:hover { color: var(--brand); text-decoration: none; }

/* ---------- Gombok ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    border-radius: 10px;
    font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: #f8fafc; border-color: #d5dbe7; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand));
    border-color: var(--brand-ink);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 16px -6px var(--brand);
}
.btn.primary:hover { background: var(--brand-ink); }
.btn.lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.icon-btn.danger:hover { background: #fef2f2; color: var(--danger); }
.icon-btn.sm { width: 30px; height: 30px; }

/* ---------- Űrlapelemek ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field > span em { color: var(--danger); font-style: normal; }
.field.narrow { max-width: 360px; }
input, textarea, select {
    display: block; width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #dbe1ec;
    border-radius: 10px;
    background: #fbfcfe;
    font: inherit; color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #a7b2c3; }
input:hover, textarea:hover, select:hover { border-color: #c8d1df; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px var(--brand-ring);
}
input[type=checkbox], input[type=radio] { width: auto; height: auto; display: inline; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin: -4px 0 14px; cursor: pointer; }
.hint { color: var(--muted); font-size: 12px; display: block; line-height: 1.4; }

.input-ic { position: relative; }
.input-ic .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-ic input { padding-left: 40px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }

/* ---------- Kártyák ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px 22px 10px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.card > textarea { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.card-head .pick { margin-left: auto; width: auto; height: 36px; font-size: 13px; font-weight: 500; max-width: 220px; background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); cursor: pointer; }
.chip { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.c1 { background: #eef2ff; color: #4f46e5; }
.c2 { background: #ecfdf5; color: #059669; }
.c3 { background: #fff7ed; color: #ea580c; }
.c4 { background: #fdf2f8; color: #db2777; }
.c5 { background: #f1f5f9; color: #475569; }

/* ---------- Értesítés ---------- */
.toast {
    display: flex; align-items: center; gap: 10px;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--ok);
    color: #14532d;
    padding: 11px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    font-weight: 500;
    animation: slideIn .35s ease-out;
}
.toast-ic { width: 24px; height: 24px; border-radius: 50%; background: #dcfce7; color: var(--ok); display: grid; place-items: center; }
.alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Statisztika ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat strong { display: block; font-size: 21px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Lista ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 440px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
    text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); background: #fafbfd;
    padding: 11px 18px; border-bottom: 1px solid var(--line);
}
table.list td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tbody tr { cursor: pointer; transition: background .12s; }
table.list tbody tr:hover { background: #f8faff; }
table.list tbody tr:last-child td { border-bottom: 0; }
.client { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.client strong { display: block; font-weight: 600; }
.client small { display: block; color: var(--muted); font-size: 12.5px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
    width: 38px; height: 38px; border-radius: 11px; flex: none;
    display: grid; place-items: center;
    font-weight: 700; font-size: 13px;
    background: hsl(var(--h) 85% 94%);
    color: hsl(var(--h) 55% 38%);
}
.amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.exp { display: inline-block; margin-left: 6px; font-size: 11px; color: #b45309; background: #fffbeb; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-blue { background: var(--brand-soft); color: var(--brand-ink); }
.b-gray { background: #f1f5f9; color: #475569; }
.b-amber { background: #fff7ed; color: #c2410c; }
.num { text-align: right !important; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions > * { display: inline-grid; vertical-align: middle; }
td.actions form { margin: 0; }

.empty { text-align: center; padding: 56px 20px 60px; }
.empty-ic { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty h3 { margin: 0 0 4px; font-size: 17px; }
.empty p { margin: 0 0 18px; color: var(--muted); }

/* ---------- Szerkesztő ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.editor-side { position: sticky; top: 24px; }

.items-head, .item {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 76px 76px 124px 112px 94px;
    gap: 8px;
    align-items: start;
}
.items-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 2px 8px; }
#items { counter-reset: row; }
.item {
    position: relative;
    padding: 8px 2px;
    border-top: 1px solid var(--line-2);
    border-radius: 10px;
    transition: background .15s;
}
.item:hover { background: #fafbff; }
.item.fresh { animation: slideIn .3s ease-out; }
.item textarea { min-height: 42px; height: 42px; overflow: hidden; resize: none; padding-top: 10px; }
.item .qty, .item .price { text-align: right; font-variant-numeric: tabular-nums; }
.price-wrap { position: relative; }
.price-wrap input { padding-right: 32px; }
.price-wrap span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; pointer-events: none; }
.item .line { padding-top: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.item-btns { display: flex; justify-content: flex-end; gap: 1px; padding-top: 6px; opacity: .55; transition: opacity .15s; }
.item:hover .item-btns, .item:focus-within .item-btns { opacity: 1; }

.add-row {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 46px; margin: 10px 0 14px;
    border: 1.5px dashed #cdd6e4;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit; font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.add-row:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* Összesítő */
.summary {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.summary-top { padding: 20px 20px 6px; }
.summary-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: #f1f4f9; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: block; text-align: center;
    padding: 8px 4px; border-radius: 9px;
    font-size: 13px; font-weight: 600; color: var(--muted);
    transition: all .15s;
}
.segmented label:hover span { color: var(--ink); }
.segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }

.rate-box { margin-bottom: 14px; }
.rate-box > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.rate-pills { display: flex; gap: 6px; }
.rate-pill {
    flex: 1; height: 38px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff;
    font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink-2);
    cursor: pointer; transition: all .15s;
}
.rate-pill:hover { border-color: var(--brand); color: var(--brand); }
.rate-pill.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.rate-input { position: relative; flex: 1.2; }
.rate-input input { height: 38px; padding-right: 26px; text-align: right; font-weight: 600; }
.rate-input span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; }
.note-box .field { margin-bottom: 6px; }
.note-box .hint { margin-bottom: 14px; }

.summary-body { padding: 4px 20px 18px; }
.tline { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); }
.tline strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.grand {
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    background:
        radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 55%, #a855f7) 0%, transparent 55%),
        linear-gradient(135deg, var(--brand-ink), var(--brand));
    color: #fff;
}
.grand span { display: block; font-size: 12.5px; font-weight: 500; opacity: .85; }
.grand strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.summary-actions { display: grid; gap: 8px; padding: 0 20px 20px; }

.mobile-bar { display: none; }

/* ---------- Beállítások ---------- */
.settings-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 22px; align-items: start; }
.stack { display: flex; flex-direction: column; }
.dropzone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 140px; padding: 18px;
    margin-bottom: 14px;
    border: 1.5px dashed #cdd6e4; border-radius: 14px;
    background: #fafbfe;
    color: var(--muted); font-size: 12.5px; text-align: center;
    cursor: pointer; transition: all .15s;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone strong { color: var(--ink); font-size: 14px; }
.dropzone img { max-height: 84px; max-width: 80%; object-fit: contain; margin-bottom: 6px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.dz-ic { width: 48px; height: 48px; border-radius: 14px; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); color: var(--brand); margin-bottom: 6px; }
.color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-row input[type=color] { width: 54px; height: 40px; padding: 4px; cursor: pointer; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch:hover { transform: scale(1.1); }
.form-foot { display: flex; justify-content: flex-end; padding: 4px 0 20px; }

/* ---------- Belépés ---------- */
body.bare { background: #fff; }
body.bare .main { margin: 0; }
body.bare .container { max-width: none; padding: 0; }
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-art {
    position: relative; overflow: hidden;
    background:
        radial-gradient(80% 60% at 10% 10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
        radial-gradient(60% 50% at 90% 90%, rgba(168, 85, 247, .35), transparent 60%),
        linear-gradient(160deg, var(--side), #0a1220);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 48px;
}
.art-inner { max-width: 420px; }
.art-inner h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; margin: 26px 0 12px; font-weight: 800; }
.art-inner p { color: #a9b8cd; font-size: 15.5px; margin: 0 0 30px; }
.art-card {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    padding: 8px 18px;
    backdrop-filter: blur(8px);
    transform: rotate(-2deg);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.art-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; color: #cbd5e1; }
.art-row b { color: #fff; font-variant-numeric: tabular-nums; }
.art-row.total { border: 0; font-weight: 600; }
.art-row.total b { font-size: 18px; }
.login-form { display: flex; flex-direction: column; justify-content: center; max-width: 380px; width: 100%; margin: 0 auto; padding: 40px 24px; }
.login-form h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.login-form .sub { color: var(--muted); margin: 4px 0 28px; }
.login-logo { max-height: 56px; max-width: 200px; object-fit: contain; align-self: flex-start; margin-bottom: 26px; }

/* =========================================================
   Reszponzív
   ========================================================= */
@media (max-width: 1520px) {
    .editor { grid-template-columns: 1fr; }
    .editor-side { position: static; }
    .summary { display: grid; grid-template-columns: 1fr 1fr; }
    .summary-top { border-right: 1px solid var(--line); }
    .summary-body { padding-top: 20px; }
    .summary-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .row4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    :root { --side-w: 0px; }
    body.app { padding-bottom: 70px; }
    .sidebar {
        inset: auto 0 0 0; width: auto; height: 64px;
        flex-direction: row; align-items: center; padding: 0 6px env(safe-area-inset-bottom);
        background: var(--side);
        box-shadow: 0 -6px 20px rgba(15, 23, 42, .18);
    }
    .brand, .nav-label, .logout { display: none; }
    .nav { flex-direction: row; margin: 0; flex: 1; justify-content: space-around; gap: 0; }
    .nav a { flex-direction: column; gap: 3px; padding: 8px 6px; font-size: 11px; flex: 1; text-align: center; align-items: center; border-radius: 12px; }
    .nav a.active { box-shadow: none; background: rgba(255,255,255,.1); }
    .container { padding: 20px 16px 30px; }
    .page-head h1 { font-size: 23px; }
    .settings-grid { grid-template-columns: 1fr; }

    .login-wrap { grid-template-columns: 1fr; }
    .login-art { display: none; }
}

@media (max-width: 760px) {
    .card { padding: 18px 16px 6px; border-radius: 14px; }
    .row3 { grid-template-columns: 1fr 1fr; }
    .row3 > :first-child { grid-column: 1 / -1; }
    .head-actions .btn { padding: 0 12px; }
    .card-head { flex-wrap: wrap; }
    .card-head .pick { margin-left: 0; width: 100%; max-width: none; }

    .items-head { display: none; }
    .item {
        grid-template-columns: 1fr 1fr 1.3fr;
        grid-template-areas: "d d d" "q u p" "l l b";
        padding: 12px 0;
    }
    .item:hover { background: none; }
    .item textarea { grid-area: d; }
    .item .qty { grid-area: q; }
    .item .unit { grid-area: u; }
    .item .price-wrap { grid-area: p; }
    .item .line { grid-area: l; text-align: left !important; padding-top: 6px; }
    .item .item-btns { grid-area: b; opacity: 1; padding-top: 0; }

    .summary { grid-template-columns: 1fr; }
    .summary-top { border-right: 0; }
    .summary-body { padding-top: 4px; }
    .summary-actions { display: none; }
    .mobile-bar {
        display: flex; align-items: center; gap: 8px;
        position: fixed; left: 0; right: 0; bottom: 64px; z-index: 15;
        padding: 10px 14px;
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--line);
    }
    .mobile-bar > div { flex: 1; min-width: 0; }
    .mobile-bar small { display: block; font-size: 11.5px; color: var(--muted); }
    .mobile-bar strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
    .mobile-bar .btn { height: 44px; }
    body.app:has(.mobile-bar) { padding-bottom: 136px; }

    .stats { gap: 10px; }
    .stat { padding: 14px; gap: 10px; }
    .stat-ic { width: 38px; height: 38px; }
    .stat strong { font-size: 17px; }

    table.list thead { display: none; }
    table.list, table.list tbody { display: block; }
    table.list tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
    table.list td { display: block; padding: 0; border: 0; }
    table.list td.client { grid-column: 1 / -1; min-width: 0; }
    table.list td[data-l="Szám"] { color: var(--muted); font-size: 13px; }
    table.list td[data-l="Kelte"] { display: none; }
    table.list td[data-l="Típus"] { text-align: right; }
    table.list td[data-l="Végösszeg"] { text-align: left !important; align-self: center; }
    table.list td.actions { text-align: right; }
    .client small { max-width: 240px; }
}

@media (max-width: 420px) {
    .row2, .row4 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { flex-direction: column; align-items: flex-start; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1; }
}
