/* Dashboard Design System - Based on UI/UX Guide */

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: #f8fafc;
    position: relative;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Navigation */
.dashboard-sidebar {
    width: 280px;
    background: #1e293b;
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.dashboard-sidebar.collapsed {
    width: 80px;
}

.dashboard-sidebar.collapsed .sidebar-title,
.dashboard-sidebar.collapsed .nav-section-title {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dashboard-sidebar.collapsed .nav-link span:not(.nav-icon) {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.dashboard-sidebar.collapsed .nav-icon {
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dashboard-sidebar.collapsed .nav-icon .icon {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    width: 20px !important;
    height: 20px !important;
}

.dashboard-sidebar.collapsed .nav-icon svg,
.dashboard-sidebar.collapsed .nav-icon i {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 20px !important;
    height: 20px !important;
}

.dashboard-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
    gap: 0;
}

.dashboard-sidebar.collapsed .sidebar-logo {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    width: 32px !important;
    height: 32px !important;
}

.dashboard-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.5rem 0.5rem;
}

.dashboard-sidebar.collapsed .nav-section {
    margin-bottom: 1rem;
}

/* Tooltip for collapsed sidebar */
.dashboard-sidebar.collapsed .nav-link {
    position: relative;
}

.dashboard-sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    color: white;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.875rem;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    padding: 0 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #334155;
    color: white;
    border-left-color: var(--primary-color);
}

.nav-link.active {
    background: #334155;
    color: white;
    border-left-color: var(--primary-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item.has-submenu>.nav-link {
    justify-content: space-between;
    cursor: pointer;
}

.submenu {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
}

.submenu-item .nav-link {
    padding-left: 3.25rem;
    font-size: 0.825rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.submenu-toggle-icon {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
    margin-left: auto;
}

.dashboard-sidebar.collapsed .submenu {
    display: none !important;
    /* Hide submenus when collapsed for now */
}

/* Ensure submenu items are hidden when collapsed */
.dashboard-sidebar.collapsed .submenu-item {
    display: none;
}

/* Active submenu item styling */
.submenu-item .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.dashboard-main.collapsed {
    margin-left: 80px;
}

/* Top Header */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #64748b;
    font-size: 1.25rem;
    min-width: 40px;
    min-height: 40px;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle i {
    font-size: 1.25rem;
}

/* Fallback if Font Awesome doesn't load */
.sidebar-toggle .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Show fallback text if icon doesn't load */
.sidebar-toggle i:empty::before {
    content: "☰";
    font-family: Arial, sans-serif;
    font-style: normal;
    font-size: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search input {
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 300px;
    font-size: 0.875rem;
}

.header-search .search-icon {
    position: absolute;
    left: 0.75rem;
    color: #64748b;
}

.header-notifications {
    position: relative;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #475569 !important;
}

.header-notifications:hover {
    background: #f1f5f9;
    color: #3b82f6 !important;
}

.header-notifications i.fas.fa-bell {
    font-size: 1.125rem;
    color: #475569 !important;
}

.header-notifications:hover i.fas.fa-bell {
    color: #3b82f6 !important;
}

/* Ensure all header buttons have proper icon colors */
.header-right button i {
    color: #475569 !important;
}

.header-right button:hover i {
    color: #3b82f6 !important;
}

.notification-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--error-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 1.25rem;
    text-align: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.header-user:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

/* Responsive helpers for front-desk and shared views */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    height: 2rem;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-action:hover {
    background: #1d4ed8;
}

.btn-action.secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-action.success {
    background: var(--success-color);
    color: #fff;
}

.btn-action.warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-action.error {
    background: var(--error-color);
    color: #fff;
}

.btn-action .fas {
    font-size: 0.9rem;
}

/* Mobile-only action button labels for consistent UX */
.action-label-mobile {
    display: none;
    margin-left: 0.25rem;
}

@media (max-width: 768px) {
    .action-label-mobile {
        display: inline;
        font-size: 0.875rem;
    }
}


/* Page header responsiveness */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn-action {
        width: 100%;
    }
}


.action-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.data-table-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.table-title {
    font-weight: 600;
    color: var(--text-color);
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .btn-action {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-filters {
        width: 100%;
        flex-direction: column;
    }

    .table-filters .btn-action,
    .table-filters .filter-select {
        width: 100%;
    }
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.kpi-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.kpi-icon.primary {
    background: var(--primary-color);
}

.kpi-icon.success {
    background: var(--success-color);
}

.kpi-icon.warning {
    background: var(--warning-color);
}

.kpi-icon.error {
    background: var(--error-color);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.kpi-change.positive {
    color: var(--success-color);
}

.kpi-change.negative {
    color: var(--error-color);
}

.kpi-change.neutral {
    color: #64748b;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 2.25rem;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.01em;
}

.btn-action:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-action i {
    font-size: 0.9375rem;
}

.btn-action.secondary {
    background: white;
    color: var(--text-color);
    border: 1px solid #e2e8f0;
}

.btn-action.secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Data Tables */
.data-table-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.table-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.data-table tr:hover {
    background: #f8fafc;
}

/* Table Action Buttons - Enhanced Visibility with Rounded Corners */
.data-table .btn-action {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    min-height: 2rem;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.01em;
}

.data-table .btn-action i {
    font-size: 0.875rem;
}

.data-table .btn-action.primary,
.data-table .btn-action {
    background: #3B82F6;
    color: white;
    border: none;
}

.data-table .btn-action.primary:hover,
.data-table .btn-action:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.data-table .btn-action.secondary {
    background: #64748b;
    color: white;
    border: none;
}

.data-table .btn-action.secondary:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(100, 116, 139, 0.3);
}

.data-table .btn-action.success {
    background: #10B981;
    color: white;
    border: none;
}

.data-table .btn-action.success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.data-table .btn-action.warning {
    background: #F59E0B;
    color: white;
    border: none;
}

.data-table .btn-action.warning:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.data-table .btn-action.danger,
.data-table .btn-action.error {
    background: #EF4444;
    color: white;
    border: none;
}

.data-table .btn-action.danger:hover,
.data-table .btn-action.error:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.data-table .btn-action.info {
    background: #06b6d4;
    color: white;
    border: none;
}

.data-table .btn-action.info:hover {
    background: #0891b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

/* Action button groups in tables - Horizontal layout */
.data-table td .action-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    align-items: center;
}

/* Icon Buttons - Enhanced Visibility for Table Actions */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0.4rem 0.65rem;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.01em;
}

.btn-icon:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-icon i {
    font-size: 0.875rem;
}

.btn-icon span {
    font-size: 0.8125rem;
    font-weight: 500;
}

.btn-icon.success {
    background: #10B981;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon.success:hover {
    background: #059669;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.btn-icon.warning {
    background: #F59E0B;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon.warning:hover {
    background: #d97706;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.btn-icon.danger,
.btn-icon.error {
    background: #EF4444;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon.danger:hover,
.btn-icon.error:hover {
    background: #dc2626;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.btn-icon.info {
    background: #06b6d4;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon.info:hover {
    background: #0891b2;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

.btn-icon.secondary {
    background: #64748b;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon.secondary:hover {
    background: #475569;
    box-shadow: 0 4px 6px rgba(100, 116, 139, 0.3);
}

/* Action buttons container - Horizontal layout */
.action-buttons {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

/* Additional button utilities for better visibility */
.btn-assign-tech {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.01em;
}

.btn-assign-tech:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-assign-tech:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-assign-tech i {
    font-size: 0.875rem;
}

/* Dropdown in tables */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown toggle styles - Enhanced visibility like hamburger button */
.dropdown-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0.5rem !important;
    background: #64748b !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.dropdown-toggle i {
    font-size: 1.125rem !important;
    color: white !important;
}

.dropdown-toggle:hover {
    background: #475569 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px rgba(100, 116, 139, 0.3) !important;
}

.dropdown-toggle:active {
    transform: translateY(0) !important;
}

/* Fallback if Font Awesome doesn't load for dropdown icons */
.dropdown-toggle i:empty::before {
    content: "⋮";
    font-family: Arial, sans-serif;
    font-style: normal;
    font-size: 1.5rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s ease;
    }

    .dashboard-layout.sidebar-open .dashboard-sidebar {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .dashboard-layout.sidebar-open .sidebar-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-overlay {
        pointer-events: none;
    }

    .dashboard-sidebar.collapsed {
        transform: translateX(-100%);
        width: 280px;
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-main.collapsed {
        margin-left: 0;
    }

    .header-search input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .header-search {
        display: none;
    }

    .user-info {
        display: none;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .table-filters {
        justify-content: stretch;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    /* Stack action buttons vertically on mobile only */
    .data-table td .action-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-icon {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-action {
        min-height: 3rem;
        font-size: 1rem;
    }

    .nav-link {
        padding: 1rem 1.5rem;
    }

    .kpi-card {
        padding: 1.25rem;
    }
}

/* Clock Status (for Technician Dashboard) */
.clock-status {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.clock-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.clock-date {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.clock-button {
    width: 200px;
    height: 60px;
    border-radius: 8px;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clock-button.clock-in {
    background: var(--success-color);
    color: white;
}

.clock-button.clock-out {
    background: var(--error-color);
    color: white;
}

.clock-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.2);
}

/* Job Cards */
.job-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.job-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.job-id {
    font-weight: 600;
    color: var(--text-color);
}

.job-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.job-priority.high {
    background: #fee2e2;
    color: #991b1b;
}

.job-priority.medium {
    background: #fef3c7;
    color: #92400e;
}

.job-priority.low {
    background: #d1fae5;
    color: #065f46;
}

.job-details {
    margin-bottom: 1.5rem;
}

.job-detail {
    display: flex;
    margin-bottom: 0.5rem;
}

.job-detail-label {
    font-weight: 500;
    color: #64748b;
    width: 100px;
    flex-shrink: 0;
}

.job-detail-value {
    color: var(--text-color);
}

.job-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.job-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.job-action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.job-action-btn.success {
    background: var(--success-color);
    color: white;
}

.job-action-btn.warning {
    background: var(--warning-color);
    color: white;
}

.job-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
}

/* Tech
nician Jobs Page Enhancements */
.jobs-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.jobs-filter-tabs .btn-action {
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
}

.job-card {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.job-card.urgent {
    border-left-color: var(--error-color);
}

.job-card.high {
    border-left-color: var(--warning-color);
}

.job-card.normal {
    border-left-color: var(--primary-color);
}

.job-card.low {
    border-left-color: var(--secondary-color);
}

.job-priority.urgent {
    background: #fee2e2;
    color: #991b1b;
}

.job-priority.high {
    background: #fef3c7;
    color: #92400e;
}

.job-priority.normal {
    background: #dbeafe;
    color: #1e40af;
}

.job-priority.low {
    background: #f3f4f6;
    color: #374151;
}

.job-detail {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}

.job-detail-label {
    font-weight: 500;
    color: #64748b;
    min-width: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.job-detail-value {
    color: var(--text-color);
    font-size: 0.875rem;
    line-height: 1.4;
}

.job-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.job-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.job-action-btn i {
    margin-right: 0.5rem;
}

.job-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #9ca3af;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-state p {
    font-size: 1rem;
    line-height: 1.5;
}

/* Loading overlay improvements */
#loading-overlay {
    backdrop-filter: blur(2px);
}

#loading-overlay>div {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Mobile optimizations for jobs page */
@media (max-width: 768px) {
    .jobs-filter-tabs {
        gap: 0.25rem;
    }

    .jobs-filter-tabs .btn-action {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .job-detail {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }

    .job-detail-label {
        min-width: auto;
        font-weight: 600;
        color: var(--text-color);
    }

    .job-actions {
        flex-direction: column;
    }

    .job-action-btn {
        min-width: auto;
        width: 100%;
    }

    .table-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-select {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .job-action-btn {
        min-height: 3rem;
        font-size: 1rem;
    }

    .jobs-filter-tabs .btn-action {
        min-height: 3rem;
        padding: 0.75rem 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .job-card {
        border: 2px solid #000;
    }

    .job-detail-label {
        color: #000;
    }

    .status-badge {
        border: 1px solid #000;
    }
}

/* Print styles for job cards */
@media print {

    .job-actions,
    .jobs-filter-tabs,
    #loading-overlay {
        display: none !important;
    }

    .job-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #000;
    }

    .kpi-grid {
        display: none;
    }
}

/* Parts
 Request Page Enhancements */
.parts-search-container {
    position: relative;
}

.search-results-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.search-result-item:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

.selected-part-card {
    border-left: 4px solid var(--primary-color);
    background: #f8fafc;
    transition: all 0.2s ease;
}

.selected-part-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
}

.quantity-input {
    width: 4rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.5rem;
}

.part-price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.part-stock {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.part-stock.low-stock {
    background: #fef3c7;
    color: #92400e;
}

.part-stock.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.total-cost-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

.request-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.request-summary h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.request-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.request-summary-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary-color);
}

/* Recent requests styling */
.recent-request-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.recent-request-item.requested {
    border-left-color: var(--warning-color);
}

.recent-request-item.approved {
    border-left-color: var(--primary-color);
}

.recent-request-item.issued {
    border-left-color: var(--success-color);
}

.recent-request-item.rejected {
    border-left-color: var(--error-color);
}

/* Mobile optimizations for parts request */
@media (max-width: 768px) {
    .quantity-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .quantity-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .quantity-input {
        width: 5rem;
    }

    .search-result-item {
        padding: 0.75rem;
    }

    .selected-part-card {
        padding: 1rem;
    }

    .part-price {
        font-size: 1rem;
    }

    .total-cost-display {
        font-size: 1.125rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .quantity-btn {
        width: 3rem;
        height: 3rem;
    }

    .search-result-item {
        padding: 1.25rem;
        min-height: 4rem;
    }

    .quantity-input {
        min-height: 3rem;
        font-size: 1rem;
    }
}

/* Loading states for parts search */
.parts-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #64748b;
}

.parts-search-loading .loading {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
}

/* Animation for adding parts */
@keyframes partAdded {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.part-added {
    animation: partAdded 0.3s ease-out;
}

/* Improved form styling */
.parts-request-form .form-group {
    margin-bottom: 1.5rem;
}

.parts-request-form .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.parts-request-form textarea {
    resize: vertical;
    min-height: 4rem;
}

/* Submit button enhancement */
.submit-parts-request {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 3.5rem;
}

.submit-parts-request:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.submit-parts-request:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Workforce Dashboard Styles */
.workforce-nav {
    background: white;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.nav-tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 3.5rem;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
    min-height: 3.5rem;
    letter-spacing: 0.01em;
}

.nav-tab i {
    font-size: 1.0625rem;
    transition: transform 0.25s ease;
}

.nav-tab:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.04);
    border-bottom-color: rgba(59, 130, 246, 0.3);
}

.nav-tab:hover i {
    transform: scale(1.1);
}

.nav-tab.active {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.06);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.nav-tab.active i {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    flex-shrink: 0;
}

.workforce-actions {
    margin-top: 2rem;
}

.workforce-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.workforce-action-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.workforce-action-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.action-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.action-icon-wrapper.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
}

.action-icon-wrapper.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.action-icon-wrapper.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.action-icon-wrapper i {
    font-size: 1.25rem;
}

.action-text {
    flex: 1;
}

.action-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.action-description {
    font-size: 0.8125rem;
    color: #64748b;
}

/* Highlights Grid */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 1rem;
    transition: all 0.2s ease;
}

.highlight-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.highlight-content {
    flex: 1;
    min-width: 0;
}

.highlight-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.highlight-meta {
    font-size: 0.8125rem;
    color: #64748b;
}

/* Responsive Workforce Dashboard */
@media (max-width: 1024px) {
    .workforce-action-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs-container {
        padding: 0 1rem;
    }

    .nav-tab {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .nav-tab span {
        display: inline;
    }
}

@media (max-width: 768px) {
    .workforce-action-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .workforce-action-card {
        padding: 1.25rem;
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .workforce-nav {
        margin-bottom: 1.5rem;
    }

    .nav-tabs-container {
        padding: 0 0.75rem;
    }

    .nav-tabs {
        gap: 0.25rem;
        min-height: 3rem;
    }

    .nav-tab {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
        gap: 0.5rem;
        min-height: 2.75rem;
    }

    .nav-tab i {
        font-size: 0.9375rem;
    }

    /* Show only icons on very small screens, full text on tap/hover */
    .nav-tab span {
        display: none;
    }

    .nav-tab:hover span,
    .nav-tab.active span {
        display: inline;
    }
}

@media (max-width: 480px) {
    .nav-tab {
        padding: 0.75rem;
        justify-content: center;
        flex: 1;
        min-width: 3rem;
    }

    .nav-tabs {
        width: 100%;
        justify-content: space-between;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal[style*="display: block"],
.modal[style*="display:block"] {
    display: flex !important;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close:hover {
    color: #111827;
}

/* 
Page Header Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-header .header-content h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header .header-content p {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}

.page-header .header-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Responsive Page Header */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .page-header .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header .header-actions .btn {
        flex: 1;
        min-width: 150px;
    }
}