/* =========================================================
   IVFCT UI POLISH
   Final visual layer loaded after normalization.
   ========================================================= */

/* ---------------------------------------------------------
   MAIN LAYOUT
   --------------------------------------------------------- */

.ivf-main-shell {
    min-width: 0;
    min-height: 100vh;
    background: var(--ivf-bg);
}

.ivf-main-content {
    min-height: 100vh;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.ivf-main-content > :first-child {
    margin-top: 0;
}

/* Keep wide admin/report tables inside the content column. */
.ivf-main-content .table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #c3cfdb transparent;
}

.ivf-main-content .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.ivf-main-content .table-responsive::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c3cfdb;
}

/* ---------------------------------------------------------
   ADMIN HOME
   --------------------------------------------------------- */

.ivf-admin-home {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.25rem 0 2rem;
}

.ivf-admin-home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.35rem;
}

.ivf-admin-home-header h1 {
    margin: 0.2rem 0 0;
    color: var(--ivf-navy);
    font-size: 1.75rem;
    font-weight: 720;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.ivf-admin-home-header p {
    max-width: 720px;
    margin: 0.55rem 0 0;
    color: var(--ivf-muted);
    font-size: var(--ivf-font-base);
    line-height: 1.55;
}

.ivf-admin-home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.ivf-admin-module-card {
    min-width: 0;
    min-height: 210px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-surface-radius);
    background: #fff;
    box-shadow: var(--ivf-surface-shadow);
}

.ivf-admin-module-card-wide {
    grid-column: 1 / -1;
    min-height: 190px;
}

.ivf-admin-module-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #d9e7f2;
    background: var(--ivf-primary-light);
    color: var(--ivf-primary);
}

.ivf-admin-module-icon svg {
    width: 22px;
    height: 22px;
}

.ivf-admin-module-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
}

.ivf-admin-module-body h2 {
    margin: 0;
    color: var(--ivf-navy);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.ivf-admin-module-body p {
    max-width: 760px;
    margin: 0.45rem 0 1.1rem;
    color: var(--ivf-muted);
    font-size: var(--ivf-font-sm);
    line-height: 1.55;
}

.ivf-admin-module-body > .btn,
.ivf-admin-module-actions {
    margin-top: auto;
}

.ivf-admin-module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

/* ---------------------------------------------------------
   COMMON INTERACTION REFINEMENTS
   --------------------------------------------------------- */

.content a.btn,
.content button.btn {
    text-decoration: none;
}

.content .card-header h5,
.content .card-header .h5 {
    margin-bottom: 0.2rem;
    color: var(--ivf-navy);
    font-size: 1rem;
    font-weight: 700;
}

.content .table td .fw-semibold,
.content .table td strong {
    color: #2f4256;
}

.content .spinner-border-sm {
    width: 0.9rem;
    height: 0.9rem;
    border-width: 0.12em;
}

.content .alert:last-child,
.content .card:last-child {
    margin-bottom: 0;
}

/* ---------------------------------------------------------
   STAFF ASSIGNMENTS
   --------------------------------------------------------- */

.ivf-assignment-inactive {
    opacity: 0.68;
    border-color: #d9e0e7 !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    filter: saturate(0.6);
}

.ivf-assignment-inactive .card-body {
    background: linear-gradient(135deg, #f8fafc 0%, #f3f6f9 100%);
}

.ivf-assignment-inactive:hover {
    transform: none !important;
}

.ivf-assignment-inactive .btn:disabled {
    cursor: not-allowed;
    opacity: 0.78;
}

.ivf-assignment-inactive-note {
    max-width: 760px;
    padding: 0.55rem 0.7rem;
    border: 1px dashed #c8d1db;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #667586;
    font-size: var(--ivf-font-xs);
    line-height: 1.45;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 900px) {
    .ivf-admin-home-grid {
        grid-template-columns: 1fr;
    }

    .ivf-admin-module-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .ivf-main-content {
        padding-top: 0.85rem;
        padding-bottom: 2rem;
    }

    .ivf-admin-home {
        padding-top: 0;
    }

    .ivf-admin-home-header h1 {
        font-size: 1.5rem;
    }

    .ivf-admin-module-card,
    .ivf-admin-module-card-wide {
        min-height: 0;
        padding: 1rem;
    }

    .ivf-admin-module-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .ivf-admin-module-icon svg {
        width: 20px;
        height: 20px;
    }

    .ivf-admin-module-actions {
        width: 100%;
        flex-direction: column;
    }

    .ivf-admin-module-actions .btn,
    .ivf-admin-module-body > .btn {
        width: 100%;
    }

    .ivf-assignment-inactive .btn {
        width: 100%;
    }
}
