:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --plate-color: #6610f2;
}

.bg-purple {
    background-color: #6f42c1 !important;
    color: white !important;
}

.border-purple {
    border-color: #59359a !important;
}

.bg-brown {
    background-color: #8B4513 !important;
    color: white !important;
}

.border-brown {
    border-color: #5e2f0d !important;
}

.done-brown {
    background-color: #8B4513 !important;
    color: white !important;
}

.done-green {
    background-color: #04581c !important;
    color: white !important;
}

.bg-orange {
    background-color: #fd7e14 !important;
    color: white !important;
}

.border-orange {
    border-color: #d66408 !important;
}

body {
    background-color: #eef2f7;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    user-select: text;
    /* Seçimi kolaylaştır */
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-size: 1.1rem;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    background: rgba(25, 135, 84, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 1);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
}

@media (max-width: 768px) {
    body {
        font-size: 0.75rem;
    }

    .kpi-card {
        min-height: 90px;
        margin-bottom: 10px;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .navbar .input-group {
        width: 100% !important;
        margin-top: 10px;
    }

    .navbar-brand span {
        display: none;
    }

    .live-indicator {
        display: none !important;
    }

    /* Acil Durum Satırı */
    .row-urgent {
        background-color: #ffcccc !important;
    }

    .row-urgent>td {
        background-color: #ffcccc !important;
        box-shadow: inset 0 0 0 9999px #ffcccc !important;
        color: #8a0c0c !important;
    }

    .nav-pills .nav-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .supply-container {
        min-width: 200px;
    }

    .supply-box {
        font-size: 0.6rem;
        padding: 3px 5px;
    }

    .filter-area {
        display: none;
    }

    th,
    td {
        white-space: nowrap;
    }
}

.kpi-row {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

.col-kpi {
    flex: 0 0 auto;
    width: 50%;
    padding: 5px;
}

@media (min-width: 768px) {
    .col-kpi {
        width: 25%;
    }
}

@media (min-width: 1200px) {
    .col-kpi {
        width: 14.28%;
    }
}

.kpi-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-clickable {
    cursor: pointer;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1;
}

.kpi-sub-value {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 5px;
    display: block;
}

.kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-bg {
    position: absolute;
    right: 10px;
    bottom: 10px;
    opacity: 0.15;
    font-size: 2.2rem;
}

.copper-split {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 10px;
}

.copper-box {
    flex: 1;
}

.copper-box.right {
    text-align: right;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 10px;
    cursor: pointer;
}

.copper-val {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.copper-lbl {
    font-size: 0.65rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 2px;
}

.nav-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
}

.nav-pills .nav-link {
    white-space: nowrap;
    border-radius: 8px;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 8px 15px;
    background: white;
    border: 1px solid #dee2e6;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 15px;
    margin-bottom: 25px;
    border-top: 4px solid var(--primary-color);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-title {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.hmc-card {
    border-top-color: #0d6efd;
    background-color: #f8fbff;
}

.special-card {
    border-top-color: #fd7e14;
    background-color: #fffbf8;
}

.plate-card {
    border-top-color: var(--plate-color);
    background-color: #fbf9ff;
}

.row-hmc {
    background-color: #ffffff !important;
}

.badge-hmc {
    background-color: #0d6efd;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-special {
    background-color: #fd7e14;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-plate {
    background-color: var(--plate-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-status {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.7rem;
    display: block;
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

.bg-devam {
    background-color: #fff8dd;
    color: #b78a0b;
    border: 1px solid #ffeeba;
}

.bg-sevke-hazir {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.bg-stok {
    background-color: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

.bg-tamam {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* --- RESPONSIVE AÇIKLAMA VE TABLO AYARLARI --- */

.clickable-desc {
    cursor: pointer;
    color: var(--secondary-color);
    border-bottom: 1px dashed #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Metin sığmazsa ... koyar */
    padding: 2px;
    display: block;

    /* Geçiş efekti ekleyelim ki ekran boyutu değişince yumuşak daralsın */
    transition: max-width 0.3s ease;

    /* Varsayılan (Geniş Ekran) Genişlik */
    max-width: 190px;
}

/* Ekran Genişliğine Göre Daraltma Kuralları */
@media (max-width: 1400px) {
    .clickable-desc {
        max-width: 180px;
    }
}

@media (max-width: 1200px) {
    .clickable-desc {
        max-width: 140px;
    }
}

@media (max-width: 992px) {

    /* Tablet modu */
    .clickable-desc {
        max-width: 110px;
    }

    /* Mobilde tablo fontunu biraz daha küçültmek faydalı olabilir */
    .table-sm {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {

    /* Mobil mod */
    .clickable-desc {
        max-width: 80px;
    }
}

@media (max-width: 576px) {

    /* Çok küçük ekranlar */
    .clickable-desc {
        max-width: 60px;
    }
}

/* Mevcut kısıtlayıcıyı responsive yapıya uydurmak için override ediyoruz */
.desc-std-limit {
    max-width: 100% !important;
    /* Üstteki kurallar geçerli olsun */
}

.cell-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 120px;
}

/* Mobil görünümde tablo başlıklarını da sıkıştıralım */
@media (max-width: 768px) {

    th,
    td {
        padding: 0.25rem !important;
    }
}

.clickable-desc:hover {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

.desc-std-limit {
    max-width: 140px;
}

.cell-nowrap {
    white-space: nowrap;
    width: 1%;
}

.cell-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: block;
    max-width: 120px;
}

th.col-status-fit {
    width: 1% !important;
    white-space: nowrap !important;
}

.supply-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.supply-header {
    font-size: 0.6rem;
    font-weight: 800;
    color: #3b82f6;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s;
    border: 1px solid #dbeafe;
    height: 42px;
    /* Matching 2 lines of supply boxes */
    min-width: 45px;
    line-height: 1;
}

.supply-header i {
    font-size: 0.8rem;
}

.supply-header:hover {
    background: #dbeafe;
    color: #2563eb;
}

.supply-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    flex: 1;
}

.supply-box {
    flex: 1 0 30%;
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.65rem;
    color: #adb5bd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    height: 20px;
    line-height: 14px;
    cursor: pointer;
}

.supply-box.active {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
    color: #0f5132;
    font-weight: 600;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    display: none;
}

.editable-cell {
    transition: all 0.2s;
    position: relative;
    display: inline-block;
    padding: 2px 4px;
    min-width: 20px;
}

.editable-cell:hover {
    background-color: #fff3cd !important;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #ffc107;
    border-radius: 3px;
}

.editing-input {
    width: 100%;
    padding: 2px 4px;
    font-size: 0.85rem;
    border: 2px solid #0d6efd;
    border-radius: 4px;
}

/* Seçim Stili */
table.dataTable tbody>tr.selected,
table.dataTable tbody>tr>.selected {
    background-color: rgba(13, 110, 253, 0.1) !important;
    box-shadow: inset 0 0 0 1px #0d6efd;
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    border: none;
    font-weight: bold;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    color: white;
}

/* Aesthetic Supply KPI Badges (Right Aligned) */
.supply-kpi-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 5px 0;
    justify-content: flex-end;
    /* Right alignment */
}

.supply-kpi-badge {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    /* Pill shape */
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.supply-kpi-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.supply-kpi-badge.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
    filter: brightness(0.95);
}

.supply-kpi-badge .kpi-count {
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.3);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    min-width: 20px;
    text-align: center;
    font-weight: 700;
}

/* Color Modifiers */
.supply-kpi-badge.bg-warning {
    background-color: #ffc107;
    color: #333;
}

.supply-kpi-badge.bg-warning .kpi-count {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.supply-kpi-badge.bg-brown {
    background-color: #8B4513;
}

.supply-kpi-badge.bg-purple {
    background-color: #6f42c1;
}

.supply-kpi-badge.bg-orange {
    background-color: #fd7e14;
}

.supply-kpi-badge.bg-success {
    background-color: #198754;
}

.supply-kpi-badge.bg-primary {
    background-color: #0d6efd;
}

.supply-kpi-badge.bg-secondary {
    background-color: #6c757d;
}

/* --- TEMİZ VE SIKIŞIK TABLO TASARIMI (FINAL) --- */

.strikethrough-green {
    text-decoration: line-through !important;
    text-decoration-color: #00FF00 !important;
    /* Bright green */
    text-decoration-thickness: 3px !important;
    /* Thick line */
    text-decoration-style: solid !important;
    /* Solid */
}