/* ============================================================
   Mancare ca la mama acasa  -  stiluri panou administrare
   ============================================================ */

:root {
    --red: #d63426; --red-dark: #a31f16; --gold: #f6a609;
    --cream: #fff6e9; --card: #ffffff; --ink: #2a1a12;
    --muted: #6b5648; --line: #e7ddcd; --green: #3f9242;
    --blue: #2563eb; --soft: #faf4ea;
    --f-display: 'Fredoka', system-ui, sans-serif;
    --f-body: 'Nunito', system-ui, sans-serif;
    --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
    --sh-sm: 0 2px 8px rgba(42,26,18,.08);
    --sh-md: 0 8px 24px rgba(42,26,18,.12);
    --ease: cubic-bezier(.16,1,.3,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

body {
    font-family: var(--f-body); background: var(--soft); color: var(--ink);
    line-height: 1.55; min-height: 100dvh;
}
.ic { flex: none; }

/* ============================================================
   LOGIN
   ============================================================ */
.admin-bare {
    display: grid; place-items: center; min-height: 100dvh;
    background: radial-gradient(circle at 50% 0%, var(--red), var(--red-dark));
    padding: 1.5rem;
}
.login { width: min(400px, 100%); }
.login__card {
    background: var(--card); border-radius: var(--r-lg);
    padding: 2.2rem 2rem; box-shadow: var(--sh-md);
}
.login__brand { text-align: center; margin-bottom: 1.4rem; }
.login__logo { display: inline-grid; place-items: center; margin-bottom: .5rem; }
.login__brand h1 { font-family: var(--f-display); font-size: 1.5rem; color: var(--red-dark); }
.login__brand p { color: var(--muted); font-size: .95rem; }
.login__form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.login__back { display: block; text-align: center; color: #ffe9d8; margin-top: 1rem; font-weight: 600; }
.login__back:hover { color: #fff; }

/* ============================================================
   LAYOUT
   ============================================================ */
.admin { display: flex; min-height: 100dvh; }

.adm-side {
    width: 250px; flex: none; background: var(--red-dark); color: #ffe9d8;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
}
.adm-side__brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.3rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.12);
}
.adm-side__name { font-family: var(--f-display); font-weight: 600; line-height: 1.1; color: #fff; font-size: 1rem; }
.adm-side__name em { font-style: normal; color: var(--gold); font-size: .82rem; }
.adm-side__nav { flex: 1; padding: 1rem .8rem; display: flex; flex-direction: column; gap: .3rem; }
.adm-side__foot {
    padding: 1rem .8rem; border-top: 1px solid rgba(255,255,255,.12);
    display: flex; flex-direction: column; gap: .3rem;
}
.adm-nav {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem .9rem; border-radius: var(--r-md);
    font-family: var(--f-display); font-weight: 500; font-size: .98rem;
    color: #ffd9c5; transition: background .15s, color .15s;
}
.adm-nav:hover { background: rgba(255,255,255,.1); color: #fff; }
.adm-nav.is-active { background: var(--gold); color: var(--ink); }
.adm-nav--ghost { font-size: .92rem; }

.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-top {
    display: flex; align-items: center; gap: 1rem;
    background: var(--card); padding: 1rem 1.6rem;
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.adm-top__burger { display: none; color: var(--red-dark); }
.adm-top__title { font-family: var(--f-display); font-size: 1.3rem; flex: 1; color: var(--red-dark); }
.adm-top__user {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--muted); font-size: .92rem; font-weight: 600;
}
.adm-content { padding: 1.6rem; display: flex; flex-direction: column; gap: 1.3rem; }
.adm-overlay {
    position: fixed; inset: 0; background: rgba(42,26,18,.5); z-index: 25;
}

/* ============================================================
   COMPONENTE
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font-family: var(--f-display); font-weight: 600;
    padding: .6rem 1.2rem; border-radius: var(--r-md); font-size: .95rem;
    transition: transform .15s var(--ease), background .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--cream); }
.btn--sm { padding: .42rem .9rem; font-size: .88rem; }
.btn--block { width: 100%; }

.alert {
    display: flex; align-items: center; gap: .55rem;
    padding: .8rem 1.1rem; border-radius: var(--r-md); font-weight: 600; font-size: .95rem;
}
.alert--success { background: #e3f3e4; color: #2c6b2f; }
.alert--error { background: #fde8e6; color: var(--red-dark); }

/* ---------- Statistici ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.stat {
    background: var(--card); border-radius: var(--r-lg); padding: 1.2rem;
    box-shadow: var(--sh-sm); display: flex; align-items: center; gap: .9rem;
    border-left: 4px solid var(--line);
}
.stat--red { border-left-color: var(--red); }
.stat--gold { border-left-color: var(--gold); }
.stat--green { border-left-color: var(--green); }
.stat--blue { border-left-color: var(--blue); }
.stat__ic { display: grid; place-items: center; width: 46px; height: 46px;
    border-radius: var(--r-md); background: var(--soft); color: var(--red-dark); }
.stat strong { font-family: var(--f-display); font-size: 1.7rem; display: block; line-height: 1; }
.stat span { color: var(--muted); font-size: .88rem; }

/* ---------- Carduri ---------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.card__head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line);
}
.card__head--wrap { flex-wrap: wrap; }
.card__head h2 {
    font-family: var(--f-display); font-size: 1.2rem; color: var(--red-dark);
    display: flex; align-items: center; gap: .5rem;
}
.card__tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card--form { padding-bottom: 1.4rem; }
.card--quick .quick-grid {
    display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; padding: 1.2rem 1.4rem;
}
.quick {
    display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem;
    background: var(--soft); border-radius: var(--r-md); font-family: var(--f-display);
    font-weight: 600; color: var(--red-dark); transition: background .15s, transform .15s;
}
.quick:hover { background: var(--cream); transform: translateY(-2px); }
.empty { padding: 2.2rem 1.4rem; text-align: center; color: var(--muted); }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th {
    text-align: left; padding: .7rem 1rem; background: var(--soft);
    font-family: var(--f-display); font-weight: 600; color: var(--muted);
    font-size: .82rem; text-transform: uppercase; letter-spacing: .03em;
    white-space: nowrap;
}
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--soft); }
.table tfoot td { background: var(--soft); font-weight: 700; }
.muted { color: var(--muted); }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-right { text-align: right; }
.pos {
    display: inline-grid; place-items: center; min-width: 28px; height: 28px;
    background: var(--soft); border-radius: var(--r-sm); font-family: var(--f-display);
    font-weight: 700; color: var(--muted);
}
.prod-cell { display: flex; align-items: center; gap: .6rem; }
.prod-cell img {
    width: 56px; height: 42px; border-radius: var(--r-sm);
    object-fit: contain;
    background: var(--cream);
    padding: 2px;
}
.prod-cell__noimg {
    width: 56px; height: 42px; border-radius: var(--r-sm); background: var(--soft);
    display: grid; place-items: center; color: var(--muted);
}
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.dot--gold { background: var(--gold); }

.actions { display: flex; gap: .4rem; align-items: center; }
.actions form { display: inline; }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border-radius: var(--r-sm); background: var(--soft); color: var(--red-dark);
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--cream); }
.icon-btn--danger:hover { background: #fde8e6; color: var(--red); }

/* ---------- Badge-uri ---------- */
.badge {
    display: inline-block; padding: .2rem .65rem; border-radius: 999px;
    font-family: var(--f-display); font-weight: 600; font-size: .8rem; white-space: nowrap;
}
.badge--lg { font-size: .95rem; padding: .35rem 1rem; }
.badge--noua { background: #fde8d0; color: #9a5b00; }
.badge--confirmata { background: #d8e7fb; color: #1b4f9c; }
.badge--livrata { background: #e3f3e4; color: #2c6b2f; }
.badge--anulata { background: #f0e6df; color: #6b5648; }

/* ---------- Tab-uri ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); }
.tab {
    padding: .45rem .9rem; border-radius: 999px; font-family: var(--f-display);
    font-weight: 600; font-size: .9rem; background: var(--soft); color: var(--muted);
    display: inline-flex; align-items: center; gap: .4rem;
}
.tab:hover { background: var(--cream); }
.tab.is-active { background: var(--red); color: #fff; }
.tab__count {
    background: rgba(0,0,0,.12); padding: 0 .45rem; border-radius: 999px; font-size: .78rem;
}
.tab.is-active .tab__count { background: rgba(255,255,255,.25); }

/* ---------- Formulare ---------- */
.form { padding: 1.3rem 1.4rem 0; display: flex; flex-direction: column; gap: 1rem; }
.form__section {
    font-family: var(--f-display); font-size: 1rem; color: var(--red-dark);
    border-bottom: 2px dashed var(--line); padding-bottom: .4rem; margin-top: .5rem;
}
.form__hint {
    font-size: .92rem; color: var(--muted); margin-top: -.3rem;
}
.form__hint code { background: var(--cream); color: var(--red-dark); padding: 1px 6px; border-radius: 4px; font-size: .85em; }
.form__steps {
    list-style: decimal; padding-left: 1.4rem;
    color: var(--muted); font-size: .9rem; line-height: 1.55;
    display: flex; flex-direction: column; gap: .55rem;
    background: var(--cream); border-radius: var(--r-sm); padding: 1rem 1rem 1rem 2.2rem;
    border-left: 3px solid var(--gold);
}
.form__steps code { background: rgba(0,0,0,.06); color: var(--red-dark); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.form__steps strong { color: var(--red-dark); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__row:has(.field--narrow) { grid-template-columns: 200px 1fr; }
.form__row:has(.field--narrow ~ .field--narrow) { grid-template-columns: 200px 1fr 200px; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span { font-family: var(--f-display); font-weight: 600; font-size: .92rem; }
.field input, .field textarea, .field select, .filter select, .status-form select {
    border: 2px solid var(--line); border-radius: var(--r-sm);
    padding: .58rem .75rem; background: var(--card); font-family: var(--f-body);
    transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); outline: none; }
.field textarea { resize: vertical; }
.field small { color: var(--muted); font-size: .82rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.check--sm { font-size: .88rem; font-weight: 500; }
.form__checks { display: flex; flex-direction: column; gap: .7rem; }
.form__actions { display: flex; gap: .7rem; padding-top: .4rem; flex-wrap: wrap; }

.icon-pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.icon-opt input { position: absolute; opacity: 0; }
.icon-opt span {
    display: grid; place-items: center; width: 46px; height: 46px;
    border-radius: var(--r-md); background: var(--soft); color: var(--muted);
    border: 2px solid transparent; transition: all .15s;
}
.icon-opt:hover span { background: var(--cream); }
.icon-opt input:checked + span { background: var(--red); color: #fff; border-color: var(--red-dark); }

.img-current { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.img-current img { width: 90px; height: 70px; object-fit: cover; border-radius: var(--r-sm); }

/* ---------- Detaliu comanda ---------- */
.order-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.4rem; padding: 1.3rem 1.4rem; }
.order-detail h3 { font-family: var(--f-display); color: var(--red-dark); margin-bottom: .7rem; font-size: 1.05rem; }
.def-list { display: grid; grid-template-columns: 110px 1fr; gap: .4rem .8rem; }
.def-list dt { font-weight: 700; color: var(--muted); }
.status-form { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.order-items-title { font-family: var(--f-display); color: var(--red-dark); padding: 0 1.4rem .6rem; }
.order-total { font-family: var(--f-display); font-size: 1.1rem; color: var(--red); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (width < 900px) {
    .stat-grid { grid-template-columns: repeat(2,1fr); }
    .card--quick .quick-grid { grid-template-columns: 1fr; }
    .order-detail { grid-template-columns: 1fr; }
}
@media (width < 760px) {
    .adm-side {
        position: fixed; z-index: 30; left: 0; top: 0;
        transform: translateX(-100%); transition: transform .3s var(--ease);
    }
    .admin.nav-open .adm-side { transform: translateX(0); }
    .admin:not(.nav-open) .adm-overlay { display: none; }
    .adm-top__burger { display: grid; place-items: center; }
    .form__row, .form__row:has(.field--narrow),
    .form__row:has(.field--narrow ~ .field--narrow) { grid-template-columns: 1fr; }
}
@media (width >= 760px) {
    .adm-overlay { display: none; }
}
