﻿/* ================================================
   Tasks Management Styles - Complete CSS File
   Modern Responsive Design with RTL & Dark Mode Support
   ================================================ */

/* ==================== CSS Variables ==================== */
:root {
    /* Primary Colors */
    --tm-primary: #6366f1;
    --tm-primary-dark: #4f46e5;
    --tm-primary-light: #818cf8;
    --tm-primary-rgb: 99, 102, 241;
    /* Status Colors */
    --tm-secondary: #64748b;
    --tm-success: #10b981;
    --tm-warning: #f59e0b;
    --tm-danger: #ef4444;
    --tm-info: #0ea5e9;
    /* Background Colors */
    --tm-bg-primary: #ffffff;
    --tm-bg-secondary: #f8fafc;
    --tm-bg-tertiary: #f1f5f9;
    --tm-bg-hover: #e2e8f0;
    /* Text Colors */
    --tm-text-primary: #1e293b;
    --tm-text-secondary: #475569;
    --tm-text-muted: #94a3b8;
    --tm-text-light: #cbd5e1;
    /* Border Colors */
    --tm-border: #e2e8f0;
    --tm-border-hover: #cbd5e1;
    --tm-border-focus: #6366f1;
    /* Shadows */
    --tm-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --tm-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --tm-shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1);
    --tm-shadow-xl: 0 20px 40px -10px rgb(0 0 0 / 0.15);
    /* Border Radius */
    --tm-radius: 0.5rem;
    --tm-radius-lg: 0.75rem;
    --tm-radius-xl: 1rem;
    --tm-radius-full: 9999px;
    /* Transitions */
    --tm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --tm-transition-fast: all 0.15s ease-in-out;
    /* Z-index */
    --tm-z-dropdown: 1000;
    --tm-z-modal: 9000;
    --tm-z-loader: 9999;
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
    :root {
        --tm-bg-primary: #0f172a;
        --tm-bg-secondary: #1e293b;
        --tm-bg-tertiary: #334155;
        --tm-bg-hover: #475569;
        --tm-text-primary: #f1f5f9;
        --tm-text-secondary: #cbd5e1;
        --tm-text-muted: #64748b;
        --tm-text-light: #475569;
        --tm-border: #334155;
        --tm-border-hover: #475569;
    }
}

/* ==================== Global Reset & Base ==================== */
.tm-container * {
    box-sizing: border-box;
}

.tm-container {
    max-width: 100%;
    padding: 1rem;
    background: var(--tm-bg-secondary);
    min-height: 100vh;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Loader Overlay ==================== */
.tm-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--tm-z-loader);
}

.tm-loader {
    background: var(--tm-bg-primary);
    padding: 2rem;
    border-radius: var(--tm-radius-lg);
    box-shadow: var(--tm-shadow-xl);
    text-align: center;
    min-width: 150px;
}

.tm-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--tm-border);
    border-top-color: var(--tm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.tm-loader-text {
    color: var(--tm-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==================== Header Section ==================== */
.tm-header {
    background: linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-primary-dark) 100%);
    border-radius: var(--tm-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--tm-shadow-lg);
    position: relative;
    overflow: hidden;
}

    .tm-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 50%;
        height: 200%;
        background: rgba(255, 255, 255, 0.05);
        transform: rotate(30deg);
    }

.tm-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.tm-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tm-header-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.tm-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
    letter-spacing: -0.025em;
}

.tm-header-stats {
    display: flex;
    gap: 1rem;
}

.tm-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: var(--tm-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    transition: var(--tm-transition);
}

    .tm-stat-card:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }

.tm-stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tm-stat-value {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* ==================== Filters Section ==================== */
.tm-filters-section {
    background: var(--tm-bg-primary);
    border-radius: var(--tm-radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--tm-shadow);
    overflow: hidden;
}

.tm-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--tm-bg-tertiary);
    border-bottom: 1px solid var(--tm-border);
}

.tm-filters-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tm-text-primary);
    margin: 0;
}

    .tm-filters-title i {
        color: var(--tm-primary);
    }

.tm-filters-toggle {
    background: transparent;
    border: none;
    color: var(--tm-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--tm-transition);
    border-radius: var(--tm-radius);
}

    .tm-filters-toggle:hover {
        color: var(--tm-primary);
        background: var(--tm-bg-hover);
    }

.tm-filters-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

    .tm-filters-wrapper.tm-filters-open {
        max-height: 800px;
    }

.tm-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.tm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tm-filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tm-text-secondary);
    letter-spacing: 0.025em;
}

.tm-filter-input,
.tm-filter-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--tm-bg-secondary);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius);
    color: var(--tm-text-primary);
    font-size: 0.875rem;
    transition: var(--tm-transition);
    outline: none;
}

    .tm-filter-input:hover,
    .tm-filter-select:hover {
        border-color: var(--tm-border-hover);
    }

    .tm-filter-input:focus,
    .tm-filter-select:focus {
        border-color: var(--tm-primary);
        box-shadow: 0 0 0 3px rgba(var(--tm-primary-rgb), 0.1);
    }

.tm-date-input {
    cursor: pointer;
}

.tm-filter-actions {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
}

/* ==================== Buttons ==================== */
.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--tm-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tm-transition);
    white-space: nowrap;
    outline: none;
    position: relative;
    overflow: hidden;
}

    .tm-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .tm-btn:active::before {
        width: 300px;
        height: 300px;
    }

    .tm-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.tm-btn-primary {
    background: var(--tm-primary);
    color: white;
}

    .tm-btn-primary:hover:not(:disabled) {
        background: var(--tm-primary-dark);
        transform: translateY(-1px);
        box-shadow: var(--tm-shadow);
    }

.tm-btn-secondary {
    background: var(--tm-secondary);
    color: white;
}

    .tm-btn-secondary:hover:not(:disabled) {
        background: var(--tm-text-secondary);
        transform: translateY(-1px);
        box-shadow: var(--tm-shadow);
    }

.tm-btn-success {
    background: var(--tm-success);
    color: white;
}

    .tm-btn-success:hover:not(:disabled) {
        background: #059669;
        transform: translateY(-1px);
        box-shadow: var(--tm-shadow);
    }

.tm-btn-warning {
    background: var(--tm-warning);
    color: white;
}

    .tm-btn-warning:hover:not(:disabled) {
        background: #dc2626;
        transform: translateY(-1px);
        box-shadow: var(--tm-shadow);
    }

/* ==================== Message Box ==================== */
.tm-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--tm-radius-lg);
    animation: slideDown 0.3s ease-in-out;
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tm-message-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.tm-message-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.tm-message-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.tm-message-info {
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    color: #075985;
}

.tm-message i {
    font-size: 1.25rem;
}

.tm-message-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: var(--tm-radius);
}

    .tm-message-close:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.05);
    }

/* ==================== Actions Bar ==================== */
.tm-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--tm-bg-primary);
    border-radius: var(--tm-radius-lg);
    box-shadow: var(--tm-shadow-sm);
}

.tm-actions-left,
.tm-actions-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tm-selection-info {
    color: var(--tm-text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--tm-bg-tertiary);
    border-radius: var(--tm-radius);
}

    .tm-selection-info i {
        color: var(--tm-primary);
    }

/* ==================== Table Section ==================== */
.tm-table-container {
    background: var(--tm-bg-primary);
    border-radius: var(--tm-radius-lg);
    box-shadow: var(--tm-shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.tm-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tm-table {
    width: 100%;
    border-collapse: collapse;
}

.tm-table-header {
    background: var(--tm-bg-tertiary);
    border-bottom: 2px solid var(--tm-border);
}

    .tm-table-header th {
        padding: 0.875rem 1rem;
        text-align: right;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--tm-text-secondary);
        white-space: nowrap;
        position: sticky;
        top: 0;
        background: var(--tm-bg-tertiary);
        z-index: 10;
    }

.tm-col-sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--tm-transition);
}

    .tm-col-sortable:hover {
        background: var(--tm-bg-secondary);
    }

.tm-sort-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

    .tm-sort-header i {
        font-size: 0.75rem;
        color: var(--tm-primary);
    }

.tm-table-body tr {
    border-bottom: 1px solid var(--tm-border);
    transition: var(--tm-transition);
}

.tm-table-row:hover {
    background: var(--tm-bg-secondary);
}

.tm-row-selected {
    background: rgba(var(--tm-primary-rgb), 0.05);
}

    .tm-row-selected:hover {
        background: rgba(var(--tm-primary-rgb), 0.1);
    }

.tm-table-body td {
    padding: 0.875rem 1rem;
    text-align: right;
    font-size: 0.875rem;
    color: var(--tm-text-primary);
}

/* Column Widths */
.tm-col-checkbox {
    width: 50px;
    text-align: center !important;
}

.tm-col-actions {
    width: 120px;
    text-align: center !important;
}

.tm-col-amount {
    font-weight: 600;
    white-space: nowrap;
}

.tm-col-date {
    white-space: nowrap;
}

/* Checkbox Styling */
.tm-checkbox-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tm-checkbox {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

    .tm-checkbox + label {
        position: relative;
        display: inline-block;
        width: 20px;
        height: 20px;
        background: var(--tm-bg-secondary);
        border: 2px solid var(--tm-border);
        border-radius: 4px;
        cursor: pointer;
        transition: var(--tm-transition);
    }

    .tm-checkbox:checked + label {
        background: var(--tm-primary);
        border-color: var(--tm-primary);
    }

        .tm-checkbox:checked + label:after {
            content: '';
            position: absolute;
            left: 6px;
            top: 2px;
            width: 6px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

    .tm-checkbox:disabled + label {
        opacity: 0.5;
        cursor: not-allowed;
        background: var(--tm-bg-hover);
    }

/* Badge Styles */
.tm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--tm-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tm-badge-primary {
    background: rgba(var(--tm-primary-rgb), 0.1);
    color: var(--tm-primary);
}

.tm-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tm-warning);
}

.tm-badge-info {
    background: rgba(14, 165, 233, 0.1);
    color: var(--tm-info);
}

.tm-badge-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--tm-secondary);
}

/* Special Cell Styles */
.tm-task-code {
    font-weight: 600;
    color: var(--tm-primary);
    font-family: 'Courier New', monospace;
}

.tm-customer-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tm-container-code {
    font-family: monospace;
    background: var(--tm-bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.tm-amount {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--tm-success);
    font-weight: 600;
}

    .tm-amount i {
        font-size: 0.875rem;
    }

.tm-date {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--tm-text-secondary);
}

    .tm-date i {
        font-size: 0.75rem;
    }

.tm-payment-badge {
    background: var(--tm-bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Action Buttons */
.tm-actions-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.tm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--tm-radius);
    cursor: pointer;
    transition: var(--tm-transition);
    font-size: 0.875rem;
    outline: none;
}

.tm-action-print {
    background: rgba(100, 116, 139, 0.1);
    color: var(--tm-secondary);
}

    .tm-action-print:hover {
        background: var(--tm-secondary);
        color: white;
        transform: scale(1.1);
    }

.tm-action-invoice-view {
    background: rgba(14, 165, 233, 0.1);
    color: var(--tm-info);
}

    .tm-action-invoice-view:hover {
        background: var(--tm-info);
        color: white;
        transform: scale(1.1);
    }

.tm-action-invoice-create {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tm-success);
}

    .tm-action-invoice-create:hover {
        background: var(--tm-success);
        color: white;
        transform: scale(1.1);
    }

/* No Data State */
.tm-no-data {
    padding: 3rem !important;
    text-align: center;
}

.tm-no-data-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--tm-text-muted);
}

    .tm-no-data-content i {
        font-size: 3rem;
        opacity: 0.5;
    }

    .tm-no-data-content p {
        margin: 0;
        font-size: 0.875rem;
    }

/* ==================== Pagination ==================== */
.tm-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--tm-bg-primary);
    border-radius: var(--tm-radius-lg);
    box-shadow: var(--tm-shadow);
}

.tm-pagination-info {
    color: var(--tm-text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--tm-bg-tertiary);
    border-radius: var(--tm-radius);
}

.tm-pagination {
    display: flex;
    gap: 0.5rem;
}

.tm-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    background: var(--tm-bg-secondary);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius);
    color: var(--tm-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tm-transition);
    outline: none;
}

    .tm-page-btn:hover:not(:disabled) {
        background: var(--tm-primary);
        border-color: var(--tm-primary);
        color: white;
        transform: translateY(-2px);
        box-shadow: var(--tm-shadow);
    }

    .tm-page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.tm-page-active {
    background: var(--tm-primary);
    border-color: var(--tm-primary);
    color: white;
}

    .tm-page-active:hover {
        background: var(--tm-primary-dark);
    }

.tm-page-first,
.tm-page-prev,
.tm-page-next,
.tm-page-last {
    padding: 0;
}

/* ==================== Mobile Responsive ==================== */
@media (max-width: 768px) {
    .tm-container {
        padding: 0.5rem;
    }

    .tm-header {
        padding: 1rem;
    }

    .tm-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .tm-title {
        font-size: 1.25rem;
    }

    .tm-header-stats {
        width: 100%;
        justify-content: space-between;
    }

    .tm-stat-card {
        flex: 1;
        min-width: auto;
        padding: 0.5rem 0.75rem;
    }

    .tm-stat-label {
        font-size: 0.65rem;
    }

    .tm-stat-value {
        font-size: 1.25rem;
    }

    .tm-filters-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0.75rem;
    }

    .tm-filter-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem 1rem;
    }

        .tm-filter-actions .tm-btn {
            width: 100%;
            justify-content: center;
        }

    .tm-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tm-actions-left {
        margin-bottom: 0.5rem;
    }

    .tm-actions-right {
        flex-direction: column;
        width: 100%;
    }

        .tm-actions-right .tm-btn {
            width: 100%;
            justify-content: center;
        }

    /* Mobile Table */
    .tm-table {
        font-size: 0.75rem;
    }

    .tm-table-header th {
        padding: 0.5rem;
        font-size: 0.65rem;
    }

    .tm-table-body td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    /* Hide less important columns on mobile */
    .tm-col-service,
    .tm-col-payment,
    .tm-col-customer {
        display: none;
    }

    .tm-pagination-container {
        flex-direction: column;
    }

    .tm-pagination-info {
        margin-bottom: 0.75rem;
    }

    .tm-pagination {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tm-page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .tm-header-icon {
        font-size: 1.5rem;
    }

    .tm-title {
        font-size: 1rem;
    }

    .tm-stat-value {
        font-size: 1.25rem;
    }

    /* Card-based layout for mobile */
    .tm-table-wrapper {
        padding: 0;
    }

    .tm-table {
        display: block;
    }

        .tm-table thead {
            display: none;
        }

    .tm-table-body {
        display: block;
    }

        .tm-table-body tr {
            display: block;
            margin-bottom: 1rem;
            background: var(--tm-bg-primary);
            border-radius: var(--tm-radius);
            padding: 0.75rem;
            box-shadow: var(--tm-shadow-sm);
            border: 1px solid var(--tm-border);
        }

        .tm-table-body td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem 0;
            text-align: left;
            border-bottom: 1px solid var(--tm-border);
        }

            .tm-table-body td:last-child {
                border-bottom: none;
            }

            .tm-table-body td:before {
                content: attr(data-label);
                font-weight: 600;
                color: var(--tm-text-secondary);
                font-size: 0.7rem;
                text-transform: uppercase;
                letter-spacing: 0.05em;
                margin-right: 0.5rem;
            }

    .tm-col-checkbox {
        order: -1;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        justify-content: center;
    }

        .tm-col-checkbox:before {
            display: none;
        }

    .tm-col-actions {
        border-top: 2px solid var(--tm-border);
        padding-top: 0.75rem !important;
        margin-top: 0.5rem;
        justify-content: center;
    }

        .tm-col-actions:before {
            display: none;
        }

    .tm-actions-group {
        justify-content: center;
        width: 100%;
    }

    /* Hide columns on very small screens */
    .tm-col-service,
    .tm-col-payment,
    .tm-col-customer,
    .tm-col-date {
        display: none !important;
    }

    /* Compact badges */
    .tm-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }

    /* Smaller buttons */
    .tm-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .tm-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* ==================== Ultra Small Screens ==================== */
@media (max-width: 360px) {
    .tm-container {
        padding: 0.25rem;
    }

    .tm-header {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .tm-header-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tm-stat-card {
        width: 100%;
    }

    .tm-filters-section,
    .tm-table-container {
        border-radius: 0.5rem;
    }

    .tm-page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .tm-filters-section,
    .tm-actions-bar,
    .tm-message,
    .tm-col-checkbox,
    .tm-col-actions,
    .tm-pagination-container,
    .tm-loader-overlay {
        display: none !important;
    }

    .tm-container {
        padding: 0;
        background: white;
        min-height: auto;
    }

    .tm-header {
        background: none;
        color: black;
        box-shadow: none;
        border-bottom: 2px solid #000;
        margin-bottom: 1rem;
        page-break-after: avoid;
    }

        .tm-header::before {
            display: none;
        }

    .tm-header-icon,
    .tm-title,
    .tm-stat-label,
    .tm-stat-value {
        color: black !important;
    }

    .tm-stat-card {
        background: transparent !important;
        border: 1px solid #000;
    }

    .tm-table-container {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .tm-table {
        border: 1px solid #000;
        width: 100%;
    }

    .tm-table-header {
        background: #f0f0f0 !important;
        border-bottom: 2px solid #000;
    }

        .tm-table-header th {
            color: black !important;
            font-weight: bold;
        }

    .tm-table-body tr {
        page-break-inside: avoid;
        border-bottom: 1px solid #000;
    }

    .tm-table-body td {
        color: black !important;
    }

    .tm-badge,
    .tm-task-code,
    .tm-amount,
    .tm-container-code {
        color: black !important;
        background: transparent !important;
    }
}

/* ==================== RTL Support (Arabic) ==================== */
[dir="rtl"] .tm-container {
    direction: rtl;
}

[dir="rtl"] .tm-header-title,
[dir="rtl"] .tm-filters-title,
[dir="rtl"] .tm-sort-header,
[dir="rtl"] .tm-actions-group,
[dir="rtl"] .tm-amount,
[dir="rtl"] .tm-date,
[dir="rtl"] .tm-selection-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .tm-table-header th,
[dir="rtl"] .tm-table-body td {
    /*  text-align: left;*/
}

[dir="rtl"] .tm-col-amount,
[dir="rtl"] .tm-col-date {
    /* text-align: left;*/
}

[dir="rtl"] .tm-checkbox:checked + label:after {
    left: auto;
    right: 6px;
}

[dir="rtl"] .tm-message-close {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .tm-filter-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .tm-actions-bar {
    flex-direction: row-reverse;
}

[dir="rtl"] .tm-pagination {
    flex-direction: row-reverse;
}

[dir="rtl"] .tm-header::before {
    right: auto;
    left: -10%;
    transform: rotate(-30deg);
}

/* ==================== Animations & Effects ==================== */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.tm-loading-shimmer {
    animation-duration: 1.5s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: shimmer;
    animation-timing-function: linear;
    background: linear-gradient( to right, var(--tm-bg-secondary) 8%, var(--tm-bg-tertiary) 18%, var(--tm-bg-secondary) 33% );
    background-size: 936px 104px;
    position: relative;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.tm-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.tm-bounce {
    animation: bounce 1s infinite;
}

/* ==================== Accessibility Features ==================== */
.tm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
.tm-btn:focus-visible,
.tm-filter-input:focus-visible,
.tm-filter-select:focus-visible,
.tm-action-btn:focus-visible,
.tm-page-btn:focus-visible,
.tm-checkbox:focus-visible + label {
    outline: 2px solid var(--tm-primary);
    outline-offset: 2px;
}

/* Skip to content link */
.tm-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--tm-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: var(--tm-radius);
    z-index: 9999;
}

    .tm-skip-link:focus {
        top: 10px;
        left: 10px;
    }

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tm-container {
        --tm-border: #000;
        --tm-text-primary: #000;
        --tm-bg-primary: #fff;
        --tm-bg-secondary: #fff;
        --tm-bg-tertiary: #f0f0f0;
    }

    .tm-btn {
        border: 2px solid currentColor;
    }

    .tm-badge {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== Custom Scrollbar ==================== */
.tm-table-wrapper::-webkit-scrollbar,
.tm-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.tm-table-wrapper::-webkit-scrollbar-track,
.tm-container::-webkit-scrollbar-track {
    background: var(--tm-bg-secondary);
    border-radius: 4px;
}

.tm-table-wrapper::-webkit-scrollbar-thumb,
.tm-container::-webkit-scrollbar-thumb {
    background: var(--tm-border-hover);
    border-radius: 4px;
}

    .tm-table-wrapper::-webkit-scrollbar-thumb:hover,
    .tm-container::-webkit-scrollbar-thumb:hover {
        background: var(--tm-text-muted);
    }

/* Firefox scrollbar */
.tm-table-wrapper,
.tm-container {
    scrollbar-width: thin;
    scrollbar-color: var(--tm-border-hover) var(--tm-bg-secondary);
}

/* ==================== Utility Classes ==================== */
/* Text Alignment */
.tm-text-center {
    text-align: center !important;
}

.tm-text-right {
    text-align: right !important;
}

.tm-text-left {
    text-align: left !important;
}

.tm-text-justify {
    text-align: justify !important;
}

/* Font Weights */
.tm-font-thin {
    font-weight: 100 !important;
}

.tm-font-light {
    font-weight: 300 !important;
}

.tm-font-normal {
    font-weight: 400 !important;
}

.tm-font-medium {
    font-weight: 500 !important;
}

.tm-font-semibold {
    font-weight: 600 !important;
}

.tm-font-bold {
    font-weight: 700 !important;
}

.tm-font-black {
    font-weight: 900 !important;
}

/* Text Sizes */
.tm-text-xs {
    font-size: 0.75rem !important;
}

.tm-text-sm {
    font-size: 0.875rem !important;
}

.tm-text-base {
    font-size: 1rem !important;
}

.tm-text-lg {
    font-size: 1.125rem !important;
}

.tm-text-xl {
    font-size: 1.25rem !important;
}

.tm-text-2xl {
    font-size: 1.5rem !important;
}

.tm-text-3xl {
    font-size: 1.875rem !important;
}

/* Margins */
.tm-m-0 {
    margin: 0 !important;
}

.tm-m-1 {
    margin: 0.25rem !important;
}

.tm-m-2 {
    margin: 0.5rem !important;
}

.tm-m-3 {
    margin: 0.75rem !important;
}

.tm-m-4 {
    margin: 1rem !important;
}

.tm-m-5 {
    margin: 1.25rem !important;
}

.tm-m-6 {
    margin: 1.5rem !important;
}

.tm-mt-0 {
    margin-top: 0 !important;
}

.tm-mt-1 {
    margin-top: 0.25rem !important;
}

.tm-mt-2 {
    margin-top: 0.5rem !important;
}

.tm-mt-3 {
    margin-top: 0.75rem !important;
}

.tm-mt-4 {
    margin-top: 1rem !important;
}

.tm-mt-5 {
    margin-top: 1.25rem !important;
}

.tm-mt-6 {
    margin-top: 1.5rem !important;
}

.tm-mb-0 {
    margin-bottom: 0 !important;
}

.tm-mb-1 {
    margin-bottom: 0.25rem !important;
}

.tm-mb-2 {
    margin-bottom: 0.5rem !important;
}

.tm-mb-3 {
    margin-bottom: 0.75rem !important;
}

.tm-mb-4 {
    margin-bottom: 1rem !important;
}

.tm-mb-5 {
    margin-bottom: 1.25rem !important;
}

.tm-mb-6 {
    margin-bottom: 1.5rem !important;
}

.tm-ml-0 {
    margin-left: 0 !important;
}

.tm-ml-1 {
    margin-left: 0.25rem !important;
}

.tm-ml-2 {
    margin-left: 0.5rem !important;
}

.tm-ml-3 {
    margin-left: 0.75rem !important;
}

.tm-ml-4 {
    margin-left: 1rem !important;
}

.tm-ml-5 {
    margin-left: 1.25rem !important;
}

.tm-ml-6 {
    margin-left: 1.5rem !important;
}

.tm-mr-0 {
    margin-right: 0 !important;
}

.tm-mr-1 {
    margin-right: 0.25rem !important;
}

.tm-mr-2 {
    margin-right: 0.5rem !important;
}

.tm-mr-3 {
    margin-right: 0.75rem !important;
}

.tm-mr-4 {
    margin-right: 1rem !important;
}

.tm-mr-5 {
    margin-right: 1.25rem !important;
}

.tm-mr-6 {
    margin-right: 1.5rem !important;
}

.tm-mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.tm-my-auto {
    margin-top: auto !important;
    margin-bottom: auto !important;
}

/* Paddings */
.tm-p-0 {
    padding: 0 !important;
}

.tm-p-1 {
    padding: 0.25rem !important;
}

.tm-p-2 {
    padding: 0.5rem !important;
}

.tm-p-3 {
    padding: 0.75rem !important;
}

.tm-p-4 {
    padding: 1rem !important;
}

.tm-p-5 {
    padding: 1.25rem !important;
}

.tm-p-6 {
    padding: 1.5rem !important;
}

/* Gaps */
.tm-gap-0 {
    gap: 0 !important;
}

.tm-gap-1 {
    gap: 0.25rem !important;
}

.tm-gap-2 {
    gap: 0.5rem !important;
}

.tm-gap-3 {
    gap: 0.75rem !important;
}

.tm-gap-4 {
    gap: 1rem !important;
}

.tm-gap-5 {
    gap: 1.25rem !important;
}

.tm-gap-6 {
    gap: 1.5rem !important;
}

/* Display */
.tm-hidden {
    display: none !important;
}

.tm-block {
    display: block !important;
}

.tm-inline-block {
    display: inline-block !important;
}

.tm-inline {
    display: inline !important;
}

.tm-flex {
    display: flex !important;
}

.tm-inline-flex {
    display: inline-flex !important;
}

.tm-grid {
    display: grid !important;
}

/* Flexbox */
.tm-flex-row {
    flex-direction: row !important;
}

.tm-flex-col {
    flex-direction: column !important;
}

.tm-flex-wrap {
    flex-wrap: wrap !important;
}

.tm-flex-nowrap {
    flex-wrap: nowrap !important;
}

.tm-items-center {
    align-items: center !important;
}

.tm-items-start {
    align-items: flex-start !important;
}

.tm-items-end {
    align-items: flex-end !important;
}

.tm-justify-center {
    justify-content: center !important;
}

.tm-justify-start {
    justify-content: flex-start !important;
}

.tm-justify-end {
    justify-content: flex-end !important;
}

.tm-justify-between {
    justify-content: space-between !important;
}

.tm-justify-around {
    justify-content: space-around !important;
}

.tm-flex-1 {
    flex: 1 !important;
}

.tm-flex-auto {
    flex: auto !important;
}

.tm-flex-none {
    flex: none !important;
}

/* Width & Height */
.tm-w-full {
    width: 100% !important;
}

.tm-w-auto {
    width: auto !important;
}

.tm-h-full {
    height: 100% !important;
}

.tm-h-auto {
    height: auto !important;
}

/* Overflow */
.tm-overflow-auto {
    overflow: auto !important;
}

.tm-overflow-hidden {
    overflow: hidden !important;
}

.tm-overflow-visible {
    overflow: visible !important;
}

.tm-overflow-scroll {
    overflow: scroll !important;
}

.tm-overflow-x-auto {
    overflow-x: auto !important;
}

.tm-overflow-y-auto {
    overflow-y: auto !important;
}

/* Position */
.tm-relative {
    position: relative !important;
}

.tm-absolute {
    position: absolute !important;
}

.tm-fixed {
    position: fixed !important;
}

.tm-sticky {
    position: sticky !important;
}

.tm-static {
    position: static !important;
}

/* Z-index */
.tm-z-0 {
    z-index: 0 !important;
}

.tm-z-10 {
    z-index: 10 !important;
}

.tm-z-20 {
    z-index: 20 !important;
}

.tm-z-30 {
    z-index: 30 !important;
}

.tm-z-40 {
    z-index: 40 !important;
}

.tm-z-50 {
    z-index: 50 !important;
}

/* Border Radius */
.tm-rounded-none {
    border-radius: 0 !important;
}

.tm-rounded {
    border-radius: var(--tm-radius) !important;
}

.tm-rounded-lg {
    border-radius: var(--tm-radius-lg) !important;
}

.tm-rounded-xl {
    border-radius: var(--tm-radius-xl) !important;
}

.tm-rounded-full {
    border-radius: var(--tm-radius-full) !important;
}

/* Shadow */
.tm-shadow-none {
    box-shadow: none !important;
}

.tm-shadow-sm {
    box-shadow: var(--tm-shadow-sm) !important;
}

.tm-shadow {
    box-shadow: var(--tm-shadow) !important;
}

.tm-shadow-lg {
    box-shadow: var(--tm-shadow-lg) !important;
}

.tm-shadow-xl {
    box-shadow: var(--tm-shadow-xl) !important;
}

/* Opacity */
.tm-opacity-0 {
    opacity: 0 !important;
}

.tm-opacity-25 {
    opacity: 0.25 !important;
}

.tm-opacity-50 {
    opacity: 0.5 !important;
}

.tm-opacity-75 {
    opacity: 0.75 !important;
}

.tm-opacity-100 {
    opacity: 1 !important;
}

/* Cursor */
.tm-cursor-pointer {
    cursor: pointer !important;
}

.tm-cursor-not-allowed {
    cursor: not-allowed !important;
}

.tm-cursor-wait {
    cursor: wait !important;
}

.tm-cursor-move {
    cursor: move !important;
}

/* User Select */
.tm-select-none {
    user-select: none !important;
}

.tm-select-text {
    user-select: text !important;
}

.tm-select-all {
    user-select: all !important;
}

/* Pointer Events */
.tm-pointer-events-none {
    pointer-events: none !important;
}

.tm-pointer-events-auto {
    pointer-events: auto !important;
}

/* ==================== End of CSS File ==================== */
/* ====== Modals for Operational Report (tm-*) ====== */
.tm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: var(--tm-z-modal);
}

.tm-modal__card {
    width: min(740px, 96vw);
    background: var(--tm-bg-primary);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-lg);
    box-shadow: var(--tm-shadow-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-modal__header, .tm-modal__footer {
    padding: 0.9rem 1rem;
    background: var(--tm-bg-tertiary);
    border-bottom: 1px solid var(--tm-border);
}

.tm-modal__footer {
    border-top: 1px solid var(--tm-border);
    border-bottom: 0;
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
}

.tm-modal__title {
    margin: 0;
    font-weight: 700;
    color: var(--tm-text-primary);
}

.tm-modal__close {
    background: transparent;
    border: 0;
    font-size: 1.15rem;
    cursor: pointer;
    color: var(--tm-text-secondary);
}

    .tm-modal__close:hover {
        color: var(--tm-primary);
    }

.tm-modal__body {
    padding: 1rem;
    overflow: auto;
}

/* Inline field error */
.tm-field-error {
    color: #b91c1c;
    font-size: .825rem;
    margin-top: .25rem;
}
