/* Bootstrap .container xl'de 1140px'de duruyor; satır tablosu (9 kolon) + 300px özet
   sütunu bu genişliğe sığmayınca tablo yatay kaydırmaya düşüyordu. Genel layout'u
   değiştirmemek için container bu sayfada genişletiliyor. */
@media (min-width: 1200px) {
    .container.quick-order-container {
        max-width: 1500px;
    }
}

.quick-order-page {
    --qo-line: #e6ebf1;
    --qo-line-soft: #eff2f6;
    --qo-field: #f3f5f8;
    --qo-muted: #6b7785;
    --qo-muted-2: #96a1ae;
    --qo-flash-bg: #e7f6ec;
}

/* ---------------- Üst şerit ---------------- */

.qo-topbar-card {
    padding: 22px 20px 20px;
}

.qo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.qo-header-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.qo-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.qo-subtitle {
    margin: 0;
    color: var(--qo-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------------- Yerleşim ---------------- */

.qo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.qo-summary-sticky {
    position: sticky;
    top: 18px;
}

@media (max-width: 1199.98px) {
    .qo-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .qo-summary-sticky {
        position: static;
    }
}

/* ---------------- Sekmeler ---------------- */

.qo-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid var(--qo-line);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.qo-tabs::-webkit-scrollbar {
    display: none;
}

.qo-tab {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 15px 14px 13px;
    font-size: 14px;
    font-weight: 500;
    color: var(--qo-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

.qo-tab:hover {
    color: var(--nav-text, #0f172a);
}

.qo-tab[aria-selected="true"] {
    color: var(--nav-accent);
    border-bottom-color: var(--nav-accent);
    font-weight: 600;
}

.qo-tab i {
    margin-right: 6px;
}

@media (max-width: 575.98px) {
    .qo-tabs {
        padding: 0;
        gap: 0;
    }

    .qo-tab {
        flex: 1 1 auto;
        min-width: 0;
        padding: 14px 6px 12px;
        font-size: 13px;
    }

    .qo-tab i {
        margin-right: 5px;
    }
}

.qo-panel {
    padding: 20px;
}

@media (max-width: 575.98px) {
    .qo-panel {
        padding: 14px;
    }

    .qo-topbar-card {
        padding: 18px 16px 16px;
    }
}

.qo-panel[hidden] {
    display: none;
}

.qo-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* ---------------- Kod girişi ---------------- */

.qo-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px auto;
    gap: 14px;
    align-items: end;
}

@media (max-width: 700px) {
    .qo-entry {
        grid-template-columns: minmax(0, 1fr);
    }
}

.qo-entry-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qo-entry-code {
    position: relative;
}

/* ---------------- Sayfa butonları ---------------- */

.qo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--qo-line);
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.qo-btn:hover,
.qo-btn:focus {
    color: #1f2937;
    border-color: var(--qo-muted-2);
    text-decoration: none;
}

.qo-btn-lg {
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
}

.qo-btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
}

.qo-btn-excel i {
    color: #1d6f42;
}

.qo-btn-excel:hover {
    border-color: #1d6f42;
}

.qo-btn-primary {
    background: var(--nav-accent);
    border-color: var(--nav-accent);
    color: #fff;
}

.qo-btn-primary:hover,
.qo-btn-primary:focus {
    background: var(--nav-accent-dark);
    border-color: var(--nav-accent-dark);
    color: #fff;
}

.qo-btn-accent {
    background: #fff;
    border-color: var(--nav-accent);
    color: var(--nav-accent);
}

.qo-btn-accent:hover:not(:disabled),
.qo-btn-accent:focus:not(:disabled) {
    background: var(--nav-accent);
    border-color: var(--nav-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--nav-accent-rgb), 0.25);
}

.qo-btn-block {
    width: 100%;
}

.qo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qo-btn i {
    font-size: 14px;
}

.quick-order-page button:focus,
.qo-btn:focus {
    outline: none;
}

.quick-order-page button:focus-visible,
.qo-btn:focus-visible {
    outline: 2px solid var(--nav-accent);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    .qo-topbar {
        align-items: stretch;
    }

    .qo-heading {
        width: 100%;
    }

    .qo-header-actions {
        width: 100%;
    }

    .qo-header-actions .qo-btn {
        width: 100%;
        height: 44px;
    }

    .qo-panel-actions {
        width: 100%;
    }

    .qo-panel-actions .qo-btn {
        flex: 1 1 auto;
        height: 44px;
    }

    .qo-drop .qo-btn {
        width: 100%;
        height: 44px;
    }
}

.qo-entry-action .qo-btn {
    width: 100%;
}

.qo-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 7px;
    line-height: 1.4;
    min-height: 18px;
}

.qo-hint {
    font-size: 12.5px;
    color: var(--qo-muted);
    margin: 10px 0 0;
    min-height: 19px;
}

.qo-hint-selected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    background: #e7f6ec;
    color: #1e8449;
    font-weight: 600;
}

.qo-hint-selected .qo-selected-name {
    max-width: 46ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qo-selected-clear {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(30, 132, 73, 0.14);
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.qo-selected-clear:hover {
    background: rgba(30, 132, 73, 0.28);
}

.qo-code-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    background: var(--qo-field);
    border: 1px solid var(--qo-line);
    border-radius: 8px;
}

.qo-code-field i {
    color: var(--qo-muted-2);
}

.qo-code-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
}

.qo-code-field input:focus {
    outline: none;
}

.qo-code-field input::placeholder {
    font-weight: 400;
    color: var(--qo-muted-2);
}

.qo-code-field:focus-within {
    background: #fff;
    border-color: var(--nav-accent);
    box-shadow: 0 0 0 3px rgba(var(--nav-accent-rgb), 0.12);
}

.qo-paste {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    resize: vertical;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.8;
    background: var(--qo-field);
    border: 1px solid var(--qo-line);
    border-radius: 8px;
}

.qo-paste:focus {
    background: #fff;
    border-color: var(--nav-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--nav-accent-rgb), 0.12);
}

.qo-drop {
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    background: var(--qo-field);
    padding: 34px 20px;
    text-align: center;
}

.qo-drop-icon {
    display: block;
    font-size: 30px;
    color: #1d8a4e;
    margin-bottom: 10px;
}

.qo-drop strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.qo-drop p {
    margin: 0 0 16px;
    color: var(--qo-muted);
}

/* ---------------- Adet stepper ---------------- */

.qo-qty {
    display: inline-flex;
    align-items: stretch;
    height: 32px;
    width: 106px;
    border: 1px solid var(--qo-line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.qo-qty .quantity-btn,
.qo-qty .quantity-input {
    height: auto;
    border: 0;
    border-radius: 0;
    margin: 0;
    background: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.qo-qty .quantity-btn {
    flex: none;
    width: 32px;
    font-size: 16px;
    font-weight: 500;
    color: var(--qo-muted);
}

.qo-qty .quantity-btn:hover {
    background: var(--qo-field);
    color: var(--nav-accent);
    border-color: transparent;
}

.qo-qty .quantity-btn:active {
    transform: none;
    background: var(--qo-line-soft);
}

.qo-qty .quantity-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0 2px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qo-qty .quantity-input::-webkit-outer-spin-button,
.qo-qty .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qo-qty .quantity-input:focus {
    outline: none;
}

.qo-qty:focus-within {
    border-color: var(--nav-accent);
    box-shadow: 0 0 0 3px rgba(var(--nav-accent-rgb), 0.12);
}

.qo-qty-lg {
    height: 44px;
    width: 100%;
}

.qo-qty-lg .quantity-btn {
    width: 42px;
    font-size: 18px;
}

.qo-qty-lg .quantity-input {
    font-size: 15px;
}

/* ---------------- Öneri kutusu ---------------- */

.qo-suggest {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--qo-line);
    border-radius: 8px;
    box-shadow: 0 16px 40px -12px rgba(16, 24, 40, 0.28);
    max-height: 340px;
    overflow: auto;
    padding: 5px;
}

.qo-suggest[hidden] {
    display: none;
}

.qo-suggest ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.qo-suggest li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.qo-suggest li[aria-selected="true"],
.qo-suggest li:hover {
    background: var(--qo-field);
}

.qo-suggest li.qo-suggest-empty {
    display: block;
    text-align: center;
    color: var(--qo-muted);
    cursor: default;
    padding: 18px 10px;
}

.qo-suggest li.qo-suggest-empty:hover {
    background: transparent;
}

.qo-suggest-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--qo-line);
    background: #fff;
}

.qo-suggest-main {
    min-width: 0;
}

.qo-suggest-name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qo-suggest-code {
    display: block;
    font-size: 12px;
    color: var(--qo-muted);
    margin-top: 2px;
}

.qo-suggest-price {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.qo-suggest-price small {
    display: block;
    font-weight: 500;
    color: var(--qo-muted-2);
    font-size: 11.5px;
    text-decoration: line-through;
}

.qo-suggest-out .qo-suggest-name,
.qo-suggest-out .qo-suggest-code {
    opacity: 0.65;
}

/* ---------------- Satır tablosu ---------------- */

.qo-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--qo-line-soft);
}

.qo-card-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.qo-card-head .qo-count {
    color: var(--qo-muted);
    font-weight: 500;
}

.qo-card-head > :last-child {
    margin-left: auto;
}

.qo-table-wrap {
    overflow-x: auto;
}

.qo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
    margin: 0;
}

.qo-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--qo-muted);
    text-transform: uppercase;
    padding: 10px 12px;
    background: #fafbfd;
    border-bottom: 1px solid var(--qo-line);
    white-space: nowrap;
}

.qo-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--qo-line-soft);
    vertical-align: middle;
    background: #fff;
}

.qo-table tbody tr:last-child td {
    border-bottom: 0;
}

.qo-r {
    text-align: right;
}

.qo-c {
    text-align: center;
}

.qo-col-idx {
    width: 44px;
    color: var(--qo-muted-2);
    font-size: 12.5px;
}

.qo-col-del {
    width: 64px;
    text-align: right;
}

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

.qo-product {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.qo-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--qo-line);
    background: #fff;
    flex: none;
}

.qo-product-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}

.qo-product-code {
    font-size: 11.5px;
    color: var(--qo-muted-2);
    font-weight: 500;
    margin-top: 2px;
}

.qo-pill {
    display: inline-flex;
    align-items: center;
    padding: 2.5px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.qo-pill-green {
    background: #e7f6ec;
    color: #1e8449;
}

.qo-pill-red {
    background: #fdeae9;
    color: #d93a34;
}

.qo-price-list {
    color: var(--qo-muted-2);
    font-size: 13px;
    white-space: nowrap;
}

.qo-price-struck {
    text-decoration: line-through;
}

.qo-discount-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    background: #e7f6ec;
    color: #1e8449;
    border-radius: 6px;
    font-weight: 700;
}

.qo-remove {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    color: var(--nav-accent);
    border: 1px solid var(--nav-accent);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.qo-remove:hover {
    background: var(--nav-accent);
    color: #fff;
}

.qo-price-net {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.qo-table tbody tr.qo-row-pending .qo-line-total {
    opacity: 0.45;
}

.qo-table tbody tr.qo-flash td {
    animation: qo-rowflash 2.4s ease-out;
}

@keyframes qo-rowflash {
    0%,
    70% {
        background: var(--qo-flash-bg);
    }

    100% {
        background: #fff;
    }
}

.qo-empty {
    padding: 54px 24px;
    text-align: center;
    color: var(--qo-muted);
}

.qo-empty i {
    font-size: 34px;
    color: var(--qo-muted-2);
    margin-bottom: 14px;
    display: block;
}

.qo-empty strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--nav-text, #0f172a);
}

.qo-empty p {
    margin: 0;
}

/* ---------------- Özet ---------------- */

.qo-summary {
    padding: 20px;
}

.qo-summary-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f5f5f5;
}

.qo-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

.qo-summary-label {
    color: #7f8c8d;
}

.qo-summary-value {
    color: var(--color-heading);
    font-weight: 600;
}

.qo-summary-value.qo-summary-positive {
    color: #1e8449;
}

.qo-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid #f5f5f5;
    font-size: 16px;
    font-weight: 700;
}

.qo-summary-total .qo-summary-label {
    color: var(--color-heading);
}

.qo-summary-total .qo-summary-value {
    color: var(--nav-accent);
    font-size: 22px;
    line-height: 1.2;
    text-align: right;
}

.qo-summary-total-main {
    font-weight: 700;
}

.qo-summary-total-alt {
    display: block;
    color: #000;
    font-weight: 200;
    font-size: 18px;
}

.qo-summary-foot {
    flex: none;
}

.qo-summary-foot form {
    margin-top: 16px;
}

.qo-summary-foot .qo-btn {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@media (min-width: 1200px) {
    .qo-summary-sticky {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 36px);
    }

    .qo-summary-sticky .qo-summary {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .qo-summary-rows {
        min-height: 0;
        overflow-y: auto;
    }
}

.qo-import-summary {
    margin-bottom: 12px;
}

/* ---------------- Rapor tablosu (içe aktarma modalı) ---------------- */

.qo-report-wrap {
    max-height: 340px;
    overflow-y: auto;
}

.qo-report-table {
    margin-bottom: 0;
    font-size: 12.5px;
}

.qo-report-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .qo-table tbody tr.qo-flash td {
        animation: none;
        background: var(--qo-flash-bg);
    }
}
