/* ==========================================================================
   Royal College Schools — administration panel
   ========================================================================== */

:root {
    --rc-sidebar-w: 272px;
    --rc-admin-bg: #f3f5f9;
}

body.rc-admin { background: var(--rc-admin-bg); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.rc-sidebar {
    --bs-offcanvas-width: var(--rc-sidebar-w);
    --bs-offcanvas-bg: var(--rc-navy-950);
    background:
        radial-gradient(400px 260px at 0% 0%, rgba(43, 134, 209, .22), transparent 70%),
        radial-gradient(300px 240px at 100% 100%, rgba(243, 154, 31, .12), transparent 70%),
        linear-gradient(180deg, var(--rc-navy-900), var(--rc-navy-950));
    color: rgba(255, 255, 255, .72);
}
@media (min-width: 992px) {
    .rc-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--rc-sidebar-w);
        z-index: 1035;
        display: flex;
        flex-direction: column;
    }
    .rc-main { margin-left: var(--rc-sidebar-w); }
}
.rc-sidebar .offcanvas-header { display: flex !important; padding: 1.4rem 1.25rem 1rem; }
.rc-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0 .85rem 1rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.rc-side-brand { display: flex; align-items: center; gap: .75rem; color: #fff; }
.rc-side-brand img { width: 44px; height: 49px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.rc-side-brand strong { display: block; font-family: var(--rc-font-display); font-size: 1.1rem; font-weight: 600; line-height: 1.1; }
.rc-side-brand > span > span { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rc-orange-500); font-weight: 700; }
.rc-side-label { margin: 1.4rem .75rem .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.rc-side-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rc-side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, .74);
    font-weight: 500;
    font-size: .9rem;
    transition: background .2s, color .2s;
}
.rc-side-link .bi { font-size: 1.05rem; width: 1.25rem; text-align: center; color: rgba(255, 255, 255, .55); transition: color .2s; }
.rc-side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.rc-side-link:hover .bi { color: #fff; }
.rc-side-link.active { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 600; }
.rc-side-link.active .bi { color: var(--rc-orange-500); }
.rc-side-link.active::before { content: ""; position: absolute; left: -.85rem; top: .5rem; bottom: .5rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--rc-orange-500); }
.rc-side-footer { margin-top: auto; padding: 1rem .75rem 0; }
.rc-side-card { padding: 1rem; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: .825rem; }
.rc-side-card a { color: var(--rc-orange-500); font-weight: 600; }

/* ---------- Top bar ---------- */
.rc-topnav {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem clamp(1rem, 3vw, 2rem);
    background: rgba(243, 245, 249, .85);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, background .2s;
}
.rc-topnav.is-scrolled { border-bottom-color: var(--rc-line); background: rgba(255, 255, 255, .9); }
.rc-topnav-title { font-weight: 700; color: var(--rc-navy-900); margin: 0; font-size: 1rem; }
.rc-topnav-crumb { font-size: .8rem; color: var(--rc-muted); }
.rc-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--rc-line);
    background: #fff;
    color: var(--rc-navy-800);
    font-size: 1.15rem;
    transition: background .2s, border-color .2s, transform .2s var(--rc-ease);
}
.rc-icon-btn:hover { background: var(--rc-blue-50); border-color: var(--rc-blue-100); }
.rc-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .75rem .3rem .3rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--rc-line);
    color: var(--rc-ink);
    font-weight: 600;
    font-size: .875rem;
}
.rc-user:hover { border-color: var(--rc-blue-100); color: var(--rc-ink); }
.rc-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rc-blue-500), var(--rc-navy-800));
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .02em;
}

/* ---------- Content ---------- */
.rc-content { padding: clamp(1rem, 3vw, 2rem); padding-top: 1rem; }
.rc-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.rc-page-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.rc-page-head p { color: var(--rc-ink-soft); margin: .35rem 0 0; }
.rc-page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.rc-back { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--rc-ink-soft); margin-bottom: .6rem; }
.rc-back:hover { color: var(--rc-navy-800); }

.rc-panel {
    background: #fff;
    border: 1px solid rgba(228, 232, 239, .9);
    border-radius: 18px;
    box-shadow: var(--rc-shadow-sm);
}
.rc-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--rc-line); }
.rc-panel-head h2 { font-family: var(--rc-font-body); font-size: 1rem; font-weight: 700; margin: 0; color: var(--rc-navy-900); }
.rc-panel-body { padding: 1.4rem; }
.rc-panel-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--rc-line); display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; background: #fafbfd; border-radius: 0 0 18px 18px; }

.rc-search { position: relative; min-width: min(280px, 100%); }
.rc-search .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--rc-muted); pointer-events: none; }
.rc-search .form-control { padding-left: 2.4rem; border-radius: 999px; background: var(--rc-admin-bg); border-color: transparent; }
.rc-search .form-control:focus { background: #fff; }

/* ---------- Tables ---------- */
.rc-table { margin: 0; --bs-table-hover-bg: #f7f9fc; }
.rc-table > :not(caption) > * > * { padding: .95rem 1.4rem; border-bottom-color: var(--rc-line); vertical-align: middle; }
.rc-table thead th {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rc-muted);
    background: #fafbfd;
    white-space: nowrap;
}
.rc-table tbody tr:last-child > * { border-bottom: 0; }
.rc-table .rc-cell-title { font-weight: 600; color: var(--rc-navy-900); }
.rc-table .rc-cell-sub { font-size: .8rem; color: var(--rc-muted); }
.rc-table a.rc-cell-title:hover { color: var(--rc-blue-600); }
.rc-table .rc-rich { max-width: 460px; color: var(--rc-ink-soft); font-size: .875rem; }
.rc-table .rc-rich p:last-child { margin-bottom: 0; }
.rc-no-results td { text-align: center; color: var(--rc-muted); padding: 2rem !important; }

.rc-actions { display: inline-flex; gap: .35rem; justify-content: flex-end; align-items: center; }
.rc-actions form { display: inline; margin: 0; }
.btn-icon { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; }

.rc-thumb { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; background: var(--rc-sand); flex: none; }
.rc-file-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #fdecec; color: var(--rc-danger); font-size: 1.15rem; }

.rc-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.rc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rc-badge-success { background: #e6f6ef; color: #17845a; }
.rc-badge-muted { background: #eef0f4; color: var(--rc-muted); }
.rc-badge-info { background: var(--rc-blue-50); color: var(--rc-navy-800); }
.rc-badge-info::before, .rc-badge-plain::before { display: none; }

/* ---------- Media grid (gallery, facilities, results) ---------- */
.rc-media-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.rc-media-tile { position: relative; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--rc-line); box-shadow: var(--rc-shadow-sm); transition: box-shadow .25s var(--rc-ease), transform .25s var(--rc-ease); }
.rc-media-tile:hover { box-shadow: var(--rc-shadow); transform: translateY(-2px); }
.rc-media-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--rc-sand); }
.rc-media-tile .ratio { background: var(--rc-navy-950); }
.rc-media-tile-body { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem .9rem; }
.rc-media-tile-title { font-weight: 600; font-size: .9rem; color: var(--rc-navy-900); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-media-tile-float { position: absolute; top: .6rem; right: .6rem; opacity: 0; transition: opacity .2s; }
.rc-media-tile:hover .rc-media-tile-float, .rc-media-tile:focus-within .rc-media-tile-float { opacity: 1; }
@media (hover: none) { .rc-media-tile-float { opacity: 1; } }

/* ---------- Dashboard ---------- */
.rc-welcome {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 22px;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    color: #fff;
    background: linear-gradient(120deg, var(--rc-navy-900), var(--rc-navy-700) 60%, var(--rc-blue-600));
    box-shadow: var(--rc-shadow);
}
.rc-welcome::before { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(243, 154, 31, .2); z-index: -1; }
.rc-welcome::after { content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .06); z-index: -1; }
.rc-welcome h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .35rem; }
.rc-welcome p { color: rgba(255, 255, 255, .8); margin: 0; }
.rc-welcome-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.5rem; }
.rc-welcome-meta div { font-size: .8rem; color: rgba(255, 255, 255, .7); }
.rc-welcome-meta strong { display: block; font-family: var(--rc-font-display); font-size: 1.6rem; color: #fff; font-weight: 600; line-height: 1.1; }

.rc-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.1rem 1.2rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(228, 232, 239, .9);
    box-shadow: var(--rc-shadow-sm);
    color: var(--rc-ink);
    transition: transform .25s var(--rc-ease), box-shadow .25s var(--rc-ease), border-color .25s;
}
.rc-stat-card:hover { transform: translateY(-3px); box-shadow: var(--rc-shadow); border-color: var(--rc-blue-100); color: var(--rc-ink); }
.rc-stat-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--rc-blue-50); color: var(--rc-blue-600); font-size: 1.25rem; }
.rc-stat-card.is-empty .rc-stat-icon { background: var(--rc-orange-100); color: var(--rc-orange-600); }
.rc-stat-value { font-family: var(--rc-font-display); font-size: 1.6rem; font-weight: 600; line-height: 1; color: var(--rc-navy-900); }
.rc-stat-name { font-size: .825rem; color: var(--rc-ink-soft); margin-top: .25rem; }
.rc-stat-flag { font-size: .7rem; font-weight: 700; color: var(--rc-orange-600); }

.rc-feed { list-style: none; margin: 0; padding: 0; }
.rc-feed li { display: flex; gap: .9rem; padding: .9rem 1.4rem; border-bottom: 1px solid var(--rc-line); }
.rc-feed li:last-child { border-bottom: 0; }
.rc-feed-dot { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--rc-blue-50); color: var(--rc-blue-600); }
.rc-feed-title { font-weight: 600; color: var(--rc-navy-900); }
.rc-feed-meta { font-size: .8rem; color: var(--rc-muted); }

.rc-shortcut { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 12px; background: var(--rc-admin-bg); color: var(--rc-navy-900); font-weight: 600; font-size: .9rem; transition: background .2s, color .2s; }
.rc-shortcut:hover { background: var(--rc-navy-800); color: #fff; }
.rc-shortcut .bi { font-size: 1.1rem; }

/* ---------- Empty state ---------- */
.rc-empty-admin { text-align: center; padding: 3rem 1.5rem; }
.rc-empty-admin .rc-empty-icon { width: 64px; height: 64px; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 20px; background: var(--rc-blue-50); color: var(--rc-blue-600); font-size: 1.6rem; }
.rc-empty-admin h3 { font-family: var(--rc-font-body); font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.rc-empty-admin p { color: var(--rc-muted); max-width: 380px; margin: 0 auto 1.25rem; font-size: .9rem; }

/* ---------- Forms ---------- */
.rc-form-narrow { max-width: 720px; }
.rc-current-file { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 12px; background: var(--rc-admin-bg); margin-bottom: .6rem; font-size: .85rem; }
.rc-current-file img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.rc-preview { display: none; margin-top: .6rem; }
.rc-preview.is-visible { display: flex; gap: .5rem; flex-wrap: wrap; }
.rc-preview img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 1px solid var(--rc-line); }

/* ---------- Toasts ---------- */
.rc-toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 1090; }
.rc-toast { border: 0; border-radius: 14px; box-shadow: var(--rc-shadow-lg); background: var(--rc-navy-900); color: #fff; min-width: 280px; }
.rc-toast .toast-body { display: flex; gap: .75rem; align-items: center; padding: .9rem 1rem; font-weight: 500; }
.rc-toast .bi-check-circle-fill { color: #4ade80; font-size: 1.2rem; }

/* ---------- Auth pages ---------- */
.rc-auth { min-height: 100vh; display: grid; background: #fff; }
@media (min-width: 992px) { .rc-auth { grid-template-columns: 1.1fr 1fr; } }
.rc-auth-visual {
    position: relative;
    isolation: isolate;
    display: none;
    padding: 3rem;
    color: #fff;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
@media (min-width: 992px) { .rc-auth-visual { display: flex; flex-direction: column; justify-content: space-between; } }
.rc-auth-visual::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(500px 300px at 0% 100%, rgba(243, 154, 31, .35), transparent 70%), linear-gradient(160deg, rgba(6, 26, 51, .78), rgba(10, 37, 71, .94)); }
.rc-auth-visual blockquote { font-family: var(--rc-font-display); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.2; font-weight: 500; max-width: 520px; margin: 0; }
.rc-auth-visual blockquote em { color: var(--rc-orange-500); }
.rc-auth-visual p { color: rgba(255, 255, 255, .75); max-width: 460px; margin: 1rem 0 0; }
.rc-auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 5vw, 4rem); }
.rc-auth-box { width: 100%; max-width: 420px; margin: 0 auto; }
.rc-auth-box h1 { font-size: 2rem; margin: 1.5rem 0 .4rem; }
.rc-auth-box .lead { color: var(--rc-ink-soft); font-size: 1rem; margin-bottom: 2rem; }
.rc-auth-foot { text-align: center; color: var(--rc-muted); font-size: .8rem; margin-top: 2.5rem; }
.rc-password-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--rc-muted); padding: .35rem .5rem; border-radius: 8px; }
.rc-password-toggle:hover { color: var(--rc-navy-800); background: var(--rc-blue-50); }
