/**
 * A-MIS detail / show pages — upgrades classic author-box + field grids
 * and shared modern profile components.
 */

:root {
    --detail-primary: #1e3a5f;
    --detail-accent: #c9a227;
    --detail-border: #e2e8f0;
    --detail-muted: #64748b;
    --detail-surface: #f8fafc;
    --detail-text: #1e293b;
}

/* -------------------------------------------------------------------------- */
/* Shared modern components (also used by candidate profile)                   */
/* -------------------------------------------------------------------------- */

.detail-page,
.profile-page {
    --profile-primary: var(--detail-primary);
    --profile-accent: var(--detail-accent);
    --profile-border: var(--detail-border);
    --profile-muted: var(--detail-muted);
    --profile-surface: var(--detail-surface);
    --profile-text: var(--detail-text);
}

.profile-hero,
.detail-hero {
    border: none !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.profile-hero-inner,
.detail-hero-inner {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
    background:
        linear-gradient(135deg, rgba(30, 58, 95, 0.06), transparent 45%),
        linear-gradient(180deg, #fff 0%, var(--detail-surface) 100%);
    border-top: 3px solid var(--detail-accent);
}

.profile-hero-photo,
.detail-hero-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
    flex-shrink: 0;
}

.profile-section,
.detail-section {
    background: #fff;
    border: 1px solid var(--detail-border);
    margin-bottom: 1rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.profile-section-header,
.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--detail-border);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), #fff 60%);
}

.profile-section-header h5,
.detail-section-header h5 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--detail-text);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.profile-section-header h5 i,
.detail-section-header h5 i {
    color: var(--detail-accent);
}

.profile-section-body,
.detail-section-body {
    padding: 1.1rem 1.15rem 0.4rem;
}

.profile-detail-grid,
.detail-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem 1.25rem;
    margin-bottom: 0.75rem;
}

.profile-detail-field,
.detail-field {
    min-width: 0;
}

.profile-detail-field.full,
.detail-field.full {
    grid-column: 1 / -1;
}

.profile-detail-label,
.detail-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--detail-muted);
    margin-bottom: 0.2rem;
}

.profile-detail-value,
.detail-field-value {
    display: block;
    color: var(--detail-text);
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-word;
}

.profile-detail-value.is-empty,
.detail-field-value.is-empty {
    color: #94a3b8;
    font-weight: 400;
    font-style: italic;
}

.profile-longtext {
    white-space: pre-wrap;
    line-height: 1.55;
}

.profile-tabs-card,
.detail-tabs-card {
    border: none;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.25rem;
}

.profile-tabs-card .nav-pills .nav-link,
.detail-tabs-card .nav-pills .nav-link {
    border-radius: 0;
    color: var(--detail-muted);
    font-weight: 600;
    padding: 0.7rem 1rem;
}

.profile-tabs-card .nav-pills .nav-link.active,
.detail-tabs-card .nav-pills .nav-link.active {
    background: var(--detail-primary);
    color: #fff;
}

.profile-badge,
.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--detail-border);
    background: #fff;
    color: var(--detail-text);
}

.profile-badge-type { border-color: rgba(30, 58, 95, 0.25); background: rgba(30, 58, 95, 0.08); color: var(--detail-primary); }
.profile-badge-draft { border-color: rgba(201, 162, 39, 0.4); background: rgba(201, 162, 39, 0.12); color: #8a6a00; }
.profile-badge-submitted { border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.1); color: #166534; }

.profile-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.15rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(201, 162, 39, 0.35);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), #fff);
}

.profile-status-banner.is-submitted {
    border-color: rgba(22, 163, 74, 0.3);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), #fff);
}

.profile-status-banner i { margin-top: 0.15rem; color: #a07800; }
.profile-status-banner.is-submitted i { color: #15803d; }
.profile-status-banner p { margin: 0.15rem 0 0; color: var(--detail-muted); font-size: 0.9rem; }

.profile-hero-main { flex: 1; min-width: 0; }
.profile-hero-name {
    margin: 0 0 0.4rem;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--detail-text);
}
.profile-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    color: var(--detail-muted);
    font-size: 0.92rem;
}
.profile-hero-meta a { color: var(--detail-primary); }
.profile-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.profile-record {
    border: 1px solid var(--detail-border);
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--detail-surface);
}
.profile-record h6 {
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: var(--detail-text);
}
.profile-record .meta { color: var(--detail-muted); font-size: 0.85rem; margin-bottom: 0.35rem; }

.profile-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.profile-doc-card {
    border: 1px solid var(--detail-border);
    background: #fff;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 150px;
}
.profile-doc-card.has-file { border-top: 3px solid #15803d; }
.profile-doc-card.missing { border-top: 3px solid #cbd5e1; }
.profile-doc-card h6 { margin: 0; font-weight: 700; }
.profile-doc-card p { margin: 0; color: var(--detail-muted); font-size: 0.88rem; flex: 1; }
.profile-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--detail-muted);
}

/* -------------------------------------------------------------------------- */
/* Classic show pages — author-box hero upgrade                                */
/* -------------------------------------------------------------------------- */

.main-content .section.app-page .author-box.card,
.main-content .section.dashboard-page .author-box.card {
    border: none !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
    margin-bottom: 1.25rem;
    overflow: hidden;
    background: #fff !important;
}

.main-content .section.app-page .author-box > .card-body,
.main-content .section.dashboard-page .author-box > .card-body {
    display: flex;
    gap: 1.35rem;
    align-items: flex-start;
    padding: 1.5rem !important;
    background:
        linear-gradient(135deg, rgba(30, 58, 95, 0.06), transparent 45%),
        linear-gradient(180deg, #fff 0%, var(--detail-surface) 100%);
    border-top: 3px solid var(--detail-accent);
}

.main-content .section.app-page .author-box .author-box-left,
.main-content .section.dashboard-page .author-box .author-box-left {
    float: none !important;
    text-align: left;
    flex-shrink: 0;
}

.main-content .section.app-page .author-box .author-box-picture,
.main-content .section.dashboard-page .author-box .author-box-picture {
    width: 96px !important;
    height: 96px !important;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
}

.main-content .section.app-page .author-box .author-box-details,
.main-content .section.dashboard-page .author-box .author-box-details {
    float: none !important;
    padding-left: 0 !important;
    flex: 1;
    min-width: 0;
}

.main-content .section.app-page .author-box .author-box-name,
.main-content .section.dashboard-page .author-box .author-box-name {
    margin-bottom: 0.45rem;
}

.main-content .section.app-page .author-box .author-box-name span,
.main-content .section.dashboard-page .author-box .author-box-name span {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--detail-text) !important;
    line-height: 1.25;
}

.main-content .section.app-page .author-box .author-box-job,
.main-content .section.dashboard-page .author-box .author-box-job {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0.75rem 0.45rem 0;
    padding: 0.28rem 0.65rem;
    background: #fff;
    border: 1px solid var(--detail-border);
    color: var(--detail-muted) !important;
    font-size: 0.84rem !important;
}

.main-content .section.app-page .author-box .author-box-job i,
.main-content .section.dashboard-page .author-box .author-box-job i {
    color: var(--detail-accent);
}

.main-content .section.app-page .author-box .author-box-job a,
.main-content .section.dashboard-page .author-box .author-box-job a {
    color: var(--detail-primary);
}

.main-content .section.app-page .author-box .author-box-description,
.main-content .section.dashboard-page .author-box .author-box-description {
    margin-top: 0.65rem;
    color: var(--detail-muted);
    max-width: 52rem;
}

.main-content .section.app-page .author-box .btn-social-icon,
.main-content .section.dashboard-page .author-box .btn-social-icon {
    width: auto !important;
    height: auto !important;
    min-width: 2.4rem;
    padding: 0.45rem 0.75rem !important;
    border-radius: 0 !important;
    margin-top: 0.85rem;
    font-size: 0.85rem;
}

.main-content .section.app-page .author-box .btn-social-icon i,
.main-content .section.dashboard-page .author-box .btn-social-icon i {
    margin: 0;
    font-size: 0.9rem !important;
}

/* -------------------------------------------------------------------------- */
/* Classic tabs strip                                                          */
/* -------------------------------------------------------------------------- */

.main-content .section.app-page .section-body > .row > .col-12 > .card.mb-0,
.main-content .section.dashboard-page .section-body > .row > .col-12 > .card.mb-0 {
    border: none;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.25rem !important;
}

.main-content .section.app-page .section-body > .row > .col-12 > .card.mb-0 > .card-body,
.main-content .section.dashboard-page .section-body > .row > .col-12 > .card.mb-0 > .card-body {
    padding: 0.65rem 0.85rem !important;
}

.main-content .section.app-page .nav-pills .nav-link,
.main-content .section.dashboard-page .nav-pills .nav-link {
    border-radius: 0;
    color: var(--detail-muted);
    font-weight: 600;
    padding: 0.7rem 1rem;
    margin-right: 0.15rem;
}

.main-content .section.app-page .nav-pills .nav-link i,
.main-content .section.dashboard-page .nav-pills .nav-link i {
    margin-right: 0.35rem;
}

.main-content .section.app-page .nav-pills .nav-link.active,
.main-content .section.dashboard-page .nav-pills .nav-link.active {
    background: var(--detail-primary) !important;
    color: #fff !important;
    box-shadow: inset 0 -2px 0 var(--detail-accent);
}

.main-content .section.app-page .nav-pills .nav-link .badge,
.main-content .section.dashboard-page .nav-pills .nav-link .badge {
    margin-left: 0.35rem;
    border-radius: 0;
    font-weight: 700;
}

.main-content .section.app-page .nav-pills .nav-link.active .badge,
.main-content .section.dashboard-page .nav-pills .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* -------------------------------------------------------------------------- */
/* Nested detail cards + classic field rows                                    */
/* -------------------------------------------------------------------------- */

.main-content .section.app-page .tab-pane > .card,
.main-content .section.app-page .tab-pane .card.card-primary,
.main-content .section.dashboard-page .tab-pane > .card,
.main-content .section.dashboard-page .tab-pane .card.card-primary {
    border: 1px solid var(--detail-border) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
    background: #fff !important;
}

.main-content .section.app-page .tab-pane .card > .card-body > .card.card-primary,
.main-content .section.app-page .tab-pane .card-body > .card.card-body.card-primary,
.main-content .section.dashboard-page .tab-pane .card > .card-body > .card.card-primary,
.main-content .section.dashboard-page .tab-pane .card-body > .card.card-body.card-primary {
    border: 1px solid var(--detail-border) !important;
    box-shadow: none !important;
    margin-bottom: 1rem;
    padding: 0 !important;
    overflow: hidden;
}

.main-content .section.app-page .tab-pane .card.card-primary > h5,
.main-content .section.app-page .tab-pane .card-body.card-primary > h5,
.main-content .section.app-page .tab-pane h5.font-weight-bolder.text-dark.pb-2,
.main-content .section.dashboard-page .tab-pane .card.card-primary > h5,
.main-content .section.dashboard-page .tab-pane .card-body.card-primary > h5,
.main-content .section.dashboard-page .tab-pane h5.font-weight-bolder.text-dark.pb-2 {
    margin: 0 0 1rem !important;
    padding: 0.9rem 1.15rem !important;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), #fff 60%);
    border-bottom: 1px solid var(--detail-border);
    font-size: 0.98rem !important;
    font-weight: 700 !important;
    color: var(--detail-text) !important;
}

.main-content .section.app-page .tab-pane .card.card-primary > h5::before,
.main-content .section.app-page .tab-pane .card-body.card-primary > h5::before,
.main-content .section.app-page .tab-pane h5.font-weight-bolder.text-dark.pb-2::before,
.main-content .section.dashboard-page .tab-pane .card.card-primary > h5::before,
.main-content .section.dashboard-page .tab-pane .card-body.card-primary > h5::before,
.main-content .section.dashboard-page .tab-pane h5.font-weight-bolder.text-dark.pb-2::before {
    content: "";
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.55rem;
    background: var(--detail-accent);
    vertical-align: middle;
}

.main-content .section.app-page .tab-pane .card.card-primary > .row,
.main-content .section.app-page .tab-pane .card-body.card-primary > .row,
.main-content .section.dashboard-page .tab-pane .card.card-primary > .row,
.main-content .section.dashboard-page .tab-pane .card-body.card-primary > .row {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 0.35rem;
}

/* Label above icon/value */
.main-content .section.app-page .tab-pane p.mt-2.mb-1.text-muted.font-weight-bold.font-12.text-uppercase,
.main-content .section.dashboard-page .tab-pane p.mt-2.mb-1.text-muted.font-weight-bold.font-12.text-uppercase,
.main-content .section.app-page .tab-pane p.text-muted.font-weight-bold.font-12.text-uppercase,
.main-content .section.dashboard-page .tab-pane p.text-muted.font-weight-bold.font-12.text-uppercase {
    margin-top: 0.35rem !important;
    margin-bottom: 0.35rem !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.04em;
    color: var(--detail-muted) !important;
}

.main-content .section.app-page .tab-pane .media,
.main-content .section.dashboard-page .tab-pane .media {
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.65rem;
    background: var(--detail-surface);
    border: 1px solid var(--detail-border);
    border-left: 3px solid rgba(201, 162, 39, 0.55);
}

.main-content .section.app-page .tab-pane .media > i,
.main-content .section.dashboard-page .tab-pane .media > i {
    width: 1.35rem !important;
    margin-right: 0.75rem !important;
    margin-top: 0.15rem !important;
    font-size: 0.95rem !important;
    color: var(--detail-accent) !important;
    flex-shrink: 0;
}

.main-content .section.app-page .tab-pane .media .media-body h5,
.main-content .section.dashboard-page .tab-pane .media .media-body h5,
.main-content .section.app-page .tab-pane .media .media-body .font-14,
.main-content .section.dashboard-page .tab-pane .media .media-body .font-14 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--detail-text) !important;
    line-height: 1.45;
}

.main-content .section.app-page .tab-pane .media .media-body a,
.main-content .section.dashboard-page .tab-pane .media .media-body a {
    color: var(--detail-primary);
    font-weight: 600;
}

/* Subsection headings inside details */
.main-content .section.app-page .tab-pane h6.text-warning.border-bottom,
.main-content .section.dashboard-page .tab-pane h6.text-warning.border-bottom {
    color: var(--detail-primary) !important;
    border-bottom-color: rgba(201, 162, 39, 0.35) !important;
    font-weight: 700;
    padding-bottom: 0.5rem !important;
    margin-top: 0.75rem;
}

/* Attachment / list media rows */
.main-content .section.app-page .tab-pane .list-unstyled-border .media,
.main-content .section.dashboard-page .tab-pane .list-unstyled-border .media {
    background: #fff;
    border: 1px solid var(--detail-border) !important;
    border-left: 3px solid #15803d !important;
    padding: 1rem !important;
    margin-bottom: 0.75rem;
}

/* Profile widget (users / profiles) */
.main-content .section.app-page .profile-widget,
.main-content .section.dashboard-page .profile-widget {
    border: none;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.main-content .section.app-page .profile-widget .profile-widget-header,
.main-content .section.dashboard-page .profile-widget .profile-widget-header {
    border-top: 3px solid var(--detail-accent);
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.06), #fff 55%);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .main-content .section.app-page .author-box > .card-body,
    .main-content .section.dashboard-page .author-box > .card-body,
    .profile-hero-inner,
    .detail-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .main-content .section.app-page .author-box .author-box-job,
    .main-content .section.dashboard-page .author-box .author-box-job {
        justify-content: center;
    }

    .main-content .section.app-page .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .main-content .section.app-page .nav-pills .nav-link {
        white-space: nowrap;
    }
}
