:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #202124;
    background: #f5f6f8;
}

* { box-sizing: border-box; }

body { margin: 0; }

a { color: inherit; }

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 245px;
    flex: 0 0 245px;
    background: #17181c;
    color: #fff;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-weight: 900;
    letter-spacing: .09em;
    line-height: 1.15;
    font-size: 20px;
    margin-bottom: 34px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar nav a {
    text-decoration: none;
    padding: 12px 13px;
    border-radius: 9px;
    color: #d6d8dd;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #2b2d33;
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    color: #858994;
}

.main {
    min-width: 0;
    flex: 1;
    padding: 36px clamp(18px, 4vw, 55px) 60px;
}

.mobile-topbar {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 28px;
}

.page-header.compact { align-items: center; }

.eyebrow {
    color: #737780;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    margin-bottom: 6px;
}

h1 {
    font-size: clamp(30px, 4vw, 42px);
    margin: 0 0 7px;
}

h2 { margin: 0; }

.page-header p, .muted {
    color: #737780;
    margin: 0;
}

.primary-button,
.secondary-button,
.search button {
    border: 0;
    border-radius: 9px;
    padding: 11px 16px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.primary-button,
.search button {
    background: #202124;
    color: #fff;
}

.secondary-button {
    background: #e7e9ed;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.metric-card {
    text-decoration: none;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 14px;
    padding: 21px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: transform .12s ease, box-shadow .12s ease;
}

.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgba(0,0,0,.06);
}

.metric-card span {
    color: #6d717a;
    font-size: 14px;
}

.metric-card strong {
    font-size: 34px;
    line-height: 1.1;
}

.metric-card small {
    color: #858993;
}

.metric-card.danger { border-left: 5px solid #d93025; }
.metric-card.critical { border-left: 5px solid #ea4335; }
.metric-card.low { border-left: 5px solid #f9ab00; }

.section-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
}

.panel {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 14px;
    padding: 22px;
}

.panel-title { margin-bottom: 17px; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-actions a {
    text-decoration: none;
    background: #f4f5f7;
    border-radius: 9px;
    padding: 14px;
    font-weight: 700;
}

.search {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    font-size: 16px;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-row a {
    text-decoration: none;
    padding: 8px 12px;
    background: #e9ebef;
    border-radius: 999px;
    font-size: 13px;
}

.filter-row a.selected {
    background: #202124;
    color: #fff;
}

.table-panel {
    padding: 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 13px 15px;
    text-align: left;
    border-bottom: 1px solid #eceff1;
    white-space: nowrap;
}

th {
    background: #fafafa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6f737c;
}

.code-link {
    color: #1769e0;
    text-decoration: none;
    font-weight: 800;
}

.quantity {
    font-weight: 800;
}

.status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status.esaurito { background: #fce8e6; }
.status.critico { background: #fde9e7; }
.status.basso { background: #fff4d6; }
.status.ok { background: #e7f5ea; }

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
}

.pagination a {
    color: #1769e0;
    text-decoration: none;
    font-weight: 700;
}

.pagination a:last-child { text-align: right; }

.empty {
    color: #737780;
    text-align: center;
    padding: 30px;
}

.piece-card { margin-top: 10px; }

.piece-title {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.details div {
    background: #f7f8fa;
    border-radius: 10px;
    padding: 15px;
}

.details span {
    display: block;
    color: #737780;
    font-size: 12px;
    margin-bottom: 6px;
}

@media (max-width: 950px) {
    .sidebar { width: 205px; flex-basis: 205px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .app-shell { display: block; }

    .sidebar {
        display: none;
    }

    .mobile-topbar {
        display: block;
        background: #17181c;
        color: #fff;
        padding: 16px 18px;
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .mobile-topbar .brand {
        margin: 0;
        font-size: 16px;
    }

    .main {
        padding: 22px 12px 45px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
        text-align: center;
    }

    .cards { gap: 10px; }

    .metric-card { padding: 15px; }

    .metric-card strong { font-size: 28px; }

    .details { grid-template-columns: repeat(2, 1fr); }

    .quick-actions { grid-template-columns: 1fr; }
}


.metric-card.blue {
    border-left: 5px solid #4285f4;
}

.secondary-cards {
    margin-top: 0;
}

.demand-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.demand-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.notice {
    background: #fff4d6;
    border: 1px solid #f4d27a;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

@media (max-width: 700px) {
    .demand-summary {
        grid-template-columns: 1fr 1fr;
    }

    .demand-toolbar {
        display: block;
    }

    .demand-toolbar .filter-row {
        margin-bottom: 8px;
    }
}


.piece-subtitle {
    color: #737780;
    margin: 7px 0 0;
}

.piece-section {
    margin-top: 28px;
    margin-bottom: 14px;
}

.sales-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.sale-card {
    background: #f7f8fa;
    border-radius: 11px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sale-card span {
    color: #737780;
    font-size: 12px;
}

.sale-card strong {
    font-size: 27px;
}

.sale-card small {
    color: #858993;
}

.piece-insight {
    margin-top: 18px;
    padding: 16px;
    border-radius: 11px;
    background: #f7f8fa;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.piece-insight > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.piece-insight span,
.piece-insight small {
    color: #737780;
}

.insight-danger strong { color: #b3261e; }
.insight-warning strong { color: #b06000; }
.insight-ok strong { color: #1e7e34; }

@media (max-width: 900px) {
    .sales-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .piece-insight {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .sales-cards {
        grid-template-columns: 1fr 1fr;
    }

    .sale-card strong {
        font-size: 23px;
    }
}


.userbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #737780;
    font-size: 13px;
}

.userbar form {
    margin: 0;
}

.logout-button {
    border: 0;
    background: transparent;
    color: #1769e0;
    font-weight: 700;
    cursor: pointer;
}

.inline-action {
    margin: 0;
}

.inline-action button {
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 14px;
    font-weight: 700;
    cursor: pointer;
    font-size: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #f5f6f8;
}

.login-card {
    width: min(430px, 100%);
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 16px;
    padding: 34px;
    box-shadow: 0 12px 35px rgba(0,0,0,.06);
}

.login-card .brand {
    color: #17181c;
    margin-bottom: 45px;
}

.login-form {
    display: grid;
    gap: 17px;
    margin-top: 25px;
}

.login-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: 14px;
}

.login-form input {
    padding: 12px 13px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    font-size: 16px;
}

.login-form button {
    border: 0;
    border-radius: 9px;
    padding: 12px 16px;
    background: #202124;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.login-error {
    margin-top: 16px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #fce8e6;
    color: #a50e0e;
}


.duplicate-group {
    padding: 18px 0;
    border-bottom: 1px solid #e5e7eb;
}

.duplicate-group:last-child {
    border-bottom: 0;
}

.duplicate-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.duplicate-heading strong {
    font-size: 17px;
}

.duplicate-heading span {
    color: #737780;
}

.duplicate-heading b {
    margin-left: auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff3cd;
    color: #8a5a00;
    font-size: 12px;
}


.import-complete-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    clear: both;
}

.import-complete-actions .primary-button,
.import-complete-actions .secondary-button {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.threshold-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.threshold-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.threshold-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.threshold-input-row label {
    color: #737780;
    font-size: 13px;
    min-width: 90px;
}

.threshold-input-row input[type="number"] {
    width: 86px;
    padding: 8px 10px;
    border: 1px solid #d9dde3;
    border-radius: 9px;
    background: #fff;
    font-size: 18px;
    font-weight: 700;
}

.threshold-input-row span {
    color: #737780;
    font-size: 13px;
}

.threshold-save {
    align-self: flex-start;
    border: 0;
    cursor: pointer;
    margin-top: 4px;
}

.flash-messages {
    margin: 0 0 16px;
}

.flash {
    padding: 11px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

.flash-success {
    background: #e8f6ec;
    color: #176b36;
}

.flash-error {
    background: #fdecec;
    color: #9b1c1c;
}


.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-kpi {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 14px;
    padding: 17px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    transition: transform .12s ease, box-shadow .12s ease;
}

.dashboard-kpi:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgba(0,0,0,.06);
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #f0f2f5;
    color: #4f535b;
    font-weight: 900;
    flex: 0 0 38px;
}

.dashboard-kpi small {
    display: block;
    color: #737780;
    font-size: 11px;
    margin-bottom: 3px;
}

.dashboard-kpi strong {
    display: block;
    font-size: 25px;
    line-height: 1.1;
}

.dashboard-kpi.kpi-danger { border-left: 4px solid #d93025; }
.dashboard-kpi.kpi-warning { border-left: 4px solid #ea4335; }
.dashboard-kpi.kpi-low { border-left: 4px solid #f9ab00; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-panel {
    min-width: 0;
}

.dashboard-panel-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dashboard-panel-title > a {
    color: #1769e0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

.dashboard-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #eceff1;
    text-decoration: none;
    min-width: 0;
}

.dashboard-list-row:last-child {
    border-bottom: 0;
}

.dashboard-list-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-list-main strong {
    color: #1769e0;
    font-size: 14px;
}

.dashboard-list-main span {
    color: #737780;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-list-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.dashboard-list-stock > strong {
    font-size: 16px;
}

.dashboard-list-stock > span:not(.status) {
    color: #737780;
    font-size: 12px;
}

.demand-number {
    min-width: 76px;
    justify-content: flex-end;
}

.dashboard-empty {
    padding: 28px 8px 8px;
    color: #737780;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 18px;
    margin-bottom: 18px;
}

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.summary-metrics a {
    background: #f7f8fa;
    border-radius: 10px;
    padding: 14px;
    text-decoration: none;
}

.summary-metrics span {
    display: block;
    color: #737780;
    font-size: 11px;
    margin-bottom: 5px;
}

.summary-metrics strong {
    font-size: 22px;
}

.dashboard-quick-actions {
    margin-top: 15px;
}

.dashboard-system {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.dashboard-system p {
    color: #737780;
    margin: 5px 0 0;
}

@media (max-width: 1100px) {
    .dashboard-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid,
    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .dashboard-hero {
        align-items: flex-start;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions a {
        flex: 1 1 100%;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-kpi {
        padding: 13px;
    }

    .dashboard-kpi strong {
        font-size: 22px;
    }

    .dashboard-list-row {
        align-items: flex-start;
    }

    .dashboard-list-stock {
        flex-direction: column;
        align-items: flex-end;
    }

    .summary-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-system {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-system .secondary-button {
        width: 100%;
    }
}


.inventory-toolbar {
    margin-bottom: 15px;
}

.inventory-search {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.inventory-search input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    font-size: 16px;
}

.inventory-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-filters select {
    min-width: 145px;
    padding: 10px 12px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
}

.inventory-filters .secondary-button {
    display: inline-flex;
    align-items: center;
}

.inventory-meta {
    display: flex;
    justify-content: space-between;
    color: #737780;
    font-size: 13px;
    margin: 0 0 10px;
}

.inventory-table-panel th a {
    color: inherit;
    text-decoration: none;
}

.description-cell {
    max-width: 520px;
    white-space: normal;
    line-height: 1.35;
}

@media (max-width: 700px) {
    .inventory-search {
        flex-direction: column;
    }

    .inventory-search .primary-button {
        width: 100%;
    }

    .inventory-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .inventory-filters select,
    .inventory-filters .secondary-button,
    .inventory-filters a {
        width: 100%;
        min-width: 0;
    }

    .inventory-meta {
        font-size: 12px;
    }

    .description-cell {
        max-width: 300px;
    }
}


.demand-search-panel {
    margin-bottom: 14px;
}

.demand-search {
    display: flex;
    gap: 10px;
}

.demand-search input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    font-size: 16px;
}

.demand-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demand-summary .metric-card {
    min-width: 0;
}

@media (max-width: 700px) {
    .demand-search {
        flex-direction: column;
    }

    .demand-search .primary-button {
        width: 100%;
    }

    .demand-summary {
        grid-template-columns: 1fr;
    }
}


.analysis-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}

.analysis-note {
    margin-bottom: 14px;
    color: #555a62;
    font-size: 13px;
    line-height: 1.5;
}

.analysis-action {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}

.analysis-action.high {
    background: #fde8e7;
    color: #a11a12;
}

.analysis-action.critical {
    background: #fff0df;
    color: #9a5300;
}

.analysis-action.low {
    background: #fff7d9;
    color: #806200;
}

.analysis-action.warning {
    background: #e8f0ff;
    color: #2458a6;
}

.analysis-action.ok {
    background: #e8f6ec;
    color: #176b36;
}

@media (max-width: 900px) {
    .analysis-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .analysis-summary {
        grid-template-columns: 1fr;
    }
}


.exhaustion-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.exhaustion-tabs a {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 13px;
    padding: 15px 17px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.exhaustion-tabs a.selected {
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

.exhaustion-tabs a > span {
    font-size: 21px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f2f3f5;
}

.exhaustion-tabs strong,
.exhaustion-tabs small {
    display: block;
}

.exhaustion-tabs small {
    color: #737780;
    margin-top: 2px;
}

.exhausted-tab.selected { border-color: #d93025; }
.critical-tab.selected { border-color: #ea4335; }
.low-tab.selected { border-color: #f9ab00; }

.exhaustion-toolbar {
    margin-bottom: 10px;
}

.exhaustion-search {
    display: flex;
    gap: 9px;
}

.exhaustion-search input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    font-size: 16px;
}

.exhaustion-info {
    color: #737780;
    font-size: 13px;
    margin: 0 0 9px;
}

@media (max-width: 700px) {
    .exhaustion-tabs {
        grid-template-columns: 1fr;
    }

    .exhaustion-search {
        flex-direction: column;
    }

    .exhaustion-search .primary-button,
    .exhaustion-search .secondary-button {
        width: 100%;
    }
}

.exhaustion-sort {
    display:flex;
    align-items:center;
    gap:9px;
    margin-top:10px;
}
.exhaustion-sort label {
    color:#737780;
    font-size:13px;
    font-weight:700;
}
.exhaustion-sort select {
    min-width:250px;
    padding:10px 12px;
    border:1px solid #cfd4da;
    border-radius:9px;
    background:#fff;
    font-size:14px;
}
@media (max-width:700px) {
    .exhaustion-sort {
        flex-direction:column;
        align-items:stretch;
    }
    .exhaustion-sort select {
        min-width:0;
        width:100%;
    }
}


.replenishment-note {
    color: #555a62;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.replenishment-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}

.replenishment-toolbar {
    margin-bottom: 12px;
}

.replenishment-search {
    display: flex;
    gap: 9px;
}

.replenishment-search input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    font-size: 16px;
}

.replenishment-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.replenishment-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #737780;
    font-size: 13px;
    font-weight: 700;
}

.replenishment-controls select {
    padding: 9px 11px;
    border: 1px solid #cfd4da;
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
}

@media (max-width: 700px) {
    .replenishment-summary {
        grid-template-columns: 1fr;
    }

    .replenishment-search {
        flex-direction: column;
    }

    .replenishment-search .primary-button {
        width: 100%;
    }

    .replenishment-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .replenishment-controls label,
    .replenishment-controls select {
        width: 100%;
    }
}

.replenishment-export {
    display:flex;
    justify-content:flex-end;
    margin: -8px 0 14px;
}


.purchase-edit-form,.purchase-actions{display:flex;align-items:center;gap:7px}
.purchase-qty{width:78px;padding:8px 9px;border:1px solid #cfd4da;border-radius:8px;font-size:14px;box-sizing:border-box}
.purchase-actions{justify-content:space-between;margin-bottom:14px}
.danger-button{padding:10px 13px;border:0;border-radius:9px;background:#fde8e7;color:#a11a12;font-weight:700;cursor:pointer}
.text-danger-button{background:transparent;border:0;color:#a11a12;font-weight:700;cursor:pointer}
.purchase-summary{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:14px}
@media(max-width:700px){.purchase-summary{grid-template-columns:1fr}.purchase-edit-form{flex-direction:column;align-items:stretch}.purchase-qty{width:100%}}

.piece-purchase {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
    margin-top:18px;
    padding:20px;
}
.piece-purchase h2 {
    margin:5px 0 6px;
}
.piece-purchase p {
    margin:0;
    color:#737780;
}
.piece-purchase-form {
    display:flex;
    align-items:center;
    gap:9px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.piece-purchase-form label {
    color:#737780;
    font-weight:700;
    font-size:13px;
}
.piece-purchase-form .purchase-qty {
    width:90px;
}
@media (max-width:800px) {
    .piece-purchase {
        flex-direction:column;
        align-items:stretch;
    }
    .piece-purchase-form {
        justify-content:flex-start;
    }
}

.purchase-actions-right {
    display:flex;
    align-items:center;
    gap:8px;
}
@media(max-width:700px) {
    .purchase-actions-right {
        flex-direction:column;
        align-items:stretch;
        width:100%;
    }
}


.purchase-filters{display:flex;gap:8px;margin:0 0 14px}
.purchase-filters a{padding:8px 12px;border:1px solid #d7dbe0;border-radius:9px;text-decoration:none;color:#5f6670;font-weight:700;font-size:13px;background:#fff}
.purchase-filters a.selected{background:#202124;color:#fff;border-color:#202124}
.purchase-status{border:0;border-radius:999px;padding:8px 11px;font-weight:700;cursor:pointer;font:inherit}
.purchase-status.pending{background:#fff2d4;color:#8a5a00}
.purchase-status.purchased{background:#e5f5ea;color:#1e6a35}
@media(max-width:700px){.purchase-filters{flex-wrap:wrap}}

.purchase-note-form {
    display:flex;
    align-items:center;
    gap:6px;
}
.purchase-note-input {
    width:180px;
    max-width:18vw;
    padding:8px 9px;
    border:1px solid #cfd4da;
    border-radius:8px;
    font:inherit;
    box-sizing:border-box;
}
@media(max-width:900px) {
    .purchase-note-form {
        flex-direction:column;
        align-items:stretch;
    }
    .purchase-note-input {
        width:100%;
        max-width:none;
    }
}
