/* Kargo Modülü - Admin Stilleri */

/* ===== Metabox ===== */
.kargo-metabox { font-size: 13px; }
.kargo-metabox .kargo-empty { color: #666; font-style: italic; padding: 8px 0; }
.kargo-metabox .kargo-note  { color: #666; font-size: 11px; font-style: italic; }

.kargo-metabox-logo {
    text-align: center;
    margin: 8px 0 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef0f2;
}
.kargo-metabox-logo img {
    max-width: 140px;
    height: auto;
    display: inline-block;
}

.kargo-grilabs-legacy {
    background: #f3f4f6;
    border-left: 3px solid #9ca3af;
    padding: 6px 10px;
    margin-bottom: 10px;
    font-size: 11px;
}

.kargo-validation-warning {
    background: #fff4e5; border-left: 4px solid #f59e0b;
    padding: 8px 10px; margin-bottom: 10px; font-size: 12px;
}
.kargo-validation-warning ul { margin: 4px 0 4px 18px; padding: 0; }

.kargo-phone-fix {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #f5b840;
}
.kargo-phone-fix label {
    display: block;
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 4px;
    color: #92400e;
}
.kargo-phone-fix-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.kargo-phone-fix-row .kargo-phone-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #c7c7c7;
    border-radius: 3px;
    background: #fff;
}
.kargo-phone-fix-row .kargo-phone-input:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
    border-color: #2271b1;
}
.kargo-phone-fix-row .kargo-phone-save-btn {
    height: 28px;
    line-height: 26px;
    padding: 0 10px;
    font-size: 12px;
    flex-shrink: 0;
}
.kargo-phone-msg {
    display: block;
    margin-top: 4px;
    font-size: 11px;
}
.kargo-phone-msg.is-error { color: #b32d2e; }
.kargo-phone-msg.is-success { color: #0a6e0a; }
.kargo-phone-msg.is-loading { color: #50575e; }

.kargo-shipment {
    border: 1px solid #e0e0e0; border-radius: 4px;
    padding: 8px; margin-bottom: 8px; background: #fafbfc;
}
.kargo-shipment-head { display:flex; justify-content: space-between; align-items: center; }
.kargo-shipment-meta {
    font-size: 11px;
    color: #666;
    margin: 4px 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.kargo-shipment-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #6b7280;
    font-size: 11px;
}
.kargo-shipment-date .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    line-height: 1;
}

.kargo-package {
    border-top: 1px dashed #d0d0d0; padding: 6px 0; margin-top: 6px;
}
.kargo-package:first-of-type { border-top: none; }
.kargo-package-head { display: flex; justify-content: space-between; align-items: center; }
.kargo-package-no { font-weight: 600; font-size: 12px; }
.kargo-package-body small { display: block; margin: 2px 0; font-size: 11px; }
.kargo-package-body code { font-size: 11px; background: #fff; padding: 1px 4px; }
.kargo-cargo-key-row,
.kargo-tracking-row {
    display: flex !important;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.kargo-op-msg { color: #555; }
.kargo-error  { color: #b91c1c; }
.kargo-yk-info {
    color: #4b5563;
    font-size: 11px;
    line-height: 1.6;
    background: #f9fafb;
    border-left: 3px solid #2271b1;
    padding: 4px 8px;
    margin: 4px 0 2px;
    border-radius: 0 3px 3px 0;
}
.kargo-yk-info .kargo-yk-event {
    color: #065f46;
    font-weight: 500;
}

/* ===== Badges ===== */
.kargo-badge {
    display: inline-block; padding: 2px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 600; line-height: 1.4;
}
.kargo-badge-pending   { background: #f3f4f6; color: #374151; }
.kargo-badge-active    { background: #fef3c7; color: #92400e; }
.kargo-badge-completed { background: #d1fae5; color: #065f46; }
.kargo-badge-cancelled { background: #fee2e2; color: #991b1b; }

.kargo-pkg-pending    { background: #f3f4f6; color: #374151; }
.kargo-pkg-created    { background: #fef3c7; color: #92400e; }
.kargo-pkg-in_transit { background: #dbeafe; color: #1e40af; }
.kargo-pkg-delivered  { background: #d1fae5; color: #065f46; }
.kargo-pkg-cancelled  { background: #fee2e2; color: #991b1b; }
.kargo-pkg-failed     { background: #fecaca; color: #7f1d1d; }
.kargo-pkg-returned   { background: #ede9fe; color: #5b21b6; }

.kargo-create-action { margin-top: 10px; text-align: center; }

/* ===== Modal ===== */
.kargo-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100000;
}
.kargo-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #fff; border-radius: 10px; max-width: 720px; width: 92%;
    max-height: 92vh; display: flex; flex-direction: column;
    z-index: 100001; box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.kargo-modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f2;
    background: #f9fafb;
    border-radius: 10px 10px 0 0;
}
.kargo-modal-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}
.kargo-modal-close {
    background: none; border: none; font-size: 26px; cursor: pointer;
    color: #9ca3af; line-height: 1; padding: 0 4px;
    transition: color .15s;
}
.kargo-modal-close:hover { color: #111827; }

.kargo-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
}

.kargo-modal-recipient {
    background: #f0f6fc;
    border: 1px solid #cfe2f3;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1e3a5f;
    line-height: 1.5;
}
.kargo-modal-recipient strong {
    color: #0b3a66;
    font-weight: 600;
    margin-right: 4px;
}

.kargo-modal-body h3 {
    margin: 18px 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kargo-modal-body h3:first-child { margin-top: 0; }
.kargo-modal-body h3 .kargo-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    flex-shrink: 0;
}
.kargo-modal-body h3 .kargo-box-count {
    margin-left: auto;
    color: #9ca3af;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

.kargo-items-table {
    margin: 0 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.kargo-items-table thead th {
    background: #f9fafb;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #e5e7eb;
}
.kargo-items-table td,
.kargo-items-table th {
    padding: 10px 12px;
    vertical-align: middle;
}
.kargo-items-table tbody tr + tr td {
    border-top: 1px solid #f3f4f6;
}
.kargo-items-table tbody tr:hover td {
    background: #fafbfc;
}
.kargo-items-table tbody td:nth-child(2) {
    font-size: 13px;
    color: #111827;
    line-height: 1.4;
}
.kargo-item-box {
    width: 100%;
    height: 30px;
    font-size: 12px;
}

.kargo-quick-actions {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
}
.kargo-quick-actions .button {
    font-size: 12px;
    height: 28px;
    line-height: 26px;
    padding: 0 10px;
}

.kargo-boxes-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 14px;
    min-height: 60px;
}
.kargo-boxes-preview > p {
    margin: 0;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
}

.kargo-box-preview {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
    transition: border-color .15s;
}
.kargo-box-preview:last-child { margin-bottom: 0; }
.kargo-box-preview:hover { border-color: #cbd5e1; }

.kargo-box-preview-title {
    font-weight: 600;
    font-size: 12px;
    color: #111827;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #f3f4f6;
}
.kargo-box-preview-items {
    font-size: 12px;
    color: #4b5563;
    margin: 0 0 8px;
    padding-left: 18px;
    list-style: disc;
}
.kargo-box-preview-items li { margin: 2px 0; }
.kargo-box-desi-row {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #f3f4f6;
}
.kargo-box-desi-row label {
    font-size: 12px;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.kargo-box-desi {
    width: 70px;
    height: 26px;
    font-size: 12px;
    padding: 2px 6px;
}

.kargo-notes-row { margin-top: 14px; }
.kargo-notes-row label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 4px;
}
.kargo-notes-row .kargo-notes {
    width: 100%;
    height: 32px;
    font-size: 13px;
    padding: 4px 8px;
}

.kargo-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid #eef0f2;
    background: #f9fafb;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== Manuel Kargo Oluştur formu ===== */
.kargo-manual-intro {
    margin: 0 0 14px;
    color: #6b7280;
    font-size: 12px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 8px 12px;
    border-radius: 3px;
}
.kargo-manual-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}
.kargo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.kargo-manual-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #374151;
}
.kargo-manual-form label > span {
    font-weight: 600;
    color: #374151;
}
.kargo-manual-form .kargo-req {
    color: #dc2626;
    font-weight: 700;
    margin-left: 2px;
}
.kargo-manual-form input[type="text"],
.kargo-manual-form input[type="tel"],
.kargo-manual-form input[type="number"],
.kargo-manual-form select,
.kargo-manual-form textarea {
    width: 100%;
    height: 32px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    transition: border-color .15s, box-shadow .15s;
}
.kargo-manual-form textarea {
    height: auto;
    min-height: 56px;
    resize: vertical;
    padding: 6px 8px;
    line-height: 1.4;
}
.kargo-manual-form input:focus,
.kargo-manual-form select:focus,
.kargo-manual-form textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}
.kargo-form-full { width: 100%; }

/* ===== Manuel kargo top button ===== */
.kargo-manual-create-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.kargo-manual-create-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    margin: 0;
}

@media (max-width: 600px) {
    .kargo-form-row { grid-template-columns: 1fr; }
}

.kargo-result {
    padding: 10px; margin: 8px 0; border-radius: 4px; font-size: 12px;
}
.kargo-result-success { background: #d1fae5; border-left: 3px solid #10b981; color: #065f46; }
.kargo-result-error   { background: #fee2e2; border-left: 3px solid #ef4444; color: #991b1b; }
.kargo-result-warning { background: #fef3c7; border-left: 3px solid #f59e0b; color: #92400e; }

/* ===== PDF popup modal (etiket görüntüleyici) ===== */
.kargo-pdf-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 100002;
}
.kargo-pdf-modal {
    position: fixed; top: 4%; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 900px; height: 92%;
    background: #fff; border-radius: 8px;
    z-index: 100003; display: flex; flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.kargo-pdf-modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid #e5e7eb;
}
.kargo-pdf-modal-head h3 { margin: 0; font-size: 15px; }
.kargo-pdf-modal-actions { display: flex; gap: 8px; align-items: center; }
.kargo-pdf-modal-close {
    background: none; border: none; font-size: 26px; cursor: pointer;
    color: #999; line-height: 1; padding: 0 4px;
}
.kargo-pdf-modal-close:hover { color: #000; }
.kargo-pdf-modal-iframe {
    flex: 1; border: none; width: 100%; background: #525659;
    border-radius: 0 0 8px 8px;
}
body.kargo-pdf-modal-open { overflow: hidden; }

/* ===== Müşteri siparişlerim — kargo özeti kutusu ===== */
.kargo-customer-summary {
    margin: 28px 0;
    padding: 22px 24px;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.kargo-customer-summary h2 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}
.kargo-customer-intro {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}
.kargo-customer-package {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.kargo-customer-package:last-child { margin-bottom: 0; }

.kargo-customer-pkg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.kargo-customer-pkg-no {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.kargo-customer-products {
    margin: 0 0 12px;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
    list-style: disc;
}
.kargo-customer-products li { margin: 2px 0; }

.kargo-customer-tracking {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-top: 8px;
    background: #f0f6fc;
    border: 1px solid #cfe2f3;
    border-radius: 6px;
    flex-wrap: wrap;
}
.kargo-customer-trackno-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}
.kargo-customer-trackno-label {
    color: #6b7280;
    font-weight: 600;
}
.kargo-customer-trackno {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    font-weight: 600;
    color: #0b3a66;
    background: #fff;
    padding: 4px 10px;
    border: 1px solid #cfe2f3;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.kargo-customer-copy {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #cfe2f3;
    border-radius: 4px;
    color: #2271b1;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.kargo-customer-copy:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}
.kargo-customer-copy.kargo-customer-copied {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}
.kargo-customer-track-btn {
    background: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
    padding: 6px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 4px !important;
    text-decoration: none;
}
.kargo-customer-track-btn:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

.kargo-customer-meta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    font-size: 13px;
    color: #4b5563;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.kargo-customer-meta strong { color: #111827; }

.kargo-customer-pending {
    margin: 8px 0 0;
    padding: 10px 12px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
    border-radius: 0 4px 4px 0;
}
.kargo-customer-delivered {
    margin: 8px 0 0;
    padding: 8px 12px;
    background: #f0fdf4;
    border-left: 3px solid #16a34a;
    font-size: 13px;
    color: #166534;
    border-radius: 0 4px 4px 0;
}

/* ===== Override select (manuel durum) ===== */
.kargo-override-select {
    font-size: 11px;
    padding: 2px 4px;
    height: 28px;
}
.kargo-admin-action-sep {
    width: 1px;
    height: 18px;
    background: #e5e7eb;
    margin: 0 2px;
}

/* ===== Icon buttons (metabox aksiyonları) ===== */
.kargo-package-actions {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.kargo-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #f6f7f7;
    color: #2271b1;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.kargo-icon-btn:not([disabled]):hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}
.kargo-icon-btn:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff inset;
}
.kargo-icon-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}
.kargo-icon-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}
.kargo-icon-btn-danger {
    color: #b32d2e;
    border-color: #d4a8a8;
}
.kargo-icon-btn-danger:not([disabled]):hover {
    background: #b32d2e;
    color: #fff;
    border-color: #b32d2e;
}
.kargo-icon-btn-danger:not([disabled]):focus-visible {
    outline: 2px solid #b32d2e;
    outline-offset: 2px;
}
.kargo-icon-btn-mini {
    width: 22px;
    height: 22px;
    border-radius: 3px;
}
.kargo-icon-btn-mini .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}
.kargo-icon-btn.kargo-copied {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}
.kargo-icon-btn-spin .dashicons {
    animation: kargo-spin 0.8s linear infinite;
}
@keyframes kargo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   Kargo shipments-list pagination — WP'nin default'u çıplak link
   görünümünde kalıyor. Buton stili veriyoruz (admin tema uyumlu).
   ============================================================ */
.tablenav-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 0;
}
.tablenav-pages .displaying-num {
    color: #50575e;
    font-size: 13px;
    margin-right: 8px;
}
.tablenav-pages .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 28px;
    transition: all 0.12s ease;
}
.tablenav-pages a.page-numbers:hover {
    background: #f0f6fc;
    border-color: #2271b1;
    color: #135e96;
}
.tablenav-pages a.page-numbers:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
}
.tablenav-pages .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    cursor: default;
}
.tablenav-pages .page-numbers.dots {
    border: none;
    background: transparent;
    color: #50575e;
    cursor: default;
    padding: 0 4px;
    min-width: auto;
}
