.salary-container {
    padding: 20px;
    font-family: 'Qatar', sans-serif;
    direction: rtl;
}

.salary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.salary-header h2 {
    color: #820c22;
    margin: 0;
    font-size: 24px;
}

.salary-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.salary-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Qatar', sans-serif;
    transition: all 0.3s;
}

.salary-btn-primary {
    background: #820c22;
    color: #fff;
}

.salary-btn-primary:hover {
    background: #6a0a1b !important;
}

.salary-btn-accent {
    background: #fac40d;
    color: #000;
}

.salary-btn-accent:hover {
    background: #e0b00c !important;
}

.salary-btn-danger {
    background: #e74c3c;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
}

.salary-btn-danger:hover {
    background: #c0392b !important;
}

.salary-btn-edit {
    background: #2980b9;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
}

.salary-btn-edit:hover {
    background: #2471a3 !important;
}

.salary-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.salary-btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.salary-toggle-active-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Qatar', sans-serif;
    transition: all 0.3s;
    background: #28a745;
    color: #fff;
}

.salary-toggle-active-btn:hover {
    opacity: 0.85;
}

.salary-toggle-active-btn.salary-toggle-inactive {
    background: #ccc;
    color: #666;
}

.salary-toggle-active-btn.salary-toggle-inactive:hover {
    background: #bbb;
}

.salary-toggle-track {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.4);
    vertical-align: middle;
    transition: background 0.3s;
}

.salary-toggle-inactive .salary-toggle-track {
    background: rgba(0, 0, 0, 0.15);
}

.salary-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s;
}

.salary-toggle-active-btn.salary-toggle-active .salary-toggle-knob {
    transform: translateX(14px);
}

.salary-toggle-active-btn.salary-toggle-inactive .salary-toggle-knob {
    transform: translateX(0);
}

.salary-toggle-label {
    vertical-align: middle;
}

.salary-row-inactive td {
    opacity: 0.45;
}

.salary-row-inactive .salary-toggle-active-btn {
    opacity: 1;
}

.salary-tabs {
    display: flex;
    border-bottom: 3px solid #820c22;
    margin-bottom: 20px;
    overflow-x: auto;
}

.salary-tab {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    font-family: 'Qatar', sans-serif;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.salary-tab.active {
    color: #820c22;
}

.salary-tab:hover {
    color: white;
}

.salary-tab-content {
    display: none;
}

.salary-tab-content.active {
    display: block;
}

.salary-filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    align-items: flex-end;
}

.salary-tx-filters .salary-filter-group select {
    min-width: 180px;
}

.salary-tx-filters .salary-filter-group input {
    min-width: 200px;
}

.salary-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 130px;
}

.salary-summary-count-box {
    margin-inline-start: auto;
    min-width: 130px;
    padding: 9px 14px;
    border: 1px solid #d7e6dc;
    border-radius: 8px;
    background: #f3fbf6;
    color: #155724;
    text-align: center;
}

.salary-summary-count-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
}

.salary-summary-count-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.salary-filter-group label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 13px;
}

.salary-filter-group input,
.salary-filter-group select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Qatar', sans-serif;
    transition: border-color 0.3s;
}

.salary-filter-group input:focus,
.salary-filter-group select:focus {
    outline: none;
    border-color: #820c22;
}

.salary-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.salary-stat-card {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.salary-stat-base {
    background: linear-gradient(135deg, #820c22, #a01533);
}

.salary-stat-deduction {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.salary-stat-recompense {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.salary-stat-net {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
}

.salary-stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.salary-stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.salary-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

.salary-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.salary-table th {
    background: #820c22;
    color: #fff;
    padding: 12px 10px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}

.salary-table th.sortable-col {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.salary-table th.sortable-col:hover {
    background: #a0102e;
}

.salary-table th.sortable-col .sort-arrow {
    display: inline-block;
    margin-right: 4px;
    font-size: 10px;
    opacity: 0.4;
    vertical-align: middle;
}

.salary-table th.sortable-col.sort-desc .sort-arrow,
.salary-table th.sortable-col.sort-asc .sort-arrow {
    opacity: 1;
}

.salary-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    vertical-align: middle;
    font-weight: bold;
}

.salary-table tbody tr:hover {
    background: #faf5f6;
}

.salary-table tbody tr:nth-child(even) {
    background: #fefcfc;
}

.salary-table tbody tr:nth-child(even):hover {
    background: #faf5f6;
}

.salary-loading {
    text-align: center;
    padding: 40px;
    color: #820c22;
    font-style: italic;
}

.salary-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.salary-badge-deduction {
    background: #e74c3c;
}

.salary-badge-recompense {
    background: #27ae60;
}

.salary-badge-automatic {
    background: #3498db;
}

.salary-badge-manual {
    background: #820c22;
}

.salary-amount-deduction {
    color: #e74c3c;
    font-weight: bold;
}

.salary-amount-recompense {
    color: #27ae60;
    font-weight: bold;
}

.salary-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.salary-pagination button {
    padding: 6px 14px;
    border: 2px solid #820c22;
    background: #fff;
    color: #820c22;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Qatar', sans-serif;
    font-weight: bold;
    transition: all 0.3s;
}

.salary-pagination button.active,
.salary-pagination button:hover {
    background: #820c22;
    color: #fff;
}

.salary-pg-btn {
    padding: 6px 12px;
    border: 2px solid #820c22;
    background: #fff;
    color: #820c22;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Qatar', sans-serif;
    font-weight: bold;
    transition: all 0.2s;
}

.salary-pg-btn.active,
.salary-pg-btn:not([disabled]):hover {
    background: #820c22;
    color: #fff;
}

.salary-pg-btn[disabled] {
    opacity: 0.35;
    cursor: default;
}

.salary-pagination-info {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    padding: 0 8px;
}

.salary-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.swal2-container {
    z-index: 100000 !important;
}

.salary-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.salary-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #820c22;
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.salary-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.salary-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.salary-modal-body {
    padding: 20px;
}

.salary-settings-section {
    margin-bottom: 28px;
}

.salary-section-header {
    margin-bottom: 12px;
}

.salary-section-header h3 {
    margin: 0 0 4px;
    color: #820c22;
    font-size: 20px;
}

.salary-section-header p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.salary-manual-form-card {
    background: #fff8ef;
    border: 1px solid #f3d7a6;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}

.salary-settings-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.salary-settings-row:last-child {
    border-bottom: none;
}

.salary-settings-label {
    flex: 1;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.salary-settings-amount {
    width: 100px;
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Qatar', sans-serif;
}

.salary-settings-amount:focus {
    border-color: #820c22;
    outline: none;
}

.salary-settings-desc {
    font-size: 12px;
    color: #666;
    flex: 1;
}

.salary-actions-cell {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.salary-bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
}

.salary-bulk-count {
    font-weight: bold;
    color: #856404;
    font-size: 14px;
}

#tx-select-all,
.tx-row-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #820c22;
}

.salary-form-row {
    display: flex;
    gap: 15px;
}

.salary-form-row .salary-form-group {
    flex: 1;
}

.salary-form-group {
    margin-bottom: 15px;
    position: relative;
}

.salary-form-label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.salary-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Qatar', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.salary-form-input:focus {
    outline: none;
    border-color: #820c22;
}

.salary-setting-preview {
    background: #f8f9fa;
    border: 1px solid #e3e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 15px;
}

.salary-setting-preview-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    color: #333;
    font-size: 14px;
}

.salary-setting-preview-row+.salary-setting-preview-row {
    margin-top: 10px;
}

.salary-setting-preview-row strong {
    color: #820c22;
    font-size: 16px;
}

.salary-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #820c22;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.salary-search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.salary-search-item:hover {
    background: #faf5f6;
}

.salary-search-item:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .salary-container {
        padding: 8px;
    }

    .salary-header {
        flex-direction: column;
        align-items: stretch;
    }

    .salary-header h2 {
        font-size: 18px;
        text-align: center;
    }

    .salary-header-actions {
        justify-content: center;
    }

    .salary-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .salary-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .salary-filters-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .salary-filter-group {
        min-width: 100%;
    }

    .salary-summary-count-box {
        width: 100%;
        margin-inline-start: 0;
    }

    .salary-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .salary-stat-card {
        padding: 12px 8px;
    }

    .salary-stat-value {
        font-size: 20px;
    }

    .salary-stat-label {
        font-size: 11px;
    }

    .salary-table-wrapper {
        margin-left: -8px;
        margin-right: -8px;
        padding: 0 4px;
    }

    .salary-table {
        font-size: 11px;
        min-width: 700px;
    }

    .salary-table th,
    .salary-table td {
        padding: 6px 4px;
    }

    .salary-modal {
        width: 98%;
        max-height: 92vh;
        border-radius: 8px;
    }

    .salary-modal-header {
        padding: 12px 14px;
        border-radius: 8px 8px 0 0;
    }

    .salary-modal-header h3 {
        font-size: 15px;
    }

    .salary-modal-body {
        padding: 12px;
    }

    .salary-form-row {
        flex-direction: column;
        gap: 0;
    }

    .salary-setting-preview-row {
        flex-direction: column;
    }

    .salary-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .salary-btn-sm {
        padding: 5px 8px;
        font-size: 11px;
    }

    .salary-actions-cell {
        flex-wrap: wrap;
        gap: 3px;
    }

    .salary-pagination {
        gap: 4px;
    }

    .salary-pg-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .salary-bulk-actions-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .salary-search-dropdown {
        z-index: 10000001;
    }
}

@media (max-width: 480px) {
    .salary-container {
        padding: 4px;
    }

    .salary-header h2 {
        font-size: 16px;
    }

    .salary-stats-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .salary-stat-value {
        font-size: 18px;
    }
    .salary-stat-value .inline-pct,
    .salary-stat-value .inline-total {
        font-size: 0.7em;
        display: block;
        margin-top: 2px;
    }

    .salary-table {
        min-width: 600px;
    }

    .salary-stat-card {
        padding: 10px 6px;
    }

    .salary-filters-bar {
        padding: 8px;
    }

    .salary-filter-group input,
    .salary-filter-group select {
        padding: 6px 8px;
        font-size: 13px;
    }

    .salary-summary-count-box {
        width: 100%;
        margin-inline-start: 0;
    }

    .salary-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .salary-modal-header {
        border-radius: 0;
    }

    .salary-form-label {
        font-size: 13px;
    }

    .salary-form-input {
        padding: 8px 10px;
        font-size: 13px;
    }

    .salary-manual-form-card {
        padding: 12px;
    }

    .salary-settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .salary-settings-amount {
        width: 100%;
    }
}

/* ─── Bonus column inline totals (admin table) ─── */
.col-bonus {
    white-space: nowrap;
}
.col-bonus .table-sub {
    font-size: 0.8em;
    color: #888;
    font-weight: normal;
}

@media (max-width: 768px) {
    .col-bonus {
        font-size: 13px;
    }
    .col-bonus .table-sub {
        font-size: 0.75em;
        display: block;
    }
}

@media (max-width: 480px) {
    .col-bonus .table-sub {
        font-size: 0.7em;
    }
}

.col-actual-salary {
    font-weight: 600;
    color: #2980b9;
}

@media (max-width: 768px) {
    .col-actual-salary {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .col-actual-salary {
        font-size: 12px;
    }
}

/* ─── Inline spans in stat values (percentage, total-bonuses) ─── */
.salary-stat-value .inline-pct,
.salary-stat-value .inline-total {
    display: inline-block;
    font-size: 0.8em;
    opacity: 0.85;
    margin-right: 2px;
}

@media (max-width: 768px) {
    .salary-stat-value .inline-pct,
    .salary-stat-value .inline-total {
        font-size: 0.75em;
    }
}

.salary-stat-actual .salary-stat-value {
    color: #fff !important;
}

.salary-stat-actual {
    background: linear-gradient(135deg, #2980b9, #3498db) !important;
    color: #fff !important;
}

.salary-stat-actual .salary-stat-label {
    color: #fff !important;
}

.salary-calc-detail {
    margin-top: 20px;
}

.salary-calc-detail .salary-table th {
    background: #2980b9;
    color: #fff;
}

.salary-calc-equation {
    background: #f8f9fa;
    border: 1px dashed #ccc;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    margin-top: 10px;
    direction: rtl;
}

.salary-calc-final {
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #2980b9;
    background: #eaf4fb;
}

.salary-calc-formula {
    background: #fff5f7;
    border: 2px solid #820c22;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    direction: rtl;
    line-height: 1.9;
    margin-top: 12px;
}

.attendance-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 12px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.attendance-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.attendance-date-nav .salary-form-input {
    width: 150px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    border: 1.5px solid #ddd;
    padding: 6px 10px;
}
.attendance-refresh {
    display: flex;
    align-items: center;
    gap: 10px;
}
.attendance-last-update {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 20px;
}
.attendance-smart-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
#att-search {
    flex: 1;
    min-width: 180px;
    border-radius: 8px;
    border: 1.5px solid #ddd;
    padding: 8px 14px;
}
#att-status-filter {
    width: 170px;
    border-radius: 8px;
    border: 1.5px solid #ddd;
    padding: 8px 14px;
}
.attendance-summary-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.att-stat-card {
    text-align: center;
    padding: 14px 8px;
    border-radius: 12px;
    font-weight: bold;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    user-select: none;
}
.att-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.att-stat-active {
    transform: translateY(-2px);
    box-shadow: 0 3px 14px rgba(0,0,0,0.18) !important;
    outline: 2px solid rgba(0,0,0,0.2);
    outline-offset: -2px;
}
.att-stat-present { background: #d4edda; color: #155724; }
.att-stat-late { background: #fff3cd; color: #856404; }
.att-stat-absent { background: #f8d7da; color: #721c24; }
.att-stat-upcoming { background: #e2e3e5; color: #383d41; }
.att-stat-total { background: #e8f4fd; color: #0c5460; }
.att-stat-num { font-size: 26px; display: block; margin-bottom: 2px; line-height: 1.2; }
.att-stat-label { font-size: 12px; opacity: 0.85; }

.attendance-accordion { margin-top: 8px; }

.att-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
    font-size: 16px;
    background: #fafafa;
    border-radius: 12px;
}

.att-teacher-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: box-shadow 0.2s;
    border-right: 4px solid transparent;
}
.att-teacher-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}
.att-status-absent { border-right-color: #e74c3c; }
.att-status-late { border-right-color: #f39c12; }
.att-status-present { border-right-color: #27ae60; }
.att-status-upcoming { border-right-color: #6c757d; }

.att-teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    gap: 12px;
    flex-wrap: wrap;
}
.att-teacher-header:hover {
    background: rgba(0,0,0,0.015);
}
.att-teacher-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.att-toggle-icon {
    font-size: 11px;
    color: #aaa;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.att-toggle-icon.expanded { transform: rotate(90deg); }
.att-teacher-name {
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-teacher-mid {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.att-teacher-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.att-ratio {
    font-weight: bold;
    font-size: 18px;
    min-width: 44px;
    text-align: center;
}
.att-lessons-total-badge {
    font-size: 11px;
    background: #e8f4fd;
    color: #0c5460;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.att-summary-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.att-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}
.att-badge-present { background: #d4edda; color: #155724; }
.att-badge-late { background: #fff3cd; color: #856404; }
.att-badge-absent { background: #f8d7da; color: #721c24; }
.att-badge-upcoming { background: #e2e3e5; color: #383d41; }

.att-lessons-panel {
    padding: 0 14px 14px;
    border-top: 1px solid #f0f0f0;
}
.att-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    padding-top: 12px;
}
.att-lesson-card {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #eee;
    transition: transform 0.15s, box-shadow 0.15s;
}
.att-lesson-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.att-timeline-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
    text-align: center;
    cursor: pointer;
}
.att-livekit-timeline {
    margin-top: 8px;
    border-top: 1px solid #e8e8e8;
    padding-top: 6px;
}
.att-livekit-event {
    display: grid;
    grid-template-columns: 58px 52px 52px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    font-size: 11px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.att-livekit-event:last-child { border-bottom: none; }
.att-livekit-time { color: #555; font-weight: 700; }
.att-livekit-action { color: #555; }
.att-livekit-joined .att-livekit-action { color: #1e8449; }
.att-livekit-left .att-livekit-action { color: #b03a2e; }
.att-livekit-role { color: #777; }
.att-livekit-name {
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.att-lesson-present { background: rgba(39,174,96,0.04); border-color: rgba(39,174,96,0.15); }
.att-lesson-late { background: rgba(243,156,18,0.04); border-color: rgba(243,156,18,0.15); }
.att-lesson-absent { background: rgba(231,76,60,0.04); border-color: rgba(231,76,60,0.15); }
.att-lesson-postponed { background: rgba(52,152,219,0.04); border-color: rgba(52,152,219,0.15); }
.att-lesson-upcoming { background: rgba(108,117,125,0.04); border-color: rgba(108,117,125,0.15); }
.att-lesson-vacation { background: rgba(0,159,167,0.04); border-color: rgba(0,159,167,0.15); }
.att-lesson-compensation { background: rgba(13,102,115,0.04); border-color: rgba(13,102,115,0.15); }

.att-lesson-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
}
.att-lesson-student {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-lesson-name {
    font-size: 11px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.att-sec-row {
    display: flex;
    align-items: center;
    padding: 5px 4px;
    border-bottom: 1px solid #f0f0f0;
    gap: 0;
}
.att-sec-row:last-of-type { border-bottom: none; }
.att-sec-icon { font-size: 12px; width: 18px; text-align: center; flex-shrink: 0; }
.att-sec-lbl { color: #888; font-size: 11px; width: 60px; text-align: right; padding-right: 2px; flex-shrink: 0; }
.att-sec-val { font-size: 13px; font-weight: 600; flex: 1; text-align: center; }
.att-sec-empty { color: #ccc; font-weight: 400; }
.att-sec-div { width: 1px; height: 14px; background: #e5e5e5; margin: 0 6px; flex-shrink: 0; }
.att-dur-val { color: #2980b9; }
.att-delta-pos { color: #27ae60; }
.att-delta-neg { color: #e74c3c; }
.att-delta-zero { color: #888; }

.att-sts-row { display: flex; justify-content: center; margin-top: 6px; }
.att-sts-badge {
    font-size: 13px;
    padding: 5px 16px;
    border-radius: 14px;
    font-weight: bold;
}
.att-sts-present { background: #d4edda; color: #155724; }
.att-sts-late { background: #fff3cd; color: #856404; }
.att-sts-absent { background: #f8d7da; color: #721c24; }

.att-stu-row { background: transparent; border-radius: 0; margin: 0; }
.att-stu-row .att-sec-lbl { color: #2980b9; }

.att-sec-box {
    border-radius: 8px;
    padding: 4px 6px;
    margin: 3px 0;
    border: 1px solid rgba(0,0,0,0.04);
}
.att-sec-box-time { background: #f8f9fa; }
.att-sec-box-teacher { background: #f0f9f0; }
.att-sec-box-student { background: #f0f7ff; }
.att-sec-box-stats { background: #faf5ff; }

.att-stu-stats {
    text-align: center;
    font-size: 11px;
    color: #2980b9;
    padding: 4px 0 2px;
    border-top: 1px dashed rgba(52,152,219,0.15);
    margin-top: 2px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.att-sessions-info {
    text-align: center;
    font-size: 11px;
    color: #e67e22;
    font-weight: bold;
    margin-top: 4px;
}
.att-stu-abs-info {
    font-size: 11px;
    color: #e67e22;
    font-weight: bold;
    background: rgba(230,126,14,0.08);
    padding: 4px 10px;
    border-radius: 8px;
    margin-top: 4px;
    text-align: center;
}
.att-sibling-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: #8e44ad;
    font-weight: bold;
    background: rgba(142,68,173,0.08);
    padding: 4px 10px;
    border-radius: 8px;
    margin-top: 4px;
    text-align: center;
}
.att-rescheduled-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: #2980b9;
    font-weight: bold;
    background: rgba(52,152,219,0.08);
    padding: 4px 10px;
    border-radius: 8px;
    margin-top: 4px;
    text-align: center;
}
.att-sts-vacation { background: rgba(0,159,167,0.12); color: #009fa7; }
.att-sts-comp { background: rgba(13,102,115,0.1); color: #0d6673; }
.att-sts-upcoming { background: rgba(108,117,125,0.1); color: #6c757d; }

.att-lesson-postponed-banner {
    text-align: center;
    padding: 7px;
    background: rgba(52,152,219,0.1);
    border-radius: 8px;
    color: #2980b9;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}
.att-lesson-upcoming-banner {
    text-align: center;
    padding: 7px;
    background: rgba(108,117,125,0.1);
    border-radius: 8px;
    color: #6c757d;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}
.att-lesson-vacation-banner {
    text-align: center;
    padding: 7px;
    background: rgba(0,159,167,0.1);
    border-radius: 8px;
    color: #009fa7;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}
.att-lesson-compensation-banner {
    text-align: center;
    padding: 7px;
    background: rgba(13,102,115,0.1);
    border-radius: 8px;
    color: #0d6673;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}
.att-lesson-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.att-lesson-present { background: rgba(39,174,96,0.04); border-color: rgba(39,174,96,0.15); }
.att-lesson-late { background: rgba(243,156,18,0.04); border-color: rgba(243,156,18,0.15); }
.att-lesson-absent { background: rgba(231,76,60,0.04); border-color: rgba(231,76,60,0.15); }
.att-lesson-postponed { background: rgba(52,152,219,0.04); border-color: rgba(52,152,219,0.15); }
.att-lesson-upcoming { background: rgba(108,117,125,0.04); border-color: rgba(108,117,125,0.15); }
.att-lesson-vacation { background: rgba(0,159,167,0.04); border-color: rgba(0,159,167,0.15); }
.att-lesson-compensation { background: rgba(13,102,115,0.04); border-color: rgba(13,102,115,0.15); }

.att-lesson-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 6px;
}
.att-lesson-student {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-lesson-name {
    font-size: 11px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.att-lesson-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}
.att-lesson-row:last-child { border-bottom: none; }
.att-lesson-row span:first-child {
    color: #777;
    font-size: 12px;
}
.att-lesson-row span:last-child {
    font-weight: 600;
    font-size: 13px;
}
.att-lesson-postponed-banner {
    text-align: center;
    padding: 8px;
    background: rgba(52,152,219,0.1);
    border-radius: 8px;
    color: #2980b9;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}
.att-lesson-upcoming-banner {
    text-align: center;
    padding: 8px;
    background: rgba(108,117,125,0.1);
    border-radius: 8px;
    color: #6c757d;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}
.att-attendance-val { font-weight: bold; }
.att-delta-positive { color: #27ae60; font-weight: bold; }
.att-delta-negative { color: #e74c3c; font-weight: bold; }
.att-delta-zero { color: #27ae60; font-weight: bold; }
.att-sessions-row span:last-child { color: #e67e22; }
.att-sessions-badge { font-size: 11px; }

.att-lesson-status-row {
    margin-top: 6px;
    text-align: center;
}
.att-status-label {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    display: inline-block;
}
.att-label-present { background: #d4edda; color: #155724; }
.att-label-late { background: #fff3cd; color: #856404; }
.att-label-absent { background: #f8d7da; color: #721c24; }
.att-label-postponed { background: #d1ecf1; color: #0c5460; }
.att-label-upcoming { background: #e2e3e5; color: #383d41; }

.att-student-absent-badge {
    font-size: 11px;
    color: #e67e22;
    font-weight: bold;
    background: rgba(230,126,14,0.08);
    padding: 4px 10px;
    border-radius: 8px;
    margin-top: 6px;
    text-align: center;
}

.att-student-time-row {
    background: rgba(52,152,219,0.06) !important;
}
.att-student-time-row span:first-child {
    color: #2980b9 !important;
}

@media (max-width: 768px) {
    .attendance-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }
    .attendance-date-nav { justify-content: center; }
    .attendance-smart-filters { flex-direction: column; }
    #att-search { min-width: unset; }
    #att-status-filter { width: 100%; }
    .attendance-summary-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .att-stat-num { font-size: 20px; }
    .att-teacher-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px;
    }
    .att-teacher-stats {
        width: 100%;
        justify-content: flex-start;
    }
    .att-lessons-grid {
        grid-template-columns: 1fr;
    }
    .att-lessons-panel {
        padding: 0 8px 10px;
    }
}
@media (max-width: 480px) {
    .attendance-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .att-stat-card { padding: 10px 6px; }
    .att-stat-num { font-size: 18px; }
    .att-teacher-name { font-size: 14px; }
    .att-lesson-card { padding: 10px 12px; }
    .attendance-date-nav .salary-form-input { width: 130px; }
}

/* ============================================
   SALARY TRANSFER STYLES
   ============================================ */

.salary-btn-success {
    background: #28a745;
    color: #fff;
}

.salary-btn-success:hover {
    background: #218838 !important;
    transform: translateY(-1px);
}

.salary-transfer-info-section {
    background: linear-gradient(135deg, #f0faf3, #e8f5e9);
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.salary-transfer-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

.salary-transfer-info-row:not(:last-child) {
    border-bottom: 1px dashed #a5d6a7;
}

.salary-transfer-info-row span {
    color: #555;
}

.salary-transfer-info-row strong {
    font-size: 15px;
}

.salary-transfer-payment-card {
    border: 1px solid #e0d5c8;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #fdf9f3;
}

.salary-transfer-payment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.salary-transfer-payment-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.salary-transfer-payment-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.salary-transfer-payment-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.salary-transfer-payment-field span {
    color: #777;
}

.salary-transfer-payment-field strong {
    color: #333;
    font-size: 14px;
}

.salary-transfer-receipt-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 2px dashed rgba(130, 12, 34, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fefaf5;
}

.salary-transfer-receipt-upload:hover {
    border-color: #820c22;
    background: #fff5f0;
}

.salary-transfer-receipt-upload.dragover {
    border-color: #28a745;
    background: #e8f5e9;
    transform: scale(1.02);
}

.salary-transfer-receipt-upload span {
    font-size: 14px;
    color: #555;
}

.salary-bottom-sheet-overlay {
    align-items: flex-end;
}

.salary-bottom-sheet {
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.salary-bottom-sheet-handle {
    border-radius: 20px 20px 0 0 !important;
    position: relative;
}

.salary-bottom-sheet-handle::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.salary-transfer-submit-spinner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 769px) {
    .salary-bottom-sheet-overlay {
        align-items: center;
    }
    .salary-bottom-sheet {
        border-radius: 12px !important;
        animation: none;
    }
    .salary-bottom-sheet-handle {
        border-radius: 12px 12px 0 0 !important;
    }
    .salary-bottom-sheet-handle::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .salary-transfer-info-row {
        font-size: 13px;
    }
    .salary-transfer-info-row strong {
        font-size: 14px;
    }
    .salary-transfer-payment-field {
        font-size: 12px;
    }
    .salary-transfer-payment-field strong {
        font-size: 13px;
    }
    .salary-transfer-receipt-upload {
        padding: 12px;
    }
    .salary-transfer-receipt-upload span {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .salary-transfer-info-section {
        padding: 10px 12px;
    }
    .salary-transfer-payment-card {
        padding: 10px 12px;
    }
    .salary-transfer-payment-header {
        font-size: 13px;
    }
    .salary-transfer-payment-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .salary-btn-success {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 15px;
    }
}
