/* Gmail-benzeri sade arayüz */
:root {
    --app-bg: #f1f3f4;
    --app-primary: #0b57d0;
    --app-sidebar: #fff;
    --app-card: #fff;
    --app-border: #dadce0;
    --app-text: #202124;
    --app-muted: #5f6368;
}

.app-body {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

.app-sidebar {
    width: 228px;
    background: var(--app-sidebar);
    border-right: 1px solid var(--app-border);
    min-height: 100vh;
}

.sidebar-brand {
    border-bottom: 1px solid var(--app-border);
}

.sidebar-nav .nav-link {
    color: var(--app-muted);
    border-radius: 16px;
    padding: 0.42rem 0.75rem;
    margin-bottom: 2px;
    font-size: 0.86rem;
}

.sidebar-nav .nav-link:hover {
    background: #f1f3f4;
    color: var(--app-text);
}

.sidebar-nav .nav-link.active {
    background: #d3e3fd;
    color: #041e49;
    font-weight: 600;
}

.sidebar-footer {
    font-size: 0.7rem;
    line-height: 1.45;
}

.sidebar-footer-line {
    word-break: break-word;
}

.nav-section {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.app-toolbar {
    min-height: 56px;
    box-shadow: 0 1px 0 rgba(60, 64, 67, 0.08);
}

.app-card {
    background: var(--app-card);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    box-shadow: none;
}

.kpi-card {
    border-radius: 16px;
    border: 1px solid var(--app-border);
    background: #fff;
    padding: 0.9rem 1rem;
    box-shadow: none;
}

.kpi-card .label {
    font-size: 0.8rem;
    color: var(--app-muted);
}

.kpi-card .value {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--app-primary);
}

.table-card {
    border-radius: 16px;
    overflow: hidden;
}

.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--app-muted);
    border-bottom-color: var(--app-border) !important;
    background: #f8f9fa;
    padding: 0.45rem 0.55rem;
}

/* Ürünler grid — başlıklar ekran görüntüsü gibi (tam metin, hücre çizgileri) */
.table-urun-grid thead th {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--app-text);
    white-space: nowrap;
    vertical-align: middle;
}

.table-urun-grid td {
    vertical-align: middle;
    font-size: 0.8125rem;
}

#wrapUrunList thead th {
    background: #fff;
    border-bottom: 1px solid #e0e3e7 !important;
    color: #5f6368;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

#wrapUrunList tbody td {
    border-bottom: 1px solid #eceff1;
    font-size: 0.79rem;
    line-height: 1.2;
}

#wrapUrunList tbody tr:hover {
    background: #f8f9fa;
}

/* Urunler sayfasi: ana sayfa kaymasin, sadece kart ici scroll olsun */
body.page-urunler {
    overflow: hidden;
}

body.page-urunler .app-main,
body.page-urunler .app-content {
    overflow: hidden;
}

body.page-urunler #wrapUrunList {
    height: calc(100vh - 190px) !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: auto;
}

/* Dashboard kart boyutlari JS ile dinamik ayarlanir */
#dashMainRow {
    overflow: hidden;
}

#dashGridLoadingInfo {
    min-height: 30px;
    line-height: 1.2;
    border-top: 1px solid #eceff1;
    flex-shrink: 0;
}

.table-urun-grid td.urun-renk-koyu {
    background: #8bc34a;
    color: #111;
}

.table-urun-grid td.urun-renk-orta {
    background: #dcedc8;
    color: #111;
}

.table td {
    vertical-align: middle;
    font-size: 0.82rem;
    padding: 0.38rem 0.55rem;
    border-color: #eceff1;
}

.btn-primary {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.36rem 0.8rem;
}

.btn-primary:hover {
    background-color: #174ea6;
    border-color: #174ea6;
}

.btn-outline-primary {
    border-radius: 18px;
    font-size: 0.8rem;
    padding: 0.34rem 0.75rem;
}

.side-panel {
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /*
     * KPI + üst çubuk payı (~200px). Yalnız max-height ile kutu yüksekliği belirsiz kalınca
     * flex çocuk .body-scroll (flex:1) dikeyde ~0px çöküyor; tablo tek çizgi gibi görünüyordu.
     */
    height: calc(100vh - 200px);
    max-height: calc(100vh - 160px);
    min-height: 280px;
}

/* Dashboard sağ panel: sayfa kaydırırken sabit kalsın */
#sideUrunGecmis {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
}

.side-panel .head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
    font-size: 0.9rem;
}

.side-panel .body-scroll {
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.5rem;
}

/* Dikey kaydırma yalnızca .body-scroll’da; içteki table-responsive yüksekliği kesmesin */
.side-panel .body-scroll .table-responsive {
    max-height: none;
}

.grid-row-hover tbody tr {
    cursor: pointer;
}

.grid-row-hover tbody tr.table-active {
    background: #e8f0fe !important;
}

#tblUrunGrid thead th.dashboard-sortable-th:hover {
    background-color: #e8eaed;
}

/* Dashboard ürün grid: daha dar sütunlar + taşan metni kaydırma/ellipsis */
#tblUrunGrid {
    table-layout: fixed;
    width: 100%;
}

#tblUrunGrid th,
#tblUrunGrid td {
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

#tblUrunGrid th {
    font-size: 0.72rem;
    padding: 0.32rem 0.4rem;
    white-space: pre-line;
    line-height: 1.2;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
}

#tblUrunGrid td {
    font-size: 0.78rem;
    padding: 0.28rem 0.4rem;
    white-space: nowrap;
}

.dashboard-hareket-table {
    font-size: 0.78rem;
}

.dashboard-hareket-table th,
.dashboard-hareket-table td {
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10500;
}

.modal-content {
    border-radius: 18px;
    border: 1px solid var(--app-border);
}

/* Tom Select: liste ürün alanının hemen altında kalsın; modal gövdesi kesmesin */
#modalUretim .modal-body {
    overflow: visible;
}
#modalUretim .ts-wrapper {
    position: relative;
    z-index: 3;
}
#modalUretim .ts-dropdown {
    z-index: 4;
}

/* Uretim filtrelerinde Tom Select dropdown sticky tablo başlığının üstünde kalsın */
#uretimFiltreBar {
    position: relative;
    z-index: 10;
}

#uretimFiltreBar .ts-wrapper {
    position: relative;
    z-index: 11;
}

#uretimFiltreBar .ts-dropdown {
    z-index: 12 !important;
}

#wrapRuloList {
    position: relative;
    z-index: 1;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.2rem rgba(11, 87, 208, 0.14);
}

.form-control,
.form-select {
    border-radius: 8px;
    border-color: #dadce0;
    font-size: 0.84rem;
}

.text-primary-app {
    color: var(--app-primary) !important;
}

/* Uretim listesi: Gmail inbox benzeri satir hissi */
#wrapRuloList .table {
    margin-bottom: 0;
}

#wrapRuloList thead th {
    background: #fff;
    border-bottom: 1px solid #e0e3e7 !important;
    color: #5f6368;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

#wrapRuloList tbody td {
    border-bottom: 1px solid #eceff1;
    padding-top: 0.34rem;
    padding-bottom: 0.34rem;
    font-size: 0.79rem;
    line-height: 1.2;
}

#wrapRuloList tbody tr:hover {
    background: #f8f9fa;
}

#wrapRuloList .form-check-input {
    width: 0.95rem;
    height: 0.95rem;
    margin-top: 0;
    border-color: #bdc1c6;
}

#wrapRuloList .btn-link.btn-sm {
    font-size: 0.74rem;
    text-decoration: none;
}

#wrapRuloList .btn-link.btn-sm:hover {
    text-decoration: underline;
}

#wrapRuloList .rulo-row-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-in-out;
    white-space: nowrap;
}

#wrapRuloList tbody tr:hover .rulo-row-actions {
    opacity: 1;
    pointer-events: auto;
}

#wrapRuloList .rulo-icon-btn {
    line-height: 1;
}

#wrapUrunList .row-actions,
#wrapMakineList .row-actions,
#wrapOpList .row-actions,
#wrapMusteriList .row-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-in-out;
    white-space: nowrap;
}

#wrapUrunList tbody tr:hover .row-actions,
#wrapMakineList tbody tr:hover .row-actions,
#wrapOpList tbody tr:hover .row-actions,
#wrapMusteriList tbody tr:hover .row-actions {
    opacity: 1;
    pointer-events: auto;
}

/* Tanimlar sekmesi: makine/operator listelerini ortada topla */
.tanimlar-orta-panel {
    max-width: 980px;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    body.page-depocikis .app-sidebar {
        display: none !important;
    }
    body.page-depocikis .app-toolbar .small.text-muted,
    body.page-depocikis .app-toolbar .small.text-secondary {
        display: none !important;
    }
    body.page-depocikis .app-content {
        padding: 0.75rem !important;
    }
}
