/* ==========================================================================
   Vetmivo Phase 14: Hospitalization & Pet Hotel Styling
   Namespace: .hosp-*, .housing-*, .mar-*
   ========================================================================== */

/* 1. Dashboard KPI Grid */
.hosp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.hosp-kpi-card {
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hosp-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.hosp-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hosp-kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text, #1e293b);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hosp-kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* 2. Operational Housing Board */
.housing-board-section {
    margin-bottom: 32px;
}

.housing-board-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text, #1e293b);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-subtle, #f1f5f9);
}

.housing-board-title-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
}

.housing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.housing-card {
    background: var(--color-surface, #ffffff);
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 14px;
    padding: 16px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.housing-card:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.housing-card.occupied {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.housing-card.occupied:hover {
    border-color: #0284c7;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.15);
}

.housing-card.available {
    border: 2px dashed #10b981;
    background: #fafffc;
}

.housing-card.available:hover {
    border-color: #059669;
    background: #f0fdf4;
}

.housing-card.cleaning {
    border: 1.5px solid #fbbf24;
    background: #fffdf5;
}

.housing-card.cleaning:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.housing-card.maintenance {
    border-color: #94a3b8;
    background: #f8fafc;
    opacity: 0.85;
}

.housing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.housing-code {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text, #1e293b);
    display: flex;
    align-items: center;
    gap: 6px;
}

.housing-patient {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.housing-patient-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    transition: color 0.15s ease;
}

.housing-patient-name:hover {
    color: var(--color-primary, #18A999);
}

.housing-patient-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.4;
}

.housing-next-task {
    margin-top: 10px;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-radius: 8px;
    font-size: 11.5px;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 3. MAR (Medication Administration Record) Table */
.mar-table-container {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 20px;
}

.mar-row {
    transition: background-color 0.15s ease;
}

.mar-row:hover {
    background-color: #f8fafc;
}

.mar-status-scheduled {
    background-color: #f1f5f9;
    color: #475569;
}

.mar-status-administered {
    background-color: #ecfdf5;
    color: #065f46;
}

.mar-status-late {
    background-color: #fffbeb;
    color: #92400e;
}

.mar-status-missed {
    background-color: #fef2f2;
    color: #991b1b;
}

/* 4. Care Tasks Workspace */
.care-task-card {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    padding: 14px 16px;
    background: #ffffff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.care-task-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.care-task-card.overdue {
    border-left: 5px solid #ef4444;
    background: #fff8f8;
}

.care-task-card.due {
    border-left: 5px solid #3b82f6;
    background: #f8fbff;
}

.care-task-card.completed {
    border-left: 5px solid #10b981;
    background: #fafdfc;
    opacity: 0.9;
}

.care-task-card.skipped {
    border-left: 5px solid #f59e0b;
    background: #fffdf5;
    opacity: 0.85;
}

/* 5. Admission Workspace Tabs */
.hosp-tab-nav {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: none;
}

.hosp-tab-nav::-webkit-scrollbar {
    display: none;
}

.hosp-tab-btn {
    padding: 11px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.hosp-tab-btn:hover {
    color: #1e293b;
    background: #f8fafc;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.hosp-tab-btn.active {
    color: var(--color-primary, #18A999);
    border-bottom-color: var(--color-primary, #18A999);
    background: #f0fdfa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* 6. Vital Numeric Inputs Grid */
.vital-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.vital-input-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.15s ease;
}

.vital-input-box:focus-within {
    border-color: var(--color-primary, #18A999);
    box-shadow: 0 0 0 3px rgba(24, 169, 153, 0.12);
}

.vital-input-box label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vital-input-box input {
    width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 4px;
    color: #0f172a;
    background: #ffffff;
}

/* 7. Timeline Stream */
.hosp-timeline-stream {
    position: relative;
    padding-left: 32px;
}

.hosp-timeline-stream::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e2e8f0;
}

.hosp-timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.hosp-timeline-bullet {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--color-primary, #18A999);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hosp-timeline-card {
    background: #ffffff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* 8. Discharge Checklist Card */
.discharge-check-item {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s ease;
}

.discharge-check-item.done {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* 9. Responsive Styles */
@media (max-width: 768px) {
    .hosp-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

    .care-task-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .vital-input-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hosp-kpi-grid {
        grid-template-columns: 1fr;
    }
}
