﻿.orders-page {
    height: 100%;
    padding: 22px;
    overflow-y: auto;
    overflow-x: hidden;
}

.orders-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    min-height: 100%;
}

.orders-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.orders-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.panel-card {
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
    padding: 18px;
    min-width: 0;
}

.panel-title {
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
}

.panel-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: #94a3b8;
}

.field-block {
    margin-top: 16px;
}

.field-label {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.customer-search-box {
    position: relative;
}

.input-text {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    border-radius: 16px;
    padding: 12px 14px;
    outline: none;
}

    .input-text:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
    }

.dropdown-list {
    margin-top: 6px;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    max-height: 240px;
    overflow-y: auto;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 16px 34px rgba(0,0,0,0.28);
}

.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #dbeafe;
    font-size: 13px;
}

    .dropdown-item:hover {
        background: rgba(59,130,246,0.22);
    }

.customer-card-mini {
    min-height: 92px;
}

.customer-summary {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.summary-box {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
}

.summary-label {
    font-size: 12px;
    color: #94a3b8;
}

.summary-value {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 800;
    color: #f8fafc;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.quick-button {
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    color: #fff;
    border: 0;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.quick-button-title {
    font-size: 15px;
    font-weight: 800;
}

.quick-button-subtitle {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.92;
}

.quick-green {
    background: linear-gradient(135deg, #059669, #10b981);
}

.quick-blue {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.quick-orange {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.orders-panel-head {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.customer-hero-banner {
    padding: 18px 22px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(37,99,235,0.28), rgba(14,165,233,0.20));
    border: 1px solid rgba(96,165,250,0.28);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    min-width: 0;
}

    .customer-hero-banner.compact {
        margin: 0;
        padding: 16px 22px;
    }

.customer-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-hero-sub {
    margin-top: 8px;
    font-size: 13px;
    color: #dbeafe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.segmented {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 16px;
    padding: 12px 16px;
    font-weight: 700;
    transition: all 0.18s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.segmented .btn {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

    .segmented .btn.active {
        background: linear-gradient(135deg, #111827, #1f2937);
        color: #fff;
    }

.table-wrap {
    margin-top: 16px;
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.orders-table-wrap {
    max-height: 420px;
}

.detail-table-wrap {
    max-height: 300px;
}

.data-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    table-layout: fixed;
}

    .data-table thead {
        background: rgba(255, 255, 255, 0.05);
    }

    .data-table th,
    .data-table td {
        padding: 12px 14px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.10);
        text-align: left;
        font-size: 14px;
        color: #dbe4f0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .data-table th {
        color: #f8fafc;
        font-weight: 800;
    }

    .data-table tbody tr {
        cursor: pointer;
        transition: background 0.15s ease;
    }

        .data-table tbody tr:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .data-table tbody tr.selected {
            background: rgba(59, 130, 246, 0.18);
        }

    .data-table th:nth-child(1),
    .data-table td:nth-child(1) {
        width: 190px;
        color: #93c5fd;
        font-weight: 800;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        width: 120px;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        width: 90px;
    }

    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        width: 90px;
    }

    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        width: 140px;
    }

    .data-table th:nth-child(6),
    .data-table td:nth-child(6) {
        width: 160px;
    }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-open {
    color: #ecfeff;
    background: rgba(16, 185, 129, 0.22);
}

.badge-closed {
    color: #fff7ed;
    background: rgba(245, 158, 11, 0.22);
}

.detail-card {
    margin-bottom: 24px;
}

.detail-empty {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 14px;
}

.badge-soft {
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    margin: 0 8px;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .orders-grid {
        grid-template-columns: 1fr;
    }

    .orders-panel-head {
        grid-template-columns: 1fr;
    }
}
.orders-page {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
}

.orders-grid {
    height: auto;
    min-height: 100%;
}

.content-shell {
    overflow: auto;
}

/* ========================= */
/* 🔥 FINAL SCROLL FIX 🔥 */
/* ========================= */

/* BODY sabit kalsın */
html, body {
    height: 100%;
    overflow: hidden;
}

/* WebView ana container */
.content-shell,
#pageHost {
    height: 100%;
    overflow: hidden !important;
}

/* 👉 ASIL SCROLL BURADA */
.orders-page {
    height: calc(100vh - 120px); /* üst bar'a göre ayarla */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 22px;
    padding-bottom: 80px;
}

/* grid akışını bozma */
.orders-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* sağ panel */
.orders-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* tablo kendi içinde scroll */
.orders-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.detail-table-wrap {
    max-height: 320px;
    overflow: auto;
}
.data-table {
    min-width: 820px;
}

    .data-table th:nth-child(1),
    .data-table td:nth-child(1) {
        width: 190px;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        width: 170px;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        width: 130px;
    }

    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        width: 100px;
    }

    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        width: 170px;
    }
.detail-table td:nth-child(3) {
    min-width: 260px;
}
.detail-table td:nth-child(5) {
    width: 80px;
    text-align: center;
    font-weight: 600;
    color: #60a5fa;
}
/* FINAL DETAIL POLISH */

/* Sol paneli biraz daralt, sağ taraf genişlesin */
.orders-grid {
    grid-template-columns: 320px minmax(0, 1fr) !important;
}

/* Hızlı işlemler biraz küçülsün */
.quick-actions {
    gap: 9px;
    margin-top: 12px;
}

.quick-button {
    padding: 12px 14px;
    border-radius: 16px;
}

.quick-button-title {
    font-size: 14px;
}

.quick-button-subtitle {
    font-size: 11px;
}

/* Detay paneli daha ferah */
.detail-card {
    padding: 18px 20px;
}

.detail-table-wrap {
    max-height: 360px;
}

/* Detay tablosu kolon ayarı */
.detail-card .data-table {
    min-width: 1000px;
    table-layout: fixed;
}

    /* Sıra kısa */
    .detail-card .data-table th:nth-child(1),
    .detail-card .data-table td:nth-child(1) {
        width: 55px;
    }

    /* Stok kodu orta */
    .detail-card .data-table th:nth-child(2),
    .detail-card .data-table td:nth-child(2) {
        width: 150px;
    }

    /* Stok adı geniş */
    .detail-card .data-table th:nth-child(3),
    .detail-card .data-table td:nth-child(3) {
        width: 380px;
    }

    /* Miktar kısa */
    .detail-card .data-table th:nth-child(4),
    .detail-card .data-table td:nth-child(4) {
        width: 95px;
        text-align: right;
    }

    /* Birim kısa */
    .detail-card .data-table th:nth-child(5),
    .detail-card .data-table td:nth-child(5) {
        width: 65px;
        text-align: center;
    }

    /* Birim fiyat */
    .detail-card .data-table th:nth-child(6),
    .detail-card .data-table td:nth-child(6) {
        width: 120px;
        text-align: right;
    }

    /* Toplam */
    .detail-card .data-table th:nth-child(7),
    .detail-card .data-table td:nth-child(7) {
        width: 140px;
        text-align: right;
    }

    /* Stok adı daha okunur */
    .detail-card .data-table td:nth-child(3) {
        color: #e5e7eb;
        font-weight: 600;
    }

    /* Sayılar daha net */
    .detail-card .data-table td:nth-child(4),
    .detail-card .data-table td:nth-child(6),
    .detail-card .data-table td:nth-child(7) {
        font-variant-numeric: tabular-nums;
    }
.orders-left .panel-card {
    padding: 16px;
}
/* TOP CUSTOMER LAYOUT */

.orders-page {
    padding: 22px;
}

.orders-grid {
    display: block !important;
}

.customer-top-panel {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr) 260px;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.customer-search-area,
.customer-info-area,
.customer-stat-area {
    min-width: 0;
}

.customer-search-area .customer-search-box {
    margin-top: 14px;
}

.customer-info-area {
    padding: 16px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37,99,235,0.24), rgba(14,165,233,0.14));
    border: 1px solid rgba(96,165,250,0.24);
}

.customer-big-code {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 900;
    color: #f8fafc;
}

.customer-big-name {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 800;
    color: #93c5fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-stat-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.orders-list-card,
.detail-card {
    margin-bottom: 18px;
}

/* alta yayılmış hızlı işlemler */
.quick-actions-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 70px;
}

.quick-actions-bottom .quick-button {
    min-height: 82px;
}
.orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(30,41,59,0.7);
    border: 1px solid rgba(148,163,184,0.12);
}

    .mini-stat span {
        font-size: 12px;
        color: #94a3b8;
    }

    .mini-stat strong {
        font-size: 18px;
        color: #f8fafc;
    }

.quick-actions-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 18px 0 70px 0;
}
.orders-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30,41,59,0.7);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 14px;
    padding: 10px 14px;
}

    .mini-stat span {
        color: #94a3b8;
        font-size: 12px;
    }

    .mini-stat strong {
        color: #fff;
        font-size: 18px;
    }

.quick-actions-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}
/* DETAY TABLO KOLON AYARI */

.detail-card table {
    table-layout: fixed;
    width: 100%;
}

/* SIRA */
.detail-card th:nth-child(1),
.detail-card td:nth-child(1) {
    width: 50px;
    text-align: center;
}

/* STOK KODU */
.detail-card th:nth-child(2),
.detail-card td:nth-child(2) {
    width: 130px;
}

/* STOK ADI (ASLAN PAYI 🦁) */
.detail-card th:nth-child(3),
.detail-card td:nth-child(3) {
    width: auto;
}

/* MİKTAR */
.detail-card th:nth-child(4),
.detail-card td:nth-child(4) {
    width: 100px;
    text-align: right;
}

/* BİRİM */
.detail-card th:nth-child(5),
.detail-card td:nth-child(5) {
    width: 60px;
    text-align: center;
}

/* BİRİM FİYAT */
.detail-card th:nth-child(6),
.detail-card td:nth-child(6) {
    width: 120px;
    text-align: right;
}

/* TOPLAM */
.detail-card th:nth-child(7),
.detail-card td:nth-child(7) {
    width: 130px;
    text-align: right;
}

/* STOK ADI TAŞMASIN */
.detail-card td:nth-child(3) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
    .detail-card td:nth-child(3):hover {
        white-space: normal;
        background: rgba(59,130,246,0.08);
    }

.start-page {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-card {
    width: 360px;
    padding: 30px;
    border-radius: 20px;
    background: linear-gradient(145deg, #020617, #0f172a);
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    text-align: center;
}

.start-title {
    font-size: 28px;
    font-weight: 900;
}

.start-sub {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.field {
    text-align: left;
    margin-bottom: 14px;
}

    .field label {
        font-size: 12px;
        color: #94a3b8;
    }

.start-button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-weight: 700;
    cursor: pointer;
}
.dark-select {
    background-color: #111827;
    color: #f8fafc;
    border: 1px solid rgba(96,165,250,0.55);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

    .dark-select option {
        background-color: #111827;
        color: #f8fafc;
    }
.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

    .clickable:hover {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(59,130,246,0.5);
    }
.order-create-page {
    height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px;
    padding-bottom: 90px;
}

.create-actions {
    margin-top: 18px;
    margin-bottom: 70px;
}
.quick-button:disabled,
.start-button:disabled,
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.button-loading {
    position: relative;
    pointer-events: none;
}
.stock-search-box {
    position: relative;
    z-index: 50;
}

#stockList {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    z-index: 9999;
    background: #07111f;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    padding: 8px;
}

    #stockList:empty {
        display: none;
    }

    #stockList .dropdown-item {
        padding: 12px 14px;
        border-radius: 14px;
        color: #dbeafe;
        cursor: pointer;
        border-bottom: 0;
    }

        #stockList .dropdown-item:hover {
            background: rgba(59, 130, 246, 0.22);
        }
.order-total-box {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(59,130,246,0.08);
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #c7d2fe;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

    .confirm-modal.hidden {
        display: none;
    }

.confirm-box {
    width: 420px;
    background: #07111f;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.6);
    color: #e5e7eb;
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.confirm-content {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
    color: #cbd5f5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-confirm {
    background: linear-gradient(135deg,#22c55e,#16a34a);
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
}

.btn-cancel {
    background: #374151;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
}
.logout-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #b91c1c;
    color: white;
    cursor: pointer;
    font-weight: 600;
}
.file-upload-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #020617;
    border: 1px dashed #475569;
    color: #cbd5e1;
    border-radius: 10px;
    padding: 11px 12px;
    cursor: pointer;
    transition: all .15s ease;
}

    .file-upload-box:hover {
        border-color: #38bdf8;
        color: #e0f2fe;
        background: #0f172a;
    }

    .file-upload-box input {
        display: none;
    }

.file-upload-icon {
    font-size: 16px;
}

.file-upload-text {
    font-weight: 600;
    font-size: 13px;
}

.file-name-text {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#btnBackOrders {
    background: #1e293b;
    color: #e5e7eb;
    border: 1px solid #475569;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

    #btnBackOrders:hover {
        background: #334155;
        border-color: #38bdf8;
    }

.hidden {
    display: none !important;
}

.testmode-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 700;
}

.testmode-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 700;
}