/* Home Dashboard Styles */

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stat-card.primary {
    border-color: #3b82f6;
}

.stat-card.primary .stat-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-card.success {
    border-color: #10b981;
}

.stat-card.success .stat-icon {
    background: #d1fae5;
    color: #10b981;
}

.stat-card.info {
    border-color: #6366f1;
}

.stat-card.info .stat-icon {
    background: #e0e7ff;
    color: #6366f1;
}

.stat-card.warning {
    border-color: #f59e0b;
}

.stat-card.warning .stat-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-icon {
    position: static; /* reset the global absolute rule; this card stacks icon above label */
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    color: #94a3b8;
}

/* Today Section */
.today-section {
    margin-top: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.today-view {
    display: grid;
    grid-template-columns: 100px 1fr;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 400px;
    max-height: 1000px;
}

/* Time Column */
.time-column {
    background: #fafafa;
    border-right: 2px solid #e2e8f0;
}

.time-header {
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.time-slots {
    overflow-y: auto;
}

.time-slot {
    padding: 12px 10px;
    text-align: right;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    height: 60px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Schedule Column */
.schedule-column {
    position: relative;
}

.schedule-header {
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.schedule-slots {
    overflow-y: auto;
    position: relative;
}

.schedule-slot {
    height: 60px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    padding: 4px;
}

/* Non-working hours styling */
.time-slot.non-working-hours,
.schedule-slot.non-working-hours {
    background: repeating-linear-gradient(
        45deg,
        #f8fafc,
        #f8fafc 10px,
        #f1f5f9 10px,
        #f1f5f9 20px
    );
    opacity: 0.6;
}

/* Schedule Items */
.schedule-item {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    position: absolute;
    left: 4px;
    right: 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    overflow: hidden;
    z-index: 10;
    border-left: 4px solid;
    display: flex;
    flex-direction: column;
}

.schedule-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.schedule-item.job {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e3a8a;
}

.schedule-item.task {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #78350f;
}

.schedule-item.overdue {
    background: #fee2e2;
    border-color: #ef4444;
    color: #7f1d1d;
}

/* Schedule Item Priority Colors for Jobs */
.schedule-item.job.priority-low {
    border-left-color: #3b82f6;
}

.schedule-item.job.priority-medium {
    border-left-color: #f59e0b;
}

.schedule-item.job.priority-high {
    border-left-color: #f97316;
}

.schedule-item.job.priority-urgent {
    border-left-color: #ef4444;
}

.schedule-item-content {
    color: inherit;
}

.schedule-item-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.schedule-item-building {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 1.2;
}

.schedule-item-customer {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-bottom: 3px;
}

.schedule-item-time {
    font-size: 10px;
    opacity: 0.85;
    line-height: 1.2;
}

/* No Results State */
.no-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 60px 40px;
    text-align: center;
    margin-top: 20px;
}

.no-results i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.no-results p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* Scrollbar Styling */
.time-slots::-webkit-scrollbar,
.schedule-slots::-webkit-scrollbar {
    width: 8px;
}

.time-slots::-webkit-scrollbar-track,
.schedule-slots::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.time-slots::-webkit-scrollbar-thumb,
.schedule-slots::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.time-slots::-webkit-scrollbar-thumb:hover,
.schedule-slots::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Current Time Indicator */
.dashboard-current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #dc2626;
    z-index: 20;
    pointer-events: none;
}

.dashboard-current-time-dot {
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
}

/* Job Attribute Indicators */
.job-attributes-row {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.job-attribute-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    cursor: help;
    transition: transform 0.15s ease;
}

.job-attribute-indicator:hover {
    transform: scale(1.3);
}

/* For scheduled jobs on timeline - smaller, top-right positioned */
.schedule-item .job-attributes-timeline {
    position: absolute;
    top: 4px;
    right: 6px;
    display: flex;
    gap: 3px;
    z-index: 1;
}

.schedule-item .job-attributes-timeline .job-attribute-indicator {
    width: 8px;
    height: 8px;
    border-width: 1px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .today-view {
        grid-template-columns: 80px 1fr;
    }

    .time-slot {
        font-size: 11px;
        padding: 8px 6px;
    }

    .schedule-item-title {
        font-size: 12px;
    }

    .schedule-item-location {
        display: none;
    }
}
