/* =============================================================================
   Trend CRM - foaia de stil
   Paleta ceruta:  gri #f0f3f5 | alb #ffffff | blue #264785 | albastru deschis #3966ab
   Font: Codec Pro daca e instalat local, altfel Roboto.
   ========================================================================== */

/* Codec Pro, daca fontul e instalat pe calculator sau pus in assets/fonts.
   Daca lipseste, browserul trece automat la Roboto. */
@font-face {
    font-family: 'Codec Pro Local';
    src: local('Codec Pro'), local('CodecPro-Regular'), local('Codec Pro Regular'),
         url('../fonts/CodecPro-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Codec Pro Local';
    src: local('Codec Pro Bold'), local('CodecPro-Bold'),
         url('../fonts/CodecPro-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    /* Paleta: alb, chihlimbar stins, gri cald. Oranjul ramane doar accent. */
    --white:         #ffffff;
    --gray:          #f5f4f1;   /* fundalul paginii */

    --brand:         #b06a1c;   /* chihlimbar inchis, pentru actiuni */
    --brand-light:   #c8811f;
    --brand-dark:    #8a5215;
    --brand-tint:    #f9f2e6;
    --brand-tint-2:  #ecdcc0;

    --yellow:        #d8ac4a;   /* auriu stins, pentru evidentieri */
    --yellow-light:  #e6c886;
    --yellow-tint:   #faf5e9;

    --sidebar:       #33302c;   /* grafit cald */
    --sidebar-dark:  #262421;

    --text:          #2f2c28;
    --text-soft:     #6b655d;
    --text-muted:    #9a938a;
    --border:        #e3ded6;
    --border-soft:   #efebe4;

    --green:         #22a45d;
    --green-bg:      #e2f6ec;
    --red:           #e05248;
    --red-bg:        #fdeceb;
    --amber:         #d4a017;

    --radius:       10px;
    --radius-lg:    13px;
    --shadow:       0 1px 2px rgba(47, 44, 40, .05), 0 3px 10px rgba(47, 44, 40, .05);
    --shadow-lg:    0 8px 26px rgba(47, 44, 40, .13);

    --sidebar-w:    58px;

    /* Tipografie - marita fata de implicit */
    --fs-base:      14px;
    --fs-sm:        13px;
    --fs-xs:        11.5px;
    --fs-lg:        16px;
    --fs-xl:        18px;
    --fs-title:     24px;

    --font: 'Codec Pro Local', 'Codec Pro', 'Roboto', -apple-system, BlinkMacSystemFont,
            'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: var(--fs-base); }

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--gray);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand-light); text-decoration: none; }
a:hover { color: var(--brand); }

.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* =============================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    z-index: 40;
}

.sidebar-logo {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid; place-items: center;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: .5px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 5px; flex: 1; width: 100%; align-items: center; }

.sidebar-link {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 10px;
    display: grid; place-items: center;
    color: rgba(255, 255, 255, .62);
    transition: background .16s ease, color .16s ease;
}
.sidebar-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar-link.active { background: var(--brand); color: #fff; }
.sidebar-link .icon { width: 19px; height: 19px; }

.sidebar-link .badge-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--sidebar);
}

.sidebar-bottom { display: flex; flex-direction: column; gap: 5px; align-items: center; width: 100%; }

.sidebar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand-light); color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: var(--fs-sm);
    border: 2px solid rgba(255, 255, 255, .35);
}

/* Tooltip pe iconitele din bara laterala */
.sidebar-link[data-label]:hover::after {
    content: attr(data-label);
    position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-dark); color: #fff;
    padding: 4px 9px; border-radius: 7px;
    font-size: var(--fs-xs); white-space: nowrap;
    box-shadow: var(--shadow); z-index: 60;
}

/* =============================================================================
   Layout principal
   ========================================================================== */
.app { margin-left: var(--sidebar-w); min-height: 100vh; }

.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px 10px;
    flex-wrap: wrap;
}

.page-title { font-size: var(--fs-title); font-weight: 700; margin: 0; letter-spacing: -.4px; }

.btn-refresh {
    width: 38px; height: 38px; border-radius: 9px;
    background: var(--brand-light); color: #fff;
    border: none; cursor: pointer;
    display: grid; place-items: center;
    transition: background .16s ease, transform .16s ease;
}
.btn-refresh:hover { background: var(--brand); }
.btn-refresh:active { transform: scale(.94); }

.search {
    position: relative;
    flex: 1 1 320px; max-width: 480px;
    display: flex; align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 9px;
    height: 40px;
    overflow: hidden;
}
.search .icon { color: var(--text-muted); margin: 0 10px; }
.search input {
    flex: 1; height: 100%; border: none; outline: none;
    font-family: inherit; font-size: var(--fs-base);
    color: var(--text); background: transparent;
}
.search input::placeholder { color: var(--text-muted); }
.search-extra {
    width: 40px; height: 100%;
    border: none; border-left: 1px solid var(--border);
    background: var(--white); color: var(--text-soft);
    cursor: pointer; display: grid; place-items: center;
}
.search-extra:hover { background: var(--gray); }

.topbar-spacer { flex: 1; }

/* Butoane */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 38px; padding: 0 15px;
    border-radius: 9px; border: 1px solid transparent;
    font-family: inherit; font-size: var(--fs-base); font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.btn-primary { background: var(--brand-light); color: #fff; }
.btn-primary:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--gray); }
.btn-danger { background: var(--white); color: var(--red); border-color: #f3c9c6; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { height: 32px; padding: 0 11px; font-size: var(--fs-xs); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-split { display: inline-flex; }
.btn-split .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split .btn-caret {
    width: 36px; padding: 0; justify-content: center;
    border-radius: 0 9px 9px 0;
    background: var(--brand); color: #fff;
    border-left: 1px solid rgba(255, 255, 255, .22);
}
.btn-split .btn-caret:hover { background: var(--brand-dark); }

/* =============================================================================
   Bara de filtre pe statusuri
   ========================================================================== */
.status-bar {
    display: flex; align-items: center; gap: 7px;
    padding: 4px 20px 12px;
    flex-wrap: wrap;
}

.status-filter-label {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--white); border: 1px solid var(--border);
    border-radius: 9px; height: 34px; padding: 0 12px;
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .6px; text-transform: uppercase;
    color: var(--text-soft);
}

/* Nebifat: culoarea statusului, dar spalata, ca sa nu tipe toata bara.
   Bifat: culoarea la intensitate intreaga, cu chenar si o ridicare mica.
   Filtrul merge pe orice culoare, deci si pe statusurile adaugate de tine. */
.status-chip {
    display: inline-flex; align-items: center; gap: 7px;
    height: 34px; padding: 0 12px;
    border-radius: 9px; border: 1px solid transparent;
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    cursor: pointer;
    filter: saturate(.2) opacity(.7);
    transition: filter .16s ease, box-shadow .16s ease, transform .16s ease, border-width .16s ease;
}
.status-chip:hover { filter: saturate(.6) opacity(.95); }

.status-chip.is-active {
    filter: none;
    border-width: 2px;
    padding: 0 11px;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-chip.is-active .dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.status-chip .count { opacity: .72; font-weight: 700; }
.status-chip.is-active .count { opacity: .9; }

/* =============================================================================
   Tabel de comenzi (randuri-card, ca in KeyCRM)
   ========================================================================== */
.table-wrap { padding: 0 20px 30px; }

.table-head {
    display: grid;
    grid-template-columns: var(--cols);
    gap: 8px;
    padding: 0 14px 9px;
    font-size: var(--fs-sm);
    color: var(--text-soft);
    font-weight: 600;
}
.table-head .sortable { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.table-head .sortable:hover { color: var(--brand); }

.order-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow .18s ease;
}
.order-card:hover { box-shadow: var(--shadow-lg); }
.order-card.is-open { box-shadow: var(--shadow-lg); }

.order-row {
    display: grid;
    grid-template-columns: var(--cols);
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}
.order-card.is-open > .order-row {
    background: var(--sidebar);
    color: #fff;
}
.order-card.is-open > .order-row a,
.order-card.is-open > .order-row .cell-muted { color: #ded6c9; }
.order-card.is-open > .order-row .row-toggle { color: #fff; }
.order-card.is-open > .order-row .product-cell .sku,
.order-card.is-open > .order-row .badge-count { color: #ded6c9; }

.row-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 0;
    display: grid; place-items: center;
    transition: transform .2s ease;
}
.order-card.is-open .row-toggle { transform: rotate(90deg); }

.cell { min-width: 0; font-size: var(--fs-sm); }
.cell-strong { font-weight: 600; font-size: var(--fs-base); }
.cell-muted { color: var(--text-soft); }
.cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.link-add {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--brand-light); font-weight: 600; font-size: var(--fs-sm);
}
.link-add:hover { color: var(--brand); }

.badge-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px; border-radius: 6px;
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    border: 1px solid transparent;
}

.buyer-cell { display: inline-flex; align-items: center; gap: 8px; }
.buyer-cell .icon { color: var(--text-muted); }
.badge-count {
    display: inline-grid; place-items: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--text-muted); color: #fff;
    font-size: var(--fs-xs); font-weight: 700;
}

.manager-cell { display: flex; align-items: center; gap: 8px; }
.avatar {
    width: 29px; height: 29px; border-radius: 50%;
    background: var(--brand-tint); color: var(--brand);
    display: grid; place-items: center;
    font-weight: 700; font-size: var(--fs-xs);
    position: relative; flex: none;
}
.avatar .online-dot {
    position: absolute; right: -1px; bottom: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--green); border: 2px solid var(--white);
}
.manager-cell .role {
    display: inline-block; margin-top: 2px;
    background: var(--brand-dark); color: #fff;
    font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
    padding: 1px 6px; border-radius: 4px; text-transform: uppercase;
}

.product-cell { display: flex; align-items: flex-start; gap: 8px; }
.product-cell .sku { color: var(--text-soft); font-weight: 600; flex: none; }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
    width: 29px; height: 29px; border-radius: 7px;
    border: 1px solid var(--border); background: var(--white);
    color: var(--text-soft); cursor: pointer;
    display: grid; place-items: center;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.icon-btn:hover { background: var(--brand-tint); color: var(--brand); border-color: var(--brand-tint-2); }
.icon-btn.is-danger:hover { background: var(--red-bg); color: var(--red); border-color: #f3c9c6; }
.order-card.is-open .icon-btn {
    background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff;
}
.order-card.is-open .icon-btn:hover { background: rgba(255, 255, 255, .24); }

/* Panoul desfacut in aceeasi pagina */
.order-detail { display: none; border-top: 1px solid var(--border-soft); padding: 16px 18px 14px; }
.order-card.is-open .order-detail { display: block; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 24px;
}
.detail-col { padding-right: 18px; }
.detail-col + .detail-col { border-left: 1px solid var(--border-soft); padding-left: 20px; }

.detail-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 5px 0; align-items: start; }
.detail-row dt { color: var(--text-soft); font-size: var(--fs-sm); }
.detail-row dd { margin: 0; font-size: var(--fs-sm); word-break: break-word; }

.utm-block { display: flex; flex-direction: column; gap: 3px; }
.utm-block span { color: var(--brand-light); font-size: var(--fs-sm); word-break: break-word; }
.utm-block b { color: var(--text-soft); font-weight: 600; }

.detail-actions { display: flex; gap: 8px; margin: 9px 0 3px; }

.section-title {
    display: flex; align-items: center; justify-content: space-between;
    margin: 18px 0 10px; font-size: var(--fs-lg); font-weight: 700;
}

/* Tabelul de produse din comanda */
.products-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.products-table th {
    text-align: left; font-size: var(--fs-sm); font-weight: 600;
    color: var(--text-soft); padding: 0 9px 9px; white-space: nowrap;
}
.products-table td {
    padding: 10px 9px; font-size: var(--fs-sm);
    background: var(--white); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.products-table tr td:first-child { border-left: 1px solid var(--border-soft); border-radius: 10px 0 0 10px; }
.products-table tr td:last-child  { border-right: 1px solid var(--border-soft); border-radius: 0 10px 10px 0; }

.thumb {
    width: 42px; height: 42px; border-radius: 7px;
    background: var(--gray); border: 1px solid var(--border-soft);
    object-fit: cover; display: block;
}
.thumb-empty { display: grid; place-items: center; color: var(--text-muted); }

.stock-line { color: var(--brand-light); }
.stock-line.is-out { color: var(--red); }

.totals { margin-top: 14px; margin-left: auto; width: min(340px, 100%); }
.totals-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: var(--fs-sm); }
.totals-row.is-grand { font-size: var(--fs-lg); font-weight: 700; padding-top: 9px; }
.totals-row .label { color: var(--text-soft); }

.detail-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 16px; padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

/* =============================================================================
   Depozit
   ========================================================================== */
.data-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 4px 8px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 12px 11px;
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft);
    border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.data-table td { padding: 11px 11px; font-size: var(--fs-sm); border-bottom: 1px solid var(--border-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafcfe; }

/* Tabelul de produse al comenzii: multe campuri editabile pe un rand, deci
   celule mai stranse si scroll orizontal daca ecranul nu ajunge. */
.products-editor { overflow-x: auto; }
.products-editor .data-table { min-width: 1000px; }
.products-editor .data-table th,
.products-editor .data-table td { padding-left: 8px; padding-right: 8px; }
.products-editor .data-table td .input { padding: 0 8px; }

.product-name { font-size: var(--fs-base); font-weight: 600; color: var(--brand-light); }
.product-name:hover { color: var(--brand); }
.product-sku { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.product-sku .tag { background: var(--gray); border-radius: 4px; padding: 1px 5px; font-weight: 700; letter-spacing: .4px; }

.qty-pos { color: var(--text); font-weight: 600; }
.qty-neg { color: var(--red); font-weight: 600; }
.qty-extra { color: var(--green); font-weight: 600; }

.select, .input, .textarea {
    width: 100%; height: 38px; padding: 0 11px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--white); color: var(--text);
    font-family: inherit; font-size: var(--fs-base);
    outline: none; transition: border-color .14s ease, box-shadow .14s ease;
}
.textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.select:focus, .input:focus, .textarea:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(176, 106, 28, .16);
}
.input:disabled, .select:disabled { background: var(--gray); color: var(--text-soft); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: var(--fs-sm); color: var(--text-soft); margin-bottom: 5px; font-weight: 600; }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

.form-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; }
.form-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }

.fieldset-title {
    font-size: var(--fs-base); font-weight: 700; margin: 18px 0 11px;
    padding-bottom: 7px; border-bottom: 1px solid var(--border-soft);
}
.fieldset-title:first-child { margin-top: 0; }

.image-drop {
    border: 2px dashed var(--border); border-radius: var(--radius);
    background: var(--gray); min-height: 150px;
    display: grid; place-items: center; text-align: center;
    color: var(--text-muted); cursor: pointer; padding: 12px;
    transition: border-color .16s ease, background .16s ease;
}
.image-drop:hover { border-color: var(--brand-light); background: var(--brand-tint); }
.image-drop img { max-width: 100%; max-height: 142px; border-radius: 7px; }

.form-footer {
    position: sticky; bottom: 0;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 20px; padding: 12px 0 3px;
    background: linear-gradient(to top, var(--white) 72%, rgba(255, 255, 255, 0));
}

/* =============================================================================
   Autentificare
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
             background: linear-gradient(150deg, var(--sidebar) 0%, var(--brand-dark) 100%); }
.auth-card { width: 100%; max-width: 360px; background: var(--white);
             border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px 26px; }
.auth-logo { width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: #fff;
             display: grid; place-items: center; font-weight: 700; margin: 0 auto 15px; font-size: var(--fs-base); }
.auth-title { text-align: center; font-size: var(--fs-xl); font-weight: 700; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--text-soft); font-size: var(--fs-sm); margin: 0 0 20px; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: var(--fs-sm); margin-bottom: 14px; }
.alert-error { background: var(--red-bg); color: #a52e26; }
.alert-ok { background: var(--green-bg); color: #14663f; }
.alert-info { background: var(--brand-tint); color: var(--brand); }

.code-input { letter-spacing: 8px; text-align: center; font-size: 21px; font-weight: 700; }

/* =============================================================================
   Statistici
   ========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 13px; margin-bottom: 17px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; }
.stat-card .label { color: var(--text-soft); font-size: var(--fs-sm); margin-bottom: 5px; }
.stat-card .value { font-size: 26px; font-weight: 700; letter-spacing: -.6px; }
.stat-card .value.is-brand { color: var(--brand); }
.stat-card .value.is-green { color: var(--green); }

.chart-card { padding: 16px 18px; }
.chart-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.chart-head h3 { margin: 0; font-size: var(--fs-base); font-weight: 700; }
.chart-box { position: relative; width: 100%; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 165px; padding: 8px 3px 0; }
.chart-bar { flex: 1; min-width: 12px; background: var(--brand-light); border-radius: 6px 6px 0 0;
             position: relative; transition: background .16s ease; }
.chart-bar:hover { background: var(--brand); }
.chart-bar span { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%);
                  font-size: 10px; color: var(--text-muted); white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* =============================================================================
   Diverse
   ========================================================================== */
.empty-state { text-align: center; padding: 50px 16px; color: var(--text-soft); }
/* Doar iconita mare din mijloc, nu si cele din butoanele de dedesubt. */
.empty-state > .icon { width: 38px; height: 38px; color: var(--text-muted); margin-bottom: 10px; }
.empty-state h3 { font-size: var(--fs-lg); margin: 0 0 6px; color: var(--text); }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 18px 0 4px; }
.pagination a, .pagination span {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: grid; place-items: center; border-radius: 10px;
    background: var(--white); border: 1px solid var(--border);
    color: var(--text); font-size: var(--fs-sm); font-weight: 600;
}
.pagination a:hover { background: var(--brand-tint); border-color: var(--brand-tint-2); }
.pagination .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* =============================================================================
   Panoul de filtre pe statusuri
   ========================================================================== */
.status-filter-label { cursor: pointer; }
.status-filter-label:hover { background: var(--brand-tint); border-color: var(--brand-tint-2); }

.status-panel {
    display: none;
    margin: 0 20px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 18px;
}
.status-panel.is-open { display: block; }

.status-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.status-group {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 10px;
    min-height: 110px;
}
.status-group-head {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 10px; border-radius: 7px; margin-bottom: 10px;
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    cursor: pointer;
    filter: saturate(.2) opacity(.7);
    transition: filter .16s ease, box-shadow .16s ease;
}
.status-group-head:hover { filter: saturate(.6) opacity(.95); }

/* Bifat, sau macar unul dintre statusurile coloanei bifat */
.status-group-head:has(input:checked),
.status-group-head:has(input:indeterminate),
.status-group-head.is-on { filter: none; box-shadow: var(--shadow); }
.status-group-head .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-group-head .count { margin-left: auto; opacity: .75; }

.status-option {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 7px; cursor: pointer;
    margin-bottom: 5px;
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase;
}
.status-option {
    filter: saturate(.2) opacity(.7);
    transition: filter .16s ease, box-shadow .16s ease;
}
.status-option:hover { filter: saturate(.6) opacity(.95); }
.status-option:has(input:checked),
.status-option.is-on { filter: none; box-shadow: var(--shadow); }
.status-option .count { margin-left: auto; opacity: .7; }

/* Butonul de adaugare a unui status in coloana grupului */
.status-add {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-top: 8px; padding: 7px 10px;
    border: 1px dashed var(--border);
    border-radius: 7px; background: transparent;
    color: var(--text-muted); cursor: pointer;
    font-family: inherit; font-size: var(--fs-xs); font-weight: 600;
    transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.status-add:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-tint);
    border-style: solid;
}
.status-add .icon { width: 13px; height: 13px; }

.status-panel-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

/* =============================================================================
   Selectarea unui rand: culoare + apasare scurta
   ========================================================================== */
@keyframes press-in {
    0%   { transform: scale(1); }
    45%  { transform: scale(.978); }
    100% { transform: scale(1); }
}

.order-card.is-selected {
    background: var(--brand-tint);
    box-shadow: inset 3px 0 0 var(--brand), var(--shadow);
}
.order-card.is-selected > .order-row { background: var(--brand-tint); }

/* Randul desfacut isi pastreaza fundalul inchis chiar daca e si bifat, altfel
   bifarea ar sterge semnul ca panoul e deschis. */
.order-card.is-open.is-selected > .order-row { background: var(--sidebar); }
.order-card.is-open.is-selected { background: var(--white); }
.order-card.is-pressed { animation: press-in .22s ease; }

/* =============================================================================
   Iconita de cutie de langa produs
   ========================================================================== */
.box-btn {
    width: 24px; height: 24px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--white);
    color: var(--brand); cursor: pointer; flex: none;
    display: grid; place-items: center; padding: 0;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.box-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.order-card.is-open > .order-row .box-btn {
    background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); color: #fff;
}

/* =============================================================================
   Panoul de previzualizare a produsului
   ========================================================================== */
.drawer-veil {
    position: fixed; inset: 0; z-index: 110;
    background: rgba(43, 33, 23, .38);
    opacity: 0; transition: opacity .2s ease;
}
.drawer-veil.is-open { opacity: 1; }

.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 111;
    width: min(520px, 94vw);
    background: var(--white);
    box-shadow: -8px 0 40px rgba(120, 74, 20, .18);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}
.drawer.is-open { transform: translateX(0); }

.drawer-head {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
}
.drawer-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.drawer-head .spacer { flex: 1; }

.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

.drawer-top { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.drawer-top .info { flex: 1; min-width: 0; }
.drawer-top .name { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 12px; }
.drawer-photo {
    width: 150px; height: 150px; flex: none;
    border-radius: var(--radius); border: 1px solid var(--border-soft);
    background: var(--gray); object-fit: cover; cursor: zoom-in;
}
.drawer-photo-empty { display: grid; place-items: center; color: var(--text-muted); }

.drawer-section { margin-top: 20px; }
.drawer-section h4 {
    margin: 0 0 10px; font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase; color: var(--text-soft);
    padding-bottom: 7px; border-bottom: 1px solid var(--border-soft);
}
.drawer-desc {
    background: var(--yellow-tint); border-radius: var(--radius);
    padding: 12px 14px; min-height: 70px; font-size: var(--fs-sm); line-height: 1.55;
}

.stock-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.stock-table th {
    text-align: right; font-weight: 600; color: var(--text-soft);
    padding: 8px 10px; border-bottom: 1px solid var(--border-soft);
}
.stock-table th:first-child { text-align: left; }
.stock-table td { padding: 10px; text-align: right; }
.stock-table td:first-child { text-align: left; }

/* =============================================================================
   Sugestii de produse la cautare
   ========================================================================== */
.suggest {
    margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius);
    max-height: 230px; overflow-y: auto; background: var(--white);
}
.suggest:empty { display: none; }
.suggest-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; cursor: pointer; width: 100%;
    border: none; background: none; text-align: left;
    border-bottom: 1px solid var(--border-soft);
    font: inherit; color: var(--text);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.is-active { background: var(--yellow-tint); }
.suggest-item .thumb-mini {
    width: 32px; height: 32px; border-radius: 6px; flex: none;
    background: var(--gray); border: 1px solid var(--border-soft); object-fit: cover;
}
.suggest-item .meta { flex: 1; min-width: 0; }
.suggest-item .meta b { display: block; font-size: var(--fs-sm); font-weight: 600;
                        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item .meta small { color: var(--text-muted); font-size: var(--fs-xs); }
.suggest-item .price { font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }

/* =============================================================================
   Lupa peste imagini
   ========================================================================== */
.lightbox {
    position: fixed; inset: 0; z-index: 130;
    background: rgba(43, 33, 23, .82);
    display: grid; place-items: center; padding: 30px;
    cursor: zoom-out;
}
.lightbox img {
    max-width: 92vw; max-height: 88vh;
    border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
    background: #fff;
}
.lightbox .close {
    position: absolute; top: 18px; right: 18px;
    width: 38px; height: 38px; border-radius: 50%;
    border: none; background: rgba(255, 255, 255, .16); color: #fff;
    display: grid; place-items: center; cursor: pointer;
}
.lightbox .close:hover { background: rgba(255, 255, 255, .3); }

.zoomable { cursor: zoom-in; }

/* =============================================================================
   Editare pe loc: popover ancorat langa campul pe care dai click
   ========================================================================== */
.editable {
    cursor: pointer;
    border-radius: 6px;
    transition: background .14s ease, box-shadow .14s ease;
}
.editable:hover { background: var(--brand-tint); box-shadow: 0 0 0 4px var(--brand-tint); }
.order-card.is-open > .order-row .editable:hover {
    background: rgba(255, 255, 255, .16); box-shadow: 0 0 0 4px rgba(255, 255, 255, .16);
}

.popover-veil { position: fixed; inset: 0; z-index: 90; background: transparent; }

.popover {
    position: absolute; z-index: 91;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    width: 300px;
    max-height: 70vh;
    overflow-y: auto;
}
.popover.is-wide { width: 340px; }

.popover-title {
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; color: var(--text-soft); margin-bottom: 10px;
}

.popover-field { margin-bottom: 10px; }
.popover-field label {
    display: block; font-size: var(--fs-xs); color: var(--text-soft);
    margin-bottom: 4px; font-weight: 600;
}
.popover-field .input, .popover-field .textarea { font-size: var(--fs-sm); }
.popover-field .input { height: 34px; }

.popover-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}

/* Lista de statusuri din popover */
.popover-status-list { display: flex; flex-direction: column; gap: 5px; }
.popover-status {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 7px; border: 1px solid transparent;
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; cursor: pointer; text-align: left; width: 100%;
    transition: box-shadow .14s ease;
}
.popover-status:hover { box-shadow: 0 0 0 2px var(--brand-light); }
.popover-status.is-current { box-shadow: 0 0 0 2px var(--brand); }
.popover-status .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.popover-status .check { margin-left: auto; }

.popover-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 8px; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(30, 42, 58, .5);
    display: none; place-items: center; padding: 20px; z-index: 100;
}
.modal-backdrop.is-open { display: grid; }
.modal {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 470px;
    max-height: 88vh; overflow-y: auto; padding: 22px;
}
.modal h3 { margin: 0 0 15px; font-size: var(--fs-lg); }

/* =============================================================================
   Dialoguri proprii, in locul celor din browser
   ========================================================================== */
.dialog-backdrop { z-index: 140; }

.dialog { max-width: 420px; }

.dialog-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.dialog-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }

.dialog-icon {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    background: var(--brand-tint); color: var(--brand);
}
.dialog-icon.is-danger { background: var(--red-bg); color: var(--red); }
.dialog-icon .icon { width: 18px; height: 18px; }

.dialog-text {
    margin: 0 0 14px; color: var(--text-soft);
    font-size: var(--fs-sm); line-height: 1.55;
}

.dialog-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    margin-top: 16px; padding-top: 13px;
    border-top: 1px solid var(--border-soft);
}

.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border); border-radius: 22px; transition: background .18s ease;
}
.switch .slider::before {
    content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
    background: var(--white); border-radius: 50%; transition: transform .18s ease;
}
.switch input:checked + .slider { background: var(--brand-light); }
.switch input:checked + .slider::before { transform: translateX(16px); }

.mono { font-family: 'SF Mono', 'Roboto Mono', ui-monospace, Menlo, monospace; font-size: var(--fs-sm); }

.checkbox { width: 16px; height: 16px; accent-color: var(--brand-light); cursor: pointer; }

/* =============================================================================
   Responsive
   ========================================================================== */
/* Sub 1280px coloana de e-mail iese, ca sa ramana loc pentru Actiuni */
@media (max-width: 1280px) {
    .orders-table { --cols: 26px 22px 72px 110px 96px 104px minmax(120px,1fr) 134px minmax(140px,1.1fr) 0 124px; }
    .orders-table .cell-hide-md { display: none; }
}

@media (max-width: 1400px) {
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .detail-col:nth-child(3) { grid-column: 1 / -1; border-left: none; padding-left: 0;
                               margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
}

@media (max-width: 1100px) {
    .form-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .form-cols-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .table-head { display: none; }
    .order-row { grid-template-columns: 28px 1fr auto; gap: 8px; }
    .order-row .cell-hide-sm { display: none; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-col + .detail-col { border-left: none; padding-left: 0; margin-top: 14px;
                                padding-top: 14px; border-top: 1px solid var(--border-soft); }
    .table-wrap, .topbar, .status-bar { padding-left: 16px; padding-right: 16px; }
    .detail-row { grid-template-columns: 1fr; gap: 2px; }
    .products-table { display: block; overflow-x: auto; }
}

@media (max-width: 640px) {
    :root { --fs-title: 21px; --fs-base: 13.5px; }
    .form-cols-2, .form-cols-4 { grid-template-columns: 1fr; }
    .detail-footer { flex-direction: column; align-items: stretch; }
}

/* =============================================================================
   Filtrul avansat de comenzi
   ========================================================================== */
.search-extra { position: relative; }
.search-extra.has-filters { color: var(--brand); background: var(--brand-tint); }
.filter-count {
    position: absolute; top: 3px; right: 3px;
    min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 8px; background: var(--brand); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}

.filter-sheet {
    margin: 0 20px 14px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.filter-sheet-body { padding: 16px 18px 4px; max-height: 66vh; overflow-y: auto; }

.filter-section { margin-bottom: 18px; }
.filter-section h4 {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 12px; font-size: var(--fs-lg); font-weight: 700; color: var(--text);
}
.filter-section h4::after {
    content: ''; flex: 1; height: 1px; background: var(--border-soft);
}

.filter-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 14px; }
.filter-field { margin-bottom: 0; }
.filter-field-wide { grid-column: span 2; }

/* Casuta si modul de potrivire stau lipite, ca sa se citeasca dintr-o privire
   „Comentariu manager: conține ...". */
.filter-input { display: flex; gap: 0; }
.filter-input .input { flex: 1; min-width: 0; border-radius: 8px 0 0 8px; }
.filter-input .filter-mode {
    width: 108px; flex: none;
    border-radius: 0 8px 8px 0; border-left: none;
    font-size: var(--fs-xs); color: var(--text-soft); background-color: var(--brand-tint);
    padding-left: 8px; padding-right: 20px;
}
.filter-input .filter-mode-wide { width: 130px; border-radius: 8px 0 0 8px; border-left: 1px solid var(--border); border-right: none; }
.filter-input .filter-mode-wide + .input { border-radius: 0 8px 8px 0; }
.filter-input .input:disabled { background: var(--gray); color: var(--text-muted); }

.filter-range { display: flex; align-items: center; gap: 6px; }
.filter-range .input { min-width: 0; }
.filter-dash { color: var(--text-muted); }

.check-line {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--fs-sm); color: var(--text-soft); margin-top: 7px; cursor: pointer;
}
.check-line span { font-weight: 500; }

.filter-sheet-actions {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--border-soft); background: var(--brand-tint);
}

.filter-saved {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border-soft);
}
.filter-saved-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft);
}
.saved-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 6px 0 11px;
    border-radius: 14px; background: var(--brand-tint); border: 1px solid var(--brand-tint-2);
    font-size: var(--fs-sm);
}
.saved-chip a { color: var(--brand-dark); font-weight: 600; }
.saved-shared { color: var(--brand); font-weight: 700; }
.saved-x {
    border: none; background: none; cursor: pointer;
    color: var(--text-muted); font-size: 15px; line-height: 1; padding: 0 3px;
}
.saved-x:hover { color: var(--red); }

/* =============================================================================
   Comenzi: comentariul managerului si telefonul in rand
   ========================================================================== */
.comment-cell { min-width: 0; }
.comment-inline {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: var(--fs-sm); color: var(--text-soft); line-height: 1.35;
}
.phone-link { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =============================================================================
   Livrare: starea coletului
   ========================================================================== */
.badge-step {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 12px;
    font-size: var(--fs-xs); font-weight: 700;
    background: var(--gray); color: var(--text-soft);
}
.badge-step.is-nepregatit { background: var(--gray);        color: var(--text-soft); }
.badge-step.is-impachetat { background: var(--yellow-tint); color: #8a6d14; }
.badge-step.is-pe_drum    { background: var(--brand-tint);  color: var(--brand-dark); }
.badge-step.is-finalizat  { background: var(--green-bg);    color: #14663f; }

.badge-flag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 11px; margin-right: 4px;
    background: var(--brand-tint); color: var(--brand-dark);
    font-size: var(--fs-xs); font-weight: 700;
}
.badge-late {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 11px;
    background: var(--red-bg); color: #a52e26; font-size: var(--fs-xs); font-weight: 700;
}
.badge-hour {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 7px; border-radius: 10px;
    background: var(--yellow-tint); color: #8a6d14; font-size: var(--fs-xs); font-weight: 700;
}

/* =============================================================================
   Harta
   ========================================================================== */
.mini-map { margin-top: 12px; }
.mini-map-canvas {
    height: 170px; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); background: var(--gray);
}
.mini-map-note { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 5px; }

.route-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.route-map-wrap { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 10px; }
.route-map { height: 66vh; min-height: 380px; border-radius: var(--radius); overflow: hidden; background: var(--gray); }
.route-summary { font-size: var(--fs-sm); color: var(--text-soft); padding: 9px 4px 2px; font-weight: 600; }

.route-stops {
    list-style: none; margin: 0; padding: 8px;
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    max-height: 72vh; overflow-y: auto;
}
.route-stop {
    display: flex; gap: 11px; padding: 11px 9px;
    border-bottom: 1px solid var(--border-soft);
}
.route-stop:last-child { border-bottom: none; }
.route-stop.is-missing { opacity: .55; }
.route-num {
    flex: none; width: 25px; height: 25px; border-radius: 50%;
    background: var(--brand-light); color: #fff;
    font-size: var(--fs-sm); font-weight: 700;
    display: grid; place-items: center;
}
.route-stop-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.route-stop-meta {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px;
}
.route-marker span {
    display: grid; place-items: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--brand); color: #fff;
    font-size: 12px; font-weight: 700;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

/* =============================================================================
   Panoul curierului
   ========================================================================== */
.inline-date { display: flex; align-items: center; gap: 8px; }
.inline-date label { font-size: var(--fs-sm); color: var(--text-soft); font-weight: 600; }
.inline-date .input { height: 30px; width: 150px; }
.btn.is-on { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand-tint-2); }

.parcel-list { display: flex; flex-direction: column; gap: 11px; }
.parcel {
    display: grid; grid-template-columns: 26px 1fr 190px; gap: 12px;
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    padding: 14px 16px;
    border-left: 3px solid transparent;
}
.parcel.is-late { border-left-color: var(--red); }
.parcel.is-done { opacity: .55; }
.parcel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.parcel-no { font-weight: 700; font-size: var(--fs-lg); }
.parcel-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.parcel-address {
    display: flex; align-items: flex-start; gap: 6px;
    margin-top: 4px; color: var(--text-soft); font-size: var(--fs-sm);
}
.parcel-address .icon { flex: none; margin-top: 2px; color: var(--brand); }
.parcel-meta {
    display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px;
    font-size: var(--fs-xs); color: var(--text-muted); align-items: center;
}
.parcel-meta .icon { color: var(--text-muted); }
.parcel-steps { display: flex; flex-direction: column; gap: 6px; }
.step-btn {
    justify-content: center;
    background: var(--white); color: var(--text-soft); border: 1px solid var(--border);
}
.step-btn:hover { background: var(--gray); }
.step-btn.is-current { background: var(--brand-light); color: #fff; border-color: var(--brand-light); }
.step-chip .dot { background: var(--text-muted); }
.step-chip.is-impachetat .dot { background: var(--yellow); }
.step-chip.is-pe_drum .dot    { background: var(--brand-light); }
.step-chip.is-finalizat .dot  { background: var(--green); }

@media (max-width: 1280px) {
    .filter-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
    .route-layout { grid-template-columns: 1fr; }
    .route-map { height: 46vh; }
    .parcel { grid-template-columns: 26px 1fr; }
    .parcel-steps { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .filter-grid { grid-template-columns: 1fr; }
    .filter-field-wide { grid-column: span 1; }
    .filter-sheet { margin-left: 16px; margin-right: 16px; }
}
