﻿/* =========================================================
   IPD MODULE
========================================================= */

.ipd-page {
    padding: 24px;
    background: #f8fafc;
    min-height: calc(100vh - 70px);
}

/* =========================================================
   PAGE HEADER
========================================================= */

.ipd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.ipd-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

.ipd-subtitle {
    color: #64748b;
    margin-top: 4px;
}

/* =========================================================
   DASHBOARD CARDS
========================================================= */

.ipd-stats {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.ipd-stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

    .ipd-stat-card h3 {
        margin: 0;
        font-size: 28px;
        font-weight: 700;
        color: #2563eb;
    }

    .ipd-stat-card span {
        color: #64748b;
        font-size: 13px;
    }

/* =========================================================
   CARD
========================================================= */

.ipd-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

.ipd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ipd-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

/* =========================================================
   FORM GRID
========================================================= */

.ipd-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 18px;
}

.ipd-field {
    display: flex;
    flex-direction: column;
}

    .ipd-field label {
        margin-bottom: 8px;
        font-size: 13px;
        font-weight: 600;
        color: #334155;
    }

    .ipd-field input,
    .ipd-field select,
    .ipd-field textarea {
        border: 1px solid #cbd5e1;
        border-radius: 12px;
        height: 46px;
        padding: 0 14px;
        background: white;
    }

    .ipd-field textarea {
        height: 120px;
        padding-top: 12px;
    }

        .ipd-field input:focus,
        .ipd-field select:focus,
        .ipd-field textarea:focus {
            outline: none;
            border-color: #2563eb;
        }

.full-width {
    grid-column: 1 / -1;
}

/* =========================================================
   PATIENT PROFILE
========================================================= */

.patient-profile-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    margin-bottom: 20px;
}

.patient-profile {
    display: flex;
    gap: 18px;
    align-items: center;
}

.patient-avatar {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    object-fit: cover;
}

.patient-details h4 {
    margin: 0;
    color: #0f172a;
}

.patient-details p {
    margin: 4px 0;
    color: #64748b;
}

/* =========================================================
   BED STATUS
========================================================= */

.bed-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.available {
    background: #dcfce7;
    color: #15803d;
}

.occupied {
    background: #fee2e2;
    color: #dc2626;
}

.reserved {
    background: #fef3c7;
    color: #d97706;
}

/* =========================================================
   EMERGENCY PRIORITY
========================================================= */

.priority-critical {
    background: #dc2626;
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
}

.priority-urgent {
    background: #f97316;
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
}

.priority-normal {
    background: #16a34a;
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
}

/* =========================================================
   TABLE
========================================================= */

.ipd-table-wrapper {
    overflow-x: auto;
}

.ipd-table {
    width: 100%;
    border-collapse: collapse;
}

    .ipd-table th {
        background: #f8fafc;
        padding: 14px;
        text-align: left;
        font-size: 13px;
        color: #475569;
    }

    .ipd-table td {
        padding: 14px;
        border-top: 1px solid #f1f5f9;
    }

    .ipd-table tr:hover {
        background: #fafafa;
    }

/* =========================================================
   ACTION BUTTONS
========================================================= */

.ipd-actions {
    display: flex;
    gap: 10px;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
}

.btn-secondary {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
}

/* =========================================================
   DISCHARGE SUMMARY
========================================================= */

.discharge-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    padding: 18px;
    line-height: 1.8;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:1200px) {

    .ipd-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .ipd-stats {
        grid-template-columns: repeat(2,1fr);
    }
}

@media(max-width:768px) {

    .ipd-page {
        padding: 16px;
    }

    .ipd-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ipd-grid {
        grid-template-columns: 1fr;
    }

    .ipd-stats {
        grid-template-columns: 1fr;
    }

    .patient-profile {
        flex-direction: column;
        text-align: center;
    }
}
