/* 
   =================================================
   Al-Raem Real Estate Development - Premium UI
   =================================================
*/

/* --- Variables --- */
:root {
    --primary: #2563eb;
    /* Modern Blue */
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --accent: #f59e0b;
    /* Warm Orange */
    --accent-hover: #d97706;

    --bg-page: #f8fafc;
    /* Clean White-Gray */
    --bg-surface: #ffffff;

    --text-dark: #0f172a;
    --text-p: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-focus: #cbd5e1;

    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-p);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.3;
}

p {
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    outline: none;
    border: none;
    cursor: pointer;
    background: none;
    font-family: inherit;
}

/* Utilities */
.hidden {
    display: none !important;
}

.balance-danger {
    color: #dc2626;
    font-weight: 800;
}

.balance-warning {
    color: #d97706;
    font-weight: 700;
}

.balance-success {
    color: #16a34a;
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.gold-text {
    color: var(--accent);
}

@media (max-width: 767px) {
    .show-on-desktop {
        display: none !important;
    }
}

.danger-text {
    color: var(--danger);
}

/* Show/Hide elements based on screen size */
.show-on-mobile {
    display: none !important;
}

.show-on-desktop {
    display: inline-flex !important;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 2rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.px-4 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.me-2 {
    margin-right: 0.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-sm {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-p);
    transition: var(--transition);
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.btn-icon.danger {
    color: var(--danger);
}

.btn-icon.danger:hover {
    background: #fef2f2;
    color: var(--danger);
}

.btn-icon.primary {
    color: var(--primary);
}

.btn-icon.primary:hover {
    background: #e0e7ff;
}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: #f8fafc;
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    color: var(--text-dark);
}

.form-control:focus {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    outline: none;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon .form-control,
.input-icon input {
    padding-right: 2.8rem;
    width: 100%;
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 1rem;
    font-size: 0.95rem;
}

/* Fallback */
.input-icon input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    outline: none;
}

.error-text {
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
}

/* Custom Checkbox */
.checkbox-group {
    margin-top: 1rem;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600 !important;
    color: var(--text-dark) !important;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #f1f5f9;
    border: 1px solid var(--border-focus);
    border-radius: 4px;
    margin-left: 10px;
    position: relative;
    transition: var(--transition);
}

.custom-checkbox:hover input~.checkmark {
    background-color: #e2e8f0;
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

/* --- Layout --- */
#app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* --- Navbar Core --- */
.navbar {
    background: var(--bg-surface);
    padding: 0 2rem;
    height: 70px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.nav-brand:hover {
    color: var(--primary-light);
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--accent);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* --- Badges --- */
.badge-role {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.b-manager {
    background: #dbeafe;
    color: #1e40af;
}

.b-engineer {
    background: #d1fae5;
    color: #065f46;
}

.b-accountant {
    background: #fef3c7;
    color: #92400e;
}

.b-supervisor {
    background: #fce7f3;
    color: #9f1239;
}

.b-worker {
    background: #f1f5f9;
    color: #475569;
}

/* Active inactive badge */
.b-active {
    background: #d1fae5;
    color: #065f46;
}

.b-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* --- Views Transitions --- */
.view-section {
    animation: fadeUp 0.4s ease forwards;
    display: none;
}

.view-section.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Common Headers --- */
.section-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary);
    margin: 0;
}

.section-header p {
    display: none;
}

.section-header.with-back {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.section-header.with-back .btn-icon {
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.2rem;
}

.section-subtitle {
    color: var(--primary);
    font-size: 1.3rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 0.4rem;
}

/* --- Dashboard --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-box {
    background: var(--bg-surface);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    border: 2px solid var(--border);
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.stat-info p {
    margin-bottom: 0.2rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    color: var(--primary);
}

.nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.nav-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    user-select: none;
}

.nav-card * {
    pointer-events: none;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-card:hover::before {
    transform: scaleX(1);
}

.nav-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.nav-card:active {
    transform: translateY(-4px);
}

.nav-card:hover .card-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    transform: scale(1.15) rotate(5deg);
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.card-content {
    width: 100%;
}

.card-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
    line-height: 1.4;
    transition: color 0.3s;
}

.nav-card:hover .card-content h3 {
    color: var(--primary);
}

.card-content p {
    display: none;
}

/* --- Internal Sections Tools --- */
.toolbar-card {
    background: var(--bg-surface);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 100%;
    flex-wrap: wrap;
}

.search-wrapper input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.search-wrapper input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- Search Suggestions --- */
.suggestions-list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid var(--border);
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f1f5f9;
}

.suggestion-item .sug-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.suggestion-item .sug-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 700;
}

.suggestion-item:hover .sug-meta {
    background: var(--primary);
    color: white;
}

.search-wrapper select {
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
}

.search-wrapper select:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- Premium Tables (Desktop) --- */
.table-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 0;
    overflow-x: auto;
    border: 2px solid var(--border);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.modern-table thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    position: sticky;
    top: 0;
    z-index: 10;
    display: table-header-group;
}

.modern-table tbody {
    background: white;
    display: table-row-group;
}

.modern-table tbody tr {
    display: table-row;
    transition: var(--transition);
    position: relative;
}

.modern-table th {
    background: transparent;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 1.25rem 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: table-cell;
}

.modern-table th:first-child {
    border-left: none;
}

.modern-table th:last-child {
    text-align: center;
}

.modern-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    border-left: 1px solid #f1f5f9;
    color: var(--text-dark);
    font-weight: 600;
    vertical-align: middle;
    display: table-cell;
}

.modern-table td:first-child {
    border-left: none;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.05rem;
}

.modern-table tbody tr::before {
    display: none;
}

.modern-table tbody tr:hover {
    background: linear-gradient(to left, #f8fafc, #ffffff);
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* --- Modals (Sleek) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 1rem;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    width: 100%;
    max-width: 700px;
    margin: auto;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.modal-header h3 {
    font-size: 1.3rem;
    color: var(--primary);
}

.modal-body {
    padding: 2rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.modal-footer {
    margin-top: 1.5rem;
    padding: 0;
    border-top: none;
    background: transparent;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    min-width: 120px;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 1rem;
}

.login-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header .logo i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Toasts */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s ease;
    font-weight: 600;
    min-width: 300px;
    max-width: 500px;
}

.toast.toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.toast-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.toast #toast-icon {
    font-size: 1.5rem;
}

.toast #toast-message {
    flex: 1;
    font-size: 0.95rem;
}

/* Hide mobile-specific elements by default (Desktop view) */
.mobile-label-top,
.mobile-badge-inline {
    display: none !important;
}

/* Mobile Responsiveness */
@media (min-width: 1200px) {
    .nav-cards-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .nav-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-col-2 {
        grid-column: span 2;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .form-col-2 {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .main-container {
        padding: 1rem;
    }

    .navbar {
        padding: 0 1rem;
        height: 65px;
    }

    .nav-brand span {
        display: none;
    }

    /* Hide text, keep icon */
    .hide-mobile {
        display: none;
    }

    /* Show/Hide elements based on screen size */
    .show-on-desktop {
        display: none !important;
    }

    .show-on-mobile {
        display: inline-flex !important;
    }

    .user-greeting {
        font-size: 0.9rem;
    }

    .toolbar-card {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: 100%;
        margin-bottom: 0.75rem;
    }

    .toolbar-buttons-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        width: 100%;
    }

    .toolbar-buttons-grid .btn {
        margin: 0 !important;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    .section-header.with-back h2 {
        font-size: 1.4rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .nav-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        max-width: 100%;
    }

    .nav-card {
        padding: 1.5rem 1rem;
        aspect-ratio: 1;
    }

    .card-icon {
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }

    .card-content h3 {
        font-size: 0.85rem;
    }

    /* Elegant Mobile Table -> Card Conversion */
    .table-container {
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        border: none;
    }

    .modern-table thead {
        display: none;
    }

    #employees-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    #employees-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }

    /* All cells hidden by default except those we want to show */
    .modern-table td {
        display: none;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.9rem;
    }

    /* Label styling for all cells */
    .modern-table td::before {
        content: attr(data-label);
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-muted);
        white-space: nowrap;
    }

    /* 1. Code - Top Field */
    #employees-section .modern-table td:nth-child(1) {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.4rem;
        background: rgba(248, 250, 252, 0.5);
        /* Semi-transparent */
        color: var(--text-muted);
        font-weight: 600;
        border-bottom: 1px solid rgba(241, 245, 249, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    #employees-section .modern-table td:nth-child(1)::before {
        content: "\f02a";
        /* Barcode icon */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: var(--primary);
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    /* 2. Name - Main Title */
    #employees-section .modern-table td:nth-child(2) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    .modern-table td:nth-child(2)::before {
        display: none;
    }

    /* 3. Profession - Show on the same row as Code */
    #employees-section .modern-table td:nth-child(3) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 0.65rem;
        /* Aligned with Code row */
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    .modern-table td:nth-child(3)::before {
        display: none;
    }

    .modern-table td:nth-child(3) .badge-role {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
        background: #f1f5f9;
        color: var(--text-muted);
        font-weight: 700;
        border-radius: 4px;
    }

    /* Hide other cells by default on mobile - Scoped to sections */
    #employees-section .modern-table tbody tr td:nth-child(n+4),
    #users-section .modern-table tbody tr td:nth-child(n+4),
    #warehouse-section .modern-table tbody tr td:nth-child(n+4),
    #incoming-section .modern-table tbody tr td:nth-child(n+4) {
        display: none;
    }

    /* Warehouse Section Mobile Cards */
    #warehouse-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    #warehouse-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }

    #warehouse-section .modern-table td:nth-child(1) {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.4rem;
        background: rgba(248, 250, 252, 0.5);
        color: var(--text-muted);
        font-weight: 600;
        border-bottom: 1px solid rgba(241, 245, 249, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    #warehouse-section .modern-table td:nth-child(1)::before {
        content: "\f02a";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: var(--primary);
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    #warehouse-section .modern-table td:nth-child(2) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    #warehouse-section .modern-table td:nth-child(2)::before {
        display: none;
    }

    #warehouse-section .modern-table td:nth-child(3) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 0.65rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #warehouse-section .modern-table td:nth-child(3)::before {
        display: none;
    }

    #warehouse-section .modern-table td:nth-child(3) span {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
        background: #dbeafe;
        color: var(--primary);
        font-weight: 700;
        border-radius: 4px;
    }

    /* Incoming Section Mobile Cards */
    #incoming-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        min-height: 100px;
    }

    #incoming-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }

    /* التاريخ - Top Field */
    #incoming-section .modern-table tbody tr td:nth-child(1) {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.4rem;
        background: rgba(248, 250, 252, 0.5);
        color: var(--text-muted);
        font-weight: 600;
        border-bottom: 1px solid rgba(241, 245, 249, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    #incoming-section .modern-table tbody tr td:nth-child(1)::before {
        content: "\f133";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: var(--primary);
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    /* اسم الصنف - Main Title */
    #incoming-section .modern-table tbody tr td:nth-child(4) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    #incoming-section .modern-table tbody tr td:nth-child(4)::before {
        display: none;
    }

    /* المستخدم - Badge في الزاوية */
    #incoming-section .modern-table tbody tr td:nth-child(7) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 0.65rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #incoming-section .modern-table tbody tr td:nth-child(7)::before {
        display: none;
    }

    #incoming-section .modern-table tbody tr td:nth-child(7) .badge-role {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
        font-weight: 700;
        border-radius: 4px;
    }

    /* الكمية - Show as badge */
    #incoming-section .modern-table tbody tr td:nth-child(6) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 3.5rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #incoming-section .modern-table tbody tr td:nth-child(6)::before {
        display: none;
    }

    #incoming-section .modern-table tbody tr td:nth-child(6) span {
        font-size: 1rem;
        padding: 0.3rem 0.8rem;
        background: #dcfce7;
        color: var(--success);
        font-weight: 700;
        border-radius: 8px;
    }

    /* Outgoing Section Mobile Cards */
    #outgoing-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        min-height: 100px;
    }

    #outgoing-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }

    /* التاريخ - Top Field */
    #outgoing-section .modern-table tbody tr td:nth-child(1) {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.4rem;
        background: rgba(248, 250, 252, 0.5);
        color: var(--text-muted);
        font-weight: 600;
        border-bottom: 1px solid rgba(241, 245, 249, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    #outgoing-section .modern-table tbody tr td:nth-child(1)::before {
        content: "\f133";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: var(--primary);
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    /* اسم الصنف - Main Title */
    #outgoing-section .modern-table tbody tr td:nth-child(4) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    #outgoing-section .modern-table tbody tr td:nth-child(4)::before {
        display: none;
    }

    /* المستخدم (Column 9) - Badge في الزاوية */
    #outgoing-section .modern-table tbody tr td:nth-child(9) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 0.65rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #outgoing-section .modern-table tbody tr td:nth-child(9)::before {
        display: none;
    }

    #outgoing-section .modern-table tbody tr td:nth-child(9) .badge-role {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
        font-weight: 700;
        border-radius: 4px;
    }

    /* الكمية (Column 6) - Show as badge on the left */
    #outgoing-section .modern-table tbody tr td:nth-child(6) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 3.5rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #outgoing-section .modern-table tbody tr td:nth-child(6)::before {
        display: none;
    }

    #outgoing-section .modern-table tbody tr td:nth-child(6) span {
        font-size: 1rem;
        padding: 0.3rem 0.8rem;
        background: #fef2f2;
        color: var(--danger);
        font-weight: 700;
        border-radius: 8px;
    }

    /* Hide other cells on mobile for Outgoing */
    #outgoing-section .modern-table tbody tr td:nth-child(2),
    #outgoing-section .modern-table tbody tr td:nth-child(3),
    #outgoing-section .modern-table tbody tr td:nth-child(5),
    #outgoing-section .modern-table tbody tr td:nth-child(7),
    #outgoing-section .modern-table tbody tr td:nth-child(8),
    #outgoing-section .modern-table tbody tr td:nth-child(10) {
        display: none !important;
    }

    /* Specific Modern Style for Users Section cards */
    #users-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        border: 1px solid #e2e8f0;
        padding: 0.5rem 0;
        cursor: pointer;
        position: relative;
    }

    #users-section .modern-table td:nth-child(1),
    #users-section .modern-table td:nth-child(2),
    #users-section .modern-table td:nth-child(3) {
        display: flex;
        padding: 0.5rem 1rem;
        border: none;
        align-items: center;
        gap: 0.5rem;
    }

    #users-section .modern-table td:nth-child(1) {
        font-weight: 700;
        color: var(--primary);
    }

    #users-section .modern-table td:nth-child(1)::before {
        content: "\f2bd";
        /* User icon */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 0.9rem;
    }

    /* Bottom Sheet Styles */
    .modal-content {
        background: #ffffff !important;
        border-radius: inherit;
        border: none;
        box-shadow: none;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .modal-dialog.bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100%;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: 92vh;
        background: #ffffff !important;
        box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.35);
        z-index: 2000;
        border: none;
    }

    .modal {
        padding: 0 !important;
    }

    .modal.show .modal-dialog.bottom-sheet {
        transform: translateY(0);
    }

    .details-body {
        padding: 1.5rem;
        flex: 1;
        overflow-y: auto;
    }

    .detail-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
        background: #f8fafc;
        border-radius: var(--radius-md);
        margin-bottom: 0.75rem;
        border: 1px solid #f1f5f9;
    }

    .phone-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .comm-actions {
        display: flex;
        gap: 0.75rem;
    }

    .comm-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        text-decoration: none;
        transition: all 0.2s;
    }

    .comm-btn.call {
        background: rgba(37, 99, 235, 0.1);
        color: #2563eb;
    }

    .comm-btn.whatsapp {
        background: rgba(34, 197, 94, 0.1);
        color: #22c55e;
    }

    .comm-btn:active {
        transform: scale(0.9);
    }

    .detail-item i {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        color: var(--primary);
        border-radius: 50%;
        font-size: 1rem;
        box-shadow: var(--shadow-sm);
    }

    .detail-info label {
        display: block;
        font-size: 0.75rem;
        color: var(--text-muted);
        font-weight: 700;
        margin-bottom: 0.1rem;
    }

    .detail-info span {
        font-weight: 700;
        color: var(--text-dark);
        font-size: 0.95rem;
    }

    .action-buttons-overlay {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }

    .action-buttons-overlay .btn {
        flex: 1;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-header {
        padding: 1.25rem 1rem;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .modal-footer {
        padding: 1.25rem;
        gap: 1rem;
        display: flex;
        flex-direction: row-reverse;
        border-top: 1px solid #f1f5f9;
        background: #ffffff !important;
        position: relative;
        z-index: 100;
        width: 100%;
        margin: 0 !important;
    }

    .modal-footer .btn {
        flex: 1;
        padding: 0.8rem;
        font-weight: 700;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }

    .btn-secondary {
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
    }
}


/* Professions List Styling */
#professions-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

#professions-list li:hover {
    background: #e2e8f0;
}

#professions-list span {
    font-weight: 600;
    color: var(--text-dark);
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* Professional Users Table Styling */
@media (min-width: 768px) {
    #users-section .modern-table thead {
        background: linear-gradient(135deg, #059669, #10b981);
    }

    #users-section .modern-table tbody tr:hover::before {
        background: #10b981;
    }

    #users-section .modern-table td:first-child {
        color: #059669;
    }

    /* Employees Table Styling */
    #employees-section .modern-table thead {
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
    }
}

/* Mobile Users Table Specific Styling */
@media (max-width: 767px) {

    /* Users table mobile cards */
    #users-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    #users-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: #10b981;
    }

    /* Users table: Username code styling */
    #users-section .modern-table td:nth-child(1) {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.4rem;
        background: rgba(240, 253, 244, 0.5);
        color: #059669;
        font-weight: 600;
        border-bottom: 1px solid rgba(220, 252, 231, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    #users-section .modern-table td:nth-child(1)::before {
        content: "\f2bd";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: #10b981;
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    /* Users table: Employee name with more padding */
    #users-section .modern-table td:nth-child(2) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    #users-section .modern-table td:nth-child(2)::before {
        display: none;
    }

    /* Users table: Role badge positioned next to username */
    #users-section .modern-table td:nth-child(3) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 0.65rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #users-section .modern-table td:nth-child(3)::before {
        display: none;
    }

    /* Users table: Status */
    #users-section .modern-table td:nth-child(4) {
        display: flex;
        padding: 0.5rem 1.25rem;
        border-bottom: none;
    }

    /* Users table: Actions (The key fix) */
    #users-section .modern-table td:nth-child(5) {
        display: flex;
        justify-content: center;
        padding: 1rem 1.25rem;
        background: #f8fafc;
        gap: 1.5rem;
    }

    #users-section .modern-table td:nth-child(5)::before {
        display: none;
    }

    /* Warehouse Section Mobile Cards */
    #warehouse-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    #warehouse-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }

    /* 1. Code - Top Field */
    #warehouse-section .modern-table td:nth-child(1) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.4rem;
        background: rgba(248, 250, 252, 0.5);
        color: var(--text-muted);
        font-weight: 600;
        border-bottom: 1px solid rgba(241, 245, 249, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    @media (max-width: 767px) {
        .mobile-label-top {
            display: inline-block !important;
            font-size: 0.75rem;
            color: var(--text-muted);
            font-weight: 700;
            background: #f1f5f9;
            padding: 0.1rem 0.5rem;
            border-radius: 4px;
        }
    }

    #warehouse-section .modern-table td:nth-child(1)::before {
        content: "\f02a";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: var(--primary);
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    /* 2. Name - Main Title */
    #warehouse-section .modern-table td:nth-child(2) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    #warehouse-section .modern-table td:nth-child(2)::before {
        display: none;
    }

    /* 3. Balance - Moved inline to Name row */
    #warehouse-section .modern-table tbody tr td:nth-child(5) {
        display: none !important;
    }

    /* Inline Badge Styling (used across sections) */
    /* Mobile specific visibility */
    @media (max-width: 767px) {
        .mobile-badge-inline {
            display: inline-block !important;
        }

        .hide-on-mobile {
            display: none !important;
        }
    }

    /* Warehouse specific colors for inline badge */
    .mobile-badge-inline.balance-danger {
        background: #fee2e2;
        color: #dc2626;
    }

    .mobile-badge-inline.balance-warning {
        background: #fef3c7;
        color: #d97706;
    }

    .mobile-badge-inline.balance-success {
        background: #dcfce7;
        color: #16a34a;
    }

    /* Hide other cells by default on mobile for warehouse */
    #warehouse-section .modern-table tbody tr td:nth-child(n+3):nth-child(-n+4),
    #warehouse-section .modern-table tbody tr td:nth-child(6) {
        display: none;
    }

    /* Overtime Section Mobile Cards */
    #overtime-section .modern-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        margin-bottom: 1.25rem;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        min-height: 100px;
    }

    #overtime-section .modern-table tbody tr:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }

    /* التاريخ (Column 2) - Top Field */
    #overtime-section .modern-table tbody tr td:nth-child(2) {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.4rem;
        background: rgba(248, 250, 252, 0.5);
        color: var(--text-muted);
        font-weight: 600;
        border-bottom: 1px solid rgba(241, 245, 249, 0.8);
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    #overtime-section .modern-table tbody tr td:nth-child(2)::before {
        content: "\f133";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        color: var(--primary);
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }

    /* اسم الموظف (Column 1) - Main Title */
    #overtime-section .modern-table tbody tr td:nth-child(1) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1e293b;
        border-bottom: none;
        padding: 0.85rem 1.25rem;
        gap: 1rem;
    }

    #overtime-section .modern-table tbody tr td:nth-child(1)::before {
        display: none;
    }

    /* اليوم (Column 3) - Badge في الزاوية علوي يسار */
    #overtime-section .modern-table tbody tr td:nth-child(3) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 0.65rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #overtime-section .modern-table tbody tr td:nth-child(3)::before {
        display: none;
    }

    /* النتيجة (Column 9) - Badge في الزاوية سفلي يسار */
    #overtime-section .modern-table tbody tr td:nth-child(9) {
        display: flex;
        position: absolute;
        left: 1.25rem;
        top: 3.5rem;
        padding: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }

    #overtime-section .modern-table tbody tr td:nth-child(9)::before {
        display: none;
    }

    #overtime-section .modern-table tbody tr td:nth-child(9) span {
        font-size: 1rem;
        padding: 0.3rem 0.8rem;
        background: #dcfce7;
        color: var(--success);
        font-weight: 700;
        border-radius: 8px;
    }

    /* إجمالي الساعات (Column 6) - Show inline with label */
    #overtime-section .modern-table tbody tr td:nth-child(6) {
        display: flex;
        padding: 0.5rem 1.25rem;
        border-bottom: none;
        font-size: 0.9rem;
    }

    #overtime-section .modern-table tbody tr td:nth-child(6)::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        margin-left: 0.5rem;
    }

    /* Hide other cells on mobile for Overtime */
    #overtime-section .modern-table tbody tr td:nth-child(4),
    #overtime-section .modern-table tbody tr td:nth-child(5),
    #overtime-section .modern-table tbody tr td:nth-child(7),
    #overtime-section .modern-table tbody tr td:nth-child(8),
    #overtime-section .modern-table tbody tr td:nth-child(10) {
        display: none !important;
    }
}


/* Alert Modal */
.alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.alert-modal.show {
    opacity: 1;
    visibility: visible;
}

.alert-dialog {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.alert-modal.show .alert-dialog {
    transform: scale(1);
}

.alert-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fef2f2, #ffffff);
}

.alert-header h3 {
    color: var(--danger);
    font-size: 1.3rem;
    margin: 0;
}

.alert-body {
    padding: 2rem;
    text-align: center;
}

.alert-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 1.5rem;
}

.alert-icon.success {
    color: var(--success);
}

.alert-icon.info {
    color: var(--primary);
}

.alert-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.alert-content strong {
    color: var(--danger);
    font-weight: 800;
}

.alert-content .duplicate-info {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    text-align: right;
}

.alert-content .duplicate-info p {
    margin: 0.5rem 0;
    font-weight: 600;
}

.alert-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--border);
    display: flex;
    justify-content: center;
}

.alert-footer .btn {
    min-width: 120px;
}


/* Load More Button */
#load-more-employees,
#load-more-users {
    padding: 1rem;
}

#load-more-employees .btn,
#load-more-users .btn {
    min-width: 200px;
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

/* Import Preview Modal */
#import-preview-modal .modern-table {
    font-size: 0.9rem;
}

#import-preview-modal .modern-table th,
#import-preview-modal .modern-table td {
    padding: 0.75rem;
}

/* Toolbar responsive */
@media (max-width: 767px) {
    .toolbar-card>div:last-child {
        flex-direction: column;
        width: 100%;
    }

    .toolbar-card>div:last-child .btn {
        width: 100%;
    }
}


/* Info Button (Export) */
.btn-info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    transform: translateY(-2px);
}

/* Toolbar buttons responsive */
@media (max-width: 767px) {
    .toolbar-card>div:last-child {
        width: 100%;
    }

    .toolbar-card>div:last-child .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: 0.6rem 0.5rem;
    }

    .toolbar-card>div:last-child .btn i {
        font-size: 0.9rem;
    }
}


/* Import Report Modal */
#import-report-modal .modal-body {
    padding: 2rem;
}

#import-report-content {
    direction: rtl;
}

#import-report-content h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Report scrollable errors */
#import-report-content>div>div {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#import-report-content>div>div::-webkit-scrollbar {
    width: 8px;
}

#import-report-content>div>div::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#import-report-content>div>div::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#import-report-content>div>div::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* Warning Button (Stats) */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
}

/* Professions Stats Modal */
#professions-stats-modal .modal-dialog {
    max-width: 900px;
    max-height: 95vh;
    margin: 1rem auto;
}

#professions-stats-modal .modal-content {
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

#professions-stats-modal .modal-body {
    overflow-y: auto;
    flex: 1;
}

#professions-stats-content>div:last-child {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#professions-stats-content>div:last-child::-webkit-scrollbar {
    width: 8px;
}

#professions-stats-content>div:last-child::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#professions-stats-content>div:last-child::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#professions-stats-content>div:last-child::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modal full height */
.modal {
    overflow-y: auto;
}

.modal-dialog {
    margin: 1rem auto;
}

@media (min-width: 768px) {
    .modal-dialog {
        max-height: 95vh;
    }
}


/* Block/Unblock button icons */
.btn-icon.warning {
    background: #f59e0b;
}

.btn-icon.warning:hover {
    background: #d97706;
}

.btn-icon.success {
    background: #10b981;
}

.btn-icon.success:hover {
    background: #059669;
}


/* Autocomplete Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8fafc;
}

.search-result-item.no-results {
    cursor: default;
    color: var(--text-muted);
    text-align: center;
}

.search-result-item.no-results:hover {
    background: white;
}

.result-code {
    font-weight: 700;
    color: var(--primary);
    min-width: 100px;
}

.result-name {
    flex: 1;
    color: var(--text-dark);
}

/* Form column span */
.form-col-2 {
    grid-column: span 2;
}

@media (max-width: 767px) {
    .form-col-2 {
        grid-column: span 1;
    }
}

/* Modern Confirm Delete Modal Styles */
#confirm-modal {
    z-index: 2000;
}

#confirm-modal .modal-content {
    border: none;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.confirm-icon-wrapper {
    animation: pulse-red 2s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

#confirm-delete-btn.disabled,
#confirm-delete-btn:disabled {
    background-color: #fca5a5 !important;
    border-color: #fca5a5 !important;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

#confirm-input:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
    outline: none;
}

/* Modern Confirm Delete Modal Styles */
#confirm-modal {
    z-index: 2000;
}

#confirm-modal .modal-content {
    border: none;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.confirm-icon-wrapper {
    animation: pulse-red 2s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

#confirm-delete-btn.disabled,
#confirm-delete-btn:disabled {
    background-color: #fca5a5 !important;
    border-color: #fca5a5 !important;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

#confirm-input:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
    outline: none;
}

/* ========================================
   Overtime Time Fields - Special Layout
   ======================================== */

/* Container for time fields (3 fields in one row) */
.time-fields-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.75rem !important;
    grid-column: 1 / -1 !important;
    margin-bottom: 1.25rem;
}

.time-fields-row .form-group {
    margin-bottom: 0 !important;
}

.time-fields-row label {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .time-fields-row {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .time-fields-row label {
        font-size: 0.8rem;
    }

    .time-fields-row .form-control {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .time-fields-row {
        gap: 0.4rem !important;
    }

    .time-fields-row label {
        font-size: 0.75rem;
    }
}