/* Hosting safety overrides: keeps UI consistent when old cache/partial CSS is served. */

.sidebar-nav .sidebar-web-link {
    margin-top: 2px;
}

.sidebar-nav .sidebar-web-link i {
    color: inherit;
}

.sidebar-nav .sidebar-web-link:hover,
.sidebar-nav .sidebar-web-link.active {
    background: #eaf1ff;
    color: #2c4ea8;
}

.admin-data-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-data-table .table-actions > .btn,
.admin-data-table .table-actions > a,
.admin-data-table .table-actions > button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.admin-action-edit,
.admin-data-table .admin-table-actions > *:nth-child(1) {
    color: #1d4ed8;
    background: #e8f0ff;
    border-color: #bfd4ff;
}

.admin-action-password,
.admin-data-table .admin-table-actions > *:nth-child(2) {
    color: #7c3aed;
    background: #f1e9ff;
    border-color: #dac7ff;
}

.admin-action-photo,
.admin-data-table .admin-table-actions > *:nth-child(3) {
    color: #0f766e;
    background: #e6f8f6;
    border-color: #b7ece7;
}

.admin-action-delete,
.admin-data-table .admin-table-actions > *:nth-child(4) {
    color: #b91c1c;
    background: #ffe8e8;
    border-color: #ffc3c3;
}

.detail-subnav {
    position: sticky;
    top: var(--detail-sticky-offset, 74px);
    z-index: 1080;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(227, 231, 240, 0.9);
    border-bottom: 1px solid rgba(227, 231, 240, 0.94);
}

.detail-subnav a.is-active {
    color: #2f55b7;
}

.detail-subnav a.is-active::after {
    content: "";
    display: block;
    height: 2px;
    border-radius: 999px;
    margin-top: 4px;
    background: #2f55b7;
}

.detail-main [id],
.detail-hero[id] {
    scroll-margin-top: calc(var(--detail-sticky-offset, 74px) + var(--detail-subnav-height, 58px) + 16px);
}

.detail-panel {
    background: #ffffff;
    border: 1px solid #e3e7f0;
    border-radius: 12px;
}

.contact-card {
    border: 1px solid rgba(47, 85, 183, 0.14);
    background: linear-gradient(180deg, rgba(47, 85, 183, 0.08), rgba(47, 85, 183, 0.02) 26%, #ffffff 70%);
}

/* Public detail page consistency */
body.page-detail-kos .detail-hero {
    padding: 24px 0 0;
    background: #f7f8fc;
}

body.page-detail-kos .detail-subnav {
    position: sticky !important;
    top: var(--detail-sticky-offset, 74px) !important;
    z-index: 1200 !important;
    border-top: 1px solid rgba(227, 231, 240, 0.9);
    border-bottom: 1px solid rgba(227, 231, 240, 0.94);
    background: rgba(255, 255, 255, 0.98);
}

body.page-detail-kos .detail-subnav-bar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.page-detail-kos .detail-subnav-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0;
}

body.page-detail-kos .detail-subnav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.page-detail-kos .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) 340px;
    gap: 24px;
}

body.page-detail-kos .detail-content {
    display: grid;
    gap: 18px;
}

body.page-detail-kos .detail-panel {
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(17, 26, 68, 0.06);
}

body.page-detail-kos .detail-info-head .badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

body.page-detail-kos .detail-info-head .badge-row .badge {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

body.page-detail-kos .detail-map-card iframe {
    width: 100%;
    min-height: 340px;
    border: 0;
}

body.page-detail-kos .detail-sidebar {
    position: relative;
    align-self: start;
}

body.page-detail-kos .detail-sidebar .sticky-card {
    position: sticky !important;
    top: calc(var(--detail-sticky-offset, 74px) + var(--detail-subnav-height, 58px) + 16px) !important;
    opacity: 1 !important;
    transform: none !important;
}

body.page-detail-kos .contact-card {
    border-radius: 18px;
    padding: 22px;
    border: 1px solid rgba(47, 85, 183, 0.14);
    box-shadow: 0 16px 34px rgba(17, 26, 68, 0.1);
}

body.page-detail-kos .contact-card .contact-lines {
    display: grid;
    gap: 8px;
}

body.page-detail-kos .contact-card .contact-lines > div {
    border: 1px solid rgba(17, 26, 68, 0.08);
    border-radius: 10px;
    background: #f8faff;
    padding: 10px 12px;
}

/* Admin detail page consistency */
body.admin-detail-kos-page .detail-admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

body.admin-detail-kos-page .detail-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.admin-detail-kos-page .detail-list-grid > div {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e3e7f0;
    background: #f8fbff;
}

body.admin-detail-kos-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.admin-detail-kos-page .gallery-card {
    border-radius: 12px;
    border: 1px solid #e3e7f0;
    overflow: hidden;
    background: #fff;
}

@media (max-width: 992px) {
    body.page-detail-kos .detail-layout {
        grid-template-columns: 1fr;
    }

    body.page-detail-kos .detail-subnav-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 0;
    }

    body.page-detail-kos .detail-subnav-inner,
    body.page-detail-kos .detail-subnav-actions {
        width: 100%;
    }

    body.admin-detail-kos-page .detail-admin-grid {
        grid-template-columns: 1fr;
    }
}
