/* ====================================
   MODERN UI COMPONENTS - PROJECT TRACKER
   A comprehensive CSS file for modern, clean UI styling
   ==================================== */

/* ====================================
   FORM CONTROLS & INPUT FIELDS
   ==================================== */

/* Base input field styling - Enhanced */
.form-control, .form-select, .form-check-input {
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    transition: all 0.15s ease-in-out !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: #495057 !important;
    position: relative !important;
}

/* Focus states for all form controls */
.form-control:focus, .form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
    background-color: #ffffff !important;
}

/* Hover states */
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: #ced4da !important;
}

/* Disabled states */
.form-control:disabled, .form-select:disabled {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Placeholder styling */
.form-control::placeholder {
    color: #adb5bd !important;
    font-style: normal !important;
    font-weight: 400 !important;
}

/* Checkbox specific styling */
.form-check-input {
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    margin-top: 0.125em !important;
    margin-right: 8px !important;
    vertical-align: top !important;
    background-color: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 4px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    print-color-adjust: exact !important;
    background-size: 14px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    position: relative !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e") !important;
    background-size: 14px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    transform: scale(1.05) !important;
    transition: none !important;
}

/* Force immediate display of checked state */
.form-check-input:checked:focus {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e") !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    transform: scale(1.05) !important;
}

/* Prevent any pseudo-element conflicts */
.form-check-input::before,
.form-check-input::after {
    content: none !important;
    display: none !important;
}

.form-check-input:hover:not(:checked):not(:disabled) {
    border-color: #0d6efd !important;
    background-color: #f8f9fa !important;
    transform: scale(1.02) !important;
}

.form-check-input:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    transition: none !important;
}

.form-check-input:active {
    transform: scale(0.95) !important;
}

.form-check-input:indeterminate {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3e%3cpath fill-rule='evenodd' d='M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z' clip-rule='evenodd'/%3e%3c/svg%3e") !important;
}

/* Additional class for enhanced visual feedback */
.form-check-input.checkbox-checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e") !important;
    transform: scale(1.05) !important;
}

/* Radio button styling */
.form-check-input[type="radio"] {
    border-radius: 50% !important;
}

.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='white'/%3e%3c/svg%3e") !important;
}

/* Form check wrapper */
.form-check {
    display: block !important;
    min-height: 1.5rem !important;
    padding-left: 2rem !important;
    margin-bottom: 0.125rem !important;
}

.form-check .form-check-input {
    float: left !important;
    margin-left: -2rem !important;
}

.form-check-label {
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #374151 !important;
}

/* Inline checkboxes */
.form-check-inline {
    display: inline-block !important;
    margin-right: 1rem !important;
}

/* Switch styling */
.form-switch .form-check-input {
    width: 2.5rem !important;
    height: 1.25rem !important;
    margin-top: 0.125rem !important;
    margin-left: -2.5rem !important;
    background-color: #dee2e6 !important; /* Light gray when unchecked */
    border: 1px solid #ced4da !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
    background-position: left center !important;
    border-radius: 2rem !important;
    transition: all 0.15s ease-in-out !important;
    cursor: pointer !important;
}

.form-switch .form-check-input:hover:not(:checked):not(:disabled) {
    background-color: #c6d0dd !important; /* Slightly darker gray on hover when unchecked */
    border-color: #b8c2cc !important;
}

.form-switch .form-check-input:checked {
    background-color: #0d6efd !important; /* Bootstrap primary blue when checked */
    border-color: #0d6efd !important;
    background-position: right center !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:checked:hover:not(:disabled) {
    background-color: #0b5ed7 !important; /* Slightly darker blue on hover when checked */
    border-color: #0b5ed7 !important;
}

.form-switch .form-check-input:active,
.form-switch .form-check-input:active:checked {
    background-color: inherit !important; /* Prevent white flash during click */
    border-color: inherit !important;
}

.form-switch .form-check-input:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:focus:not(:checked) {
    background-color: #dee2e6 !important; /* Maintain gray color when focused but not checked */
}

.form-switch .form-check-input:focus:checked {
    background-color: #0d6efd !important; /* Maintain blue color when focused and checked */
}

.form-switch .form-check-label {
    cursor: pointer !important;
    margin-left: 0.5rem !important;
}

/* Disabled state styling */
.form-switch .form-check-input:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.form-switch .form-check-input:disabled + .form-check-label {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Small input variants */
.form-control-sm, .form-select-sm {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
}

/* Large input variants */
.form-control-lg, .form-select-lg {
    padding: 16px 20px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
}

/* Input focus states */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15) !important;
    outline: none !important;
    background-color: #ffffff !important;
}

/* Input hover states */
.form-control:hover:not(:focus), .form-select:hover:not(:focus) {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04) !important;
}

/* Disabled input states */
.form-control:disabled, .form-select:disabled {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #64748b !important;
    opacity: 0.7 !important;
}

/* Invalid input states */
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

/* Valid input states */
.form-control.is-valid, .form-select.is-valid {
    border-color: #198754 !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15) !important;
}

/* Placeholder styling */
.form-control::placeholder {
    color: #94a3b8 !important;
    font-style: italic !important;
    opacity: 1 !important;
}

/* Textarea specific styling */
textarea.form-control {
    resize: vertical !important;
    min-height: 80px !important;
}

/* File input styling */
.form-control[type="file"] {
    padding: 8px 12px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-style: dashed !important;
}

.form-control[type="file"]:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

/* ====================================
   INPUT GROUPS - IMPROVED ALIGNMENT
   ==================================== */

/* Base input group styling */
.input-group {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Input group text (icon container) */
.input-group-text {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 2px solid #e9ecef !important;
    border-right: none !important;
    border-radius: 8px 0 0 8px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 45px !important;
    padding: 12px 12px !important;
    font-size: 14px !important;
}

/* Form controls in input groups */
.input-group .form-control {
    border: 2px solid #e9ecef !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    background-color: #ffffff !important;
    transition: all 0.15s ease-in-out !important;
    position: relative !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Form select in input groups */
.input-group .form-select {
    border: 2px solid #e9ecef !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    background-color: #ffffff !important;
    transition: all 0.15s ease-in-out !important;
    position: relative !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Middle elements (when there are multiple elements) */
.input-group .form-control:not(:first-child):not(:last-child),
.input-group .form-select:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
}

/* Buttons in input groups */
.input-group .btn {
    border: 2px solid #e9ecef !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease-in-out !important;
}

/* Focus states */
.input-group .form-control:focus,
.input-group .form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    z-index: 5 !important;
}

.input-group .form-control:focus + .input-group-text,
.input-group .input-group-text:has(+ .form-control:focus) {
    border-color: #0d6efd !important;
}

/* Icon alignment */
.input-group-text i {
    font-size: 14px !important;
    line-height: 1 !important;
    color: #64748b !important;
}

/* Fix for specific edge cases */
.input-group .border-end-0 {
    border-right: none !important;
}

.input-group .border-start-0 {
    border-left: none !important;
}

.input-group .ps-0 {
    padding-left: 16px !important;
}

/* Invalid state styling */
.input-group .form-control.is-invalid,
.input-group .form-select.is-invalid {
    border-color: #dc3545 !important;
}

.input-group .form-control.is-invalid:focus,
.input-group .form-select.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

/* Read-only and disabled states */
.input-group .form-control-plaintext {
    border: 2px solid #e9ecef !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    padding: 12px 16px !important;
    background-color: #f8f9fa !important;
    color: #495057 !important;
}

/* ====================================
   FORM LABELS & HELP TEXT
   ==================================== */

.form-label {
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
    font-size: 14px !important;
}

.form-text {
    color: #64748b !important;
    font-size: 12px !important;
    margin-top: 4px !important;
}

/* Required field indicator */
.form-label.required::after {
    content: ' *' !important;
    color: #dc3545 !important;
}

/* ====================================
   BUTTON STYLING
   ==================================== */

.btn {
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    border: 2px solid transparent !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-sm {
    padding: 8px 16px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
}

.btn-lg {
    padding: 16px 32px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
}

.btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Primary button styling */
.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%) !important;
    border-color: #0b5ed7 !important;
    color: #ffffff !important;
}

/* Secondary button styling */
.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%) !important;
    border-color: #5a6268 !important;
    color: #ffffff !important;
}

/* Success button styling */
.btn-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%) !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #157347 0%, #146c43 100%) !important;
    border-color: #157347 !important;
    color: #ffffff !important;
}

/* Danger button styling */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%) !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #bb2d3b 0%, #b02a37 100%) !important;
    border-color: #bb2d3b !important;
    color: #ffffff !important;
}

/* Warning button styling */
.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%) !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ffca2c 0%, #ffd60a 100%) !important;
    border-color: #ffca2c !important;
    color: #000000 !important;
}

/* Info button styling */
.btn-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #3dd5f3 100%) !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, #3dd5f3 0%, #6edff6 100%) !important;
    border-color: #3dd5f3 !important;
    color: #000000 !important;
}

/* Outline button variants */
.btn-outline-primary {
    border-color: #0d6efd !important;
    color: #0d6efd !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn-outline-secondary {
    border-color: #6c757d !important;
    color: #6c757d !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn-outline-success {
    border-color: #198754 !important;
    color: #198754 !important;
    background-color: transparent !important;
}

.btn-outline-success:hover {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background-color: transparent !important;
}

.btn-outline-danger:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-outline-warning {
    border-color: #ffc107 !important;
    color: #ffc107 !important;
    background-color: transparent !important;
}

.btn-outline-warning:hover {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

.btn-outline-info {
    border-color: #0dcaf0 !important;
    color: #0dcaf0 !important;
    background-color: transparent !important;
}

.btn-outline-info:hover {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

/* ====================================
   CARD STYLING
   ==================================== */

.card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    background-color: #ffffff !important;
    overflow: hidden !important;
}

.card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    color: #212529 !important;
}

.card-header.bg-primary {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.card-header h1, .card-header h2, .card-header h3, 
.card-header h4, .card-header h5, .card-header h6,
.card-header .card-title {
    color: inherit !important;
    margin-bottom: 0 !important;
}

/* Specific fix for field config form header */
.admin-form .card-header {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.admin-form .card-header h4,
.admin-form .card-header .card-title {
    color: #ffffff !important;
}

.card-body {
    padding: 24px !important;
}

.card-footer {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 0 12px 12px !important;
    padding: 16px 24px !important;
}

.card-title {
    color: #1e293b !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

.card-text {
    color: #475569 !important;
}

.card-text .fas {
    color: #64748b !important;
}

/* ====================================
   FORM SPACING & LAYOUT
   ==================================== */

.form-group, .mb-3 {
    margin-bottom: 24px !important;
}

.row.g-3 > * {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* ====================================
   ALERTS & NOTIFICATIONS
   ==================================== */

.alert {
    border: none !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    margin-bottom: 20px !important;
    border-left: 4px solid transparent !important;
}

.alert-primary {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af !important;
    border-left-color: #3b82f6 !important;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #166534 !important;
    border-left-color: #22c55e !important;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    color: #92400e !important;
    border-left-color: #f59e0b !important;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #991b1b !important;
    border-left-color: #ef4444 !important;
}

.alert-info {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%) !important;
    color: #0c4a6e !important;
    border-left-color: #0ea5e9 !important;
}

/* ====================================
   BADGES & PILLS
   ==================================== */

.badge {
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.badge i {
    font-size: 10px !important;
    margin: 0 !important;
}

/* ====================================
   NAVIGATION & BREADCRUMBS
   ==================================== */

.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.breadcrumb-item a {
    color: #64748b !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.breadcrumb-item a:hover {
    color: #0d6efd !important;
}

.breadcrumb-item.active {
    color: #374151 !important;
    font-weight: 500 !important;
}

/* ====================================
   TABLES
   ==================================== */

.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600 !important;
    color: #374151 !important;
    padding: 16px !important;
}

.table td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.02) !important;
}

/* ====================================
   PAGINATION
   ==================================== */

.pagination .page-link {
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    margin: 0 2px !important;
    padding: 8px 12px !important;
    color: #64748b !important;
    background-color: #ffffff !important;
    transition: all 0.15s ease !important;
}

.pagination .page-link:hover {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #374151 !important;
    transform: translateY(-1px) !important;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

/* ====================================
   UTILITY CLASSES
   ==================================== */

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.rounded-modern {
    border-radius: 8px !important;
}

.rounded-modern-lg {
    border-radius: 12px !important;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 768px) {
    .btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
    
    .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .form-control, .form-select {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    .card-body {
        padding: 16px !important;
    }
    
    .card-header {
        padding: 16px !important;
    }
}

/* ====================================
   DARK MODE SUPPORT (Optional)
   ==================================== */

@media (prefers-color-scheme: dark) {
    .card {
        background-color: #1f2937 !important;
        color: #f9fafb !important;
    }
    
    .card-header {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%) !important;
        border-bottom-color: #4b5563 !important;
    }
    
    .form-control, .form-select {
        background-color: #374151 !important;
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }
    
    .form-control:focus, .form-select:focus {
        background-color: #374151 !important;
        border-color: #3b82f6 !important;
    }
    
    .table th {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%) !important;
        color: #f9fafb !important;
        border-bottom-color: #4b5563 !important;
    }
    
    .table td {
        border-bottom-color: #4b5563 !important;
        color: #f9fafb !important;
    }
    
    .table tbody tr:hover {
        background-color: rgba(59, 130, 246, 0.1) !important;
    }
}

/* ====================================
   ICON STYLING & VISUAL ELEMENTS
   ==================================== */

/* Ensure FontAwesome icons are properly displayed */
.fas, .far, .fab, .fal, .fad {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
}

/* Status icons for checkboxes and other elements */
.text-success i, .text-danger i, .text-warning i, .text-info i {
    font-size: 0.875rem !important;
    margin-right: 0.25rem !important;
}

/* Badge styling improvements */
.badge {
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.badge i {
    font-size: 10px !important;
    margin: 0 !important;
}

/* Status indicators */
.status-indicator {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.status-indicator.status-active {
    background-color: rgba(34, 197, 94, 0.1) !important;
    color: #16a34a !important;
}

.status-indicator.status-inactive {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

.status-indicator.status-pending {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
}

/* ====================================
   TOOLTIP IMPROVEMENTS
   ==================================== */

.tooltip {
    font-size: 12px !important;
}

.tooltip-inner {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    max-width: 200px !important;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #1f2937 !important;
}

.tooltip.bs-tooltip-right .tooltip-arrow::before {
    border-right-color: #1f2937 !important;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #1f2937 !important;
}

.tooltip.bs-tooltip-left .tooltip-arrow::before {
    border-left-color: #1f2937 !important;
}

/* ====================================
   LOADING STATES & SPINNERS
   ==================================== */

.spinner-border-sm {
    width: 1rem !important;
    height: 1rem !important;
    border-width: 0.125rem !important;
}

.search-spinner .spinner-border-sm {
    width: 0.875rem !important;
    height: 0.875rem !important;
}

/* Loading overlay */
.loading-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    border-radius: 8px !important;
}

.loading-overlay .spinner-border {
    color: #0d6efd !important;
}

/* Text visibility fixes */
.card-title {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.card-text {
    color: #475569 !important;
}

.card-text .fas {
    color: #64748b !important;
}

/* Project info visibility */
.project-info .card-title,
.project-info h5 {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.project-info .card-text,
.project-info p {
    color: #475569 !important;
}

.project-info small {
    color: #64748b !important;
}

/* Ensure good contrast for all text elements */
.text-muted {
    color: #6b7280 !important;
}

/* Fix any invisible text issues */
.opacity-75 {
    opacity: 0.85 !important;
    color: #64748b !important;
}

/* Checkbox label visibility */
.form-check-label {
    color: #374151 !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

/* Make sure disabled fields are visible but distinguishable */
.form-check.dimmed-field .form-check-label {
    color: #9ca3af !important;
    opacity: 0.7 !important;
}

/* Project info card text fixes */
.bg-primary.text-white .card-title,
.bg-primary.text-white h5 {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.bg-primary.text-white .card-text,
.bg-primary.text-white p {
    color: #ffffff !important;
}

.bg-primary.text-white small {
    color: rgba(255, 255, 255, 0.85) !important;
}

.bg-primary.text-white .fas {
    color: #ffffff !important;
}

/* Ensure project info visibility */
.card.bg-primary {
    background-color: #0d6efd !important;
}

.card.bg-primary .card-body {
    color: #ffffff !important;
}

/* Enhanced checkbox display fixes */
.form-check-input {
    /* Force proper checkbox styling even with conflicts */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    position: relative !important;
}

/* Ensure labels are clickable */
.form-check-label {
    cursor: pointer !important;
    user-select: none !important;
}
