/* Akuku B2B - stil de baza (fara framework, fara JS) */
:root {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --ink: #1f2a2e;
    --muted: #66737a;
    --line: #e4e0d7;
    --accent: #1d6f6a;
    --accent-ink: #ffffff;
    --accent-soft: #e5f1ef;
    --warn: #b7791f;
    --warn-soft: #fdf3e1;
    --danger: #b3412e;
    --danger-soft: #fbeae6;
    --good: #2f7a3e;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(31, 42, 46, .05), 0 4px 16px rgba(31, 42, 46, .04);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 40px; min-height: 70vh; }
.footer { color: var(--muted); font-size: 12px; padding-bottom: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .95em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.danger { color: var(--danger) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; }

/* ---------- Topbar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand__mark { font-weight: 800; font-size: 1.45rem; letter-spacing: -.03em; color: var(--accent); }
.brand__mark--lg { font-size: 2.4rem; display: inline-block; margin-bottom: 12px; }
.brand__tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--bg); }
.nav a.is-active { background: var(--accent-soft); color: var(--accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.account__name { color: var(--ink); text-decoration: none; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__grid { background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; line-height: 20px; }
.badge--warn { background: var(--warn); }

/* ---------- Componente ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { margin-top: 24px; }
section.card.section, .card.section { padding: 20px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #cfc9bc; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #175b57; border-color: #175b57; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.btn:focus-visible, .link:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(29, 111, 106, .35); outline-offset: 1px;
}

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search],
input[type=number], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #d6d1c6; border-radius: 8px;
    background: #fff; color: var(--ink); font: inherit;
}
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.field small { font-weight: 400; color: var(--muted); }
.field__error { color: var(--danger); font-size: 13px; font-weight: 500; }
.field--sm { max-width: 140px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form--row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.form--row .field { margin-bottom: 0; min-width: 220px; }
.form--row .check { margin-bottom: 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.alert--success { background: var(--accent-soft); border-color: #bfdcd8; color: #154f4b; }
.alert--error { background: var(--danger-soft); border-color: #efc5bc; color: #7d2a1c; }
.alert--info { background: var(--warn-soft); border-color: #efd9ad; color: #6d4a12; }

.tabs { display: flex; border-bottom: 1px solid var(--line); margin: -24px -24px 20px; }
.tab { flex: 1; text-align: center; padding: 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.subnav a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.status { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); }
.status--pending, .status--new { background: var(--warn-soft); color: var(--warn); }
.status--active, .status--completed { background: var(--accent-soft); color: var(--accent); }
.status--processing { background: #e8eef8; color: #33558f; }
.status--suspended, .status--rejected, .status--cancelled { background: var(--danger-soft); color: var(--danger); }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 0 8px; font-weight: 600; }

.empty { padding: 32px; text-align: center; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }

h1.mono { font-size: 1.5rem; letter-spacing: -.01em; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.success .btn + .btn { margin-left: 8px; }

/* ---------- Pagini simple (am uitat parola, resetare) ---------- */
.narrow { max-width: 460px; margin: 24px auto; padding: 28px; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.account-layout .section { margin-top: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.account__name:hover, .account__name.is-active { color: var(--accent); text-decoration: underline; }
.pw-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); width: 100%; }
.pw-actions .btn { padding: 6px 12px; font-size: 13px; }
.alert--secret { font-size: 15px; }
.pw-actions .tag { font-size: 12px; padding: 2px 8px; }
.alert--secret .mono { font-size: 1.15rem; background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid #bfdcd8; user-select: all; }

/* ---------- Login ---------- */
.is-guest .main { padding-top: 48px; }
.auth { display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: 48px; align-items: start; }
.auth__intro h1 { font-size: 2rem; max-width: 14ch; }
.auth__intro p { color: var(--muted); max-width: 44ch; font-size: 16px; }
.auth__points { padding: 0; list-style: none; margin: 20px 0 0; }
.auth__points li { padding: 6px 0 6px 26px; position: relative; }
.auth__points li::before { content: ""; position: absolute; left: 0; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-soft); border: 3px solid var(--accent); }
.auth__panel { padding: 24px; }

/* ---------- Catalog ---------- */
.search { display: flex; gap: 8px; min-width: min(100%, 420px); }
.plist { overflow: hidden; }
.plist__head, .prow {
    display: grid; grid-template-columns: 80px minmax(0, 1fr) 110px 120px 110px 200px;
    gap: 16px; align-items: center; padding: 10px 16px;
}
.plist__head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); background: #fbfaf7; }
.prow { border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: #fcfbf8; }
.prow__img img, .noimg { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.noimg { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; }
.prow__name { font-weight: 600; }
.prow__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 2px; }
.prow__price .lbl { display: none; }
.price { font-size: 1.05rem; color: var(--accent); }
.strike { text-decoration: line-through; color: var(--muted); }
.buy { display: flex; gap: 8px; justify-content: flex-end; }
.buy input { width: 76px; text-align: right; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }

/* ---------- Tabele ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fbfaf7; }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.table tfoot .grand td { font-weight: 700; font-size: 1.05rem; }
.cell-product { display: flex; gap: 12px; align-items: center; }
.cell-product img { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.qty { width: 84px !important; text-align: right; }

/* ---------- Cos ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cart { overflow: hidden; }
.cart__actions { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.summary { padding: 20px; position: sticky; top: 76px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 18px; font-size: 14px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 1.15rem; font-weight: 700; color: var(--ink); padding-top: 10px; border-top: 1px solid var(--line); }
.success { padding: 24px; margin-bottom: 24px; border-left: 4px solid var(--accent); }

/* ---------- Admin ---------- */
.client { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.client--pending { border-left: 4px solid var(--warn); }
.client__title { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.client__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; }
.stat__n { font-size: 1.8rem; font-weight: 700; }
.report { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.report__nums { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0 0 10px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.notes { background: var(--warn-soft); padding: 10px 12px; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; gap: 24px; }
    .cart-layout, .account-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .plist__head { display: none; }
    /* rand produs: poza | info pe toata latimea, apoi 3 preturi, apoi cumparare */
    .prow { grid-template-columns: 72px repeat(3, minmax(0, 1fr)); gap: 6px 14px; padding: 14px; }
    .prow__price { text-align: left; display: flex; flex-direction: column; }
    .prow__price .lbl { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
    .prow__img { grid-column: 1; grid-row: 1 / span 2; }
    .prow__info { grid-column: 2 / -1; }
    .prow > .prow__price:nth-of-type(3) { grid-column: 2; }
    .prow > .prow__price:nth-of-type(4) { grid-column: 3; }
    .prow > .prow__price:nth-of-type(5) { grid-column: 4; }
    .prow__buy { grid-column: 1 / -1; }
    .buy { justify-content: stretch; }
    .buy input { flex: 0 0 90px; }
    .buy .btn { flex: 1; }
}
@media (max-width: 640px) {
    h1 { font-size: 1.35rem; }
    .account { width: 100%; margin-left: 0; justify-content: space-between; padding-bottom: 10px; }
    .topbar__inner { gap: 8px 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .search { width: 100%; }
    .stats { grid-template-columns: 1fr 1fr 1fr; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .table td { border: 0; padding: 3px 0; text-align: left !important; }
    .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
    .table tfoot { display: block; width: 100%; border-top: 1px solid var(--line); }
    .table tfoot tr { display: flex; justify-content: space-between; gap: 16px; padding: 6px 14px; border: 0; }
    .table tfoot td { width: auto; padding: 0; }
    .table tfoot .grand { padding-top: 10px; }
    /* liniile de produs: etichetele in 2 coloane, mai compact */
    .table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
    .table tbody td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
    .prow { grid-template-columns: 64px 1fr 1fr; }
    .prow__img img, .prow .noimg { width: 64px; height: 64px; }
    .prow > .prow__price:nth-of-type(3) { grid-column: 2; }
    .prow > .prow__price:nth-of-type(4) { grid-column: 3; }
    .prow > .prow__price:nth-of-type(5) { display: none; }
}
