:root {
    --navy: #051D3F;
    --red: #C8102E;
    --red-dark: #a00f24;
    --ink: #1c2430;
    --muted: #64748b;
    --line: #e2e8f0;
    --paper: #f8fafc;
    --side: 268px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.rb-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: #051D3F url("login-backdrop.png") center top / cover no-repeat fixed;
    min-height: 100vh;
}
body.rb-app::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(5, 29, 63, 0.55);
    pointer-events: none;
    z-index: 0;
}
.rb-side, .rb-main { position: relative; z-index: 1; }
.rb-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side);
    display: flex;
    flex-direction: column;
    padding: 22px 14px 16px;
    background: rgba(5, 29, 63, 0.88);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}
.rb-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 8px 18px; text-decoration: none; color: #fff; }
.rb-brand img { height: 32px; width: auto; }
.rb-brand span { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; color: rgba(255,255,255,0.82); }
.rb-nav-label {
    margin: 8px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}
.rb-sidenav a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.86);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.rb-sidenav a svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.9; }
.rb-sidenav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.rb-sidenav a.is-on {
    background: rgba(255,255,255,0.12);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--red);
}
.rb-side-foot {
    margin-top: auto;
    padding: 14px 10px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.62);
}
.rb-side-foot strong { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.rb-side-foot a { color: #fff; text-decoration: none; font-weight: 600; }
.rb-side-foot a:hover { color: #ffd0d6; }
.rb-main { margin-left: var(--side); padding: 28px 32px 48px; min-height: 100vh; }
.rb-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.rb-top h1 { margin: 0; color: #fff; font-size: 28px; letter-spacing: -0.03em; }
.rb-top p { margin: 6px 0 0; color: rgba(255,255,255,0.78); font-size: 14px; max-width: 640px; }
.rb-menu {
    display: none;
    border: 0;
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}
.rb-card {
    background: rgba(6, 22, 48, 0.82);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.22);
    padding: 22px 24px;
    margin-bottom: 16px;
    color: #e8eef6;
}
.rb-card h2 { margin: 0 0 14px; color: #fff; font-size: 18px; }
.rb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rb-latest {
    background: rgba(3, 14, 32, 0.55);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    padding: 16px 18px;
}
.rb-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin: 0 0 6px; }
.rb-ver { font-size: 32px; font-weight: 750; color: #fff; letter-spacing: -0.03em; margin: 0 0 6px; }
.rb-desc { color: rgba(255,255,255,0.78); font-size: 14px; line-height: 1.45; margin: 0 0 12px; }
.rb-meta { color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 10px; }
label { display: block; font-weight: 650; margin: 0 0 6px; font-size: 13px; color: #fff; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"], input[type="file"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.38);
    border-radius: 10px;
    font-size: 15px;
    margin-bottom: 14px;
    background: rgba(3, 14, 32, 0.72);
    color: #fff;
    font-family: inherit;
}
select option { background: #051D3F; color: #fff; }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.45); }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
    background: rgba(3, 14, 32, 0.92);
}
.hint { font-size: 12px; color: rgba(255,255,255,0.55); margin: -8px 0 14px; line-height: 1.45; }
.note { font-size: 13px; color: rgba(255,255,255,0.62); line-height: 1.5; margin: 4px 0 0; }
.note a, .rb-card a { color: #fff; }
code { background: rgba(0,0,0,0.28); color: #fff; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.rb-btn, button.rb-btn, a.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--red);
    color: #fff !important;
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.rb-btn:hover { background: var(--red-dark); }
.rb-btn.navy { background: transparent; border: 1px solid rgba(255,255,255,0.45); }
.rb-btn.ghost { background: transparent; color: #fff !important; border: 1px solid rgba(255,255,255,0.38); }
.rb-btn.full { width: 100%; }
.rb-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rb-flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.rb-flash.ok { background: rgba(22, 101, 52, 0.35); color: #d1fae5; border: 1px solid rgba(167, 243, 208, 0.35); }
.rb-flash.bad { background: rgba(153, 27, 27, 0.35); color: #fee2e2; border: 1px solid rgba(254, 202, 202, 0.35); }
table.rb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rb-table th, table.rb-table td { text-align: left; padding: 12px 8px; border-bottom: 0; color: #fff; vertical-align: middle; }
table.rb-table tr { border-bottom: 1px solid rgba(255,255,255,0.18); }
table.rb-table th { color: rgba(255,255,255,0.55); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
table.rb-table td.rb-actions, table.rb-table th.rb-actions { width: 132px; text-align: right; white-space: nowrap; padding-right: 0; }
table.rb-table tr.is-on { background: rgba(200,16,46,0.18); }
table.rb-table a { color: #fff; font-weight: 700; text-decoration: none; }
table.rb-table a:hover { color: #ffd0d6; }
.rb-seg { display: inline-flex; background: rgba(255,255,255,0.14); border-radius: 12px; padding: 4px; gap: 4px; }
.rb-seg a { color: #fff; text-decoration: none; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.rb-seg a.is-on { background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.28); }
.rb-empty { color: rgba(255,255,255,0.6); font-size: 14px; padding: 8px 0 2px; }
body.rb-login {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    background: #051D3F url("login-backdrop.png") center center / cover no-repeat;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rb-login-card {
    width: 400px;
    max-width: 100%;
    background: rgba(10, 24, 51, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.35);
    padding: 36px 28px 28px;
}
.rb-login-card img.mark {
    height: 78px;
    width: auto;
    display: block;
    margin: 0 auto 26px;
}
.rb-login-field { position: relative; display: block; margin: 0 0 14px; }
.rb-login-field input {
    width: 100%;
    margin: 0;
    min-height: 52px;
    padding: 0 44px 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #07162e;
    color: #fff;
    font-size: 15px;
}
.rb-login-field input::placeholder { color: rgba(203, 213, 225, 0.7); }
.rb-eye {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}
.rb-login-card .rb-btn { margin-top: 4px; min-height: 48px; border-radius: 12px; font-size: 16px; }
.rb-login-card .rb-btn.ghost { margin-top: 12px; background: rgba(8, 22, 46, 0.4); }
.rb-login-card .rb-flash { margin-bottom: 14px; }

.rb-float { position: relative; display: block; margin: 0 0 14px; }
.rb-float-icon { position: absolute; left: 12px; top: 15px; width: 18px; height: 18px; color: rgba(255,255,255,0.55); z-index: 1; }
.rb-float-icon svg { width: 18px; height: 18px; display: block; }
.rb-float input, .rb-float select {
    width: 100%;
    margin: 0;
    min-height: 52px;
    padding: 18px 14px 6px 40px;
    background: rgba(3, 14, 32, 0.72);
    border: 1px solid rgba(255,255,255,0.38);
    color: #fff;
}
.rb-float-text {
    position: absolute;
    left: 40px;
    top: 16px;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    pointer-events: none;
    transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}
.rb-float input:focus + .rb-float-text,
.rb-float input:not(:placeholder-shown) + .rb-float-text,
.rb-float select + .rb-float-text {
    top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.rb-iconbtn {
    position: relative;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 10px;
    background: rgba(3, 14, 32, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.rb-iconbtn svg { width: 18px; height: 18px; }
.rb-iconbtn:hover { background: var(--navy); color: #fff; }
.rb-iconbtn.danger:hover { background: var(--red); }
.rb-iconbtn[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    padding: 7px 8px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
}
.rb-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.rb-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 29, 63, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 30;
}
.rb-modal.open { display: flex; }
.rb-modal-card {
    width: min(480px, 100%);
    background: rgba(8, 24, 51, 0.96);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.rb-modal-card h2 { margin: 0 0 8px; color: #fff; font-size: 20px; }
.rb-modal-card p { margin: 0 0 14px; color: rgba(255,255,255,0.7); }
.rb-top .rb-iconbtn { background: rgba(255,255,255,0.16); color: #fff; }
.rb-top .rb-iconbtn:hover { background: #fff; color: var(--navy); }
@media (max-width: 900px) {
    body.rb-app::after, body.rb-login::after {
        content: "Restore Britain Site Admin is desktop only. Open it on a computer.";
        position: fixed;
        inset: 0;
        z-index: 80;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 28px;
        text-align: center;
        background: #051D3F;
        color: #fff;
        font-size: 18px;
        font-weight: 650;
        line-height: 1.45;
    }
}

