/* PROFESSIONAL ADMIN THEME v2.8 (Grid Table & Smart Print Buttons) */
@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800&display=swap');

:root {
    --pro-primary: #14294C;
    /* Ticimax Navy */
    --pro-accent: #3B82F6;
    /* Vivid Blue */
    --pro-bg: #F8FAFC;
    --pro-card-bg: #FFFFFF;
    --pro-text: #0F172A;
    --pro-text-light: #64748B;
    --pro-border: #E2E8F0;

    --primary: var(--pro-primary) !important;
    --text-main: var(--pro-text) !important;
    --bg-light: var(--pro-bg) !important;
}

body {
    background-color: var(--pro-bg) !important;
    font-family: 'Urbanist', sans-serif !important;
    color: var(--pro-text) !important;
    text-rendering: optimizeLegibility;
}

/* NO SHADOWS (Flat Design) */
*,
.btn,
.card,
.icon,
button,
::after,
::before {
    box-shadow: none !important;
    text-shadow: none !important;
}

/* CARDS */
.data-card,
.stat-card,
.filter-form,
.settings-content,
.settings-sidebar,
.integration-card,
.sync-selection-card,
.swal2-popup {
    background-color: var(--pro-card-bg) !important;
    border-radius: 20px !important;
    border: 1px solid var(--pro-border) !important;
    overflow: visible !important;
    /* Dropdownların kesilmesini engeller */
}

/* TABLE STYLE - GRID LOOK (New Requirement) */
table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: 1px solid #E2E8F0 !important;
}

th,
td {
    border: 1px solid #E2E8F0 !important;
    /* Full Grid Lines */
    padding: 12px 15px !important;
    vertical-align: middle !important;
}

thead th {
    background-color: #F1F5F9 !important;
    /* Gray Header */
    color: #475569 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    border-bottom: 2px solid #E2E8F0 !important;
}

tbody tr:hover {
    background-color: #F8FAFC !important;
}

/* GLOBAL HEIGHT STANDARDIZATION (46px) */
input[type="text"]:not(.swal2-input),
input[type="password"]:not(.swal2-input),
input[type="email"]:not(.swal2-input),
input[type="number"]:not(.swal2-input),
input[type="date"]:not(.swal2-input),
select:not(.swal2-select),
textarea:not(.swal2-textarea),
button:not([class^="swal2-"]):not(.fatura-toggle-btn):not(.fInvoice-btn):not(.more-products-btn):not(.action-toggle-btn):not(.modal-close),
.btn,
.action-btn,
.btn-submit,
.btn-secondary,
.btn-bulk-trigger,
.filter-btn-clear,
.bulk-dropdown-item {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    line-height: normal !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    border-radius: 10px !important;
}

textarea:not(.swal2-textarea) {
    height: auto !important;
    min-height: 80px !important;
    max-height: none !important;
    padding: 12px !important;
}

/* TABLE BUTTONS & PRINT BUTTONS */
/* Print Buttons Logic: Default Navy -> Printed White */
.btn-print {
    background-color: #14294C !important;
    /* Navy Background */
    color: white !important;
    border: 1px solid #14294C !important;
    border-radius: 6px !important;
    padding: 0 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    /* Compact */
    width: 100% !important;
    margin-bottom: 6px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: all 0.2s !important;
}

.btn-print:hover {
    background-color: #0F172A !important;
    opacity: 0.95;
}

/* PRINTED STATE: White Background, Navy Text */
.btn-print.printed {
    background-color: #FFFFFF !important;
    color: #14294C !important;
    border: 1px solid #14294C !important;
}

/* Other Table Buttons (e.g. Invoice) - Outline Style */
table a[href*="showInvoice"],
.more-products-btn {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    background-color: #FFFFFF !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0 !important;
}

table a[href*="showInvoice"]:hover,
.more-products-btn:hover {
    background-color: #F8FAFC !important;
    color: #14294C !important;
    border-color: #CBD5E1 !important;
}

/* FILTER & TOOLBAR */
.filter-btn-clear {
    background: transparent !important;
    border: none !important;
    color: #ef4444 !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    display: inline-block !important;
}

.toolbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.toolbar-actions>* {
    margin: 0 !important;
    height: 40px !important;
}

.toolbar-btn {
    background: white !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0 20px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    justify-content: center !important;
}

.toolbar-btn:hover {
    background: #f8fafc !important;
}

.filter-action-group {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.filter-action-group>* {
    flex: 1 !important;
    justify-content: center !important;
    text-align: center !important;
}

/* NAV - Active: Blue, Hover: Gray */
.top-nav {
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--pro-border) !important;
    border-radius: 0 0 20px 20px !important;
}

.top-nav-link.active,
.settings-nav li a.active {
    background-color: #EFF6FF !important;
    color: #1e40af !important;
    border: 1px solid #DBEAFE !important;
}

.top-nav-link.active i,
.settings-nav li a.active i {
    color: #3B82F6 !important;
}

.top-nav-link:hover:not(.active),
.settings-nav li a:hover:not(.active) {
    background-color: #F8FAFC !important;
    color: #334155 !important;
    transform: none !important;
    border-color: transparent !important;
}

/* PRIMARY BUTTONS (Filtrele, Kaydet, Onayla -> NAVY BLUE) */
.action-btn,
.btn-primary,
.btn-submit,
button[type="submit"],
.swal2-confirm,
.bulk-menu-btn,
.btn-bulk-trigger,
.sync-all-btn,
.btn-primary-orange,
.swal-btn-confirm {
    background-color: #14294C !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 0 24px !important;
    justify-content: center !important;
}

.action-btn:hover,
.btn-primary:hover,
.btn-submit:hover,
.swal2-confirm:hover,
.bulk-menu-btn:hover,
.sync-all-btn:hover,
.btn-bulk-trigger:hover {
    background-color: #0F172A !important;
    opacity: 0.95;
}

/* RED BUTTONS */
.btn-danger,
button[onclick*="delete"],
.swal2-cancel,
a[href*="clear_data"] {
    background-color: #EF4444 !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    background-color: #DC2626 !important;
}

/* SECONDARY BUTTONS (Gray) */
.swal2-deny,
.btn-secondary {
    background-color: #F8FAFC !important;
    color: #475569 !important;
    border: 1px solid #CBD5E1 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    justify-content: center !important;
}

.swal2-deny:hover,
.btn-secondary:hover {
    background-color: #E2E8F0 !important;
    color: #14294C !important;
}

/* POPUP CLOSE BUTTON (X) */
.swal2-close {
    font-size: 24px !important;
    color: #94A3B8 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    height: auto !important;
    /* Exception */
    min-height: auto !important;
}

.swal2-close:hover {
    color: #EF4444 !important;
}

/* POPUP ACTIONS */
.swal2-actions {
    display: flex !important;
    width: 100% !important;
    justify-content: center !important;
    /* Centered for standard popups */
    gap: 12px !important;
    padding: 24px 24px 20px 24px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* Fix for loading spinner alignment - Only show when active */
.swal2-loader {
    margin: 15px auto !important;
    justify-content: center !important;
    align-items: center !important;
}

.swal2-loading .swal2-loader {
    display: flex !important;
}

.swal2-loading .swal2-actions {
    justify-content: center !important;
}

.swal2-actions button {
    flex: 1 !important;
    margin: 0 !important;
    height: 48px !important;
}

/* INPUTS */
input,
select {
    border: 1px solid #E2E8F0 !important;
    background: #fff;
    color: #0F172A;
    padding: 0 12px !important;
}

input:focus,
select:focus {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.inv-container {
    text-align: left !important;
}

.inv-grid {
    text-align: left !important;
}

.inv-box {
    text-align: left !important;
}

.bulk-dropdown-container {
    position: relative;
    display: inline-block;
}

.bulk-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    padding: 8px;
    min-width: 180px;
    z-index: 50;
    display: none;
}

.bulk-dropdown-menu.show {
    display: block;
}

/* Clean Popup (No Buttons/Inputs) */
.clean-popup .swal2-actions,
.clean-popup .swal2-footer,
.clean-popup .swal2-input,
.clean-popup .swal2-textarea,
.clean-popup .swal2-select,
.clean-popup .swal2-radio,
.clean-popup .swal2-checkbox {
    display: none !important;
}

/* More Products Button Style */
.more-products-btn {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border: 1px solid #dbeafe !important;
    height: 30px !important;
    /* Fatura butonu ile eşitledik */
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 12px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    line-height: normal !important;
}

.more-products-btn i {
    color: inherit !important;
    width: 14px !important;
    height: 14px !important;
}

.more-products-btn:hover {
    background-color: #dbeafe !important;
    color: #1e3a8a !important;
    border-color: #bfdbfe !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Fatura Dropdown Styles */
.fatura-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.fatura-dropdown-menu {
    display: none;
    /* JS toggles flex */
    position: absolute;
    /* TAM SAĞ TARAF POZİSYONLAMA */
    left: 100% !important;
    top: 0 !important;
    margin-left: 5px !important;
    /* Hafif boşluk */
    transform: none !important;
    /* Varsa eski transformları temizle */

    min-width: 150px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 5px;
    z-index: 9999;
    /* En üstte */
    flex-direction: column;
    gap: 4px;
}

.fatura-toggle-btn {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    display: inline-flex !important;
    /* inline-flex for better wrapper behavior */
    align-items: center !important;
    justify-content: center !important;
    /* Center content */
    gap: 6px !important;
    padding: 0 12px !important;
    height: 30px !important;
    /* Daha kompakt yükseklik */
    min-height: auto !important;
    /* Global 46px engelini kaldır */
    max-height: 30px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: white !important;
    cursor: pointer !important;
    width: 100% !important;
    white-space: nowrap !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
}

/* Sağa açıldığı için ok sağa baksın, açılınca sola dönsün veya aşağı kalsın */
.fatura-toggle-btn svg {
    transform: rotate(-90deg);
    /* Başlangıçta sağa bakan ok */
    transition: transform 0.2s ease;
    width: 14px;
    height: 14px;
}

.fatura-toggle-btn.active svg {
    transform: rotate(0deg);
    /* Açılınca aşağı/normal */
}

.fatura-toggle-btn.active {
    border-color: #cbd5e1 !important;
    background-color: #f8fafc !important;
}

.fInvoice-btn {
    width: 100%;
    height: 30px !important;
    /* Daha kompakt yükseklik */
    min-height: auto !important;
    /* Global 46px engelini kaldır */
    display: flex !important;
    align-items: center !important;
    padding: 0 15px !important;
    border-radius: 5px !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.1s !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;

    /* İstenen Stil: Gri Çerçeveli Beyaz Buton */
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

.fInvoice-btn:hover {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Generic Action Dropdown for "İşlemler" */
.action-dropdown-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0 !important;
    top: 100% !important;
    margin-top: 5px !important;
    min-width: 180px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 6px;
    z-index: 1000;
    flex-direction: column;
    gap: 4px;
}

.action-toggle-btn {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    height: 30px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: #f8fafc !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.2s !important;
}

.action-toggle-btn:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.action-toggle-btn i,
.action-toggle-btn svg {
    color: #475569 !important;
}

.action-dropdown-item {
    width: 100%;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 12px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.2s !important;
    background: white !important;
    border: none !important;
    color: #475569 !important;
}

.action-dropdown-item:hover {
    background: #f1f5f9 !important;
    color: #1e40af !important;
}

.action-dropdown-item.danger:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.fInvoice-btn:active {
    transform: scale(0.98);
}

/* Invoice Modal Specific */
.invoice-modal-content {
    max-width: 950px !important;
    width: 95% !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

.invoice-modal-inner {
    padding: 30px !important;
}

.invoice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.invoice-modal-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-modal-info-text {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #ff6000;
}

.invoice-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.invoice-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.invoice-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-align: left;
    padding: 15px 18px;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table td {
    padding: 18px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    vertical-align: middle;
    font-size: 14px;
}

.invoice-tax-select {
    width: 100px;
    height: 38px !important;
    min-height: 38px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    background: white !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    cursor: pointer;
    outline: none;
}

.invoice-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px dashed #e2e8f0;
}

.btn-quick-invoice {
    background: #ff6000 !important;
    color: white !important;
    border: none !important;
    padding: 0 40px !important;
    height: 52px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 15px -3px rgba(255, 96, 0, 0.3) !important;
}

.btn-quick-invoice:hover {
    background: #e65600 !important;
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(255, 96, 0, 0.4) !important;
}

.badge-live {
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid #dbeafe;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}