:root{color-scheme:light;--ts-bg:#f4f7fb;--ts-surface:#fff;--ts-surface-2:#f8fafc;--ts-text:#17243a;--ts-muted:#617087;--ts-border:#dbe3ee;--ts-focus:#1d5fd1;--ts-danger:#b4233d}
html.dark{color-scheme:dark;--ts-bg:#09111d;--ts-surface:#111c2b;--ts-surface-2:#172437;--ts-text:#edf3fb;--ts-muted:#aebbd0;--ts-border:#314158;--ts-focus:#8fb4ff;--ts-danger:#ff92a5}
html,body{background:var(--ts-bg)!important;color:var(--ts-text)!important}
body,.main-content,.content-area,.tab-content,.modal,.modal-content,.card,.stat-card,.product-card,.dropdown-menu,.search-results,.permission-picker{color:var(--ts-text)}
.card,.stat-card,.product-card,.modal-content,.dropdown-menu,.search-results,.permission-picker,.alert{background:var(--ts-surface)!important;border-color:var(--ts-border)!important}
input:not([type=checkbox]):not([type=radio]),select,textarea,.form-control,.search-input,.editable-input{background:var(--ts-surface-2)!important;color:var(--ts-text)!important;border-color:var(--ts-border)!important}
input::placeholder,textarea::placeholder,.text-muted,.form-text,small{color:var(--ts-muted)!important;opacity:1}
label,h1,h2,h3,h4,h5,h6,th,td,.card-title,.modal-title,.product-card-title,.product-card-value{color:var(--ts-text)!important}
table,thead,tbody,tr,th,td{border-color:var(--ts-border)!important} thead tr,th{background:var(--ts-surface-2)!important}
a{color:var(--ts-focus)} button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid color-mix(in srgb,var(--ts-focus) 45%,transparent)!important;outline-offset:2px}
.btn-secondary{background:var(--ts-surface-2)!important;color:var(--ts-text)!important;border-color:var(--ts-border)!important}.btn-danger{color:#fff!important}
.modal-overlay{background:rgba(4,10,20,.64)!important}.badge,.status-badge{border:1px solid color-mix(in srgb,currentColor 35%,transparent)}
.kvkk-footer-links{display:flex;gap:14px;justify-content:center;flex-wrap:wrap;margin-top:8px}.kvkk-footer-links a{font-weight:700;text-decoration:none}
/* Sidebar footer was still receiving light-only rules from legacy styles. */
html.dark .sidebar-footer{background:#081528!important;border-top-color:#263852!important;color:#aebbd0!important}
html.dark .sidebar-footer .ts-sidebar-user{background:#0d1b2e!important;border-color:#263852!important;color:#edf3fb!important;box-shadow:none!important}
html.dark .sidebar-footer .ts-sidebar-user strong{color:#edf3fb!important}
html.dark .sidebar-footer .ts-sidebar-user small{color:#aebbd0!important}
html.dark .sidebar-footer .ts-logout{background:rgba(239,68,68,.12)!important;color:#fda4af!important;border-color:rgba(251,113,133,.28)!important}
html.light .sidebar-footer{background:#fbfcff!important;border-top-color:#e2e8f0!important;color:#637087!important}
html.light .sidebar-footer .ts-sidebar-user{background:#fff!important;border-color:#e6ebf3!important;color:#172033!important}
html.light .sidebar-footer .ts-sidebar-user strong{color:#172033!important}
html.light .sidebar-footer .ts-sidebar-user small{color:#6b7a90!important}
html.light .sidebar-footer .ts-logout{background:#fff1f3!important;color:#c62c48!important;border-color:#fecdd5!important}
/* Legacy modal header variables could stay light while the modal body was dark. */
.modal .modal-header,#product-detail-modal .modal-header,#delivery-modal .modal-header{background:var(--ts-surface-2)!important;color:var(--ts-text)!important;border-color:var(--ts-border)!important}
.modal .modal-header h2,.modal .modal-header h3,#product-detail-modal .modal-header h2,#delivery-modal .modal-header h2{color:var(--ts-text)!important}
.modal .modal-close{background:var(--ts-surface)!important;color:var(--ts-text)!important;border-color:var(--ts-border)!important}
/* Delivery summary had hard-coded light-theme text colors. */
#delivery-modal .delivery-product-summary{background:color-mix(in srgb,var(--ts-focus) 7%,var(--ts-surface))!important;border-color:color-mix(in srgb,var(--ts-focus) 25%,var(--ts-border))!important;color:var(--ts-text)!important}
#delivery-modal .delivery-summary-heading strong,#delivery-modal #delivery-product-title,#delivery-modal .delivery-summary-item strong,#delivery-modal #delivery-unique-code,#delivery-modal #delivery-product-status,#delivery-modal #delivery-summary-customer{color:var(--ts-text)!important}
#delivery-modal .delivery-summary-heading small,#delivery-modal .delivery-summary-item span{color:var(--ts-muted)!important}
#delivery-modal .delivery-summary-item{background:var(--ts-surface-2)!important;border-color:var(--ts-border)!important;color:var(--ts-text)!important}
#delivery-modal .delivery-summary-item.is-price strong,#delivery-modal #delivery-selling-price{color:#10b981!important}
/* Clickable operational KPI cards. */
.ts-kpi-card[role="button"]{position:relative;cursor:pointer;outline:none;isolation:isolate;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.ts-kpi-card[role="button"]>div:not(.ts-kpi-icon){display:flex!important;flex:1 1 auto!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;min-width:0!important;overflow:hidden!important}
.ts-kpi-card[role="button"]>div:not(.ts-kpi-icon)>span,.ts-kpi-card[role="button"]>div:not(.ts-kpi-icon)>strong,.ts-kpi-card[role="button"]>div:not(.ts-kpi-icon)>small{display:block!important;width:100%!important;max-width:100%!important}
.ts-kpi-card[role="button"]>div:not(.ts-kpi-icon)>strong{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.ts-kpi-card[role="button"]:hover,.ts-kpi-card[role="button"]:focus-visible{border-color:color-mix(in srgb,var(--ts-focus) 52%,var(--ts-border))!important;box-shadow:0 12px 28px color-mix(in srgb,var(--ts-focus) 13%,transparent)!important;transform:translateY(-2px)}
.ts-kpi-card[role="button"]:focus-visible{outline:3px solid color-mix(in srgb,var(--ts-focus) 38%,transparent)!important;outline-offset:3px}
.ts-kpi-card .ts-kpi-icon{border:1px solid transparent!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.18)}
html.dark .ts-kpi-card .ts-kpi-icon.is-blue{background:#102e59!important;color:#82b4ff!important;border-color:#254c80!important}
html.dark .ts-kpi-card .ts-kpi-icon.is-indigo{background:#24264f!important;color:#b0b7ff!important;border-color:#41467c!important}
html.dark .ts-kpi-card .ts-kpi-icon.is-orange{background:#493019!important;color:#ffc26a!important;border-color:#74502a!important}
html.dark .ts-kpi-card .ts-kpi-icon.is-violet{background:#342157!important;color:#c9a7ff!important;border-color:#5d3b8d!important}
html.light .ts-kpi-card .ts-kpi-icon.is-blue{background:#eaf2ff!important;color:#1769ff!important;border-color:#cfe0ff!important}
html.light .ts-kpi-card .ts-kpi-icon.is-indigo{background:#eef0ff!important;color:#515bd7!important;border-color:#d7dafd!important}
html.light .ts-kpi-card .ts-kpi-icon.is-orange{background:#fff4e4!important;color:#c56b00!important;border-color:#ffe0ad!important}
html.light .ts-kpi-card .ts-kpi-icon.is-violet{background:#f2eaff!important;color:#7c3ddd!important;border-color:#dfceff!important}

/* Seven-day chart: theme-aware tracks, grid and readable labels. */
.ts-trend-card .ts-mini-chart{position:relative;gap:12px!important;padding:12px 4px 0!important;background:linear-gradient(to bottom,color-mix(in srgb,var(--ts-border) 32%,transparent) 1px,transparent 1px);background-size:100% 25%;border-radius:12px}
.ts-trend-card .ts-chart-col{grid-template-rows:22px minmax(118px,1fr) 24px!important;gap:5px}
.ts-trend-card .ts-chart-value{color:var(--ts-text)!important;font-weight:800!important;font-size:10px!important}
.ts-trend-card .ts-chart-bar{background:color-mix(in srgb,var(--ts-focus) 7%,var(--ts-surface-2))!important;border:1px solid var(--ts-border)!important;border-radius:10px!important;padding:3px!important;box-shadow:inset 0 1px 4px rgba(15,23,42,.08)}
.ts-trend-card .ts-chart-bar i{background:linear-gradient(180deg,#67a7ff 0%,#1769ff 72%,#0d55cf 100%)!important;border-radius:7px!important;box-shadow:0 5px 14px rgba(23,105,255,.22)}
.ts-trend-card .ts-chart-col small{color:var(--ts-muted)!important;font-weight:700!important;font-size:9px!important}
html.dark .ts-trend-card .ts-chart-bar{background:#0b1727!important;border-color:#2b3d57!important;box-shadow:inset 0 1px 5px rgba(0,0,0,.28)}
html.dark .ts-trend-card .ts-chart-bar i{background:linear-gradient(180deg,#75b2ff 0%,#2f7dff 55%,#155ed6 100%)!important}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
@media (forced-colors:active){button,a,input,select,textarea,.card{border:1px solid CanvasText!important}}

/* Sayfa içinde sayfa göstermeyen, uygulamayla uyumlu güvenli oturum yenileme. */
#ts-reauth-shade{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;padding:20px;background:rgba(3,8,18,.72);backdrop-filter:blur(7px);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
.ts-reauth-dialog{width:min(94vw,430px);overflow:hidden;background:var(--ts-surface);color:var(--ts-text);border:1px solid var(--ts-border);border-radius:20px;box-shadow:0 28px 90px rgba(0,0,0,.38)}
.ts-reauth-head{display:grid;grid-template-columns:42px minmax(0,1fr) 36px;align-items:center;gap:12px;padding:18px 18px 16px;border-bottom:1px solid var(--ts-border);background:var(--ts-surface)}
.ts-reauth-symbol{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,#1769ff,#7047eb);color:#fff;font-weight:900;font-size:19px;box-shadow:0 8px 18px rgba(23,105,255,.25)}
.ts-reauth-head h2{margin:0!important;color:var(--ts-text)!important;font-size:18px!important;line-height:1.2!important;font-weight:800!important}.ts-reauth-head p{margin:4px 0 0;color:var(--ts-muted);font-size:12px;line-height:1.35}
.ts-reauth-close{width:36px;height:36px;padding:0;border:1px solid var(--ts-border);border-radius:10px;background:var(--ts-surface-2);color:var(--ts-text);font-size:22px;line-height:1;cursor:pointer}
.ts-reauth-form{display:grid;gap:9px;padding:20px}.ts-reauth-note{display:grid;gap:3px;margin-bottom:7px;padding:12px 13px;border:1px solid color-mix(in srgb,var(--ts-focus) 22%,var(--ts-border));border-radius:12px;background:color-mix(in srgb,var(--ts-focus) 7%,var(--ts-surface))}.ts-reauth-note strong{font-size:13px;color:var(--ts-text)}.ts-reauth-note span{font-size:11px;line-height:1.45;color:var(--ts-muted)}
.ts-reauth-form label{margin-top:4px;color:var(--ts-text)!important;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.ts-reauth-form input{width:100%;height:48px;padding:0 14px!important;border:1px solid var(--ts-border)!important;border-radius:11px!important;background:var(--ts-surface-2)!important;color:var(--ts-text)!important;font:inherit!important;box-sizing:border-box}.ts-reauth-form input:focus{border-color:var(--ts-focus)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--ts-focus) 18%,transparent)!important;outline:0!important}
.ts-reauth-error{margin-top:4px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--ts-danger) 35%,var(--ts-border));border-radius:10px;background:color-mix(in srgb,var(--ts-danger) 9%,var(--ts-surface));color:var(--ts-danger);font-size:12px;font-weight:700;line-height:1.4}.ts-reauth-error[hidden]{display:none!important}
.ts-reauth-actions{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px;margin-top:9px}.ts-reauth-actions button{height:46px;border-radius:11px;font-weight:800;cursor:pointer}.ts-reauth-cancel{border:1px solid var(--ts-border);background:var(--ts-surface-2);color:var(--ts-text)}.ts-reauth-submit{border:0;background:linear-gradient(135deg,#1769ff,#7047eb);color:#fff;box-shadow:0 9px 20px rgba(71,70,229,.24)}.ts-reauth-submit:disabled{cursor:wait;opacity:.72}
html.dark .ts-reauth-dialog{box-shadow:0 28px 90px rgba(0,0,0,.7)}
@media(max-width:480px){#ts-reauth-shade{padding:12px}.ts-reauth-head{padding:15px}.ts-reauth-form{padding:16px}.ts-reauth-actions{grid-template-columns:1fr}.ts-reauth-cancel{order:2}}

/* Teslim edilenler tablosunda geri döndürülemez silme işlemi iki temada da belirgin olsun. */
#delivered-products-table .action-buttons .delete-btn{background:#c81e3a!important;border-color:#9f1230!important;color:#fff!important;box-shadow:0 4px 11px rgba(159,18,48,.28)!important}
#delivered-products-table .action-buttons .delete-btn:hover,#delivered-products-table .action-buttons .delete-btn:focus-visible{background:#a9122e!important;border-color:#881326!important;color:#fff!important;box-shadow:0 6px 16px rgba(159,18,48,.38)!important}
html.dark #delivered-products-table .action-buttons .delete-btn{background:#d92d4c!important;border-color:#fb7185!important;color:#fff!important;box-shadow:0 4px 13px rgba(251,113,133,.24)!important}
html.dark #delivered-products-table .action-buttons .delete-btn:hover,html.dark #delivered-products-table .action-buttons .delete-btn:focus-visible{background:#be123c!important;border-color:#fda4af!important;color:#fff!important}
/* Ürün durum filtreleri kaydırmasız ve tek satırda yedi eşit sütun. */
#products-tab .filters {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 8px !important;
    overflow: visible !important;
}
#products-tab .filters .btn {
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    font-size: clamp(7.5px, .66vw, 10px) !important;
    white-space: nowrap !important;
}

@media (max-width: 760px) {
    #products-tab .filters { gap: 3px !important; padding-left: 4px !important; padding-right: 4px !important; }
    #products-tab .filters .btn { padding-left: 2px !important; padding-right: 2px !important; font-size: clamp(6px, 1.45vw, 8px) !important; }
}

/* Teslime Hazır seçiliyken beyaz yazının açık zeminde kaybolmasını önler. */
#products-tab .filters [data-filter="ready"].active,
#products-tab .filters [data-filter="ready"].active:hover,
html.light #products-tab .filters [data-filter="ready"].active,
html.dark #products-tab .filters [data-filter="ready"].active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0f9f72 0%, #087758 100%) !important;
    border-color: #087758 !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 1px rgba(0,0,0,.18) !important;
    box-shadow: 0 7px 18px rgba(8,119,88,.25) !important;
}

