/*
 * Soverse SaaS ERP - Custom Style Overrides
 * This file is automatically loaded by the Perfex CRM core in assets_helper.php, template_helper.php and themes_helper.php
 */

/* ==========================================================================
   1. DataTables - Centering and Styling "No Data" Row (Minimal Design)
   ========================================================================== */
table.dataTable tbody tr td.dataTables_empty {
    text-align: center !important;
    background: none !important; /* Hide the ugly PNG illustration with cloud and lines */
    height: auto !important; /* Remove the huge 228px height */
    padding: 50px 20px !important; /* Clean, modern padding */
    color: #64748b !important; /* Slate gray text color */
    font-size: 14px !important;
    font-weight: 500 !important;
    border-bottom: 0 !important;
}

/* Minimal FontAwesome Folder Open Icon */
table.dataTable tbody tr td.dataTables_empty::before {
    content: "\f07c" !important; /* FontAwesome folder-open icon */
    font-family: "FontAwesome", "Font Awesome 5 Free" !important;
    font-weight: 400 !important;
    display: block !important;
    font-size: 28px !important; /* Minimal small icon size */
    color: #cbd5e1 !important; /* Soft gray icon */
    margin: 0 auto 10px auto !important;
    opacity: 0.8 !important;
}

/* ==========================================================================
   2. PolyUtilities Column Display Filters (Styled as a compact, premium inline toolbar)
   ========================================================================== */
.poly-utilities-filter {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom: 0 !important; /* Merge with the table header border */
    padding: 6px 12px !important; /* Tight, compact spacing */
    margin-bottom: 0 !important; /* No extra height gap */
    border-top-left-radius: 6px !important;
    border-top-right-radius: 6px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    box-shadow: none !important;
}

/* Add a minimal colon label prefix */
.poly-utilities-filter::before {
    content: "Sütunlar:" !important;
    font-weight: 600 !important;
    color: #64748b !important;
    font-size: 11.5px !important;
    margin-right: 2px !important;
}

/* Style each checkbox item container */
.poly-item-filter {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 0 !important;
    background: transparent !important; /* Make background clean and transparent */
    border: 0 !important; /* Remove borders for individual items */
    padding: 2px 4px !important;
    border-radius: 0 !important;
    cursor: pointer !important;
}

.poly-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 0 !important;
    cursor: pointer !important;
    font-size: 12px !important; /* Compact text size */
    color: #475569 !important; /* Darker slate gray text */
    font-weight: 500 !important;
}

/* Modern Styled Checkbox */
.poly-label input[type="checkbox"].poly-checkbox {
    margin: 0 !important;
    accent-color: #6366f1 !important; /* Indigo primary checkmark */
    width: 13px !important; /* Compact checkbox size */
    height: 13px !important;
    cursor: pointer !important;
}

.poly-label span {
    margin-left: 0 !important;
    top: 0 !important;
}

/* Reorder reset button styling */
.poly_utilities_reset_order_columns {
    color: #64748b !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    transition: all 0.2s !important;
    margin-left: 5px !important;
}

.poly_utilities_reset_order_columns:hover {
    color: #6366f1 !important;
    border-color: #6366f1 !important;
    background: #f5f3ff !important;
}

/* ==========================================================================
   3. SweetAlert Column Selector Modal Styling
   ========================================================================== */
.poly-utilities-filter-modal {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    padding: 15px !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
}

/* Style each checkbox item container inside the modal */
.poly-utilities-filter-modal .poly-item-filter {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 0 !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
}

.poly-utilities-filter-modal .poly-item-filter:hover {
    border-color: #6366f1 !important;
    background: #f5f3ff !important;
}

.poly-utilities-filter-modal .poly-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 0 !important;
    cursor: pointer !important;
    font-size: 13px !important;
    color: #334155 !important;
    font-weight: 500 !important;
}

/* Modern Styled Checkbox inside modal */
.poly-utilities-filter-modal .poly-label input[type="checkbox"].poly-checkbox {
    margin: 0 !important;
    accent-color: #6366f1 !important;
    width: 15px !important;
    height: 15px !important;
    cursor: pointer !important;
}

/* Fix for anchor inside custom table tools button */
.poly-button-tools a {
    color: inherit !important;
    text-decoration: none !important;
    display: inline-block !important;
}

/* ==========================================================================
   4. UI/UX - Modal Close Button Color & Visibility Fix (Anti White-on-White)
   ========================================================================== */
.modal-header .close, 
.modal-header .close span,
.modal-dialog button.close[data-dismiss="modal"],
.modal-dialog button.close[data-dismiss="modal"] span {
    color: #475569 !important; /* Dark Slate Gray */
    opacity: 0.8 !important;
    text-shadow: none !important;
    outline: none !important;
}

.modal-header .close:hover, 
.modal-header .close:hover span,
.modal-dialog button.close[data-dismiss="modal"]:hover,
.modal-dialog button.close[data-dismiss="modal"]:hover span {
    color: #0f172a !important; /* Darker Slate Gray on Hover */
    opacity: 1 !important;
}

/* ==========================================================================
   5. UI/UX - Status Badge Contrast Fix
   ========================================================================== */
.project-heading .label-default,
.tasks-table .label-default {
    background-color: #f1f5f9 !important; /* Soft gray background */
    color: #475569 !important; /* Highly readable slate gray text */
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   6. UI/UX - Header Navigation Badges Alignment
   ========================================================================== */
ul.nav.navbar-nav.navbar-right li a .label {
    top: 5px !important;
    padding: 2px 5px !important;
    font-size: 10px !important;
}

/* ==========================================================================
   7. UI/UX - Datatables Pagination Active Button Contrast Fix
   ========================================================================== */
#wrapper .pagination > .active > a,
#wrapper .pagination > .active > a:hover,
#wrapper .pagination > .active > a:focus,
#wrapper .pagination > .active > span,
#wrapper .pagination > .active > span:hover,
#wrapper .pagination > .active > span:focus,
#wrapper .dataTables_paginate .paginate_button.active a,
#wrapper .dataTables_paginate .paginate_button.active a:hover,
#wrapper .dataTables_paginate .paginate_button.active a:focus,
#wrapper .dataTables_paginate .paginate_button.current a,
#wrapper .dataTables_paginate .paginate_button.current a:hover,
#wrapper .dataTables_paginate .paginate_button.current a:focus,
.pagination > .active > a, 
.pagination > .active > a:focus, 
.pagination > .active > a:hover, 
.pagination > .active > span, 
.pagination > .active > span:focus, 
.pagination > .active > span:hover {
    color: #ffffff !important;
    background-color: #4f5da7 !important;
    border-color: #4f5da7 !important;
}

/* ==========================================================================
   8. Sütun Özelleştirme (Column Customizer) UI Styles
   ========================================================================== */
/* Hide the old horizontal checkbox list */
.poly-utilities-filter, .poly-utilities-filter-modal {
    display: none !important;
}

/* Customize Columns Button Group */
.dt-column-customizer-btn-group {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-left: 8px !important;
}

.dt-column-customizer-btn-group button {
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 4px !important;
}

/* Customize Columns Dropdown Menu */
.dt-column-customizer-menu {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 0 !important;
    min-width: 230px !important;
    max-height: 380px !important;
    overflow-y: auto !important;
    z-index: 1050 !important;
    background: #ffffff !important;
}

.dt-column-customizer-menu li {
    padding: 6px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    transition: background 0.15s ease !important;
    list-style: none !important;
}

.dt-column-customizer-menu li:hover {
    background-color: #f8fafc !important;
}

.dt-column-customizer-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    margin: 0 !important;
    cursor: pointer !important;
    flex-grow: 1 !important;
}

/* Small Premium Toggle Switch (iOS Style) */
.switch-small {
    position: relative !important;
    display: inline-block !important;
    width: 36px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.switch-small input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.switch-small .slider {
    position: absolute !important;
    cursor: pointer !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: #cbd5e1 !important;
    transition: .25s !important;
    border-radius: 20px !important;
}

.switch-small .slider:before {
    position: absolute !important;
    content: "" !important;
    height: 14px !important;
    width: 14px !important;
    left: 3px !important;
    bottom: 3px !important;
    background-color: white !important;
    transition: .25s !important;
    border-radius: 50% !important;
}

.switch-small input:checked + .slider {
    background-color: #6366f1 !important; /* Premium Indigo Accent */
}

.switch-small input:checked + .slider:before {
    transform: translateX(16px) !important;
}

/* ==========================================================================
   9. Table First Column Alignment Fix (Avoid center-aligning non-checkbox columns)
   ========================================================================== */
body.poly-utilities table.dataTable thead th:first-child,
body.poly-utilities table.dataTable tbody td:first-child,
body.poly-utilities .table thead th:first-child,
body.poly-utilities .table tbody td:first-child {
    text-align: left !important;
}

body.poly-utilities table.dataTable thead th:first-child:has(input[type="checkbox"]),
body.poly-utilities table.dataTable tbody td:first-child:has(input[type="checkbox"]),
body.poly-utilities table.dataTable thead th.not-export:first-child,
body.poly-utilities table.dataTable tbody td.not-export:first-child {
    text-align: center !important;
}

/* Force dataTables_empty (no records found row) to remain center-aligned */
body.poly-utilities table.dataTable tbody td.dataTables_empty {
    text-align: center !important;
}

/* Reset negative margins on table-responsive that cause clipping/cut-off borders on left/right */
body.poly-utilities .panel-table-full .dataTables_wrapper .table-responsive,
body.poly-utilities .table-responsive {
    margin-left: 0px !important;
    margin-right: 0px !important;
}

/* ==========================================================================
   10. UI/UX - Modal Close Button Contrast Fix
   ========================================================================== */
.modal-header .close,
.modal-header button.close[data-dismiss="modal"] span {
    color: #475569 !important; /* Koyu Slate Gray */
    opacity: 0.85 !important;
    text-shadow: none !important;
    font-size: 24px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}
.modal-header .close:hover,
.modal-header button.close[data-dismiss="modal"] span:hover {
    color: #0f172a !important; /* Çok koyu Slate Gray */
    opacity: 1 !important;
}

/* ==========================================================================
   11. UI/UX - Form Elements Height Standardization (36px)
   ========================================================================== */
.form-control {
    height: 36px !important;
    line-height: 22px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    box-sizing: border-box !important;
}

body.poly-utilities .bootstrap-select > .btn-default,
body.poly-utilities .bootstrap-select > .btn-default:focus,
body.poly-utilities .bootstrap-select .btn.dropdown-toggle {
    min-height: 36px !important;
    height: 36px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    line-height: 22px !important;
    box-sizing: border-box !important;
}

.select2-container--default .select2-selection--single,
.select2-container .select2-selection--single {
    height: 36px !important;
    min-height: 36px !important;
    line-height: 34px !important;
    box-sizing: border-box !important;
}
/* Eşleşen label hizalaması */
.form-group label {
    margin-bottom: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* ==========================================================================
   12. UI/UX - Horizontal Scroll for 26+ Project Tabs
   ========================================================================== */
.nav-tabs-horizontal,
.horizontal-tabs,
#wrapper .nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 1px !important;
}
.nav-tabs-horizontal li,
.horizontal-tabs li,
#wrapper .nav-tabs li {
    flex: 0 0 auto !important;
    float: none !important;
}

/* ==========================================================================
   13. UI/UX - Border Radius and Visual Consistency Standard
   ========================================================================== */
/* Butonlar, inputlar ve eklenti seçim alanları için 6px radius */
.btn,
.form-control,
.input-group-addon,
.bootstrap-select .btn.dropdown-toggle,
.select2-container--default .select2-selection--single {
    border-radius: 6px !important;
}
/* Paneller ve modaller için 8px radius */
.panel_s,
.panel_s .panel-body,
.modal-content,
.modal-header {
    border-radius: 8px !important;
}
.modal-header {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.modal-footer {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ==========================================================================
   14. UI/UX - Scoped Item Editor Table Dropdown Fix
   ========================================================================== */
table.items,
.estimate-items-table,
.invoice-items-table,
#invoice-form table.items,
#proposal-form table.items {
    overflow: visible !important;
}
body.admin .table-responsive:has(table.items),
body.admin .table-responsive:has(.estimate-items-table),
body.admin .table-responsive:has(.invoice-items-table) {
    overflow: visible !important;
}


/* ==========================================================================
   15. Public Proposal/Estimate/Invoice View Style Enhancements
   ========================================================================== */
body.proposal-view .panel_s,
body.estimates-view .panel_s,
body.invoice-view .panel_s {
    background: #ffffff !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 8px !important;
    padding: 25px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
    margin-bottom: 20px !important;
}
body.proposal-view .proposal-right .panel_s,
body.estimates-view .proposal-right .panel_s,
body.invoice-view .proposal-right .panel_s {
    padding: 20px !important;
}

/* ==========================================================================
   16. Public View Item Table Styling and Fixed Layout (No Horizontal Scroll)
   ========================================================================== */
body.proposal-view table.items,
body.estimates-view table.items,
body.invoice-view table.items {
    table-layout: fixed !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
    border-collapse: collapse !important;
}
body.proposal-view table.items thead th,
body.estimates-view table.items thead th,
body.invoice-view table.items thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 10px !important;
}
body.proposal-view table.items tbody td,
body.estimates-view table.items tbody td,
body.invoice-view table.items tbody td {
    background: #ffffff !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: 0 !important;
    font-size: 12.5px !important;
    padding: 12px 10px !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}
body.proposal-view table.items tbody tr:hover td,
body.estimates-view table.items tbody tr:hover td,
body.invoice-view table.items tbody tr:hover td {
    background: #f8fafc !important;
}

/* Explicit column widths to ensure prices are always visible without scrolling */
body.proposal-view table.items th:nth-child(1),
body.estimates-view table.items th:nth-child(1),
body.invoice-view table.items th:nth-child(1) { width: 5% !important; }
body.proposal-view table.items th:nth-child(2),
body.estimates-view table.items th:nth-child(2),
body.invoice-view table.items th:nth-child(2) { width: 50% !important; }
body.proposal-view table.items th:nth-child(3),
body.estimates-view table.items th:nth-child(3),
body.invoice-view table.items th:nth-child(3) { width: 10% !important; }
body.proposal-view table.items th:nth-child(4),
body.estimates-view table.items th:nth-child(4),
body.invoice-view table.items th:nth-child(4) { width: 12% !important; }
body.proposal-view table.items th:nth-child(5),
body.estimates-view table.items th:nth-child(5),
body.invoice-view table.items th:nth-child(5) { width: 10% !important; }
body.proposal-view table.items th:nth-child(6),
body.estimates-view table.items th:nth-child(6),
body.invoice-view table.items th:nth-child(6) { width: 13% !important; }

/* ==========================================================================
   17. Public View Item Table Text Contrast & Border Overrides
   ========================================================================== */
body.proposal-view .proposal-left table.items td,
body.proposal-view .proposal-left table.items td strong,
body.proposal-view .proposal-left table.items td span,
body.proposal-view .proposal-left table.items td p,
body.proposal-view .proposal-left table.items td small,
body.proposal-view .proposal-left table.items td em,
body.proposal-view .proposal-left table.items td a,
body.estimates-view .proposal-left table.items td,
body.estimates-view .proposal-left table.items td strong,
body.estimates-view .proposal-left table.items td span,
body.estimates-view .proposal-left table.items td p,
body.estimates-view .proposal-left table.items td small,
body.estimates-view .proposal-left table.items td em,
body.estimates-view .proposal-left table.items td a,
body.invoice-view .proposal-left table.items td,
body.invoice-view .proposal-left table.items td strong,
body.invoice-view .proposal-left table.items td span,
body.invoice-view .proposal-left table.items td p,
body.invoice-view .proposal-left table.items td small,
body.invoice-view .proposal-left table.items td em,
body.invoice-view .proposal-left table.items td a {
    color: #334155 !important; /* Koyu Slate - yüksek kontrastlı okunabilir renk */
}

/* Hyperlinks within items */
body.proposal-view .proposal-left table.items td a,
body.estimates-view .proposal-left table.items td a,
body.invoice-view .proposal-left table.items td a {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* Clean Line-Based Table Layout (Remove Vertical Borders) */
body.proposal-view .proposal-left table.items td,
body.proposal-view .proposal-left table.items th,
body.estimates-view .proposal-left table.items td,
body.estimates-view .proposal-left table.items th,
body.invoice-view .proposal-left table.items td,
body.invoice-view .proposal-left table.items th {
    border-left: 0 !important;
    border-right: 0 !important;
}


