/* ============================================================
   Schedule — Grid, shift blocks, staffing indicators
   ============================================================ */

/* ---- Schedule Grid ---- */
.schedule-grid-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
}

.schedule-grid {
    min-width: 800px;
    width: 100%;
    border-collapse: collapse;
}

.schedule-grid thead th {
    background: var(--sidebar-bg);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 5;
}

.schedule-grid thead th:first-child {
    text-align: left;
    padding-left: 14px;
    min-width: 160px;
    position: sticky;
    left: 0;
    z-index: 6;
}

.schedule-grid thead th.today {
    background: var(--primary);
}

.schedule-grid tbody td {
    padding: 4px;
    border: 1px solid var(--border-light);
    vertical-align: top;
    min-width: 110px;
    height: 60px;
    position: relative;
}

.schedule-grid tbody td:first-child {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    background: var(--bg);
    min-width: 160px;
    position: sticky;
    left: 0;
    z-index: 3;
    vertical-align: middle;
}

.schedule-grid tbody td:hover {
    background: var(--primary-bg);
}

.schedule-grid tbody td:first-child:hover {
    background: var(--bg);
}

.schedule-grid tbody tr.staffing-row td {
    background: var(--bg);
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    vertical-align: middle;
    height: auto;
    padding: 10px 8px;
}

.schedule-grid tbody tr.staffing-row td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Shift Block ---- */
.shift-block {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    margin: 2px;
    position: relative;
}

.shift-block:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.shift-block .shift-time {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.shift-block .shift-type-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-top: 1px;
}

.shift-block.type-open {
    background: #dbeafe;
    border-left-color: #2563eb;
}

.shift-block.type-open .shift-type-label { color: #1d4ed8; }

.shift-block.type-close {
    background: #fce7f3;
    border-left-color: #be185d;
}

.shift-block.type-close .shift-type-label { color: #be185d; }

.shift-block.type-mid {
    background: #e0e7ff;
    border-left-color: #4338ca;
}

.shift-block.type-mid .shift-type-label { color: #4338ca; }

.shift-block.type-custom {
    background: #f1f5f9;
    border-left-color: #64748b;
}

.shift-block.type-custom .shift-type-label { color: #64748b; }

.shift-block.status-called_out {
    opacity: 0.6;
    text-decoration: line-through;
    background: var(--warning-light);
    border-left-color: var(--warning);
}

.shift-block.status-no_show {
    opacity: 0.6;
    text-decoration: line-through;
    background: var(--danger-light);
    border-left-color: var(--danger);
}

/* PTO conflict indicator */
.shift-cell-pto {
    position: absolute;
    top: 2px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    z-index: 2;
}

/* Empty cell add button */
.cell-add {
    width: 100%;
    height: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    font-size: 20px;
}

td:hover .cell-add {
    opacity: 1;
}

/* ---- Staffing status cells ---- */
.staffing-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.staffing-ok {
    background: var(--success-light);
    color: var(--success);
}

.staffing-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.staffing-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* ---- My Schedule (employee view) ---- */
.my-schedule-day {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg-white);
    overflow: hidden;
    transition: all var(--transition);
}

.my-schedule-day.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.my-schedule-day.off {
    opacity: 0.6;
}

.day-date-col {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: var(--bg);
    border-right: 1px solid var(--border-light);
    flex-shrink: 0;
}

.day-date-col .day-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.day-date-col .day-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.today .day-date-col {
    background: var(--primary);
}

.today .day-date-col .day-name,
.today .day-date-col .day-num {
    color: #fff;
}

.day-info-col {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.day-shift-time {
    font-size: 16px;
    font-weight: 600;
}

.day-shift-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-off-label {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Staffing Dashboard Cards ---- */
.staffing-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.staffing-day-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    background: var(--bg-white);
}

.staffing-day-card.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.staffing-day-card .sdc-day {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.staffing-day-card .sdc-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.staffing-day-card .sdc-count {
    font-size: 24px;
    font-weight: 700;
}

.staffing-day-card .sdc-minimum {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.staffing-day-card .sdc-off {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.staffing-day-card.status-ok .sdc-count { color: var(--success); }
.staffing-day-card.status-warning .sdc-count { color: var(--warning); }
.staffing-day-card.status-danger .sdc-count { color: var(--danger); }

/* ---- Clocked In ---- */
.clock-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.clock-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
}

.clock-card.mismatch {
    border-color: var(--warning);
    background: var(--warning-light);
}

.clock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.clock-card.mismatch .clock-dot {
    background: var(--warning);
}

.clock-name {
    font-weight: 500;
    font-size: 13px;
}

.clock-time {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ---- Alert cards ---- */
.alert-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-white);
}

.alert-card.unacknowledged {
    border-left: 3px solid var(--warning);
    background: var(--warning-light);
}

.alert-content {
    flex: 1;
}

.alert-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.alert-message {
    font-size: 13px;
    color: var(--text);
}

.alert-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Time Off Request Cards ---- */
.pto-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-white);
}

.pto-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pto-card-name {
    font-weight: 600;
    font-size: 14px;
}

.pto-card-dates {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pto-card-category {
    font-size: 12px;
    color: var(--text-muted);
}

.pto-card-notes {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-style: italic;
}

.pto-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
