/* ============ Design tokens ============ */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-accent: #f59e0b;
    --color-text: #111827;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg-alt: #f8fafc;
    --sidebar-bg: #111827;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #1f2937;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
    --shadow-md: 0 4px 14px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--color-text);
    line-height: 1.55;
    background: #fff;
}
a { color: var(--color-primary); }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ============ Public top navbar ============ */
.topbar {
    background: var(--color-text);
    color: #fff;
    font-size: 12.5px;
}
.topbar .container { display: flex; justify-content: space-between; padding: 6px 20px; }
.topbar a { color: #e5e7eb; text-decoration: none; margin-left: 14px; }

.site-header {
    border-bottom: 1px solid var(--color-border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 20px; }
.logo { font-weight: 800; font-size: 21px; color: var(--color-primary); text-decoration: none; letter-spacing: -.5px; }
.logo span { color: var(--color-text); }
.site-header nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.site-header nav a { color: var(--color-text); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.site-header nav a:hover { color: var(--color-primary); }
.header-cta { display: flex; align-items: center; gap: 12px; }
.header-cta a.btn-outline {
    border: 1px solid var(--color-border);
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 14px;
}
.mobile-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--color-text);
}

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    background: none;
    border: none;
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-dropdown-toggle:hover { color: var(--color-primary); }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 30;
}
.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}
.nav-dropdown-menu a:hover { background: var(--color-bg-alt); }
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

@media (max-width: 700px) {
    .topbar .container { justify-content: flex-end; }
    .topbar .container > span { display: none; }
}

@media (max-width: 900px) {
    .header-inner { flex-wrap: wrap; }
    .header-cta { display: none; }
    .mobile-nav-toggle { display: block; order: 2; }
    .site-header nav.main-nav {
        display: none;
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 10px 0 4px;
        border-top: 1px solid var(--color-border);
        margin-top: 10px;
    }
    .site-header nav.main-nav.mobile-open { display: flex; }
    .site-header nav.main-nav a { padding: 8px 4px; width: 100%; }
    .nav-dropdown { width: 100%; }
    .nav-dropdown-toggle { padding: 8px 4px; width: 100%; justify-content: space-between; }
    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 12px;
        min-width: 0;
        max-height: none;
    }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav-dropdown-menu a { padding: 8px 4px; }
}

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    padding: 56px 0 72px;
}
.hero h1 { font-size: 34px; margin: 0 0 10px; max-width: 640px; }
.hero p.lead { font-size: 16px; opacity: .92; max-width: 560px; margin: 0 0 26px; }
.search-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 8px;
    display: flex;
    gap: 8px;
    max-width: 720px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}
.search-box input, .search-box select {
    border: none;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    flex: 1;
    min-width: 140px;
}
.search-box select { border-left: 1px solid var(--color-border); color: var(--color-muted); }
.search-box button {
    background: var(--color-accent);
    color: #1a1a1a;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}
.hero-stats { display: flex; gap: 34px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-size: 22px; }
.hero-stats div span { font-size: 12.5px; opacity: .85; }

/* ============ Category pills ============ */
.category-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 28px 0; }
.category-pill {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13.5px;
    text-decoration: none;
    color: var(--color-text);
    background: #fff;
}
.category-pill:hover, .category-pill.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ============ Section headers ============ */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 44px 0 16px; }
.section-head h2 { font-size: 22px; margin: 0; }
.section-head a.see-all { font-size: 14px; text-decoration: none; }

/* ============ Cards ============ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 20px 0; }
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { margin: 6px 0 6px; font-size: 16.5px; }
.card h3 a { color: var(--color-text); text-decoration: none; }
.card h3 a:hover { color: var(--color-primary); }
.card .meta { color: var(--color-muted); font-size: 13px; margin-bottom: 6px; }
.badge { display: inline-block; background: var(--color-bg-alt); border-radius: 6px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; color: var(--color-primary); text-transform: uppercase; letter-spacing: .3px; }
.card-thumb { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; display: block; background: var(--color-bg-alt); }
.detail-hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin: 14px 0; display: block; }

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 11px 18px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.btn:hover { background: var(--color-primary-dark); }
.btn-block { display: block; width: 100%; text-align: center; }

/* ============ CTA banner ============ */
.cta-banner {
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    padding: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 50px 0;
    flex-wrap: wrap;
    gap: 16px;
}
.cta-banner h3 { margin: 0 0 4px; }
.cta-banner p { margin: 0; color: var(--color-muted); }

/* ============ Forms (public) ============ */
form.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
form.filters input, form.filters select {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
}
.form-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 22px;
    max-width: 480px;
}
.form-card input, .form-card select, .form-card textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}
.form-card label { font-size: 13.5px; color: var(--color-muted); display: block; margin-bottom: 4px; }

/* ============ Institution profile page ============ */
.institution-banner {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
.institution-banner-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
.institution-header {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    margin-top: -48px;
    padding: 0 4px 20px;
    flex-wrap: wrap;
}
.institution-logo {
    width: 96px;
    height: 110px;
    border-radius: 14px;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    object-fit: cover;
    flex-shrink: 0;
}
.institution-logo-placeholder {
    width: 96px;
    height: 110px;
    border-radius: 14px;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--color-primary);
    flex-shrink: 0;
}
.institution-header-info {
    background: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    min-height: 110px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.institution-header-info h1 { margin: 4px 0 4px; }
.rating-stars { color: #f59e0b; font-size: 15px; letter-spacing: 1px; }
.rating-stars .rating-num { color: var(--color-text); font-weight: 700; font-size: 14px; margin-left: 4px; }

.profile-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; margin-top: 10px; }
.profile-sidebar { position: sticky; top: 80px; }
.profile-sidebar .panel { padding: 16px; margin-bottom: 16px; }
.profile-sidebar h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); margin: 0 0 10px; }
.quick-facts { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.quick-facts li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--color-border); }
.quick-facts li:last-child { border-bottom: none; }
.quick-facts .fact-label { color: var(--color-muted); }
.profile-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.profile-sidebar nav a { padding: 7px 0; font-size: 13.5px; text-decoration: none; color: var(--color-text); border-left: 2px solid transparent; padding-left: 10px; }
.profile-sidebar nav a:hover { color: var(--color-primary); border-left-color: var(--color-primary); }
.sidebar-cta { display: flex; flex-direction: column; gap: 8px; }
.sidebar-cta .btn, .sidebar-cta .btn-outline { width: 100%; text-align: center; box-sizing: border-box; }
.sidebar-rating { text-align: center; }
.sidebar-rating .big-num { font-size: 32px; font-weight: 800; }

.profile-main .panel { margin-bottom: 20px; }
.profile-main .panel h2 { margin: 0 0 14px; font-size: 18px; }
.contact-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.contact-list li { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.contact-list li:last-child { border-bottom: none; }
.contact-list .fact-label { color: var(--color-muted); display: inline-block; min-width: 90px; }
.map-embed { width: 100%; height: 280px; border: 0; border-radius: 10px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.gallery-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; display: block; }

/* ============ Lightbox ============ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 60px 20px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-content { position: relative; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox-content img { max-width: 92vw; max-height: 80vh; display: block; border-radius: 8px; margin: 0 auto; }
.lightbox-caption { color: #e5e7eb; margin-top: 12px; font-size: 14px; }
.lightbox-close {
    position: absolute; top: -44px; right: -6px;
    background: none; border: none; color: #fff; font-size: 30px; line-height: 1;
    cursor: pointer; padding: 6px;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.12); border: none; color: #fff;
    font-size: 20px; width: 44px; height: 44px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: -8px; }
.lightbox-next { right: -8px; }
@media (max-width: 900px) {
    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }
    .lightbox-close { top: -38px; right: 0; }
}

.bullet-list { margin: 0; padding-left: 20px; }
.bullet-list li { margin-bottom: 8px; font-size: 14.5px; }

.course-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.course-pills a {
    display: inline-block;
    background: #eef4ff;
    color: var(--color-primary);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.course-pills a:hover { background: var(--color-primary); color: #fff; }

.institution-cta-buttons { display: flex; gap: 10px; align-items: center; margin-top: 8px; margin-left: auto; flex-wrap: wrap; }

@media (max-width: 800px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-sidebar { position: static; }
}
.site-footer { background: #111827; color: #cbd5e1; margin-top: 60px; padding: 40px 0 20px; font-size: 13.5px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.6fr 1fr; gap: 24px; margin-bottom: 24px; }
.footer-more-list { columns: 2; column-gap: 20px; }
.footer-more-list a { break-inside: avoid; }
.footer-grid h4 { color: #fff; font-size: 14px; margin: 0 0 10px; }
.footer-grid a { color: #9ca3af; text-decoration: none; display: block; margin-bottom: 6px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1f2937; padding-top: 16px; color: #6b7280; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.footer-credit { margin-left: auto; text-align: right; }
.footer-credit a { color: #e5e7eb; font-weight: 700; text-decoration: underline; }
.footer-credit a:hover { color: #fff; }

/* ============ Auth pages (login/register) ============ */
.auth-wrap {
    min-height: 100vh;
    display: flex;
}
.auth-side {
    flex: 1;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
}
.auth-side h2 { font-size: 28px; max-width: 380px; }
.auth-side p { opacity: .9; max-width: 380px; }
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #fff;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo { display: block; margin-bottom: 26px; }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; }
.auth-card p.sub { color: var(--color-muted); margin: 0 0 26px; font-size: 14px; }
.auth-card label { font-size: 13px; font-weight: 600; display: block; margin: 14px 0 6px; }
.auth-card input, .auth-card select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
}
.auth-card .btn { width: 100%; margin-top: 20px; padding: 13px; }
.auth-card .alt-link { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--color-muted); }
.auth-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 6px;
}
.auth-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 6px;
}
@media (max-width: 800px) { .auth-side { display: none; } }

/* ============ ADMIN: sidebar layout ============ */
.admin-wrap { display: flex; min-height: 100vh; background: var(--color-bg-alt); }
.admin-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0 0 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar .brand {
    padding: 20px;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    display: block;
    text-decoration: none;
    border-bottom: 1px solid #1f2937;
    margin-bottom: 10px;
}
.admin-sidebar .nav-section { padding: 10px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; }
.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-sidebar nav a .nav-icon { width: 18px !important; height: 18px !important; flex-shrink: 0; opacity: .85; }
.admin-sidebar nav a:hover .nav-icon,
.admin-sidebar nav a.active .nav-icon { opacity: 1; }
.admin-sidebar nav a:hover { background: var(--sidebar-active); color: #fff; }
.admin-sidebar nav a.active { background: var(--sidebar-active); color: #fff; border-left-color: var(--color-primary); font-weight: 600; }
.admin-sidebar .sidebar-foot { padding: 16px 20px; border-top: 1px solid #1f2937; margin-top: 10px; font-size: 12.5px; color: #6b7280; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 26px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-topbar h1 { font-size: 19px; margin: 0; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.admin-user .logout-link {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 7px;
}
.admin-user .logout-link:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.admin-user .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--color-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.admin-content { padding: 26px; }

.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 28px; }
.admin-stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; }
.admin-stat-card .num { font-size: 26px; font-weight: 800; }
.admin-stat-card .label { color: var(--color-muted); font-size: 13px; }

.panel { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 17px; }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td {
    border-bottom: 1px solid var(--color-border);
    padding: 11px 10px;
    text-align: left;
    font-size: 13.5px;
}
table.admin-table th { color: var(--color-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
table.admin-table tr:hover td { background: var(--color-bg-alt); }
.row-actions a { margin-right: 10px; font-size: 13px; text-decoration: none; }

.status-pill { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.status-pill.published { background: #dcfce7; color: #15803d; }
.status-pill.draft { background: #fef3c7; color: #92400e; }
.status-pill.archived { background: #f3f4f6; color: #6b7280; }
.status-pill.new { background: #dbeafe; color: #1d4ed8; }
.status-pill.contacted { background: #fef3c7; color: #92400e; }
.status-pill.converted { background: #dcfce7; color: #15803d; }
.status-pill.closed { background: #f3f4f6; color: #6b7280; }

.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 14px;
}
.admin-form label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 5px; }
.admin-form .checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.admin-form .checkbox-row input { width: auto; margin: 0; }

@media (max-width: 900px) {
    .admin-sidebar { width: 72px; }
    .admin-sidebar .brand, .admin-sidebar nav a span.label, .admin-sidebar .nav-section, .admin-sidebar .sidebar-foot { display: none; }
    .admin-sidebar nav a { justify-content: center; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}


/* ---------- Delete buttons, flash messages, scrollable tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.row-actions { white-space: nowrap; }
.delete-form { display: inline; margin: 0; }
.btn-delete {
    background: none; border: none; padding: 0; margin: 0;
    color: #c0392b; font-size: 13px; font-family: inherit; cursor: pointer;
}
.btn-delete:hover { text-decoration: underline; }
.btn.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.btn-danger:hover { background: #991b1b; }
.danger-zone { margin-top: 20px; border-color: #fecaca; max-width: 720px; }
.danger-zone h2 { margin: 0 0 6px; font-size: 16px; color: #b91c1c; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---------- Single/detail pages: 70% content / 30% sidebar ---------- */
.detail-wrap { padding-top: 24px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 28px; align-items: start; }
.detail-main { min-width: 0; line-height: 1.7; }
.detail-main h1 { margin: 8px 0 6px; line-height: 1.3; }
.detail-sidebar { position: sticky; top: 80px; }
.detail-sidebar .panel { padding: 16px; margin-bottom: 16px; }
.detail-sidebar h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); margin: 0 0 12px; }
.sidebar-form input, .sidebar-form textarea {
    width: 100%; margin-bottom: 10px; padding: 10px 12px; font-family: inherit; font-size: 14px;
    border: 1px solid var(--color-border); border-radius: 8px; box-sizing: border-box;
}
.sidebar-form .btn { width: 100%; }
.enquiry-success { background: #dcfce7; color: #166534; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 12px; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { border-bottom: 1px solid var(--color-border); }
.related-list li:last-child { border-bottom: none; }
.related-list a { display: flex; gap: 10px; align-items: center; padding: 10px 0; text-decoration: none; color: var(--color-text); }
.related-list a:hover .related-title { color: var(--color-primary); }
.related-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.related-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.related-meta { display: block; font-size: 12px; color: var(--color-muted); margin-top: 2px; }
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
}


/* ---------- SEO fields on admin forms ---------- */
.seo-fields { border: 1px solid var(--color-border); border-radius: 10px; padding: 14px 16px 4px; margin: 6px 0 18px; background: #f9fafb; }
.seo-fields legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.seo-fields legend .meta { font-weight: 400; font-size: 12px; }
.seo-hint { font-size: 12px; color: var(--color-muted); margin: -10px 0 14px; }
.seo-hint.seo-over { color: #b91c1c; }
.seo-page-card { border-top: 1px solid var(--color-border); padding-top: 16px; margin-top: 16px; }
.seo-page-card:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.seo-page-card h3 { margin: 0 0 10px; font-size: 15px; }
.seo-page-card .seo-url { font-weight: 400; font-size: 12px; color: var(--color-muted); margin-left: 6px; }


/* ---------- Logo height setting ---------- */
.logo-height-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.logo-height-row input[type="range"] { flex: 1; margin: 0; padding: 0; border: none; }
.admin-form .logo-height-row input[type="number"] { width: 90px; margin: 0; }
.logo-preview-box { background: #fff; border: 1px dashed var(--color-border); border-radius: 8px; padding: 14px; margin-bottom: 14px; overflow-x: auto; }
.logo-preview-box img { display: block; width: auto; max-width: none; }
.admin-sidebar .brand img { max-width: 100%; }
@media (max-width: 700px) {
    .logo .site-logo-img { max-height: 56px; }
}


/* ---------- Social links ---------- */
.social-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.footer-grid .social-links a.social-icon { display: inline-flex; margin: 0; }
.social-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: #1f2937; color: #cbd5e1; text-decoration: none; transition: background .15s, color .15s;
}
a.social-icon:hover { color: #fff; }
a.social-facebook:hover  { background: #1877f2; }
a.social-instagram:hover { background: #d6249f; }
a.social-youtube:hover   { background: #ff0000; }
a.social-tiktok:hover    { background: #000; }
a.social-x:hover         { background: #000; }
a.social-linkedin:hover  { background: #0a66c2; }
a.social-whatsapp:hover  { background: #25d366; }
.social-label { display: flex !important; align-items: center; gap: 8px; }
.social-label .social-icon { width: 26px; height: 26px; }

/* ---------- Rich text (content written with the WYSIWYG editor) ---------- */
.rich-text { line-height: 1.75; font-size: 15.5px; color: var(--color-text); overflow-wrap: break-word; }
.rich-text > :first-child { margin-top: 0; }
.rich-text p { margin: 0 0 14px; }
.rich-text h2 { font-size: 22px; margin: 26px 0 10px; line-height: 1.3; }
.rich-text h3 { font-size: 18.5px; margin: 22px 0 8px; line-height: 1.35; }
.rich-text h4 { font-size: 16px; margin: 18px 0 6px; }
.rich-text ul, .rich-text ol { margin: 0 0 14px; padding-left: 24px; }
.rich-text li { margin-bottom: 6px; }
.rich-text a { color: var(--color-primary); text-decoration: underline; }
.rich-text img { max-width: 100%; height: auto; border-radius: 8px; }
.rich-text figure { margin: 16px 0; }
.rich-text figcaption { font-size: 13px; color: var(--color-muted); text-align: center; margin-top: 6px; }
.rich-text blockquote { border-left: 4px solid var(--color-primary); margin: 16px 0; padding: 10px 16px; background: #f9fafb; color: #374151; border-radius: 0 8px 8px 0; }
.rich-text hr { border: none; border-top: 1px solid var(--color-border); margin: 22px 0; }
.rich-text .table-scroll { width: 100%; overflow-x: auto; margin: 0 0 16px; }
.rich-text table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 14.5px; }
.rich-text th, .rich-text td { border: 1px solid var(--color-border); padding: 8px 12px; text-align: left; vertical-align: top; }
.rich-text th, .rich-text thead td { background: #f3f4f6; font-weight: 600; }
.rich-text tr:nth-child(even) td { background: #fafafa; }
.rich-text .embed-wrap { position: relative; padding-top: 56.25%; margin: 16px 0; border-radius: 10px; overflow: hidden; background: #000; }
.rich-text .embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rich-text pre { background: #111827; color: #e5e7eb; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }

/* Editor box in admin forms */
.admin-form .tox-tinymce { border-radius: 8px; border-color: var(--color-border); margin-bottom: 14px; }


/* ---------- Homepage hero banner image ---------- */
.hero.hero-image { background-color: #1e3a8a; background-size: cover; background-position: center; }
.hero.hero-image h1, .hero.hero-image p.lead, .hero.hero-image .hero-stats { text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.hero-preview {
    border-radius: 10px; padding: 26px 22px; margin-bottom: 16px; color: #fff;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    background-size: cover; background-position: center;
}
.hero-preview strong { display: block; font-size: 17px; margin-bottom: 6px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.hero-preview span { font-size: 13px; opacity: .9; }

/* ---------- "Also offered by" picker (admin program form) ---------- */
.also-offered { border: 1px solid var(--color-border); border-radius: 10px; padding: 14px 16px; margin: 4px 0 18px; }
.also-offered legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.also-offered legend .meta { font-weight: 400; font-size: 12px; }
.admin-form .also-search { margin-bottom: 6px; }
.also-tools { font-size: 12.5px; margin-bottom: 8px; }
.also-tools a { color: var(--color-primary); }
.also-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 8px; }
.admin-form .also-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0; font-weight: 400; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.also-row:last-child { border-bottom: none; }
.also-row.checked { background: #eff6ff; }
.admin-form .also-row input[type="checkbox"] { width: auto; margin: 0; flex-shrink: 0; }
.also-name { flex: 1; font-size: 14px; }
.also-name small { display: block; color: var(--color-muted); font-size: 12px; }
.admin-form .also-row .also-fee { width: 150px; margin: 0; padding: 6px 8px; font-size: 13px; display: none; }
.also-row.checked .also-fee { display: block; }

/* ---------- "Also offered at" on course pages ---------- */
.offered-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0 24px; }
.offered-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--color-border); border-radius: 10px; padding: 12px; text-decoration: none; color: var(--color-text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.offered-item:hover { border-color: var(--color-primary); box-shadow: 0 2px 10px rgba(37,99,235,.08); }
.offered-item img, .offered-item .offered-initial { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; flex-shrink: 0; background: #f3f4f6; }
.offered-item .offered-initial { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--color-primary); }
.offered-item strong { display: block; font-size: 14.5px; line-height: 1.3; }
.offered-item small { display: block; color: var(--color-muted); font-size: 12.5px; margin-top: 2px; }
.offered-item .primary-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #166534; background: #dcfce7; border-radius: 4px; padding: 1px 6px; margin-top: 4px; }
.more-colleges { color: var(--color-primary); font-size: 12.5px; font-weight: 600; }

/* ---------- Course page (Edusanjal-style) ---------- */
.course-head { margin-bottom: 18px; }
.course-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-soft { color: var(--color-muted); }
.course-head h1 { font-size: 28px; margin: 10px 0 6px; line-height: 1.3; }
.course-sub { color: var(--color-muted); font-size: 14.5px; margin: 0 0 16px; }
.course-sub a { font-weight: 600; }
.course-facts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px;
    background: var(--color-border); border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden;
}
.course-fact { background: #fff; padding: 12px 14px; }
.course-fact span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); margin-bottom: 4px; }
.course-fact strong { font-size: 14.5px; line-height: 1.35; display: block; }
.course-fact strong a { color: var(--color-primary); text-decoration: none; }

.course-tabs {
    position: sticky; top: 64px; z-index: 10; background: #fff;
    display: flex; gap: 4px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid var(--color-border); margin: 6px 0 8px; scrollbar-width: none;
}
.course-tabs::-webkit-scrollbar { display: none; }
.course-tabs a {
    padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--color-muted); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.course-tabs a:hover { color: var(--color-text); }
.course-tabs a.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.course-section { padding: 18px 0 8px; border-bottom: 1px solid var(--color-border); scroll-margin-top: 140px; }
.course-section:last-of-type { border-bottom: none; }
.course-section > h2 { font-size: 21px; margin: 0 0 12px; }

.college-rows { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 767px) {
    .college-row {
        display: block;
    }
}
@media (min-width: 768px) {
    .college-row {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    border: 1px solid var(--color-border); border-radius: 10px; background: #fff;
 } 
}


.college-row:hover { border-color: #bfdbfe; }
.college-row-logo { width: 54px; height: 54px; flex-shrink: 0; border-radius: 8px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; }
.college-row-logo img { width: 100%; height: 100%; object-fit: contain; }
.college-row-logo span { font-weight: 800; font-size: 20px; color: var(--color-primary); }
.college-row-info { flex: 1; min-width: 0; }
.college-row-name { font-weight: 700; font-size: 15px; color: var(--color-text); text-decoration: none; line-height: 1.3; }
.college-row-name:hover { color: var(--color-primary); }
.college-row .meta { font-size: 13px; margin-top: 3px; }
.college-row .primary-tag { margin: 0 0 0 6px; vertical-align: middle; }
.college-row-fee { text-align: right; min-width: 120px; }
.college-row-fee span { display: block; font-size: 11px; text-transform: uppercase; color: var(--color-muted); letter-spacing: .4px; }
.college-row-fee strong { font-size: 14px; }
.btn.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn.btn-outline { background: #fff; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn.btn-outline:hover { background: var(--color-primary); color: #fff; }
@media (max-width: 640px) {
    .course-head h1 { font-size: 23px; }
    .college-row { flex-wrap: wrap; }
    .college-row-fee { text-align: left; min-width: 0; order: 3; flex: 1; }
    .college-row .btn { order: 4; }
}

/* "Published on : 27 Sep 2026" on news, blog and post pages */
.published-on { text-align: right; font-weight: 700; margin: 8px 0 16px; }


/* "Main college" tag anywhere + program rows on institution pages */
.primary-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #166534; background: #dcfce7; border-radius: 4px; padding: 1px 6px; }
.program-row-thumb { width: 88px; height: 60px; }
.program-row-thumb img { object-fit: cover; }

/* ---------- Email verification (OTP) ---------- */
.otp-input { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-weight: 700; }
.link-button { background: none; border: none; padding: 0; color: var(--color-primary); font-size: 13.5px; cursor: pointer; font-family: inherit; text-decoration: underline; }
.status-pill.pending { background: #fef3c7; color: #92400e; }
.status-pill.rejected { background: #fee2e2; color: #b91c1c; }
.status-pill.disabled { background: #f3f4f6; color: #6b7280; }
.status-pill.active { background: #dcfce7; color: #166534; }
.pending-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.pending-alert a { font-weight: 700; color: #92400e; }
.link-action { background: none; border: none; padding: 0; margin-right: 10px; color: var(--color-primary); cursor: pointer; font-size: 13px; font-family: inherit; }
.link-action.approve { color: #15803d; font-weight: 700; }
.link-action.reject { color: #b91c1c; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tabs a { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--color-border); background: #fff; color: var(--color-text); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.filter-tabs a.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------- Partner sign-up steps ---------- */
.reg-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 18px; counter-reset: step; }
.reg-steps li { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--color-muted); padding-top: 30px; position: relative; counter-increment: step; }
.reg-steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; line-height: 24px; border-radius: 50%; background: #e5e7eb; color: #6b7280; font-size: 12px; }
.reg-steps li.current { color: var(--color-primary); }
.reg-steps li.current::before { background: var(--color-primary); color: #fff; }
.reg-steps li.done::before { content: '✓'; background: #16a34a; color: #fff; }
.verified-email { color: #166534; background: #dcfce7; border-radius: 8px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; margin: 0 0 6px; }
.publish-panel { border: 1px solid #bfdbfe; background: #f8fbff; margin-bottom: 20px; }
.publish-checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 14px 0 18px; }
.publish-checklist h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); }
.check-item { font-size: 14px; padding: 4px 0; color: #6b7280; }
.check-item.done { color: #166534; font-weight: 600; }

/* ---------- Partner: find & join existing courses ---------- */
.find-course-form { display: flex; gap: 8px; flex-wrap: wrap; }
.find-course-form input[type="text"] { flex: 1; min-width: 220px; }
.find-course-form input, .find-course-form select { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.join-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.join-form input { width: 150px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 13px; }
.create-new-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding: 14px 16px; background: #f9fafb; border: 1px dashed var(--color-border); border-radius: 10px; }
.linked-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: #1d4ed8; background: #dbeafe; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.fee-inline { display: inline-flex; gap: 6px; align-items: center; }
.fee-inline input { width: 110px; padding: 5px 8px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 13px; }
.duplicate-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.duplicate-hint { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: -8px 0 14px; }
.duplicate-hint a { font-weight: 700; color: #92400e; }

/* ---------- Approvals ---------- */
.nav-badge { margin-left: auto; background: #f59e0b; color: #111827; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; line-height: 1.5; }
.review-note { background: #fef2f2; border-left: 4px solid #b91c1c; color: #7f1d1d; padding: 10px 14px; border-radius: 0 8px 8px 0; margin-bottom: 16px; font-size: 14px; }
.preview-banner { background: #fef3c7; color: #92400e; text-align: center; padding: 10px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid #fde68a; }

/* ---------- Enquiry popup (includes/popup.php, assets/js/popup.js) ---------- */
body.hp-popup-open { overflow: hidden; }
.hp-popup { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.hp-popup[hidden] { display: none; }
.hp-popup-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .6); }
.hp-popup-card { position: relative; display: flex; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); animation: hp-pop .25s ease-out; }
.hp-popup-card.has-image { max-width: 860px; }
@keyframes hp-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.hp-popup-img { flex: 0 0 42%; background-size: cover; background-position: center; background-color: #e5e7eb; }
.hp-popup-body { flex: 1; min-width: 0; padding: 28px 28px 24px; overflow-y: auto; }
.hp-popup-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border: none; border-radius: 50%; background: #fff; color: #374151; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.hp-popup-x:hover { background: #f3f4f6; }
.hp-popup-body h3 { margin: 0 34px 6px 0; font-size: 21px; line-height: 1.25; color: var(--color-primary-dark); }
.hp-popup-intro { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--color-muted); }
.hp-popup-body label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--color-text); }
.hp-opt { font-weight: 400; color: var(--color-muted); }
.hp-popup-body input[type=text], .hp-popup-body input[type=tel], .hp-popup-body input[type=email], .hp-popup-body select {
    width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 11px 12px; font: inherit; font-size: 14px; color: var(--color-text);
    background: #fff; border: 1px solid var(--color-border); border-radius: 10px;
}
.hp-popup-body input:focus, .hp-popup-body select:focus { outline: 2px solid var(--color-primary); outline-offset: 0; border-color: var(--color-primary); }
.hp-popup-body select:disabled { background: #f3f4f6; color: #9ca3af; }
.hp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.hp-locked { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--color-primary-dark); }
.hp-locked img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; background: #fff; flex-shrink: 0; }
.hp-submit { display: block; width: 100%; padding: 13px 16px; border: none; border-radius: 999px; background: var(--color-accent); color: #111827; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.hp-submit:hover { filter: brightness(.96); }
.hp-submit:disabled { opacity: .7; cursor: wait; }
.hp-note { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--color-muted); }
.hp-error { margin: 0 0 12px; padding: 9px 12px; background: #fef2f2; color: #991b1b; border-radius: 8px; font-size: 13px; }
.hp-popup-done { text-align: center; padding: 30px 6px 10px; }
.hp-popup-done[hidden], .hp-popup-form-wrap[hidden], .hp-error[hidden] { display: none; }
.hp-popup-done h3 { margin: 12px 0 6px; }
.hp-popup-done p { color: var(--color-muted); margin: 0 0 20px; }
.hp-tick { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: #dcfce7; color: #166534; font-size: 28px; line-height: 56px; font-weight: 700; }
@media (max-width: 720px) {
    .hp-popup-img { display: none; }            /* photo is hidden on phones */
    .hp-popup-card, .hp-popup-card.has-image { max-width: 440px; }
    .hp-popup-body { padding: 24px 20px 20px; }
}
/* Admin → Popup */
.popup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.popup-fields { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.popup-fields label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
.popup-fields input { width: auto; margin: 0; }
.popup-image-preview { width: 150px; height: 200px; object-fit: cover; border-radius: 10px; display: block; margin: 0 0 10px; border: 1px solid var(--color-border); }
@media (max-width: 720px) { .popup-grid { grid-template-columns: 1fr; } }

/* ============ Team (/team/ and /team/{slug}/) ============ */
.team-hero { background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 100%); border-bottom: 1px solid var(--color-border); padding: 38px 0 26px; }
.team-hero h1 { margin: 10px 0 6px; font-size: 30px; }
.team-hero p { color: var(--color-muted); margin: 0 0 18px; max-width: 640px; }
.team-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.team-filter a { border: 1px solid var(--color-border); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: var(--color-text); text-decoration: none; }
.team-filter a span { color: var(--color-muted); font-weight: 500; margin-left: 2px; }
.team-filter a.active, .team-filter a:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.team-filter a.active span, .team-filter a:hover span { color: #dbeafe; }

.team-group-title { font-size: 21px; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--color-border); }
.team-group:first-child .team-group-title { margin-top: 26px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin: 20px 0; }
.team-card { background: #fff; border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.team-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.team-card.is-featured { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent), var(--shadow-sm); }
.team-card-photo { display: block; text-decoration: none; aspect-ratio: 1 / 1; background: var(--color-bg-alt); overflow: hidden; }
.team-card-photo .team-photo { width: 100%; height: 100%; object-fit: cover; display: flex; transition: transform .3s; }
.team-card:hover .team-card-photo img { transform: scale(1.04); }
.team-card-photo .team-initials { font-size: 56px; }
.team-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.team-card-body h3 { margin: 0 0 3px; font-size: 17px; }
.team-card-body h3 a { color: var(--color-text); text-decoration: none; }
.team-card-body h3 a:hover { color: var(--color-primary); }
.team-role { color: var(--color-primary); font-weight: 600; font-size: 14px; }
.team-card-body .meta { color: var(--color-muted); font-size: 13px; }
.team-card-bio { color: #374151; font-size: 13.5px; margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.team-card-link { display: inline-block; margin-top: auto; padding-top: 12px; font-size: 13.5px; font-weight: 600; text-decoration: none; }

.team-initials { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; letter-spacing: 1px; }

.team-social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.team-social a { text-decoration: none; }
.team-social .social-icon, .team-connect .social-icon { width: 30px; height: 30px; background: var(--color-bg-alt); color: #475569; border: 1px solid var(--color-border); }
.team-social a:hover .social-icon, .team-connect a:hover .social-icon { color: #fff; border-color: transparent; }
.team-social a:hover .social-facebook,  .team-connect a:hover .social-facebook  { background: #1877f2; }
.team-social a:hover .social-instagram, .team-connect a:hover .social-instagram { background: #d6249f; }
.team-social a:hover .social-linkedin,  .team-connect a:hover .social-linkedin  { background: #0a66c2; }
.team-social a:hover .social-x,         .team-connect a:hover .social-x,
.team-social a:hover .social-tiktok,    .team-connect a:hover .social-tiktok,
.team-social a:hover .social-github,    .team-connect a:hover .social-github    { background: #111; }
.team-social a:hover .social-youtube,   .team-connect a:hover .social-youtube   { background: #ff0000; }
.team-social a:hover .social-website,   .team-connect a:hover .social-website   { background: var(--color-primary); }
.team-social .social-youtube svg path, .team-connect .social-youtube svg path { fill: #fff; }

/* Profile page */
.team-cover { height: 230px; background: linear-gradient(120deg, var(--color-primary-dark) 0%, #3b82f6 55%, #60a5fa 100%) center / cover no-repeat; }
.team-profile-head { display: flex; align-items: flex-end; gap: 22px; margin-top: -70px; padding-bottom: 20px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.team-profile-photo .team-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 5px solid #fff; box-shadow: var(--shadow-md); background: #fff; display: flex; font-size: 48px; }
.team-profile-info { flex: 1; min-width: 240px; padding-top: 76px; }
.team-profile-info h1 { margin: 2px 0 2px; font-size: 28px; }
.team-crumbs a { color: var(--color-muted); text-decoration: none; }
.team-crumbs a:hover { color: var(--color-primary); }
.team-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }
.team-btn-wa { background: #25d366; }
.team-btn-wa:hover { background: #1ebe5b; }
.team-profile-grid { margin-top: 24px; margin-bottom: 40px; }
.team-quote { margin: 0 0 20px; padding: 16px 20px; border-left: 4px solid var(--color-accent); background: #fffbeb; border-radius: 0 var(--radius) var(--radius) 0; font-size: 17px; font-style: italic; color: #374151; }
.team-tags span { display: inline-block; background: #eef4ff; color: var(--color-primary); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; }

.team-feed-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.team-feed-tabs button { border: 1px solid var(--color-border); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--color-text); }
.team-feed-tabs button.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.team-feed .feed-frame { border: 0; width: 100%; display: block; }
.team-feed .feed-facebook { max-width: 500px; height: 600px; margin: 0 auto; }
.team-feed .embed-wrap { position: relative; padding-top: 56.25%; }
.team-feed .embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.feed-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.feed-posts .feed-instagram { height: 560px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
.feed-posts .feed-tiktok { height: 740px; border-radius: 10px; }
.feed-posts .feed-linkedin { height: 560px; border: 1px solid var(--color-border); border-radius: 10px; }

.team-connect { display: flex; flex-direction: column; gap: 4px; }
.team-connect-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; color: var(--color-text); text-decoration: none; }
.team-connect-row:hover { color: var(--color-primary); }
.team-mini-list { list-style: none; margin: 0; padding: 0; }
.team-mini-list li a { display: flex; gap: 10px; align-items: center; padding: 7px 0; text-decoration: none; color: var(--color-text); font-size: 13.5px; }
.team-mini-list li a > span { display: flex; flex-direction: column; }
.team-mini-list .meta { font-size: 12.5px; color: var(--color-muted); }
.team-mini-photo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 15px; }

@media (max-width: 900px) {
    .team-profile-grid { grid-template-columns: 1fr; }
    .team-profile-grid .profile-sidebar { position: static; }
}
@media (max-width: 640px) {
    .team-hero h1 { font-size: 24px; }
    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .team-card-body { padding: 12px; }
    .team-card-body h3 { font-size: 15px; }
    .team-card-bio { display: none; }
    .team-cover { height: 150px; }
    .team-profile-head { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; }
    .team-profile-photo .team-photo { width: 120px; height: 120px; }
    .team-profile-info { padding-top: 0; }
    .team-profile-info .team-social, .team-profile-actions { justify-content: center; }
}

/* Admin → Team */
.team-admin-member { display: flex; align-items: center; gap: 10px; }
.team-admin-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 14px; }
#team-table .drag-handle { cursor: grab; color: var(--color-muted); font-size: 18px; text-align: center; user-select: none; }
#team-table tr.dragging { opacity: .45; background: #eef4ff; }
.team-form-tabs { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; background: #fff; padding: 8px 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--color-border); }
.team-form-tabs a { font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--color-bg-alt); color: var(--color-text); }
.team-form-tabs a:hover { background: var(--color-primary); color: #fff; }
.admin-form .form-section { padding: 18px 0 6px; border-bottom: 1px dashed var(--color-border); scroll-margin-top: 60px; }
.admin-form .form-section h3 { margin: 0 0 14px; font-size: 16px; }
.admin-form .form-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; }
.admin-form .form-cols .checkbox-row { margin-top: -6px; }
.team-form > .btn { margin-top: 18px; }

/* ============ Admin → Settings → Tracking & Custom Code ============ */
.admin-form .code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; background: #0f172a; color: #e2e8f0; border-color: #1e293b; tab-size: 4; white-space: pre; overflow-x: auto; }
.admin-form .code-box::placeholder { color: #64748b; }
.admin-form .code-section-title { font-size: 15px; margin: 20px 0 12px; padding-top: 14px; border-top: 1px dashed var(--color-border); }
