/* ============================================
   UTILITY CLASSES - Replaces inline styles
   ============================================ */

/* ----------------------------------------
   Margin Utilities
   ---------------------------------------- */
.mt-4 { margin-top: 4px; }
.mt-5 { margin-top: 5px; }
.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mb-4 { margin-bottom: 4px; }
.mb-5 { margin-bottom: 5px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-15 { margin-bottom: 15px; }
.ml-6 { margin-left: 6px; }
.ml-8 { margin-left: 8px; }
.ml-10 { margin-left: 10px; }
.ml-20 { margin-left: 20px; }

/* ----------------------------------------
   Padding Utilities
   ---------------------------------------- */
.p-8 { padding: 8px; }
.pt-8 { padding-top: 8px; }

/* ----------------------------------------
   Display Utilities
   ---------------------------------------- */
.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-grid { display: grid; }

/* ----------------------------------------
   Flex Utilities
   ---------------------------------------- */
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

/* ----------------------------------------
   Gap Utilities
   ---------------------------------------- */
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* ----------------------------------------
   Width Utilities
   ---------------------------------------- */
.w-100 { width: 100%; }
.w-100px { width: 100px; }
.w-120px { width: 120px; }
.w-150px { width: 150px; }
.w-160px { width: 160px; }
.w-180px { width: 180px; }
.w-60 { width: 60px; }
.w-200px { width: 200px; }
.min-w-80 { min-width: 80px; }
.min-w-90 { min-width: 90px; }
.min-w-100 { min-width: 100px; }
.min-w-110 { min-width: 110px; }
.min-w-120 { min-width: 120px; }
.min-w-130 { min-width: 130px; }
.min-w-140 { min-width: 140px; }
.min-w-150 { min-width: 150px; }
.min-w-160 { min-width: 160px; }
.min-w-180 { min-width: 180px; }
.min-w-200 { min-width: 200px; }
.min-w-220 { min-width: 220px; }
.min-w-260 { min-width: 260px; }
.min-w-280 { min-width: 280px; }
.min-w-300 { min-width: 300px; }
.max-w-160 { max-width: 160px; }
.max-w-520 { max-width: 520px; }
.max-w-800 { max-width: 800px; }
.max-w-900 { max-width: 900px; }
.max-h-200 { max-height: 200px; }
.max-h-400 { max-height: 400px; }
.max-h-90vh { max-height: 90vh; }

/* ----------------------------------------
   Text Utilities
   ---------------------------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-white { color: white; }
.text-muted { color: #718096; }
.text-muted-dark { color: #4a5568; }
.text-hint { color: #666; }
.text-link { color: #4299e1; }
.font-bold { font-weight: bold; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-13 { font-size: 13px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.nowrap { white-space: nowrap; }

/* ----------------------------------------
   Cursor Utilities
   ---------------------------------------- */
.cursor-pointer { cursor: pointer; }

/* ----------------------------------------
   Overflow Utilities
   ---------------------------------------- */
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

/* ----------------------------------------
   Position Utilities
   ---------------------------------------- */
.sticky-top { position: sticky; top: 0; }

/* ----------------------------------------
   List Utilities
   ---------------------------------------- */
.list-none { list-style: none; padding: 0; margin: 0; }
.list-disc { list-style: disc; margin-left: 20px; }

/* ----------------------------------------
   Combined Utilities (Common Patterns)
   ---------------------------------------- */
.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.radio-group-row {
    display: flex;
    gap: 15px;
    padding-top: 8px;
}

.flex-row-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flex-row-gap-10 {
    display: flex;
    gap: 10px;
}

.flex-row-gap-15 {
    display: flex;
    gap: 15px;
    align-items: center;
}

.flex-between-mb8 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.flex-between-mb10 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.flex-between-mb15 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* ----------------------------------------
   Form Field Labels
   ---------------------------------------- */
.field-label {
    font-size: 12px;
    color: #4a5568;
    display: block;
    margin-bottom: 4px;
}

.field-label-bold {
    font-size: 12px;
    color: #4a5568;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.section-heading {
    margin: 0;
    font-size: 14px;
    color: #2d3748;
}

/* ----------------------------------------
   Hint/Help Text
   ---------------------------------------- */
.hint-text {
    color: #666;
    font-style: italic;
    display: block;
    margin-top: 8px;
}

.hint-text-inline {
    margin-left: 20px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.hint-text-blue {
    color: #4299e1;
    font-style: italic;
    display: block;
    margin-top: 4px;
}

.section-desc {
    color: #4a5568;
    font-size: 13px;
    margin-bottom: 12px;
}

.section-desc-sm {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
}

/* ----------------------------------------
   Background Utilities
   ---------------------------------------- */
.bg-light { background: #f8fafc; }
.bg-white { background: white; }
.bg-success-light { background: rgba(56, 161, 105, 0.1); border-color: rgba(56, 161, 105, 0.3); }
.bg-danger-light { background: rgba(229, 62, 62, 0.1); border-color: rgba(229, 62, 62, 0.3); }
.bg-info-light { background: rgba(66, 153, 225, 0.1); border-color: rgba(66, 153, 225, 0.3); }
.bg-purple-light { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.3); }
.bg-expenses-card { background: rgba(229, 62, 62, 0.2); border-color: rgba(229, 62, 62, 0.3); }
.bg-bills-card { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.3); }

/* ----------------------------------------
   Border Utilities
   ---------------------------------------- */
.rounded { border-radius: 8px; }
.rounded-5 { border-radius: 5px; }
.border { border: 1px solid #e2e8f0; }
.border-t-2 { border-top: 2px solid #4a5568; }

/* ----------------------------------------
   Filter/Control Box
   ---------------------------------------- */
.filter-box {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.filter-box-gradient {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid rgba(66, 153, 225, 0.2);
}

.category-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.category-add-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(66, 153, 225, 0.2);
}

/* ----------------------------------------
   Grid Layouts
   ---------------------------------------- */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.grid-auto-280 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ----------------------------------------
   Table Cell Alignments
   ---------------------------------------- */
.cell-right { text-align: right; }
.cell-center { text-align: center; }

/* ----------------------------------------
   Bill Modal Item Table Styles
   ---------------------------------------- */
.bill-item-header {
    padding: 8px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.bill-item-header-right {
    padding: 8px;
    text-align: right;
    border: 1px solid #e2e8f0;
}

.bill-item-header-center {
    padding: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.bill-grand-total {
    text-align: right;
    margin-top: 10px;
    padding: 10px;
    background: #edf2f7;
    border-radius: 5px;
}

/* ----------------------------------------
   Session List
   ---------------------------------------- */
.session-list-info {
    font-size: 12px;
    color: #718096;
}

/* ----------------------------------------
   Email Template Placeholder
   ---------------------------------------- */
.template-placeholder {
    background: #ebf8ff;
    color: #3182ce;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* ----------------------------------------
   Control Panel Tab Navigation
   ---------------------------------------- */
.control-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.control-tab {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.control-tab:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.control-tab.active {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border-color: #3182ce;
}

.control-tab-content {
    display: none;
}

.control-tab-content.active {
    display: block;
}

/* ----------------------------------------
   Compact Horizontal Buttons (Control Page)
   ---------------------------------------- */
.management-buttons-compact {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row !important;
    gap: 6px;
    align-items: center;
}

.management-buttons-compact .btn {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.management-buttons-compact .hint-text {
    width: 100%;
    margin-top: 6px;
}

/* Settings grid compact layout */
.settings-actions-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.settings-actions-compact .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Small button modifier */
.btn-sm {
    padding: 5px 10px !important;
    font-size: 11px !important;
}

/* Compact Add button for Category form */
.btn-compact {
    padding: 6px 12px;
    font-size: 12px;
}
/* ============================================
   CONFIRMATION DIALOG STYLES
   ============================================ */
.confirm-dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--duration-fast) var(--easing-default);
}

.confirm-dialog-overlay.active {
    display: flex;
}

.confirm-dialog {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-6);
    width: 90%;
    max-width: 400px;
    animation: slideUp var(--duration-normal) var(--easing-default);
    z-index: 9999;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    text-align: center;
}

.confirm-dialog h3 {
    margin: var(--space-4) 0 var(--space-3);
    font-size: 18px;
    color: var(--gray-900);
    font-weight: 600;
}

.confirm-dialog p {
    margin: 0 0 var(--space-6);
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

.confirm-actions .btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
}

.confirm-actions .btn-secondary {
    background: var(--gray-100);
    color: var(--gray-800);
}

.confirm-actions .btn-secondary:hover {
    background: var(--gray-200);
}

.confirm-actions .btn-danger {
    background: var(--danger);
    color: var(--white);
}

.confirm-actions .btn-danger:hover {
    background: var(--danger-dark);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Bulk Adjustment UI
   ======================================== */

.adjustment-entry-table {
    flex: 1;
    min-width: 300px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 15px;
    background: var(--white);
}

.adjustment-entry-table h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.adjustment-entry-table .table-responsive {
    max-height: 400px;
    overflow-y: auto;
}

.adjustment-entry-table .data-table thead {
    position: sticky;
    top: 0;
    background: var(--gray-50);
    z-index: 1;
}

.adjustment-entry-table .data-table th {
    font-size: 12px;
    font-weight: 600;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid var(--gray-300);
}

.adjustment-entry-table .data-table td {
    padding: 8px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
}

.adjustment-entry-table .badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
}

.adjustment-entry-table .badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.adjustment-entry-table .badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

.adjustment-entry-table .bg-warning-light {
    background: rgba(255, 193, 7, 0.1);
}

.btn-group-compact {
    display: flex;
    gap: 8px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    height: auto;
    border-radius: 4px;
}
