/* style.css */
:root {
    --primary: #22A958;
    --primary-light: #E8F5EE;
    --secondary: #3A4D5F;
    --light: #F8FAFC;
    --dark: #1E293B;
    --success: #22A958;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #0EA5E9;
    --gray: #64748B;
    --gray-light: #CBD5E1;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F1F5F9;
    color: var(--dark);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 100;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--gray-light);
}

.logo {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--dark);
}

.sidebar-menu {
    padding: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
}

.menu-item:hover,
.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.menu-item i {
    margin-right: 12px;
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-info {
    margin-right: 12px;
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    color: var(--gray);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
}

/* Search and Filters */
.search-section.card {
    padding: 16px;
    margin-bottom: 24px;
}

.search-bar-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input-group {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

.search-input-group .form-control {
    padding-left: 35px;
}

.search-actions {
    display: flex;
    gap: 8px;
}

.filter-row {
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.status-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.status-chips::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

.status-chip {
    padding: 6px 16px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--gray);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.status-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.status-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-light);
    color: var(--gray);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--gray);
}

@media (max-width: 768px) {
    .search-bar-row {
        flex-direction: column;
    }

    .search-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .search-actions .btn {
        width: 100%;
        padding: 10px;
    }

    .status-chips {
        margin: 0 -16px;
        padding: 0 16px 8px 16px;
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 24px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table, .table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

th {
    font-weight: 600;
    color: var(--gray);
    background: #f8fafc;
}

@media (max-width: 768px) {
    .table thead {
        display: none;
    }

    .table tr {
        display: block;
        margin-bottom: 15px;
        background: white;
        border: 1px solid var(--gray-light);
        border-radius: 12px;
        padding: 10px;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    .table td:last-child {
        border-bottom: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        float: left;
        color: var(--gray);
        text-align: left;
        margin-right: 15px;
    }
}
    font-size: 14px;
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.badge-success {
    background: var(--primary-light);
    color: var(--success);
}

.badge-warning {
    background: #FEF3C7;
    color: var(--warning);
}

.badge-danger {
    background: #FEE2E2;
    color: var(--danger);
}

.badge-info {
    background: #DBEAFE;
    color: var(--info);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #1D8E4A;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Forms */
.form-row {
    display: flex;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group {
    margin-bottom: 20px;
}

.label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }

    .sidebar .logo-text,
    .sidebar .menu-text {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }

    .sidebar-header {
        justify-content: center;
    }

    .menu-item {
        justify-content: center;
    }

    .menu-item i {
        margin-right: 0;
        font-size: 20px;
    }
}

@media (max-width: 768px) {

    /* Better Top Bar for Mobile */
    .top-bar {
        padding: 10px 16px !important;
        margin-bottom: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .main-content {
        padding: 0 16px 80px 16px !important;
    }

    /* Stats Grid Refinement */
    .stats-grid {
        display: flex !important;
        overflow-x: auto !important;
        gap: 12px !important;
        padding: 8px 4px 16px 4px !important;
        margin: 0 -16px 12px -16px !important;
        -webkit-overflow-scrolling: touch;
        scroll-padding: 16px;
    }

    .stats-grid::after {
        content: "";
        flex: 0 0 16px;
    }

    .stat-card {
        min-width: 140px !important;
        flex: 0 0 auto !important;
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .stat-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        margin-right: 8px !important;
    }

    .stat-value {
        font-size: 18px !important;
    }

    .stat-label {
        font-size: 11px !important;
    }

    /* Job Card Detail Refinement */
    .job-detail-row {
        gap: 12px;
        align-items: flex-start;
    }

    .job-detail-label {
        font-size: 12px;
        color: #718096;
    }

    .job-detail-value {
        font-size: 13px;
        flex: 1;
        text-align: right;
        word-break: break-word;
    }

    .job-detail-value select {
        max-width: 140px;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
    }

    .job-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .job-actions .btn, .job-actions select {
        width: 100%;
        height: 38px;
        font-size: 13px;
        margin: 0;
    }

    /* Small Cards for Job Details */
    .jobs-table tr {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        padding: 15px !important;
        border: 1px solid #eef2f6 !important;
    }

    .jobs-table td {
        padding: 0 !important;
        border: none !important;
        display: block !important;
        min-height: auto !important;
    }

    .jobs-table td:before {
        position: static !important;
        display: block !important;
        font-size: 10px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 4px !important;
    }

    .jobs-table td:last-child {
        grid-column: span 2 !important;
        padding-top: 10px !important;
        border-top: 1px solid #eee !important;
        margin-top: 5px !important;
    }

    /* Labelling table cells for jobs small cards */
    .jobs-table td:nth-of-type(1):before {
        content: "Order ID";
    }

    .jobs-table td:nth-of-type(2):before {
        content: "Customer";
    }

    .jobs-table td:nth-of-type(3):before {
        content: "Device";
    }

    .jobs-table td:nth-of-type(4):before {
        content: "Issue";
    }

    .jobs-table td:nth-of-type(5):before {
        content: "Staff";
    }

    .jobs-table td:nth-of-type(6):before {
        content: "Status";
    }

    .jobs-table td:nth-of-type(7):before {
        content: "Action";
    }

    /* Responsive Table to Cards */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }

    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 1px solid var(--gray-light);
        border-radius: 12px;
        margin-bottom: 15px;
        background: white;
        padding: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 45% !important;
        text-align: left !important;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
    }

    .table-responsive td:before {
        position: absolute;
        top: 0;
        left: 12px;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--gray);
        height: 100%;
        display: flex;
        align-items: center;
        font-size: 12px;
    }

    /* Labelling table cells for mobile cards - Scoped to Jobs where appropriate */
    .jobs-table td:nth-of-type(1):before, 
    .table-responsive.jobs-table td:nth-of-type(1):before {
        content: "Job ID";
    }

    .jobs-table td:nth-of-type(2):before,
    .table-responsive.jobs-table td:nth-of-type(2):before {
        content: "Customer";
    }

    .jobs-table td:nth-of-type(3):before,
    .table-responsive.jobs-table td:nth-of-type(3):before {
        content: "Device";
    }

    .jobs-table td:nth-of-type(4):before,
    .table-responsive.jobs-table td:nth-of-type(4):before {
        content: "Issue";
    }

    .jobs-table td:nth-of-type(5):before,
    .table-responsive.jobs-table td:nth-of-type(5):before {
        content: "Staff";
    }

    .jobs-table td:nth-of-type(6):before,
    .table-responsive.jobs-table td:nth-of-type(6):before {
        content: "Status";
    }

    .jobs-table td:nth-of-type(7):before,
    .table-responsive.jobs-table td:nth-of-type(7):before {
        content: "Actions";
    }

    /* Global Adjustments */
    .card {
        padding: 16px !important;
        border-radius: 16px !important;
    }
}

/* Quick Action Menu & More Menu Styles */
.action-menu-overlay,
.more-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    justify-content: center;
    align-items: flex-end;
}

.action-menu-overlay.active,
.more-menu-overlay.active {
    display: flex;
    opacity: 1;
}

.action-menu-container,
.more-menu-container {
    background: white;
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 30px 20px 80px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.action-menu-overlay.active .action-menu-container,
.more-menu-overlay.active .more-menu-container {
    transform: translateY(0);
}

.action-grid,
.more-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.action-item,
.more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    font-size: 11px;
    font-weight: 500;
}

.action-icon,
.more-icon {
    width: 54px;
    height: 54px;
    background: #f8fafc;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 8px;
    transition: 0.2s;
    border: 1px solid #f1f5f9;
}

.action-item:active .action-icon,
.more-menu-item:active .more-icon {
    transform: scale(0.92);
    background: var(--primary-light);
}

/* Wizard Specific Styles (from add_job.php) */
.wizard-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.step-indicator {
    display: flex;
    background: #f8fafc;
    padding: 20px 40px;
    border-bottom: 1px solid #e2e8f0;
    justify-content: space-between;
}

.step-item {
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: 0.3s;
}

.step-item.active {
    opacity: 1;
    color: var(--primary);
    font-weight: 600;
}

.step-circle {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: #64748B;
}

.step-item.active .step-circle {
    background: var(--primary);
    color: white;
}

.step-item.completed .step-circle {
    background: var(--primary);
    color: white;
}

.form-section {
    display: none;
    padding: 30px 40px;
    animation: fadeIn 0.3s;
}

.form-section.active {
    display: block;
}

/* Job Status Icons (from jobs.php) */
.icon-pending {
    background: #FEF3C7;
    color: var(--warning);
}

.icon-progress {
    background: #E0F2FE;
    color: var(--info);
}

.icon-completed {
    background: var(--primary-light);
    color: var(--success);
}

.icon-hold {
    background: #FEE2E2;
    color: var(--danger);
}

.icon-due {
    background: #F3E8FF;
    color: #8B5CF6;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 15px auto;
        width: 95%;
        max-width: none;
        border-radius: 12px;
        padding-bottom: 20px;
    }

    .modal-body {
        padding: 16px !important;
    }

    .detail-grid {
        grid-template-columns: 1fr !important;
    }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--gray);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--dark);
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    margin-bottom: 12px;
}

.detail-label {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 600;
    color: var(--dark);
}

/* Overlays */
.action-menu-overlay,
.more-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2001;
    justify-content: flex-end;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-menu-overlay.active,
.more-menu-overlay.active {
    opacity: 1;
}

.action-menu-container,
.more-menu-container {
    background: white;
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 30px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-menu-overlay.active .action-menu-container,
.more-menu-overlay.active .more-menu-container {
    transform: translateY(0);
}

.action-grid,
.more-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.action-item,
.more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    font-size: 12px;
    text-align: center;
}

.action-icon,
.more-icon {
    width: 56px;
    height: 56px;
    background: var(--light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 24px;
    color: var(--primary);
}

.action-item span,
.more-menu-item span {
    font-weight: 500;
}

/* Dashboard Quick Actions BLEED Fix */
@media (max-width: 768px) {
    .step-indicator {
        padding: 15px;
    }

    .step-item span {
        font-size: 11px;
    }

    .step-circle {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-right: 5px;
    }

    .form-section {
        padding: 15px;
    }
}

.alert-success {
    background: var(--primary-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: #FEE2E2;
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Tabs and Master Data Styles (from masters.php) */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.master-form {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* Tabs and Master Data Styles (from masters.php) */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.master-form {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* Mobile Utilities */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1001;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px !important;
        width: 100%;
        overflow-x: hidden;
    }

    .top-bar {
        padding: 12px 15px !important;
        margin-bottom: 15px !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .top-bar .page-title {
        font-size: 20px;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }

    .btn {
        width: 100%;
        margin-bottom: 8px;
        justify-content: center;
        display: flex;
        align-items: center;
    }

    .btn-sm {
        width: auto;
        margin-bottom: 0;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .btn {
        width: 100%;
    }

    /* Modal Mobile Fix */
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 15px !important;
    }

    /* Mobile Table Overrides - Generic */
    .table-responsive table, 
    .table-responsive thead, 
    .table-responsive tbody, 
    .table-responsive th, 
    .table-responsive td, 
    .table-responsive tr { 
        display: block; 
    }

    .table-responsive thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr { 
        border: 1px solid #eee;
        margin-bottom: 15px;
        background: white;
        border-radius: 8px;
        padding: 5px;
    }

    .table-responsive td { 
        border: none;
        border-bottom: 1px solid #f1f5f9; 
        position: relative;
        padding-left: 45% !important; 
        text-align: right !important;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
    }

    .table-responsive td:before { 
        position: absolute;
        left: 15px;
        width: 40%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: var(--gray);
        content: attr(data-label);
    }

    /* Mobile Job Cards Display */
    .mobile-cards {
        display: block !important;
    }

    .desktop-table {
        display: none !important;
    }

    .job-card {
        background: white;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        border: 1px solid #edf2f7;
    }

    .job-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f7fafc;
    }

    .job-id {
        font-weight: 700;
        color: var(--primary);
    }

    .job-customer {
        font-weight: 600;
        font-size: 16px;
        margin-bottom: 4px;
    }

    .job-phone {
        color: var(--gray);
        font-size: 14px;
        margin-bottom: 12px;
    }

    .job-detail-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .job-detail-label {
        color: var(--gray);
        font-weight: 500;
    }

    .job-detail-value {
        font-weight: 600;
        text-align: right;
    }

    .job-actions {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #f7fafc;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Base Mobile-Cards display state (hidden by default) */
.mobile-cards {
    display: none;
}

/* Page Specific Responsive Table Labels */
@media (max-width: 768px) {

    /* Customers Table */
    .customers-table td:nth-of-type(1):before {
        content: "Name";
    }

    .customers-table td:nth-of-type(2):before {
        content: "Contact";
    }

    .customers-table td:nth-of-type(3):before {
        content: "Address";
    }

    .customers-table td:nth-of-type(4):before {
        content: "Jobs";
    }

    .customers-table td:nth-of-type(5):before {
        content: "Actions";
    }

    /* Masters Table */
    .masters-table td:nth-of-type(1):before {
        content: "ID";
    }

    .masters-table td:nth-of-type(2):before {
        content: "Name";
    }

    .masters-table td:nth-of-type(3):before {
        content: "Actions";
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}/* Modern UI Theme (Harmonized) */
:root {
    --modern-primary: #4361ee;
    --modern-primary-light: #eef2ff;
    --modern-secondary: #3a0ca3;
    --modern-success: #4cc9f0;
    --modern-info: #4361ee;
    --modern-warning: #f72585;
    --modern-danger: #f72585;
    --modern-dark: #2b2d42;
    --modern-light: #f8f9fa;
    --modern-gray: #6c757d;
    --modern-gray-light: #e9ecef;
    --modern-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --modern-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Modern Header & Container */
.modern-container {
    padding: 16px;
    width: 100%;
}

.modern-header {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    box-shadow: var(--modern-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Modern Stats Grid (Swipable) */
.modern-stats-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 0 16px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.modern-stats-scroll::-webkit-scrollbar {
    display: none;
}

.modern-stat-card {
    min-width: 150px;
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--modern-shadow-sm);
}

.modern-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Modern Search Card */
.modern-search-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--modern-shadow-sm);
}

/* Modern Job/Entity Cards */
.modern-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--modern-shadow-sm);
    border-left: 4px solid var(--modern-primary);
}

.modern-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.modern-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

/* Mobile Compatibility Fixes */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    body {
        padding-bottom: 80px;
    }
}
