* {
    box-sizing: border-box;
}

:root {
    --background: #171b20;
    --sidebar: #20252b;
    --panel: #242a31;
    --panel-light: #2b323a;
    --border: #363e47;
    --text: #f2f4f7;
    --muted: #9da7b3;
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --blue: #38bdf8;
    --orange: #f59e0b;
    --red: #ef4444;
    --purple: #a78bfa;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow-x: hidden;
}

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

.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 24px;
    font-size: 25px;
    font-weight: 800;
    border-bottom: 1px solid var(--border);
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 22px;
    color: #d4dae1;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background: #2a3037;
    color: white;
    border-left-color: var(--primary);
}

.sidebar i {
    width: 22px;
    text-align: center;
}

.main {
    width: calc(100% - 245px);
    padding: 25px;
}

.page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.page-topbar h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

.page-topbar p {
    margin: 0;
    color: var(--muted);
}

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

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button.primary {
    background: var(--primary);
    color: #07140b;
}

.button.primary:hover {
    background: var(--primary-dark);
    color: white;
}

.button.secondary {
    background: var(--panel-light);
    border-color: var(--border);
    color: white;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(125px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.dot-all {
    background: #94a3b8;
}

.status-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    min-height: 65px;
    padding: 13px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.status-card:hover,
.status-card.active {
    background: var(--panel-light);
    border-color: #64748b;
}

.status-card-name {
    font-size: 13px;
    line-height: 1.2;
}

.status-card strong {
    font-size: 22px;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #64748b;
}

.dot-orange {
    background: var(--orange);
}

.status-new {
    background: var(--orange);
}

.status-payment {
    background: #dc2626;
}

.status-waiting {
    background: var(--blue);
}

.status-picking {
    background: var(--purple);
}

.status-ready {
    background: #06b6d4;
}

.status-shipped {
    background: var(--primary);
}

.status-cancelled {
    background: #64748b;
}

.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
    padding: 15px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.filter-search {
    grid-column: span 2;
}

.search-scope-option {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin: 7px 0 0 !important;
    color: #cbd5e1 !important;
    cursor: pointer;
    user-select: none;
}

.filters .search-scope-option input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    accent-color: #3b82f6;
}

.search-scope-option span {
    font-size: 12px;
    font-weight: 700;
}

.search-scope-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 14px;
    padding: 9px 12px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, .12);
    border: 1px solid rgba(96, 165, 250, .30);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
}

.search-scope-notice i {
    color: #60a5fa;
}

.search-scope-notice span {
    color: #94a3b8;
    font-weight: 500;
}

.search-scope-notice.is-hidden {
    display: none;
}

.filter-actions {
    align-self: end;
}

.filters label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.filters input,
.filters select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    color: white;
    background: #171b20;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.filter-actions {
    display: flex;
    gap: 7px;
}

.orders-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.orders-panel-header {
    display: flex;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.orders-panel-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.orders-panel-header span {
    color: var(--muted);
    font-size: 13px;
}

.table-scroll {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    min-width: 1380px;
    border-collapse: collapse;
}

.orders-table th {
    padding: 12px 10px;
    background: #303740;
    color: #cdd3db;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

.orders-table td {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    vertical-align: top;
    font-size: 13px;
}

.order-row {
    cursor: pointer;
}

.order-row:hover {
    background: #2a3139;
}

.check-column {
    width: 35px;
}

.order-number strong {
    display: block;
    color: var(--blue);
    font-size: 14px;
}

.order-number small,
.buyer-cell small,
.delivery-cell small,
.products-cell small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.buyer-login-link {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    user-select: text;
}

.buyer-login-link:hover {
    color: var(--blue);
    text-decoration: underline;
}

.order-date {
    white-space: nowrap;
}

.buyer-cell {
    min-width: 180px;
}

.products-cell {
    min-width: 270px;
}

.product-line {
    margin-bottom: 4px;
    line-height: 1.3;
}

.picking-progress {
    display: inline-block;
    margin-top: 7px;
    padding: 3px 7px;
    background: #182029;
    color: #cbd5e1;
    border-radius: 4px;
    font-size: 11px;
}

.payment-cell strong {
    display: block;
    margin-top: 5px;
    white-space: nowrap;
}

.payment-paid {
    color: #4ade80;
    font-weight: 700;
}

.payment-waiting {
    color: #fbbf24;
    font-weight: 700;
}

.delivery-cell {
    min-width: 210px;
}

.info-cell {
    white-space: nowrap;
}

.info-badge,
.icon-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 34px;
    min-height: 30px;
    margin-right: 4px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 800;
}

.info-badge.invoice {
    background: #2563eb;
    color: white;
}

.icon-button {
    border: 1px solid var(--border);
    background: #313944;
    color: white;
    cursor: pointer;
}

.icon-button:hover {
    background: #3e4854;
}

.message-button {
    border-color: #d97706;
    background: #92400e;
    color: #fef3c7;
    font-size: 14px;
}

.message-button:hover {
    background: #b45309;
}

.inventory-operation {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.inventory-operation h2 {
    margin-top: 0;
}

.inventory-operation form {
    display: grid;
    grid-template-columns:
        minmax(240px, 2fr)
        minmax(130px, .8fr)
        minmax(100px, .7fr)
        minmax(145px, 1fr)
        minmax(150px, 1fr)
        auto;
    gap: 12px;
    align-items: end;
}

.inventory-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.inventory-section-heading h2 {
    margin: 0 0 5px;
}

.inventory-section-heading p {
    margin: 0;
    color: var(--muted);
}

.inventory-shortcut {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid #365477;
    border-radius: 20px;
    background: #1e3551;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 700;
}

.quick-stock-entry {
    display: grid;
    grid-template-columns:
        minmax(300px, 2fr)
        minmax(120px, .65fr)
        minmax(155px, .8fr)
        minmax(190px, 1fr)
        auto;
    gap: 12px;
    align-items: end;
}

.quick-stock-entry > div:not(.autocomplete-field) {
    min-width: 0;
}

.quick-stock-entry label {
    display: block;
    margin-bottom: 6px;
}

.quick-stock-entry input {
    width: 100%;
}

.quick-stock-batch {
    display: block !important;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #365477;
    border-radius: 10px;
    background: rgba(30, 53, 81, .35);
}

.quick-stock-batch[hidden] {
    display: none !important;
}

.quick-stock-summary,
.quick-stock-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.quick-stock-summary {
    margin-bottom: 10px;
}

.quick-stock-summary span {
    color: #93c5fd;
    font-weight: 700;
}

.quick-stock-table {
    width: 100%;
    border-collapse: collapse;
}

.quick-stock-table th,
.quick-stock-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.quick-stock-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.quick-stock-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.quick-stock-remove {
    padding: 6px 8px;
    border: 1px solid #7f1d1d;
    border-radius: 6px;
    background: #451a1a;
    color: #fecaca;
    cursor: pointer;
}

.stock-change-positive {
    color: #4ade80;
    font-weight: 800;
}

.stock-change-negative {
    color: #f87171;
    font-weight: 800;
}

.stock-result {
    color: #93c5fd;
    font-weight: 800;
}

.autocomplete-field {
    position: relative;
}

.suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    overflow: auto;
    max-height: 320px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #202733;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .45);
}

.suggestion-item,
.suggestion-empty {
    display: flex;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: white;
    text-align: left;
}

.suggestion-item {
    flex-direction: column;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #374151;
}

.suggestion-item small {
    margin-top: 3px;
    color: var(--muted);
}

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

.inventory-search input {
    width: min(480px, 100%);
}

.stock-adjust-input {
    width: 92px;
    border-color: #365477;
    text-align: center;
}

.stock-adjust-input:not(:placeholder-shown) {
    border-color: #60a5fa;
    background: #172b45;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, .12);
}

.inline-stock-savebar {
    position: sticky;
    z-index: 25;
    right: 0;
    bottom: 14px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 16px 0 0;
    padding: 13px 16px;
    border: 1px solid #2563eb;
    border-radius: 10px;
    background: #14243a;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .5);
}

.inline-stock-savebar[hidden] {
    display: none;
}

.inline-stock-savebar div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.inline-stock-savebar strong {
    color: #93c5fd;
}

.inline-stock-savebar span {
    color: var(--muted);
    font-size: 12px;
}

.product-settings-form {
    display: grid;
    grid-template-columns:
        100px
        90px
        minmax(190px, 1.3fr)
        minmax(110px, 1fr)
        auto;
    gap: 10px;
    align-items: center;
}

.purchase-quantity {
    color: #fbbf24;
    text-align: center;
}

.purchase-price-field {
    min-width: 190px;
}

.price-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-input input {
    width: 115px;
}

.price-input span {
    color: var(--muted);
}

.price-change {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    white-space: nowrap;
}

.price-up {
    color: #f87171;
}

.price-down {
    color: #4ade80;
}

.price-same,
.price-missing {
    color: var(--muted);
}

.stock-negative {
    color: #f87171;
    font-weight: 800;
}

.post-sale-sync-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.post-sale-sync-state {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 13px 15px;
    border: 1px solid #285c46;
    border-radius: 9px;
    background: rgba(22, 101, 52, .16);
}

.post-sale-sync-state span {
    color: #86efac;
    font-size: 12px;
}

.post-sale-sync-state.error {
    border-color: #854d0e;
    background: rgba(146, 64, 14, .16);
}

.post-sale-sync-state.error span {
    color: #fcd34d;
}

.post-sale-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.post-sale-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: #dbe4ee;
    text-decoration: none;
}

.post-sale-tabs a.active {
    border-color: #3b82f6;
    background: #1e3a5f;
    color: #ffffff;
}

.post-sale-tabs span {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.post-sale-sort {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}

.post-sale-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.post-sale-tools .post-sale-sort {
    margin: 0;
}

.post-sale-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.post-sale-search input {
    width: min(430px, 100%);
    border: 1px solid #46515d;
    border-radius: 8px;
    background: #20272e;
    color: #f3f5f7;
    padding: 9px 12px;
    font: inherit;
}

.post-sale-sort label {
    color: #98a4b0;
    font-size: 13px;
    font-weight: 600;
}

.post-sale-sort select {
    min-width: 210px;
    border: 1px solid #46515d;
    border-radius: 8px;
    background: #20272e;
    color: #f3f5f7;
    padding: 9px 12px;
    font: inherit;
}

.post-sale-list {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.post-sale-list-row {
    display: grid;
    grid-template-columns: 235px minmax(260px, 1fr) 170px 160px 18px;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: #e5edf5;
    text-decoration: none;
}

.post-sale-row-origin {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.post-sale-row-origin time {
    color: #aab5c0;
    font-size: 12px;
    white-space: nowrap;
}

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

.post-sale-list-row:hover {
    background: #29323d;
}

.post-sale-list-row.is-unread {
    box-shadow: inset 4px 0 #3b82f6;
    background: rgba(30, 58, 95, .35);
}

.post-sale-list-row.is-urgent {
    box-shadow: inset 4px 0 #f59e0b;
}

.post-sale-alert {
    width: max-content;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
}

.post-sale-alert.warning {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
}

.post-sale-alert.critical {
    background: rgba(239, 68, 68, .16);
    color: #f87171;
}

.post-sale-list-main,
.post-sale-list-status,
.post-sale-due {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.post-sale-list-main > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-sale-list-main span,
.post-sale-list-status span,
.post-sale-due {
    color: var(--muted);
    font-size: 12px;
}

.post-sale-due.overdue,
.post-sale-overdue {
    color: #f87171;
}

.post-sale-type,
.post-sale-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.post-sale-action-card textarea,
.post-sale-action-card select,
.post-sale-detail-side textarea,
.post-sale-detail-side select,
.post-sale-detail-side input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #46515d;
    border-radius: 8px;
    background: #161c22;
    color: #f3f5f7;
    padding: 10px 12px;
    font: inherit;
    margin-top: 8px;
}

.post-sale-file-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    color: #aeb8c2;
    font-size: 12px;
}

.post-sale-file-field input {
    color: #dce3ea;
}

.post-sale-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.post-sale-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #46515d;
    border-radius: 7px;
    padding: 6px 9px;
    color: #78c7ff;
    text-decoration: none;
    font-size: 12px;
}

.post-sale-action-card textarea:focus,
.post-sale-detail-side textarea:focus,
.post-sale-detail-side select:focus,
.post-sale-detail-side input[type="text"]:focus {
    border-color: #22c96b;
    outline: 2px solid rgba(34, 201, 107, .15);
}

.post-sale-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.post-sale-form-actions small {
    color: #93a0ad;
}

.post-sale-detail-side form .button {
    margin-top: 10px;
}

.post-sale-danger-zone {
    border-color: rgba(245, 166, 35, .35);
}

.post-sale-decision-card {
    border-color: rgba(34, 201, 107, .35);
}

.post-sale-decision-card p,
.post-sale-danger-zone p {
    color: #aeb8c2;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .post-sale-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .post-sale-tools,
    .post-sale-search {
        align-items: stretch;
        flex-direction: column;
    }
}

.post-sale-type.type-return {
    background: #164e63;
    color: #a5f3fc;
}

.post-sale-type.type-claim {
    background: #7f1d1d;
    color: #fecaca;
}

.post-sale-type.type-dispute {
    background: #78350f;
    color: #fde68a;
}

.post-sale-type.type-message {
    background: #1e3a8a;
    color: #bfdbfe;
}

.post-sale-status {
    background: #374151;
    color: #e5e7eb;
}

.post-sale-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    padding: 50px 20px;
    color: var(--muted);
}

.post-sale-empty i {
    font-size: 30px;
}

.post-sale-detail-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.post-sale-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 16px;
}

.post-sale-detail-main,
.post-sale-detail-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-sale-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.post-sale-card h2 {
    margin: 4px 0 14px;
}

.post-sale-description {
    padding: 12px;
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, .09);
    line-height: 1.55;
}

.post-sale-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.post-sale-meta div {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.post-sale-meta dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.post-sale-meta dd {
    margin: 0;
    font-weight: 700;
}

.post-sale-items article,
.post-sale-messages article {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.post-sale-items article:last-child,
.post-sale-messages article:last-child {
    border-bottom: 0;
}

.post-sale-items article > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-sale-items small {
    color: var(--muted);
}

.post-sale-expectations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-sale-expectations span {
    padding: 6px 9px;
    border-radius: 6px;
    background: #713f12;
    color: #fef3c7;
    font-weight: 800;
}

.post-sale-messages article {
    flex-direction: column;
}

.post-sale-messages header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.post-sale-messages header span {
    color: var(--muted);
    font-size: 12px;
}

.post-sale-messages p {
    margin: 0;
    line-height: 1.55;
}

.post-sale-card .full-width {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 9px;
}

@media (max-width: 1100px) {
    .post-sale-list-row {
        grid-template-columns: 95px minmax(220px, 1fr) 150px 18px;
    }

    .post-sale-due {
        display: none;
    }
}

@media (max-width: 760px) {
    .post-sale-sync-grid,
    .post-sale-detail {
        grid-template-columns: 1fr;
    }

    .post-sale-list-row {
        grid-template-columns: 90px minmax(0, 1fr) 16px;
    }

    .post-sale-list-status {
        display: none;
    }

    .post-sale-meta {
        grid-template-columns: 1fr;
    }
}

.attention-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}

.attention-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: white;
    text-decoration: none;
}

.attention-card i {
    color: #60a5fa;
    font-size: 24px;
}

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

.attention-card.warning i {
    color: #fbbf24;
}

.attention-card.danger i {
    color: #f87171;
}

.pickup-address-card,
.pickup-proposal-card {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.pickup-address-card h2,
.pickup-proposal-card h2 {
    margin-top: 0;
}

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

.pickup-address-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pickup-carrier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.pickup-carrier-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.pickup-carrier-card > div:first-child {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pickup-carrier-card h2 {
    margin: 0;
}

.pickup-carrier-card i {
    color: #60a5fa;
    font-size: 22px;
}

.pickup-count {
    display: block;
    margin: 18px 0 8px;
    font-size: 26px;
}

.pickup-carrier-card p {
    overflow: hidden;
    max-height: 3.2em;
    color: var(--muted);
    line-height: 1.6;
}

.pickup-empty {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.pickup-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.pickup-slot {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    min-width: 220px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.pickup-slot input {
    grid-row: 1 / 3;
}

.pickup-slot span {
    color: var(--muted);
}

.pickup-history small {
    display: block;
    margin-top: 4px;
}

.pickup-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.pickup-status.status-success {
    background: #166534;
    color: #dcfce7;
}

.pickup-status.status-in_progress {
    background: #92400e;
    color: #fef3c7;
}

.pickup-status.status-error {
    background: #991b1b;
    color: #fee2e2;
}

.order-sort-link {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.order-sort-link:hover {
    color: #93c5fd;
}

.purchase-check-column {
    width: 42px;
    text-align: center;
}

.purchase-checkbox {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.purchase-stock,
.purchase-quantity,
.purchase-bought-column {
    text-align: center;
    white-space: nowrap;
}

.purchase-write-line {
    display: inline-block;
    width: 52px;
    height: 18px;
    border-bottom: 1px solid currentColor;
}

.purchase-print-date {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    .sidebar,
    .page-topbar .button,
    .orders-panel-header .button {
        display: none !important;
    }

    .main {
        margin: 0 !important;
        padding: 0 !important;
    }

    .table-scroll {
        overflow: visible !important;
    }

    .orders-panel,
    .orders-table,
    .orders-table th,
    .orders-table td {
        color: #000 !important;
        background: #fff !important;
    }

    .orders-table {
        width: 100% !important;
    }

    .orders-table th,
    .orders-table td {
        border-color: #777 !important;
    }

    .purchase-quantity,
    .purchase-quantity strong {
        color: #000 !important;
        font-size: 11px !important;
        font-weight: 900 !important;
        white-space: nowrap;
    }

    .purchase-list-page .page-topbar {
        display: none !important;
    }

    .purchase-list-page .orders-panel {
        border: 0 !important;
        box-shadow: none !important;
    }

    .purchase-list-page .orders-panel-header {
        padding: 0 0 5px !important;
    }

    .purchase-list-page .orders-panel-header h2 {
        margin: 0 !important;
        font-size: 15px !important;
    }

    .purchase-list-page .orders-panel-header span {
        font-size: 8px !important;
    }

    .purchase-list-page .purchase-print-date {
        display: inline !important;
    }

    .purchase-list-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        font-size: 8px !important;
    }

    .purchase-list-table th,
    .purchase-list-table td {
        height: auto !important;
        padding: 2px 3px !important;
        line-height: 1.08 !important;
        vertical-align: middle !important;
        overflow-wrap: anywhere;
    }

    .purchase-list-table th:nth-child(1),
    .purchase-list-table td:nth-child(1) {
        width: 5% !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
        text-align: center !important;
    }

    .purchase-list-table th:nth-child(2),
    .purchase-list-table td:nth-child(2) {
        width: 49% !important;
    }

    .purchase-list-table th:nth-child(3),
    .purchase-list-table td:nth-child(3) {
        width: 16% !important;
    }

    .purchase-list-table th:nth-child(4),
    .purchase-list-table td:nth-child(4) {
        width: 10% !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    .purchase-list-table th:nth-child(5),
    .purchase-list-table td:nth-child(5) {
        width: 12% !important;
        text-align: center !important;
    }

    .purchase-list-table th:nth-child(6),
    .purchase-list-table td:nth-child(6) {
        width: 8% !important;
        text-align: center !important;
    }

    .purchase-checkbox {
        display: inline-block;
        width: 3.2mm;
        height: 3.2mm;
        border: .35mm solid #000;
        background: #fff;
    }

    .purchase-stock,
    .purchase-stock strong {
        color: #000 !important;
    }

    .purchase-stock span {
        padding: 0 1px;
        color: #555 !important;
    }

    .purchase-write-line {
        display: block;
        width: 100%;
        height: 3.2mm;
        border-bottom: .3mm solid #000;
    }

    .purchase-list-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

.order-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.row-action {
    display: inline-block;
    padding: 7px 10px;
    color: white;
    background: #374151;
    border-radius: 5px;
    text-decoration: none;
}

.row-action:hover {
    background: #4b5563;
}

.notice {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 7px;
    font-weight: 700;
}

.notice.success {
    background: rgba(34, 197, 94, .15);
    border: 1px solid rgba(34, 197, 94, .5);
    color: #86efac;
}

.notice.error {
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .5);
    color: #fca5a5;
}

.muted {
    color: var(--muted);
}

.empty-state {
    padding: 40px !important;
    color: var(--muted);
    text-align: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
}

.modal-overlay[hidden] {
    display: none;
}

.sidebar a {
    position: relative;
}

.sidebar a.active {
    background: rgba(37, 99, 235, .18);
    color: #fff;
}

.sidebar a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: #3b82f6;
}

.sidebar-alert-count {
    min-width: 23px;
    height: 23px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, .13);
    font-size: 11px;
    line-height: 23px;
    text-align: center;
}

.modal-box {
    width: min(560px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.modal-header,
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
}

.modal-header {
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    border: 0;
    background: transparent;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.modal-content {
    padding: 22px 18px;
    color: #e5e7eb;
    line-height: 1.6;
    white-space: pre-wrap;
}

@media (max-width: 1200px) {
    .inventory-operation form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-operation .autocomplete-field {
        grid-column: span 2;
    }

    .quick-stock-entry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-stock-entry .autocomplete-field {
        grid-column: span 2;
    }

    .status-grid {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
    }

    .filters {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-search {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .inventory-operation form {
        grid-template-columns: 1fr;
    }

    .inventory-operation .autocomplete-field {
        grid-column: auto;
    }

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

    .quick-stock-entry .autocomplete-field {
        grid-column: auto;
    }

    .inventory-section-heading,
    .inline-stock-savebar {
        align-items: stretch;
        flex-direction: column;
    }

    .sidebar {
        width: 70px;
    }

    .sidebar .logo {
        padding: 20px 8px;
        font-size: 0;
    }

    .sidebar .logo::after {
        content: "R";
        font-size: 25px;
    }

    .sidebar a {
        justify-content: center;
        padding: 17px 8px;
        font-size: 0;
    }

    .sidebar a span {
        display: none;
    }

    .sidebar-alert-count {
        position: absolute;
        right: 5px;
        top: 5px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 9px;
        line-height: 18px;
    }

    .sidebar i {
        width: auto;
        font-size: 19px;
    }

    .main {
        width: calc(100% - 70px);
        padding: 14px;
    }

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

    .status-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .filter-search {
        grid-column: auto;
    }
}
