/* ==================================================================
   reseme.css — self-contained design system (no Bootstrap)
   Ported/adapted from the SwiftTech B2C design language.
   All classes are prefixed `reseme-`. Solid fills (no gradients).
   ================================================================== */

/* ===== Design tokens ===== */
:root {
    --red-900:#7F0000; --red-800:#B30000; --red-700:#D32F2F; --red-600:#E53935;
    --red-500:#F44336; --red-400:#EF5350; --red-200:#EF9A9A; --red-100:#FFCDD2; --red-50:#FFEBEE;
    --teal-800:#00695C; --teal-700:#00796B; --teal-600:#00897B; --teal-500:#009688; --teal-200:#80CBC4; --teal-50:#E0F2F1;
    --gold-700:#9A7B1E; --gold-500:#C9A84C; --gold-300:#E7CE86; --gold-100:#FFF8E1;
    --green-700:#166534; --green-600:#16A34A; --green-200:#BBF7D0; --green-100:#DCFCE7; --green-50:#F0FDF4;
    --amber-700:#92400E; --amber-500:#F59E0B; --amber-300:#FDE68A; --amber-100:#FEF3C7;
    --blue-700:#1D4ED8; --blue-500:#3B82F6; --blue-100:#DBEAFE; --blue-50:#EFF6FF;
    --violet-600:#7C3AED; --violet-100:#EDE9FE;
    --navy-900:#0D1B2A; --navy-800:#112233; --navy-700:#1A2E44; --navy-600:#243B55;
    --surface:#FFFFFF; --surface-2:#F6F7FB; --surface-3:#EFF1F6;
    --border:#E4E7EE; --border-strong:#C9CFDA;
    --text-1:#0D1117; --text-2:#4A5568; --text-3:#8A94A6; --text-inv:#FFFFFF;
    --r-xs:4px; --r-sm:6px; --r-md:10px; --r-lg:14px; --r-xl:20px; --r-2xl:28px; --r-full:9999px;
    --shadow-xs:0 1px 3px rgba(16,24,40,.06);
    --shadow-sm:0 2px 8px rgba(16,24,40,.07);
    --shadow-md:0 4px 16px rgba(16,24,40,.09);
    --shadow-lg:0 8px 32px rgba(16,24,40,.12);
    --shadow-xl:0 20px 60px rgba(16,24,40,.18);
    --transition:.18s ease;
    --brand:var(--red-600); --brand-600:var(--red-700); --brand-tint:var(--red-50);
    --maxw:1180px;
    --sidebar-w:250px; --sidebar-w-collapsed:74px; --topbar-h:62px;
}

/* ===== Dark theme (toggled via <html data-theme="dark">) ===== */
:root[data-theme="dark"] {
    --surface:#131C27; --surface-2:#0C131C; --surface-3:#1E2A38;
    --border:#26313F; --border-strong:#3A4A5E;
    --text-1:#EAEEF4; --text-2:#AEB9C7; --text-3:#7B8798; --text-inv:#0C131C;
    --brand-tint:rgba(229,57,53,.16);
    --shadow-xs:0 1px 3px rgba(0,0,0,.45);
    --shadow-sm:0 2px 8px rgba(0,0,0,.45);
    --shadow-md:0 4px 16px rgba(0,0,0,.5);
    --shadow-lg:0 8px 32px rgba(0,0,0,.55);
    --shadow-xl:0 20px 60px rgba(0,0,0,.6);
}
:root[data-theme="dark"] .reseme-topbar,
:root[data-theme="dark"] .reseme-nav { background: rgba(19,28,39,.85); }
:root[data-theme="dark"] img.reseme-logo { filter: brightness(1.1); }

/* ===== Reset & base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px; line-height: 1.6; color: var(--text-1); background: var(--surface-2);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,h4,h5,h6 { line-height: 1.2; font-weight: 700; color: var(--text-1); letter-spacing: -.01em; }

/* ===== Layout helpers ===== */
.reseme-container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.reseme-row { display: flex; flex-wrap: wrap; gap: 24px; }
.reseme-muted { color: var(--text-2); }
.reseme-center { text-align: center; }

/* ===== Buttons ===== */
.reseme-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--r-md); border: 1.5px solid transparent;
    font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
    transition: var(--transition); user-select: none;
}
.reseme-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.reseme-btn:disabled { opacity: .55; cursor: not-allowed; }
.reseme-btn-primary { background: var(--red-600); color: #fff; border-color: var(--red-600); box-shadow: 0 2px 10px rgba(229,57,53,.28); }
.reseme-btn-primary:hover { background: var(--red-700); border-color: var(--red-700); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(229,57,53,.34); }
.reseme-btn-navy { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.reseme-btn-navy:hover { background: var(--navy-900); transform: translateY(-1px); }
.reseme-btn-secondary { background: var(--surface); color: var(--text-1); border-color: var(--border); }
.reseme-btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }
.reseme-btn-outline { background: transparent; color: var(--red-600); border-color: var(--red-200); }
.reseme-btn-outline:hover { background: var(--red-50); border-color: var(--red-400); }
.reseme-btn-ghost { background: transparent; color: var(--text-2); }
.reseme-btn-ghost:hover { background: var(--surface-3); color: var(--text-1); }
.reseme-btn-light { background: #fff; color: var(--navy-900); border-color: #fff; }
.reseme-btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.reseme-btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.reseme-btn-outline-light:hover { background: rgba(255,255,255,.12); }
.reseme-btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.reseme-btn-xs { padding: 6px 12px; font-size: 12px; border-radius: var(--r-sm); gap: 6px; }
.reseme-btn-xs svg { width: 14px; height: 14px; }
.reseme-btn-esewa { background: #60BB46; color: #fff; border-color: #60BB46; }
.reseme-btn-esewa:hover { background: #4e9e39; border-color: #4e9e39; }

/* Payment-method modal — small, centered; JME-style dark header + card options */
.reseme-modal-dialog.reseme-pay-dialog { max-width: 380px; width: 92vw; margin: 7vh auto; }
.reseme-paym-head { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 18px 18px 16px; background: var(--navy-900); color: #fff; }
.reseme-paym-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--red-600); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.reseme-paym-badge svg { width: 22px; height: 22px; }
.reseme-paym-htx { display: flex; flex-direction: column; gap: 2px; padding-right: 22px; }
.reseme-paym-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--teal-200); }
.reseme-paym-title { font-size: 17px; font-weight: 800; line-height: 1.2; }
.reseme-paym-sub { font-size: 12.5px; color: rgba(255,255,255,.6); }
.reseme-paym-close { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; display: grid; place-items: center; border: none; background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; cursor: pointer; transition: background var(--transition); }
.reseme-paym-close:hover { background: rgba(255,255,255,.22); }
.reseme-paym-close svg { width: 16px; height: 16px; }
.reseme-paym-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.reseme-paym-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.reseme-paym-note svg { width: 13px; height: 13px; flex-shrink: 0; }
.reseme-pay-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.reseme-pay-method { display: grid; grid-template-columns: 42px 1fr; align-items: center; column-gap: 13px; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-1); cursor: pointer; transition: var(--transition); }
.reseme-pay-method:hover:not(.is-soon), .reseme-pay-method:focus-visible { border-color: var(--red-400); background: var(--red-50); outline: none; }
.reseme-pay-method .ic { grid-row: 1 / span 2; align-self: center; width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden; background: var(--surface-3); color: var(--text-2); }
.reseme-pay-method .ic svg { width: 20px; height: 20px; }
.reseme-pay-method .ic.ic--logo { background: none; }
.reseme-pay-method .ic.ic--logo svg { width: 42px; height: 42px; }
.reseme-pay-method b { grid-column: 2; align-self: end; display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.reseme-pay-method small { grid-column: 2; align-self: start; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.reseme-pay-method small .fs-logo { display: inline-flex; color: var(--text-2); }
.reseme-pay-method.is-soon { opacity: .55; cursor: default; }
#payEsewaForm { width: 100%; }
.reseme-btn-lg { padding: 14px 26px; font-size: 15px; border-radius: var(--r-lg); }
.reseme-btn-block { width: 100%; }

/* ===== Cards / badges ===== */
.reseme-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.reseme-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; }
.reseme-badge-red { background: var(--red-50); color: var(--red-700); }
.reseme-badge-green { background: var(--green-100); color: var(--green-700); }

/* ===== Alerts ===== */
.reseme-alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.reseme-alert-success { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.reseme-alert-danger { background: var(--red-50); border-color: var(--red-100); color: var(--red-700); }
.reseme-alert ul { margin: 4px 0 0 18px; }

/* ===== Forms ===== */
.reseme-field { margin-bottom: 16px; }
.reseme-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reseme-field-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.reseme-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.reseme-check input { width: auto; accent-color: var(--red-500); }
.reseme-link { color: var(--red-600); font-weight: 600; }
.reseme-label-row { display: flex; align-items: center; justify-content: space-between; }

/* ===== Auth (split screen) ===== */
.reseme-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.reseme-auth-brandpanel { background: var(--navy-900); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.reseme-auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; }
.reseme-auth-pitch h2 { color: #fff; font-size: 1.9rem; line-height: 1.2; }
.reseme-auth-pitch p { color: #cfd8e3; margin-top: 12px; max-width: 40ch; }
.reseme-auth-points { list-style: none; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.reseme-auth-points li { display: flex; align-items: center; gap: 10px; color: #e6edf5; font-size: 14px; }
.reseme-auth-points svg { width: 18px; height: 18px; color: var(--red-400); flex-shrink: 0; }
.reseme-auth-foot { color: #8ea0b4; font-size: 13px; }
.reseme-auth-formpanel { display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--surface-2); }
.reseme-auth-card { width: 100%; max-width: 400px; }
.reseme-auth-card > .reseme-brand { margin-bottom: 22px; display: none; }
.reseme-auth-title { font-size: 1.4rem; font-weight: 800; }
.reseme-auth-sub { color: var(--text-2); margin: 4px 0 22px; }
.reseme-auth-alt { text-align: center; margin-top: 22px; color: var(--text-2); font-size: 14px; }
@media (max-width: 820px) {
    .reseme-auth { grid-template-columns: 1fr; }
    .reseme-auth-brandpanel { display: none; }
    .reseme-auth-card > .reseme-brand { display: flex; }
    .reseme-form-row { grid-template-columns: 1fr; }
}
.reseme-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.reseme-input, .reseme-select, .reseme-textarea {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--r-md);
    font-family: inherit; font-size: 14px; color: var(--text-1); background: var(--surface); transition: var(--transition);
    appearance: none; -webkit-appearance: none;
}
.reseme-textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.reseme-input::placeholder, .reseme-textarea::placeholder { color: var(--text-3); }
.reseme-input:focus, .reseme-select:focus, .reseme-textarea:focus { outline: none; border-color: var(--red-400); box-shadow: 0 0 0 3px rgba(239,83,80,.12); }

/* ===== Navbar ===== */
.reseme-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.reseme-nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.reseme-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--text-1); }
.reseme-brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--red-600); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.reseme-nav-links { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.reseme-nav-link { padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; font-size: 14px; transition: var(--transition); }
.reseme-nav-link:hover { color: var(--text-1); background: var(--surface-3); }
.reseme-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.reseme-nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); align-items: center; justify-content: center; }
.reseme-nav-toggle svg { width: 20px; height: 20px; }

/* ===== Footer ===== */
.reseme-footer { background: var(--navy-900); color: #cfd8e3; padding: 48px 0 24px; }
.reseme-footer a { color: #cfd8e3; opacity: .85; }
.reseme-footer a:hover { opacity: 1; color: #fff; }
.reseme-foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.reseme-foot-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: #fff; margin-bottom: 10px; }
.reseme-foot-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.reseme-foot-col a { display: block; padding: 4px 0; font-size: 14px; }
.reseme-foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; opacity: .8; }

/* ==================================================================
   Authenticated app shell — left sidebar + topbar
   ================================================================== */
.reseme-app { display: flex; flex-direction: column; min-height: 100vh; }
.reseme-appmain { flex: 1 0 auto; padding: 28px 0 48px; }
.reseme-nav-active { color: var(--red-600) !important; background: var(--red-50) !important; }

.reseme-shell { min-height: 100vh; }
.reseme-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 200; background: var(--navy-900); color: #fff; display: flex; flex-direction: column; transition: transform .28s cubic-bezier(.4,0,.2,1); }
.reseme-sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 18px; height: var(--topbar-h); flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.reseme-sb-logo { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--red-600); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; }
.reseme-sb-name { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.reseme-sidebar-scroll { flex: 1; overflow-y: auto; padding: 14px 12px; }
.reseme-sidebar-scroll { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.reseme-sidebar-scroll::-webkit-scrollbar { width: 6px; background: transparent; }
.reseme-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.reseme-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 8px; }
.reseme-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); }
.reseme-nav-sec { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 14px 12px 7px; }
.reseme-sb-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: rgba(255,255,255,.74); font-size: 13px; font-weight: 600; transition: var(--transition); margin-bottom: 2px; }
.reseme-sb-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.reseme-sb-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.reseme-sb-item.is-active { background: var(--red-600); color: #fff; }
.reseme-sb-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-full); background: var(--red-600); color: #fff; }
.reseme-sb-item.is-active .reseme-sb-badge { background: rgba(255,255,255,.25); }
.reseme-sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.reseme-sb-cta { background: rgba(201,168,76,.12); border: 1px solid rgba(201,168,76,.3); border-radius: var(--r-md); padding: 13px; margin-bottom: 10px; }
.reseme-sb-cta .t { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--gold-300); }
.reseme-sb-cta .t svg { width: 14px; height: 14px; }
.reseme-sb-cta .d { font-size: 11px; color: rgba(255,255,255,.6); margin: 3px 0 9px; }
.reseme-sb-cta .reseme-btn-primary { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); box-shadow: none; }
.reseme-sb-cta .reseme-btn-primary:hover { background: var(--gold-300); border-color: var(--gold-300); transform: none; }
.reseme-sb-signout-form { margin: 0; }
.reseme-sb-signout { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; background: none; border: none; color: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; }
.reseme-sb-signout:hover { background: rgba(255,255,255,.08); color: #fff; }
.reseme-sb-signout svg { width: 17px; height: 17px; }

.reseme-main-area { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.reseme-topbar { position: sticky; top: 0; z-index: 150; height: var(--topbar-h); background: rgba(255,255,255,.9); backdrop-filter: saturate(1.3) blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 22px; }
.reseme-topbar h1 { font-size: 1.05rem; font-weight: 700; }
.reseme-topbar-spacer { flex: 1; }
.reseme-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Topbar search */
.reseme-search { flex: 0 1 520px; margin-right: auto; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); transition: border-color var(--transition), background var(--transition); }
.reseme-search:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.reseme-search svg { width: 17px; height: 17px; color: var(--text-3); flex-shrink: 0; }
.reseme-search input { flex: 1; border: none; background: none; outline: none; font-size: 14px; color: var(--text-1); min-width: 0; }
.reseme-search input::placeholder { color: var(--text-3); }

/* Topbar user chip */
.reseme-userchip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--text-1); }
.reseme-userchip:hover { background: var(--surface-3); }
.reseme-userchip .reseme-uavatar { width: 34px; height: 34px; background: var(--teal-700); }
.reseme-userchip-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.reseme-userchip-txt .nm { font-weight: 700; font-size: 13.5px; }
.reseme-userchip-txt .st { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
.reseme-userchip-txt .st svg { width: 12px; height: 12px; }
.reseme-userchip-txt .st.is-verified { color: var(--green-600); }
.reseme-userchip-txt .st.is-unverified { color: var(--amber-500); }
.reseme-userchip-caret { width: 16px; height: 16px; color: var(--text-3); }
@media (max-width: 720px) { .reseme-userchip-txt, .reseme-userchip-caret { display: none; } .reseme-userchip { padding: 4px; } }
.reseme-sb-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); align-items: center; justify-content: center; }
.reseme-sb-toggle svg { width: 20px; height: 20px; }
.reseme-content { padding: 30px; flex: 1; }
.reseme-sb-overlay { display: none; position: fixed; inset: 0; background: rgba(13,27,42,.5); z-index: 190; }
.reseme-collapse-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); }
.reseme-collapse-btn:hover { background: var(--surface-3); color: var(--text-1); }
.reseme-collapse-btn svg { width: 19px; height: 19px; }

/* Collapsed (desktop icon-only) */
.reseme-sidebar { transition: transform .28s cubic-bezier(.4,0,.2,1), width .24s ease; }
.reseme-main-area { transition: margin-left .24s ease; }
.reseme-shell.is-collapsed .reseme-sidebar { width: var(--sidebar-w-collapsed); }
.reseme-shell.is-collapsed .reseme-main-area { margin-left: var(--sidebar-w-collapsed); }
.reseme-shell.is-collapsed .reseme-sb-name,
.reseme-shell.is-collapsed .reseme-sb-item span,
.reseme-shell.is-collapsed .reseme-nav-sec,
.reseme-shell.is-collapsed .reseme-sb-badge,
.reseme-shell.is-collapsed .reseme-sb-cta,
.reseme-shell.is-collapsed .reseme-sb-signout span { display: none; }
.reseme-shell.is-collapsed .reseme-sidebar-brand { justify-content: center; padding: 0; gap: 0; }
.reseme-shell.is-collapsed .reseme-sb-item { justify-content: center; }
.reseme-shell.is-collapsed .reseme-sb-signout { justify-content: center; }
.reseme-shell.is-collapsed .reseme-collapse-btn svg { transform: scaleX(-1); }
@media (max-width: 1000px) {
    .reseme-collapse-btn { display: none; }
    .reseme-shell.is-collapsed .reseme-sidebar { width: var(--sidebar-w); }
    .reseme-shell.is-collapsed .reseme-main-area { margin-left: 0; }
    .reseme-shell.is-collapsed .reseme-sb-name,
    .reseme-shell.is-collapsed .reseme-sb-item span,
    .reseme-shell.is-collapsed .reseme-nav-sec,
    .reseme-shell.is-collapsed .reseme-sb-cta,
    .reseme-shell.is-collapsed .reseme-sb-signout span { display: revert; }
    .reseme-shell.is-collapsed .reseme-sidebar-brand { justify-content: flex-start; padding: 0 18px; gap: 11px; }
    .reseme-shell.is-collapsed .reseme-sb-item { justify-content: flex-start; }
}

@media (max-width: 1000px) {
    .reseme-sidebar { transform: translateX(-100%); }
    .reseme-shell.is-open .reseme-sidebar { transform: none; }
    .reseme-shell.is-open .reseme-sb-overlay { display: block; }
    .reseme-main-area { margin-left: 0; }
    .reseme-sb-toggle { display: inline-flex; }
}
@media (max-width: 560px) { .reseme-content { padding: 16px; } }

/* Generic dropdown (JS toggles .is-open) */
.reseme-dd { position: relative; }
.reseme-dd-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 200; }
.reseme-dd.is-open .reseme-dd-menu { display: block; }
.reseme-dd-up .reseme-dd-menu { top: auto; bottom: calc(100% + 8px); }
.reseme-dd-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 11px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--text-1); background: none; border: none; }
.reseme-dd-item:hover { background: var(--surface-3); }
.reseme-dd-item svg { width: 16px; height: 16px; color: var(--text-3); }
.reseme-dd-item.is-danger { color: var(--red-700); }
.reseme-dd-item.is-danger svg { color: var(--red-700); }
.reseme-dd-divider { height: 1px; background: var(--border); margin: 6px 0; }
.reseme-dd form { margin: 0; }

/* User avatar menu */
.reseme-uavatar { width: 34px; height: 34px; border-radius: var(--r-full); background: var(--red-600); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; overflow: hidden; }
.reseme-uavatar img { width: 100%; height: 100%; object-fit: cover; }
.reseme-usermenu { min-width: 250px; padding: 0; }
.reseme-usermenu-head { display: flex; align-items: center; gap: 11px; padding: 14px; border-bottom: 1px solid var(--border); }
.reseme-usermenu-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.reseme-usermenu-email { color: var(--text-3); font-size: 12.5px; }
.reseme-usermenu-body { padding: 6px; }
.reseme-plan-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); }
.reseme-plan-badge.is-paid { background: var(--green-100); color: var(--green-700); }

/* Icon button */
.reseme-iconbtn { width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text-2); position: relative; }
.reseme-iconbtn:hover { background: var(--surface-3); color: var(--text-1); }
.reseme-iconbtn svg { width: 18px; height: 18px; }

/* Notification bell */
.reseme-notif-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-full); background: var(--red-600); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.reseme-notif-menu { min-width: 320px; padding: 0; }
.reseme-notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.reseme-notif-list { max-height: 360px; overflow-y: auto; }
.reseme-notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-1); }
.reseme-notif-item:hover { background: var(--surface-2); }
.reseme-notif-item.is-unread { background: var(--red-50); }
.reseme-notif-ic { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--red-50); color: var(--red-600); display: grid; place-items: center; flex-shrink: 0; }
.reseme-notif-ic svg { width: 15px; height: 15px; }
.reseme-notif-item b { display: block; font-size: 13px; }
.reseme-notif-item small { font-size: 12px; color: var(--text-2); }
.reseme-notif-time { font-size: 11px; color: var(--text-3); margin-top: 2px; display: block; }
.reseme-notif-empty { padding: 26px; text-align: center; color: var(--text-3); font-size: 13px; }
.reseme-notif-foot { display: block; text-align: center; padding: 11px; font-weight: 600; color: var(--red-600); border-top: 1px solid var(--border); font-size: 13px; }

/* Page header */
.reseme-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.reseme-page-title { font-size: 1.5rem; font-weight: 800; }
.reseme-page-sub { color: var(--text-2); margin-top: 2px; }
.reseme-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; }
.reseme-sec-head h2 { font-size: 1.05rem; font-weight: 700; }

/* ---- B2C-style dashboard ---- */
.reseme-welcome { position: relative; overflow: hidden; background: var(--navy-900); color: #fff; border-radius: var(--r-xl); padding: 26px 28px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.reseme-welcome::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; top: -100px; right: -70px; background: rgba(229,57,53,.22); }
.reseme-welcome-inner { position: relative; z-index: 1; }
.reseme-welcome h1 { color: #fff; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.reseme-welcome p { color: rgba(255,255,255,.72); font-size: 14px; margin-top: 5px; max-width: 460px; }
.reseme-welcome-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }

.reseme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }

.reseme-card-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.reseme-card-header h3 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.reseme-head-icon { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--red-50); color: var(--red-600); display: grid; place-items: center; flex-shrink: 0; }
.reseme-head-icon svg { width: 16px; height: 16px; }
.reseme-card-body { padding: 20px; }

.reseme-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 15px; box-shadow: var(--shadow-xs); transition: var(--transition); margin-bottom: 14px; }
.reseme-metric:last-child { margin-bottom: 0; }
.reseme-metric .ic { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 10px; background: var(--red-50); color: var(--red-600); }
.reseme-metric .ic svg { width: 18px; height: 18px; }
.reseme-metric .ic.teal { background: var(--teal-50); color: var(--teal-700); }
.reseme-metric .ic.gold { background: var(--gold-100); color: var(--gold-700); }
.reseme-metric .ic.green { background: var(--green-100); color: var(--green-700); }
.reseme-metric .lbl { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.reseme-metric .val { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.reseme-metric .val .of { font-size: 13px; font-weight: 600; color: var(--text-3); }

/* Quick-action cards */
.reseme-qa { display: flex; align-items: center; gap: 13px; padding: 15px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); color: var(--text-1); transition: transform .28s cubic-bezier(.34,1.3,.4,1), box-shadow .28s ease; }
.reseme-qa:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.reseme-qa-ic { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.reseme-qa-ic svg { width: 21px; height: 21px; }
.reseme-qa-red .reseme-qa-ic { background: var(--red-600); }
.reseme-qa-violet .reseme-qa-ic { background: var(--violet-600); }
.reseme-qa-teal .reseme-qa-ic { background: var(--teal-600); }
.reseme-qa-gold .reseme-qa-ic { background: var(--gold-500); }
.reseme-qa b { display: block; font-size: 14px; }
.reseme-qa small { color: var(--text-3); font-size: 12.5px; }

/* Stat cards */
.reseme-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-xs); }
.reseme-stat-top { display: flex; align-items: center; justify-content: space-between; }
.reseme-stat-label { color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.reseme-stat-ic { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--red-50); color: var(--red-600); display: grid; place-items: center; }
.reseme-stat-ic svg { width: 17px; height: 17px; }
.reseme-stat-value { font-size: 1.7rem; font-weight: 800; margin-top: 8px; }
.reseme-stat-value .of { font-size: .95rem; font-weight: 600; color: var(--text-3); }
.reseme-progress { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.reseme-progress > span { display: block; height: 100%; background: var(--red-500); border-radius: var(--r-full); }
.reseme-stat-foot { margin-top: 8px; font-size: 13px; }

/* Resume card */
.reseme-rcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); transition: transform .2s ease, box-shadow .2s ease; height: 100%; }
.reseme-rcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.reseme-rcard-body { padding: 16px; }
.reseme-rcard-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.reseme-rcard-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.reseme-tpl-tag { font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); padding: 2px 8px; border-radius: var(--r-full); }
.reseme-rcard-meta .t { color: var(--text-3); font-size: 12px; }
.reseme-rcard-actions { display: flex; align-items: center; gap: 8px; }

/* Template gallery */
.reseme-tpl-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.reseme-tcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.reseme-tcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.reseme-tthumb { position: relative; height: 300px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border); }
.reseme-tthumb-inner { width: 250%; transform: scale(.4); transform-origin: top left; pointer-events: none; }
.reseme-tthumb-inner .resume { width: 100%; min-height: auto; box-shadow: none; margin: 0; }
.reseme-tbadge { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--r-full); font-size: 9.5px; font-weight: 700; letter-spacing: .02em; box-shadow: var(--shadow-sm); }
.reseme-tbadge svg { width: 10px; height: 10px; }
.reseme-tbadge.is-premium { background: var(--gold-500); color: var(--navy-900); }
.reseme-tbadge.is-free { background: rgba(255,255,255,.92); color: var(--text-2); border: 1px solid var(--border); }
.reseme-tcard-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.reseme-tcard-name { font-size: 15px; font-weight: 700; }
.reseme-cat { background: var(--red-50); color: var(--red-700); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-full); }
.reseme-tcard-desc { font-size: 13px; color: var(--text-2); flex: 1; }
.reseme-tcard-actions { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; }
.reseme-tcard-actions form { flex: 1; margin: 0; }

/* Modal (JS-toggled, no Bootstrap) */
.reseme-modal { position: fixed; inset: 0; z-index: 1000; display: none; }
.reseme-modal.is-open { display: block; }
.reseme-modal-overlay { position: absolute; inset: 0; background: rgba(13,27,42,.5); }
.reseme-modal-dialog { position: relative; max-width: 1120px; width: 94vw; margin: 3vh auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; max-height: 94vh; overflow: hidden; }
.reseme-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.reseme-modal-head-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.reseme-modal-ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--red-50); color: var(--red-600); display: grid; place-items: center; flex-shrink: 0; }
.reseme-modal-ic svg { width: 19px; height: 19px; }
.reseme-modal-title { display: block; font-weight: 700; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reseme-modal-sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.reseme-modal-close { width: 34px; height: 34px; border-radius: var(--r-full); border: none; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex-shrink: 0; transition: var(--transition); }
.reseme-modal-close:hover { background: var(--red-50); color: var(--red-600); transform: rotate(90deg); }
.reseme-modal-body { flex: 1; background: #eef1f5; position: relative; min-height: 0; }
.reseme-modal-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.reseme-modal-foot-hint { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); min-width: 0; }
.reseme-modal-foot-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.reseme-modal-foot-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.reseme-modal-foot form { margin: 0; }
@media (max-width: 560px) { .reseme-modal-sub, .reseme-modal-foot-hint { display: none; } }
.reseme-preview-frame { width: 100%; height: 75vh; border: 0; display: block; }
.reseme-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 14px; }

/* Panels (settings / content cards) */
/* Fill the full content width so account pages line up edge-to-edge with the top bar. */
.reseme-narrow { max-width: 100%; margin: 0; }
.reseme-narrow.reseme-narrow-lg { max-width: 100%; margin: 0; }
.reseme-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); padding: 22px; margin-bottom: 20px; }
.reseme-panel-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.reseme-avatar-lg { width: 66px; height: 66px; border-radius: var(--r-full); background: var(--red-600); color: #fff; font-weight: 700; font-size: 24px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.reseme-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* Usage meter rows */
.reseme-usage-row { margin-bottom: 16px; }
.reseme-usage-row:last-child { margin-bottom: 0; }
.reseme-usage-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.reseme-usage-top .v { color: var(--text-3); }
.reseme-progress.is-over > span { background: var(--red-600); }

/* Simple linked list */
.reseme-list { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.reseme-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); color: var(--text-1); }
.reseme-list-item:last-child { border-bottom: none; }
.reseme-list-item:hover { background: var(--surface-2); }

/* Notification center */
.reseme-notifc { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.reseme-notifc-item { display: flex; gap: 12px; align-items: flex-start; padding: 15px 18px; border-bottom: 1px solid var(--border); color: var(--text-1); }
.reseme-notifc-item:last-child { border-bottom: none; }
.reseme-notifc-item:hover { background: var(--surface-2); }
.reseme-notifc-item.is-unread { background: var(--red-50); }
.reseme-notifc-item .reseme-notif-ic { width: 36px; height: 36px; }
.reseme-notifc-item b { display: block; font-size: 14px; }
.reseme-notifc-item small { color: var(--text-2); font-size: 13px; }
.reseme-notifc-item .t { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; align-self: center; }

/* Export / print page */
.export-body { background: var(--surface-2); margin: 0; }
.export-toolbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.export-toolbar-inner { max-width: 900px; margin: 0 auto; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.export-stage { padding: 32px 16px; display: flex; justify-content: center; }
.resume-page { width: 210mm; min-height: 297mm; background: #fff; box-shadow: var(--shadow-md); }
.export-toolbar .reseme-btn svg { width: 15px; height: 15px; }

/* Error page */
.reseme-error { text-align: center; padding: 90px 20px; }
.reseme-error-code { font-size: 5rem; font-weight: 800; color: var(--red-600); line-height: 1; }
.reseme-error h1 { font-size: 1.4rem; margin: 12px 0 6px; }
.reseme-error p { color: var(--text-2); margin-bottom: 18px; }

/* Empty state */
.reseme-empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: 48px 20px; text-align: center; }
.reseme-empty-ic { width: 54px; height: 54px; border-radius: var(--r-lg); background: var(--surface-3); color: var(--text-3); display: grid; place-items: center; margin: 0 auto 12px; }
.reseme-empty-ic svg { width: 26px; height: 26px; }
.reseme-empty h3 { font-size: 16px; }
.reseme-empty p { color: var(--text-2); margin: 6px 0 16px; }

/* ==================================================================
   Admin shell (dark sidebar)
   ================================================================== */
.reseme-admin { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.reseme-admin-sidebar { background: var(--navy-900); color: #cfd8e3; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.reseme-admin-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; color: #fff; padding: 6px 8px 16px; }
.reseme-admin-nav { display: flex; flex-direction: column; gap: 2px; }
.reseme-admin-navlink { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-md); color: #b7c2d0; font-weight: 500; font-size: 14px; transition: var(--transition); }
.reseme-admin-navlink:hover { background: rgba(255,255,255,.06); color: #fff; }
.reseme-admin-navlink.is-active { background: var(--red-600); color: #fff; }
.reseme-admin-navlink svg { width: 17px; height: 17px; }
.reseme-admin-foot { margin-top: auto; padding-top: 12px; }
.reseme-admin-content { display: flex; flex-direction: column; min-width: 0; }
.reseme-admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.reseme-admin-topbar h1 { font-size: 1.15rem; font-weight: 700; }
.reseme-admin-main { padding: 26px; flex: 1; }

/* Admin tabs (top-nav sub-navigation, replaces the sidebar) */
.reseme-admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.reseme-admin-bar h1 { font-size: 1.35rem; font-weight: 800; }
.reseme-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.reseme-tab { padding: 11px 15px; font-weight: 600; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.reseme-tab:hover { color: var(--text-1); }
.reseme-tab.is-active { color: var(--red-600); border-bottom-color: var(--red-600); }

/* Table */
.reseme-table-wrap { overflow-x: auto; }
.reseme-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.reseme-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.reseme-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.reseme-table tbody tr:hover, .reseme-table tr:hover td { background: var(--surface-2); }
.reseme-table .num { text-align: right; }
/* Right-aligned action cell. Must NOT be display:flex — that removes the <td>
   from table layout and breaks its bottom-border alignment with the other cells. */
.reseme-table-actions { text-align: right; white-space: nowrap; }
.reseme-table-actions > * { display: inline-block; vertical-align: middle; }
.reseme-table-actions > * + * { margin-left: 6px; }

/* badges (more tones) */
.reseme-badge-gray { background: var(--surface-3); color: var(--text-2); }
.reseme-badge-amber { background: var(--amber-100); color: var(--amber-700); }
.reseme-badge-danger { background: var(--red-50); color: var(--red-700); }

/* Inline select in tables */
.reseme-select-sm { width: auto; padding: 6px 26px 6px 10px; font-size: 13px; border-radius: var(--r-sm); }

/* Filter bar */
.reseme-filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.reseme-filters .reseme-field { margin: 0; }
.reseme-filters label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; margin-bottom: 4px; display: block; }

/* Pagination */
.reseme-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.reseme-pager-btns { display: flex; gap: 8px; }

/* Template tiles */
.reseme-tile { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; background: var(--surface); box-shadow: var(--shadow-xs); height: 100%; }
.reseme-tile.is-inactive { opacity: .6; }
.reseme-tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

/* Usage bars (admin dashboard) */
.reseme-ubar-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; margin-bottom: 10px; }
.reseme-ubar { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.reseme-ubar > span { display: block; height: 100%; background: var(--red-500); }
.reseme-ubar-count { text-align: right; font-weight: 600; }

/* Toggle switch */
.reseme-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.reseme-switch input { position: absolute; opacity: 0; }
.reseme-switch-track { width: 40px; height: 22px; border-radius: var(--r-full); background: var(--border-strong); position: relative; transition: var(--transition); flex-shrink: 0; }
.reseme-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: var(--transition); }
.reseme-switch input:checked + .reseme-switch-track { background: var(--red-600); }
.reseme-switch input:checked + .reseme-switch-track::after { transform: translateX(18px); }

/* Matrix */
.reseme-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.reseme-matrix th, .reseme-matrix td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.reseme-matrix th:first-child, .reseme-matrix td:first-child { text-align: left; }
.reseme-matrix .grouprow td { background: var(--surface-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); text-align: left; }
.reseme-matrix .yes { color: var(--green-600); }
.reseme-matrix .no { color: var(--text-3); }

@media (max-width: 820px) {
    .reseme-admin { grid-template-columns: 1fr; }
    .reseme-admin-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .reseme-admin-nav { flex-direction: row; flex-wrap: wrap; }
    .reseme-admin-foot { margin: 0 0 0 auto; padding: 0; }
    .reseme-filters { grid-template-columns: 1fr; }
}

/* ==================================================================
   Landing sections
   ================================================================== */
.reseme-hero { padding: 72px 0 64px; background: var(--surface); }
.reseme-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.reseme-hero-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-radius: var(--r-full); padding: 6px 13px; font-size: 13px; font-weight: 600; }
.reseme-hero-badge svg { width: 15px; height: 15px; color: var(--red-600); }
.reseme-hero-title { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; line-height: 1.08; margin: 18px 0 0; }
.reseme-hero-title .reseme-accent { color: var(--red-600); }
.reseme-hero-lead { font-size: 1.02rem; color: var(--text-2); margin: 16px 0 26px; max-width: 44ch; }
.reseme-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.reseme-hero-stats { display: inline-flex; flex-wrap: wrap; margin-top: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.reseme-hero-stats > div { padding: 12px 22px; }
.reseme-hero-stats > div + div { border-left: 1px solid var(--border); }
.reseme-hero-stats strong { display: block; font-size: 1.5rem; font-weight: 800; }
.reseme-hero-stats span { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; }
.reseme-hero-note { margin-top: 18px; font-size: 13px; color: var(--text-3); }
.reseme-hero-note code { color: var(--red-600); font-weight: 600; }

/* Hero preview card + floating badges */
.reseme-hpv { position: relative; max-width: 460px; margin: 0 auto; }
.reseme-hpv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); padding: 24px; }
.reseme-hpv-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.reseme-hpv-logo { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--red-600); color: #fff; font-weight: 800; display: grid; place-items: center; }
.reseme-hpv-name { height: 15px; width: 46%; border-radius: 6px; background: var(--border-strong); margin-bottom: 9px; }
.reseme-hpv-sub { height: 9px; width: 30%; border-radius: 5px; background: var(--red-600); opacity: .45; margin-bottom: 22px; }
.reseme-hpv-lines { display: flex; flex-direction: column; gap: 10px; }
.reseme-hpv-l { height: 9px; border-radius: 5px; background: var(--surface-3); }
.reseme-hpv-divider { height: 2px; background: var(--red-600); opacity: .85; border-radius: 2px; margin: 22px 0 14px; }
.reseme-hpv-foot { display: flex; align-items: center; justify-content: space-between; }
.reseme-hpv-total { color: var(--red-600); font-weight: 700; }
.reseme-hpv-chips { display: flex; gap: 6px; }
.reseme-hpv-chips i { width: 34px; height: 16px; border-radius: 5px; background: var(--red-50); }
.reseme-hpv-badge { position: absolute; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 10px 13px; }
.reseme-hpv-badge.is-tl { top: 0; left: -6px; }
.reseme-hpv-badge.is-br { bottom: 0; right: -6px; }
.reseme-hpv-ic { width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; }
.reseme-hpv-ic svg { width: 16px; height: 16px; }
.reseme-hpv-ic.is-green { background: var(--green-100); color: var(--green-700); }
.reseme-hpv-ic.is-violet { background: var(--violet-100); color: var(--violet-600); }
.reseme-hpv-badge b { display: block; font-size: 13px; }
.reseme-hpv-badge small { font-size: 11px; color: var(--text-3); }

/* Section shell */
.reseme-section { padding: 72px 0; }
.reseme-section-alt { background: var(--surface); }
.reseme-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.reseme-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red-600); background: var(--red-50); padding: 5px 12px; border-radius: var(--r-full); margin-bottom: 14px; }
.reseme-h2 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); font-weight: 800; }
.reseme-lead { color: var(--text-2); margin-top: 8px; font-size: 1rem; }

/* Feature grid */
.reseme-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.reseme-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.reseme-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-xs); transition: transform .28s cubic-bezier(.34,1.3,.4,1), box-shadow .28s ease; }
.reseme-feature:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.reseme-feature-ic { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--red-50); color: var(--red-600); display: grid; place-items: center; margin-bottom: 14px; }
.reseme-feature-ic svg { width: 22px; height: 22px; }
.reseme-feature h3 { font-size: 15px; margin-bottom: 6px; }
.reseme-feature p { color: var(--text-2); font-size: 13.5px; }

/* Steps */
.reseme-step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px 22px 22px; box-shadow: var(--shadow-xs); height: 100%; }
.reseme-step-no { position: absolute; top: -16px; left: 22px; width: 32px; height: 32px; border-radius: var(--r-full); background: var(--red-600); color: #fff; font-weight: 800; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.reseme-step-ic { color: var(--red-600); margin: 6px 0 10px; }
.reseme-step-ic svg { width: 26px; height: 26px; }
.reseme-step h3 { font-size: 15px; margin-bottom: 6px; }
.reseme-step p { color: var(--text-2); font-size: 13.5px; }

/* Template mocks */
.reseme-tpl { text-align: center; }
.reseme-tpl-mock { position: relative; aspect-ratio: 3/2; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: var(--shadow-xs); display: flex; transition: transform .18s ease, box-shadow .18s ease; }
.reseme-tpl:hover .reseme-tpl-mock { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.reseme-tpl-aside { width: 34%; background: var(--tpl); }
.reseme-tpl-dark .reseme-tpl-aside { background: #2b2f38; order: 2; }
.reseme-tpl-dark .reseme-tpl-main { order: 1; }
.reseme-tpl-main { flex: 1; padding: 14px; }
.reseme-tpl-name { height: 12px; width: 60%; border-radius: 4px; background: var(--tpl); margin-bottom: 12px; }
.reseme-tpl-l { height: 7px; border-radius: 4px; background: #e7eaf0; margin-bottom: 8px; }
.reseme-tpl-label { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; }

/* Pricing */
.reseme-price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 980px; margin: 0 auto; }
.reseme-price { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.reseme-price.is-featured { border: 2px solid var(--red-600); box-shadow: 0 12px 34px rgba(229,57,53,.14); }
.reseme-price-name { font-size: 17px; font-weight: 700; }
.reseme-price-desc { color: var(--text-2); font-size: 13px; margin: 4px 0 14px; }
.reseme-price-amt { font-size: 2rem; font-weight: 800; margin-bottom: 16px; }
.reseme-price-perks { list-style: none; margin: 0 0 22px; display: flex; flex-direction: column; gap: 9px; }
.reseme-price-perks li { display: flex; gap: 8px; font-size: 13.5px; }
.reseme-price-perks svg { width: 16px; height: 16px; color: var(--green-600); flex-shrink: 0; }
.reseme-price .reseme-btn { margin-top: auto; }

/* Testimonials */
.reseme-review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-xs); height: 100%; }
.reseme-stars { color: #f6c000; display: flex; gap: 2px; margin-bottom: 10px; }
.reseme-stars svg { width: 15px; height: 15px; fill: #f6c000; }
.reseme-review p { color: var(--text-1); font-size: 14px; }
.reseme-review-by { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.reseme-avatar { width: 40px; height: 40px; border-radius: var(--r-full); color: #fff; font-weight: 700; display: grid; place-items: center; }
.reseme-review-by b { display: block; font-size: 14px; }
.reseme-review-by small { color: var(--text-3); }

/* FAQ (native details/summary — no JS) */
.reseme-faq { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.reseme-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.reseme-faq summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.reseme-faq summary::-webkit-details-marker { display: none; }
.reseme-faq summary::after { content: "+"; font-size: 20px; color: var(--red-600); font-weight: 400; }
.reseme-faq details[open] summary { color: var(--red-600); }
.reseme-faq details[open] summary::after { content: "\2212"; }
.reseme-faq-body { padding: 0 20px 18px; color: var(--text-2); font-size: 14px; }

/* CTA band */
.reseme-cta { background: var(--navy-900); color: #fff; padding: 64px 0; text-align: center; }
.reseme-cta h2 { color: #fff; font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.reseme-cta p { opacity: .8; margin: 12px 0 24px; }
.reseme-cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Motion (reveal on scroll) ===== */
.reseme-reveal { opacity: 0; transform: translateY(22px) scale(.98); transition: opacity .6s ease, transform .7s cubic-bezier(.34,1.35,.4,1); }
.reseme-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reseme-reveal { opacity: 1 !important; transform: none !important; } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .reseme-hero-grid { grid-template-columns: 1fr; }
    .reseme-hero-visual { order: -1; }
    .reseme-grid-3, .reseme-grid-4, .reseme-price-grid { grid-template-columns: 1fr; }
    .reseme-foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .reseme-nav-links, .reseme-nav-right .reseme-hide-sm { display: none; }
    .reseme-nav-toggle { display: inline-flex; }
    .reseme-nav.is-open .reseme-nav-links { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px; gap: 2px; }
    .reseme-grid-3, .reseme-grid-4 { grid-template-columns: 1fr; }
    .reseme-foot-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ==== Account: referrals, refunds, billing links ================== */
.reseme-invite-note { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.reseme-invite-note svg { width: 16px; height: 16px; color: var(--gold-500); flex-shrink: 0; }

/* Native <details> used as an inline popover for refund / resolve forms */
.reseme-refund { position: relative; display: inline-block; }
.reseme-refund > summary { list-style: none; cursor: pointer; }
.reseme-refund > summary::-webkit-details-marker { display: none; }
.reseme-refund-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.16)); padding: 14px; text-align: left; }

/* Referral hero */
.reseme-refhero { text-align: center; }
.reseme-refhero-ic { width: 56px; height: 56px; border-radius: var(--r-full); background: var(--gold-500); color: var(--navy-900); display: grid; place-items: center; margin: 0 auto 12px; }
.reseme-refhero-ic svg { width: 26px; height: 26px; }
.reseme-refhero h2 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.reseme-refhero p { max-width: 520px; margin: 0 auto; font-size: 13.5px; }
.reseme-copyrow { display: flex; gap: 8px; max-width: 520px; margin: 18px auto 8px; }
.reseme-copyrow .reseme-input { flex: 1; font-size: 13px; }
.reseme-refcode { font-size: 12.5px; color: var(--text-3); }
.reseme-refcode strong { color: var(--text-1); letter-spacing: .06em; }

/* Link tiles (subscription quick links) */
.reseme-linktiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.reseme-linktile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); transition: var(--transition); }
.reseme-linktile:hover { border-color: var(--red-400); background: var(--surface-2); }
.reseme-linktile .ic { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex-shrink: 0; }
.reseme-linktile .ic.gold { background: var(--gold-500); color: var(--navy-900); }
.reseme-linktile .ic svg { width: 18px; height: 18px; }
.reseme-linktile .tx { display: flex; flex-direction: column; }
.reseme-linktile .tx strong { font-size: 14px; }
.reseme-linktile .tx small { font-size: 12px; color: var(--text-3); }
.reseme-linktile .ch { margin-left: auto; width: 18px; height: 18px; color: var(--text-3); }

@media (max-width: 640px) {
    .reseme-linktiles { grid-template-columns: 1fr; }
    .reseme-refund-pop { position: fixed; left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; }
}

/* Every title/heading uses Title Case (first letter of each word capitalized). */
.reseme-page-title,
.reseme-panel-title,
.reseme-auth-title,
.reseme-card-header h3,
.reseme-sec-head h2,
.reseme-head .reseme-h2,
.reseme-empty h3,
.reseme-metric .lbl,
.reseme-nav-sec,
.reseme-linktile .tx strong { text-transform: capitalize; }
/* Opt-out for brand names / acronyms that must keep their exact casing. */
.reseme-page-title .reseme-exact,
.reseme-panel-title .reseme-exact,
.reseme-exact { text-transform: none; }

/* Footer social icons (admin-configured) */
.reseme-social { display: inline-flex; gap: 8px; }
.reseme-social a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--r-full); background: rgba(255,255,255,.10); color: inherit; transition: var(--transition); }
.reseme-social a:hover { background: var(--red-600); color: #fff; transform: translateY(-1px); }
.reseme-social svg { width: 17px; height: 17px; }

/* Two-column form grid (admin AI provider form, etc.) */
.reseme-formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 640px) { .reseme-formgrid { grid-template-columns: 1fr; } }

/* Key/value detail grids (payment & refund detail pages) */
.reseme-kvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.reseme-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.reseme-kv .k { color: var(--text-3); white-space: nowrap; }
.reseme-kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.reseme-kv .v.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 500; font-size: 12px; }
@media (max-width: 640px) { .reseme-kvgrid { grid-template-columns: 1fr; } }
