/* ==========================================================================
   GF Dashboard — Strict scoped styles (override theme conflicts)
   ========================================================================== */

/* ---- Reset: scope everything under .gf-dashboard ---- */
.gf-dashboard *,
.gf-dashboard *::before,
.gf-dashboard *::after {
    box-sizing: border-box !important;
}

/* ---- Base button reset (prevents theme from shrinking buttons) ---- */
.gf-dashboard button,
.gf-dashboard .btn,
.gf-dashboard input[type="submit"],
.gf-dashboard input[type="button"],
.gf-dashboard select,
.gf-dashboard input[type="text"],
.gf-dashboard input[type="email"],
.gf-dashboard input[type="number"],
.gf-dashboard input[type="tel"],
.gf-dashboard input[type="url"],
.gf-dashboard input[type="date"],
.gf-dashboard input[type="time"],
.gf-dashboard textarea {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    min-height: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.gf-dashboard button,
.gf-dashboard .btn,
.gf-dashboard input[type="submit"],
.gf-dashboard input[type="button"] {
    display: inline-block !important;
    cursor: pointer !important;
    text-align: center !important;
    white-space: nowrap !important;
    user-select: none !important;
    border: 1px solid transparent !important;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    height: auto !important;
    width: auto !important;
    box-shadow: none !important;
}

/* ---- Table ---- */
.gf-dashboard .table {
    width: 100% !important;
    margin-bottom: 1rem !important;
    color: #212529 !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
}

/* Comment badge */
.gf-dashboard .gf-comment-badge {
    display: inline-block !important;
    background-color: #6c757d !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    margin-left: 6px !important;
    vertical-align: middle !important;
    min-width: 18px !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* No entries message */
.gf-dashboard .gf-no-entries {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: .25rem !important;
    padding: 60px 20px !important;
    text-align: center !important;
    min-height: 300px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 !important;
}

.gf-dashboard .gf-no-entries p {
    font-size: 1.125rem !important;
    color: #6c757d !important;
    margin: 0 !important;
}

.gf-dashboard .gf-table-loading {
    margin: 10px 0 14px !important;
    text-align: center !important;
}

.gf-dashboard .gf-table-loading-inner {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #495057 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.gf-dashboard .gf-table-loading-spinner {
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #ced4da !important;
    border-top-color: #6c757d !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: gf-table-spin 0.8s linear infinite !important;
}

@keyframes gf-table-spin {
    to { transform: rotate(360deg); }
}

/* --- Mobile responsive table: keep Date + first two fields + Actions --- */
@media (max-width: 640px) {
  .gf-dashboard #entries-table th,
  .gf-dashboard #entries-table td {
    white-space: nowrap !important;
  }

  .gf-dashboard #entries-table th:nth-child(n+4):not(:last-child),
  .gf-dashboard #entries-table td:nth-child(n+4):not(:last-child) {
    display: none !important;
  }

  .gf-dashboard .form-toggle-buttons .btn,
  .gf-dashboard .action-buttons .btn,
  .gf-dashboard .pagination .page-link {
    padding: .5rem .75rem !important;
  }
}


.gf-dashboard .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05) !important;
}
.gf-dashboard .table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.075) !important;
}
.gf-dashboard .table thead th {
    vertical-align: bottom !important;
    border-bottom: 2px solid #dee2e6 !important;
}
.gf-dashboard .table td,
.gf-dashboard .table th {
    padding: .75rem !important;
    vertical-align: top !important;
    border-top: 1px solid #dee2e6 !important;
}
.gf-dashboard .thead-dark th {
    color: #fff !important;
    background-color: #343a40 !important;
    border-color: #454d55 !important;
}

/* ---- Buttons ---- */
.gf-dashboard .btn-primary {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    padding: .375rem .75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border-radius: .25rem !important;
}
.gf-dashboard .btn-primary:hover,
.gf-dashboard .btn-primary:focus {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}
.gf-dashboard .btn-info {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    border-radius: .2rem !important;
}
.gf-dashboard .btn-info:hover,
.gf-dashboard .btn-info:focus {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}
.gf-dashboard .btn-secondary {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    padding: .375rem .75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border-radius: .25rem !important;
}
.gf-dashboard .btn-secondary:hover,
.gf-dashboard .btn-secondary:focus {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}
.gf-dashboard .btn-danger {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    border-radius: .2rem !important;
}
.gf-dashboard .btn-danger:hover,
.gf-dashboard .btn-danger:focus {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}
.gf-dashboard .btn-sm {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    border-radius: .2rem !important;
}

/* ---- Container ---- */
.gf-dashboard .container {
    width: 100% !important;
    max-width: none !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}
.fl-full-width .gf-dashboard .container,
.fl-module .gf-dashboard .container {
    width: 100% !important;
    max-width: none !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}
.gf-dashboard .my-4 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}
.gf-dashboard .mb-3 {
    margin-bottom: 1rem !important;
}

/* ---- Form selector ---- */
.gf-dashboard .form-selector-wrapper {
    margin-bottom: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}
.gf-dashboard .form-selector-wrapper label {
    font-weight: 600 !important;
    margin: 0 !important;
    color: #495057 !important;
}
.gf-dashboard .form-selector {
    padding: .5rem 2rem .5rem .75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: .25rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    min-width: 250px !important;
    height: auto !important;
}
.gf-dashboard .form-selector:focus {
    border-color: #6c757d !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25) !important;
}

/* ---- Page size selector ---- */
.gf-dashboard .gf-page-size-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: auto !important;
}
.gf-dashboard .gf-page-size-wrapper label {
    font-weight: 600 !important;
    margin: 0 !important;
    color: #495057 !important;
    font-size: .875rem !important;
    white-space: nowrap !important;
}
.gf-dashboard .gf-page-size-select {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: .2rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    min-width: 60px !important;
    height: auto !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right .4rem center !important;
    background-size: 12px 9px !important;
    padding-right: 1.4rem !important;
}

/* ---- Form toggle ---- */
.gf-dashboard .form-toggle-buttons {
    margin-bottom: 1rem !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}
.gf-dashboard .form-toggle-buttons .btn {
    margin-right: 5px !important;
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}
.gf-dashboard .form-toggle-buttons .btn.active {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    font-weight: bold !important;
}

/* ---- Pagination ---- */
.gf-dashboard .pagination {
    margin-top: 1rem !important;
    display: flex !important;
    justify-content: center !important;
    list-style: none !important;
    padding-left: 0 !important;
}
.gf-dashboard .pagination .page-item {
    margin: 0 2px !important;
    list-style: none !important;
}
.gf-dashboard .pagination .page-item::before {
    content: none !important;
}
.gf-dashboard .pagination .page-link {
    color: #fff !important;
    background-color: #6c757d !important;
    border: 1px solid #6c757d !important;
    padding: .375rem .75rem !important;
    border-radius: .25rem !important;
    display: block !important;
    text-decoration: none !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
}
.gf-dashboard .pagination .page-link:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}
.gf-dashboard .pagination .page-item.active .page-link {
    background-color: #495057 !important;
    border-color: #495057 !important;
    font-weight: bold !important;
}
.gf-dashboard .pagination .page-item.disabled .page-link {
    color: #6c757d !important;
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    pointer-events: none !important;
}

/* ---- Action buttons ---- */
.gf-dashboard .action-buttons {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}
.gf-dashboard .action-buttons .date-range-picker button,
.gf-dashboard .action-buttons .gf-download-csv,
.gf-dashboard .action-buttons .gf-edit-columns-btn {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    border-radius: .2rem !important;
}
.gf-dashboard .action-buttons .date-range-picker input {
    color: #495057 !important;
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    padding: .25rem .5rem !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    border-radius: .2rem !important;
    min-width: 180px !important;
}

.gf-dashboard #date-range,
.gf-dashboard #date-range::placeholder {
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.gf-dashboard .gf-page-size-wrapper label {
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.gf-dashboard #gf-page-size,
.gf-dashboard #gf-page-size option {
    font-size: 16px !important;
    line-height: 1.4 !important;
}
.gf-dashboard .action-buttons .date-range-picker button:hover,
.gf-dashboard .action-buttons .gf-download-csv:hover,
.gf-dashboard .action-buttons .gf-edit-columns-btn:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

/* ---- Edit Columns Modal ---- */
.gf-dashboard .gf-columns-modal-backdrop {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,.5) !important;
    z-index: 10001 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}
.gf-dashboard .gf-columns-modal-backdrop.open {
    display: flex !important;
}
.gf-dashboard .gf-columns-modal {
    background: #fff !important;
    border-radius: 6px !important;
    padding: 20px 24px !important;
    min-width: 320px !important;
    max-width: 440px !important;
    width: 90% !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.25) !important;
    max-height: 80vh !important;
    display: flex !important;
    flex-direction: column !important;
}
.gf-dashboard .gf-columns-modal h5 {
    margin: 0 0 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #212529 !important;
}
.gf-dashboard .gf-columns-list {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
    overflow-y: auto !important;
    flex: 1 !important;
}
.gf-dashboard .gf-columns-list li {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    margin-bottom: 4px !important;
    background: #fff !important;
    cursor: grab !important;
    font-size: 14px !important;
    color: #212529 !important;
    transition: background .1s !important;
    list-style: none !important;
    list-style-type: none !important;
}
.gf-dashboard .gf-columns-list li::before {
    content: none !important;
    display: none !important;
}
.gf-dashboard .gf-columns-list li::marker {
    content: none !important;
    display: none !important;
    font-size: 0 !important;
}
.gf-dashboard .gf-columns-list li:active {
    cursor: grabbing !important;
}
.gf-dashboard .gf-columns-list li.gf-col-dragging {
    opacity: .5 !important;
    background: #e9ecef !important;
}
.gf-dashboard .gf-columns-list li .gf-col-drag-handle {
    color: #adb5bd !important;
    cursor: grab !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
    user-select: none !important;
}
.gf-dashboard .gf-columns-list li input[type="checkbox"] {
    flex-shrink: 0 !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    cursor: pointer !important;
}
.gf-dashboard .gf-columns-list li label {
    flex: 1 !important;
    margin: 0 !important;
    cursor: pointer !important;
    font-weight: 400 !important;
    color: #212529 !important;
    font-size: 14px !important;
}
.gf-dashboard .gf-columns-modal-actions {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    padding-top: 12px !important;
    border-top: 1px solid #dee2e6 !important;
}