/* CSS Reset & Basic Styles */
:root {
    --primary: #ff6000;
    --primary-dark: #e55600;
    --secondary: #1e293b;
    --bg-light: #f1f5f9;
    /* Eski arka plan rengi */
    --text-main: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* GENEL FONT - Eski haline (Poppins'e benzer sistem fontları) döndürüldü */
body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Segoe UI', 'Poppins', sans-serif;
    /* Eski font yapısı */
}

/* TOP NAV - Slim & Compact */
.top-nav {
    background: white;
    height: 52px;
    /* Drastically reduced from 70px */
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    /* Reduced side padding */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    /* Lighter shadow */
}

.top-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 180px;
}

.top-nav-logo img {
    height: 24px;
    /* Reduced from 38px */
    object-fit: contain;
}

.top-nav-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* CENTER MENU - Segmented Control / Capsule Design */
.top-nav-menu {
    display: inline-flex;
    /* Shrink to fit content */
    align-items: center;
    justify-content: center;
    background: transparent;
    /* The gray capsule container */
    padding: 3px;
    /* Padding inside the capsule */
    border-radius: 8px;
    /* Slightly rounded edges */
    gap: 2px;
    /* Very tight gap between tabs */
    height: 32px;
    /* Fixed height for consistency */
}

.top-nav-link {
    padding: 0 12px;
    /* Horizontal padding only, height handled by flex */
    height: 100%;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    /* Micro text size */
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    white-space: nowrap;
    /* Prevent wrapping */
}

.top-nav-link:hover {
    color: #334155;
    background: rgba(0, 0, 0, 0.02);
}

.top-nav-link.active {
    background: white;
    /* White card look */
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    /* Crisp shadow */
}

.top-nav-link i {
    width: 13px;
    height: 13px;
    opacity: 0.9;
    stroke-width: 2.5px;
    /* Thicker, smaller icons */
}

/* SYNC STATUS - FIXED RIGHT */
.sync-status-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f0fdf4;
    /* Light green bg */
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    min-width: 180px;
    /* Fixed width for consistency */
    justify-content: center;
}

.sync-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sync-live {
    font-size: 10px;
    font-weight: 800;
    color: #166534;
    /* Green text */
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.sync-last-time {
    font-size: 11px;
    color: #15803d;
    font-weight: 600;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.top-nav-menu {
    display: flex;
    gap: 10px;
    height: 100%;
}

.top-nav-link {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.top-nav-link:hover {
    color: var(--primary);
    background: #fff7ed;
}

.top-nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #fff7ed;
}

/* MAIN CONTENT - ESKİ HALİ (Tam Genişlik) */
.main-content {
    padding: 30px 40px;
    min-height: calc(100vh - 70px);
}

/* CARDS - Eski haline yakın */
.data-card {
    background: white;
    border-radius: 12px;
    /* Biraz daha az yuvarlak */
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    margin-bottom: 20px;
    overflow: hidden;
}

/* TABS - Eski haline yakın */
.order-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.order-tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    /* Tam yuvarlak değil */
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.order-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.order-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(255, 96, 0, 0.25);
}

.order-tab span {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.order-tab:not(.active) span {
    background: #f1f5f9;
    color: var(--text-light);
}

/* TABLE - Eski haline yakın */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 15px;
    /* Padding azaltıldı */
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    /* Daha kalın */
    color: #475569;
    text-transform: none;
    letter-spacing: 0.02em;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

td {
    padding: 15px;
    /* Padding azaltıldı */
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-main);
    vertical-align: middle;
    /* Middle yapıldı */
}

tr:hover td {
    background: #fdfdfd;
}

/* MARKET BADGES */
.market-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    width: 100%;
    text-align: center;
}

.market-trendyol {
    background: #fff0e6;
    color: #f27a1a;
    border: 1px solid #ffdec2;
}

.market-hepsiburada {
    background: #fff2f0;
    color: #ff6000;
    border: 1px solid #ffdec2;
}

.market-n11 {
    background: #f0f0ff;
    color: #5f3dc4;
    border: 1px solid #e0d4fc;
}

.market-ciceksepeti {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

/* LOGO STANDARDIZATION */
.market-logo {
    height: 45px;
    width: 140px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
}

/* Settings and Sync grid alignment */
.market-card .market-logo,
.integration-card .market-logo {
    margin: 0;
    object-position: left;
}

.sync-selection-card .market-logo {
    margin: 0 auto 15px auto;
    object-position: center;
}

.table-market-logo {
    height: 45px;
    width: 100px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
}

.cargo-img {
    height: 40px;
    width: 120px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto 5px auto;
}

/* PRODUCT IMAGE */
.p-img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.p-img:hover {
    transform: scale(1.05);
}

/* ACTIONS */
.action-btn {
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #ff6000;
    color: #fff;
    border: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(255, 96, 0, 0.2);
    cursor: pointer;
    width: 155px;
    /* Standart genişlik */
}

.action-btn:hover {
    background: #e65600;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(255, 96, 0, 0.3);
}

.action-btn.printed {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: default;
}

.action-btn.printed i {
    opacity: 0.5;
}

.invoice-btn {
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #0284c7;
    /* Profesyonel Mavi */
    color: #fff;
    border: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
    cursor: pointer;
    width: 155px;
}

.invoice-btn:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(2, 132, 199, 0.3);
}

.invoice-btn i,
.invoice-btn svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
}

.action-btn i,
.action-btn svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
}

.kargo-link {
    display: inline-block;
    margin-top: 5px;
    background: #ff6000;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 11px;
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(255, 96, 0, 0.1);
}

.kargo-link:hover {
    background: #ff8533;
    /* Daha açık turuncu */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 96, 0, 0.2);
    text-decoration: none;
}

.copy-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 5px;
    vertical-align: middle;
}

.copy-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.copy-btn i,
.copy-btn svg {
    width: 12px !important;
    height: 12px !important;
}

/* PROFESYONEL KARGO KARTI STİLLERİ */
.cargo-mini-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 180px;
    margin: 0 auto;
    transition: all 0.2s;
    border-top: 3px solid #64748b;
    /* Üstte ince bir gri çizgi etikete hava katar */
}

.cargo-mini-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.barcode-img {
    max-width: 100%;
    height: auto;
    margin: 5px 0;
    transition: transform 0.2s;
}

.barcode-img:hover {
    transform: scale(1.05);
}

.barcode-none {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 700;
    border: 1px dashed #cbd5e1;
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    text-align: center;
    background: #f8fafc;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(255, 96, 0, 0.3);
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #f1f5f9;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 10px;
    border-radius: 8px;
    position: relative;
    max-width: 90vw;
    display: flex;
}

.modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* --- SWEETALERT2 POPUP STİLLERİ (Örnek Popup Gibi) --- */
div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: 20px !important;
    padding: 30px !important;
    font-family: inherit !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

div:where(.swal2-title) {
    color: #1e293b !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

div:where(.swal2-html-container) {
    color: #64748b !important;
    font-size: 14px !important;
}

.swal2-actions {
    gap: 15px;
    width: 100%;
    margin-top: 25px !important;
}

.swal-custom-btn {
    flex: 1;
    padding: 12px 0 !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.swal-custom-btn:active {
    transform: scale(0.98);
}

/* İPTAL BUTTONU (Beyaz, gri border) */
.swal-btn-cancel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

.swal-btn-cancel:hover {
    background: #f8fafc !important;
}

/* ONAY BUTONU (Örnekteki gibi soft kırmızı/turuncu) */
.swal-btn-confirm {
    background: #ffe4e6 !important;
    /* Soft Kırmızımsı */
    border: 1px solid #fecdd3 !important;
    color: #e11d48 !important;
    /* Koyu Kırmızı yazı */
}

.swal-btn-confirm:hover {
    background: #fecdd3 !important;
}

.swal-btn-efatura {
    background: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
}

.swal-btn-efatura:hover {
    background: #bae6fd !important;
}

/* İKON DÜZENLEMELERİ */
div:where(.swal2-icon).swal2-question {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

/* --- COLUMN FILTER STYLES --- */
.header-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.header-filter:hover {
    color: var(--primary);
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 240px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 12px;
    text-transform: none;
    letter-spacing: normal;
    text-align: left;
}

.filter-dropdown.dropdown-left {
    left: auto;
    right: 0;
}

.filter-dropdown.show {
    display: flex;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none;
    font-weight: 500;
    color: #475569;
}

.filter-option:hover {
    background: #f1f5f9;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.filter-footer {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    margin-top: 5px;
    border-top: 1px solid #f1f5f9;
    position: sticky;
    bottom: -12px;
    background: white;
}

.filter-btn-apply {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.filter-btn-clear {
    flex: 1;
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* BULK ACTIONS DROPDOWN */
.bulk-dropdown-container {
    position: relative;
    display: inline-block;
}

.bulk-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 220px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 8px;
    flex-direction: column;
    gap: 4px;
}

.bulk-dropdown-menu.show {
    display: flex;
}

.bulk-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.bulk-dropdown-item:hover {
    background-color: #f8fafc;
    color: #ff6000;
}

.bulk-dropdown-item i {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.bulk-dropdown-item:hover i {
    color: #ff6000;
}

.btn-bulk-trigger {
    background: #ff6000;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(255, 96, 0, 0.2);
}

.btn-bulk-trigger:hover {
    background: #e65600;
    transform: translateY(-1px);
}