/* Vetmivo - Surgery & Operating Room Module CSS (Phase 15) */

/* Metrics Bar */
.surgery-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.surgery-kpi-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.surgery-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.surgery-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.surgery-kpi-icon.primary { background: #eff6ff; color: #2563eb; }
.surgery-kpi-icon.warning { background: #fffbeb; color: #d97706; }
.surgery-kpi-icon.danger { background: #fef2f2; color: #dc2626; }
.surgery-kpi-icon.info { background: #f0fdf4; color: #16a34a; }
.surgery-kpi-icon.purple { background: #faf5ff; color: #9333ea; }

.surgery-kpi-val {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-heading, #0f172a);
}

.surgery-kpi-lbl {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

/* Operating Room Cards Grid */
.or-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.or-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border-top: 4px solid #94a3b8;
    transition: all 0.2s ease;
}

.or-card.available { border-top-color: #10b981; }
.or-card.occupied { border-top-color: #ef4444; background: #fffafa; }
.or-card.cleaning { border-top-color: #f59e0b; background: #fffdfa; }
.or-card.maintenance { border-top-color: #64748b; }
.or-card.blocked { border-top-color: #0f172a; background: #f8fafc; }

.or-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.or-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1e293b;
}

.or-card-code {
    font-size: 0.75rem;
    font-family: monospace;
    padding: 2px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #475569;
    font-weight: 600;
}

/* Surgery Kanban Board */
.surgery-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    align-items: flex-start;
}

.surgery-board-col {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-height: 400px;
}

.surgery-board-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.surgery-board-col-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.surgery-case-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.surgery-case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.surgery-case-card-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.surgery-case-card-patient {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.surgery-case-card-proc {
    font-size: 0.875rem;
    color: #334155;
    font-weight: 500;
}

.surgery-case-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #f1f5f9;
    font-size: 0.75rem;
    color: #64748b;
}

/* Surgery Clinical Workspace & Header */
.surgery-workspace-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.surgery-workspace-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.surgery-patient-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.surgery-patient-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.surgery-tab-nav {
    display: flex;
    gap: 0.375rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
}

.surgery-tab-link {
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
}

.surgery-tab-link:hover {
    color: #1e293b;
    background: #f8fafc;
}

.surgery-tab-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

/* Pre-Op Checklist UI */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.875rem 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.15s ease;
}

.checklist-item-card.completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.checklist-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist-item-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Intra-Op Monitoring Table & Trend Grid */
.monitoring-latest-card {
    background: #0f172a;
    color: #ffffff;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    text-align: center;
}

.monitoring-stat-box {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.monitoring-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.monitoring-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.2;
}

.monitoring-stat-unit {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.monitoring-chart-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    height: 320px;
}

/* Timeline Stream */
.surgery-timeline-stream {
    position: relative;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.surgery-timeline-stream::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0.75rem;
    width: 2px;
    background: #e2e8f0;
}

.surgery-timeline-node {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.surgery-timeline-node::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #bfdbfe;
}

/* Responsive adjustments for Tablet and Mobile */
@media (max-width: 1024px) {
    .surgery-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .surgery-board-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .monitoring-latest-card {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .surgery-kpi-grid {
        grid-template-columns: 1fr;
    }
    .surgery-board-grid {
        grid-template-columns: 1fr;
    }
    .monitoring-latest-card {
        grid-template-columns: repeat(2, 1fr);
    }
    .surgery-tab-nav {
        gap: 0.25rem;
    }
    .surgery-tab-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}
