/*
 * School ERP theme on top of Tabler. Plain CSS, no build step.
 * Colours, font, size and corners come from the school's Appearance settings as CSS variables
 * (partials.head writes them after this file). Light and dark: <html data-bs-theme="light|dark">.
 * Animations are short, CSS-only, and off for "reduce motion", printing and html.erp-no-motion.
 */

/* ---------- Tokens ---------- */
:root {
    --erp-c1: #4f46e5; --erp-c2: #7c3aed; --erp-c3: #db2777; --erp-c1-rgb: 79, 70, 229;
    --erp-s1: #1e1b4b; --erp-s2: #312e81; --erp-s3: #4c1d95;
    --erp-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --erp-size: 16px;
    --erp-radius: 14px; --erp-radius-sm: 10px;
    --erp-ease: cubic-bezier(.22, .8, .36, 1);
}
:root, [data-bs-theme="light"] {
    --erp-bg: #f4f6fd;
    --erp-surface: #ffffff;
    --erp-surface-2: #f8f9ff;
    --erp-text: #1e293b;
    --erp-heading: #1e1b4b;
    --erp-muted: #64748b;
    --erp-line: color-mix(in srgb, var(--erp-c1) 9%, #e5e7eb);
    --erp-tint: color-mix(in srgb, var(--erp-c1) 6%, #ffffff);
    --erp-tint-2: color-mix(in srgb, var(--erp-c1) 12%, #ffffff);
    --erp-thead: color-mix(in srgb, var(--erp-c1) 70%, #1e1b4b);
    --erp-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
    --erp-shadow-hover: 0 4px 10px rgba(15, 23, 42, .07), 0 14px 32px rgba(var(--erp-c1-rgb), .16);
    --erp-glass: rgba(255, 255, 255, .82);
}
[data-bs-theme="dark"] {
    --erp-bg: #0b1020;
    --erp-surface: #131a2e;
    --erp-surface-2: #182038;
    --erp-text: #e2e8f0;
    --erp-heading: #f1f5f9;
    --erp-muted: #94a3b8;
    --erp-line: rgba(148, 163, 184, .16);
    --erp-tint: color-mix(in srgb, var(--erp-c1) 14%, #131a2e);
    --erp-tint-2: color-mix(in srgb, var(--erp-c1) 24%, #131a2e);
    --erp-thead: color-mix(in srgb, var(--erp-c1) 35%, #e0e7ff);
    --erp-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    --erp-shadow-hover: 0 6px 14px rgba(0, 0, 0, .45), 0 16px 36px rgba(var(--erp-c1-rgb), .25);
    --erp-glass: rgba(19, 26, 46, .82);
    --tblr-body-bg: var(--erp-bg);
    --tblr-bg-surface: var(--erp-surface);
    --tblr-bg-surface-secondary: var(--erp-surface-2);
    --tblr-body-color: var(--erp-text);
    --tblr-border-color: var(--erp-line);
    color-scheme: dark;
}
:root, [data-bs-theme] {
    --erp-grad: linear-gradient(135deg, var(--erp-c1) 0%, var(--erp-c2) 55%, var(--erp-c3) 100%);
    --erp-grad-btn: linear-gradient(135deg, var(--erp-c1), var(--erp-c2));
    --erp-grad-soft: linear-gradient(135deg, rgba(var(--erp-c1-rgb), .10), color-mix(in srgb, var(--erp-c3) 9%, transparent));
    --tblr-primary: var(--erp-c1);
    --tblr-primary-rgb: var(--erp-c1-rgb);
    --tblr-link-color: var(--erp-c1);
    --tblr-link-color-rgb: var(--erp-c1-rgb);
    --tblr-font-sans-serif: var(--erp-font);
    --tblr-border-radius: var(--erp-radius-sm);
    --tblr-card-border-radius: var(--erp-radius);
}
[data-bs-theme="dark"] { --tblr-link-color: color-mix(in srgb, var(--erp-c1) 45%, #ffffff); }

html { font-size: var(--erp-size); }
body {
    font-family: var(--erp-font);
    background: var(--erp-bg);
    background-image:
        radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--erp-c2) 8%, transparent), transparent 60%),
        radial-gradient(900px 400px at -10% 110%, color-mix(in srgb, var(--erp-c3) 6%, transparent), transparent 60%);
    background-attachment: fixed;
    color: var(--erp-text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .page-title, .card-title { color: var(--erp-heading); }
.text-secondary, .text-muted, .form-hint { color: var(--erp-muted) !important; }
a { color: var(--tblr-link-color); }

.ti { font-size: 1.15em; vertical-align: -.15em; }
.nav-link .ti { margin-right: .5rem; }
a, .btn, .nav-link, .card, .form-control, .form-select, .dropdown-item, .badge, .list-group-item {
    transition: color .2s var(--erp-ease), background-color .2s var(--erp-ease), border-color .2s var(--erp-ease),
                box-shadow .25s var(--erp-ease), transform .25s var(--erp-ease), opacity .2s var(--erp-ease);
}

/* ---------- Top loading bar (erp-ui.js) ---------- */
#erp-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000;
    background: var(--erp-grad); box-shadow: 0 0 10px rgba(var(--erp-c1-rgb), .6);
    transition: width .4s var(--erp-ease), opacity .3s ease; opacity: 0;
}
#erp-progress.on { opacity: 1; }

/* ---------- Sidebar (menu style: gradient / dark / light) ---------- */
:root { --erp-side-bg: linear-gradient(180deg, var(--erp-s1) 0%, var(--erp-s2) 55%, var(--erp-s3) 100%); --erp-side-text: rgba(255, 255, 255, .78); --erp-side-strong: #fff; --erp-side-hover: rgba(255, 255, 255, .08); --erp-side-head: rgba(255, 255, 255, .5); --erp-side-line: rgba(255, 255, 255, .14); }
.erp-side-dark { --erp-side-bg: #0f172a; }
.erp-side-light { --erp-side-bg: var(--erp-surface); --erp-side-text: var(--erp-muted); --erp-side-strong: var(--erp-heading); --erp-side-hover: var(--erp-tint); --erp-side-head: var(--erp-muted); --erp-side-line: var(--erp-line); }
.navbar-vertical.navbar-expand-lg { background: var(--erp-side-bg) !important; border-right: 1px solid var(--erp-line); box-shadow: 4px 0 24px rgba(15, 23, 42, .12); }
.erp-side-light .navbar-vertical .navbar-toggler-icon { filter: invert(.6); }
.navbar-vertical .navbar-brand { padding: .25rem 0; }
.erp-brand { display: flex; align-items: center; gap: .65rem; color: var(--erp-side-strong) !important; text-decoration: none !important; font-weight: 700; line-height: 1.2; white-space: normal; text-align: left; }
header .erp-brand { color: #fff !important; }
.erp-brand-logo { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.erp-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.erp-brand-logo span { font-weight: 800; font-size: 1.2rem; background: var(--erp-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.navbar-vertical .nav-link { color: var(--erp-side-text) !important; border-radius: var(--erp-radius-sm); margin: 1px .5rem; padding: .5rem .75rem; }
.navbar-vertical .nav-link:hover { color: var(--erp-side-strong) !important; background: var(--erp-side-hover); transform: translateX(3px); }
.navbar-vertical .nav-item.active > .nav-link { color: #fff !important; font-weight: 600; background: var(--erp-grad-btn); box-shadow: 0 6px 18px rgba(var(--erp-c1-rgb), .45); }
.navbar-vertical .nav-item.active > .nav-link .ti { animation: erp-pop .4s var(--erp-ease); }
.navbar-vertical .erp-menu-heading { color: var(--erp-side-head) !important; font-size: .68rem; letter-spacing: .08em; font-weight: 700; }
.navbar-vertical .erp-submenu { border-left: 2px solid var(--erp-side-line); margin-left: 1.6rem !important; padding-left: .25rem; animation: erp-fade-down .3s var(--erp-ease) both; }
.navbar-vertical .erp-submenu .nav-link { margin: 0; padding: .32rem .6rem; color: var(--erp-side-text) !important; opacity: 1; }
.navbar-vertical .erp-submenu .nav-link:hover { color: var(--erp-side-strong) !important; }
.navbar-vertical .erp-submenu .nav-link.erp-current { color: var(--erp-side-strong) !important; background: var(--erp-side-hover); font-weight: 600; box-shadow: inset 3px 0 0 var(--erp-c2); }

/* ---------- Top bar ---------- */
.page-wrapper > header.navbar {
    position: sticky; top: 0; z-index: 1020;
    background: var(--erp-glass) !important;
    backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--erp-line);
}
.avatar.erp-avatar { background: var(--erp-grad); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(var(--erp-c1-rgb), .35); }
.erp-mode-toggle { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--erp-line); background: var(--erp-surface); color: var(--erp-heading); }
.erp-mode-toggle:hover { transform: rotate(20deg); box-shadow: var(--erp-shadow); }
header[data-bs-theme="dark"] .erp-mode-toggle { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.dropdown-menu { background: var(--erp-surface); border: 1px solid var(--erp-line); border-radius: 12px; box-shadow: 0 12px 40px rgba(15, 23, 42, .18); animation: erp-fade-down .18s var(--erp-ease); }
.dropdown-item { border-radius: 8px; margin: 0 .35rem; width: auto; color: var(--erp-text); }
.dropdown-item:hover { background: var(--erp-tint); color: var(--erp-heading); }

/* Platform and portal top navigation */
header.navbar[data-bs-theme="dark"] { background: linear-gradient(90deg, var(--erp-s2), var(--erp-c2) 60%, var(--erp-c3)) !important; box-shadow: 0 4px 20px rgba(15, 23, 42, .25); }

/* ---------- Page header ---------- */
.page-header { margin-top: 1.25rem; }
.page-title { font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: .6rem; }
.page-title::before { content: ""; width: 6px; height: 1.4em; border-radius: 6px; background: var(--erp-grad); display: inline-block; }
.page-subtitle { color: var(--erp-muted); margin-top: .15rem; font-size: .9rem; }

/* ---------- Page enter animation ---------- */
.page-body > .container-xl > *, .page-body > .container-xl > .row > * { animation: erp-fade-up .45s var(--erp-ease) both; }
.page-body > .container-xl > *:nth-child(2), .page-body > .container-xl > .row > *:nth-child(2) { animation-delay: .05s; }
.page-body > .container-xl > *:nth-child(3), .page-body > .container-xl > .row > *:nth-child(3) { animation-delay: .1s; }
.page-body > .container-xl > *:nth-child(4), .page-body > .container-xl > .row > *:nth-child(4) { animation-delay: .15s; }
.page-body > .container-xl > *:nth-child(n+5) { animation-delay: .2s; }
.row-cards > * { animation: erp-fade-up .5s var(--erp-ease) both; }
.row-cards > *:nth-child(2) { animation-delay: .06s; }
.row-cards > *:nth-child(3) { animation-delay: .12s; }
.row-cards > *:nth-child(4) { animation-delay: .18s; }
.row-cards > *:nth-child(n+5) { animation-delay: .24s; }

/* ---------- Cards ---------- */
.card { background: var(--erp-surface); border: 1px solid var(--erp-line); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow); color: var(--erp-text); }
.card-header { background: transparent; border-bottom: 1px solid var(--erp-line); }
.card-title { font-weight: 700; }
.card-footer { background: var(--erp-surface-2); border-top: 1px solid var(--erp-line); }
.row-cards .card:hover, .card-link:hover, .erp-tile:hover, .erp-report-card:hover { transform: translateY(-3px); box-shadow: var(--erp-shadow-hover); }
.list-group-item { background: var(--erp-surface); border-color: var(--erp-line); color: var(--erp-text); }

/* Tabs: pills with a coloured active tab */
.nav-tabs { border-bottom: 1px solid var(--erp-line); gap: .25rem; flex-wrap: wrap; }
.nav-tabs .nav-link { border: 0; border-radius: var(--erp-radius-sm) var(--erp-radius-sm) 0 0; color: var(--erp-muted); font-weight: 600; padding: .55rem .9rem; position: relative; }
.nav-tabs .nav-link:hover { color: var(--erp-c1); background: var(--erp-tint); }
.nav-tabs .nav-link.active { color: var(--erp-c1); background: var(--erp-tint); }
.nav-tabs .nav-link.active::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 3px; border-radius: 3px; background: var(--erp-grad-btn); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active, [data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: var(--tblr-link-color); }
.nav-pills .nav-link.active { background: var(--erp-grad-btn); }

/* Colourful stat tiles */
.erp-tile { position: relative; overflow: hidden; border: 0; }
.erp-tile .card-body { position: relative; z-index: 1; }
.erp-tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--tile-soft); transition: transform .5s var(--erp-ease); }
.erp-tile:hover::after { transform: scale(1.25); }
.erp-tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--tile-grad); box-shadow: 0 6px 16px var(--tile-shadow); flex: none; }
.erp-tile-icon .ti { font-size: 1.4rem; }
.erp-tile-label { color: var(--erp-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.erp-tile-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; color: var(--erp-heading); }
.erp-tile-value a { color: inherit; text-decoration: none; }
.tile-indigo { --tile-grad: var(--erp-grad-btn); --tile-soft: rgba(var(--erp-c1-rgb), .10); --tile-shadow: rgba(var(--erp-c1-rgb), .4); }
.tile-emerald { --tile-grad: linear-gradient(135deg, #10b981, #14b8a6); --tile-soft: rgba(16, 185, 129, .10); --tile-shadow: rgba(16, 185, 129, .4); }
.tile-amber { --tile-grad: linear-gradient(135deg, #f59e0b, #f97316); --tile-soft: rgba(245, 158, 11, .12); --tile-shadow: rgba(245, 158, 11, .4); }
.tile-rose { --tile-grad: linear-gradient(135deg, #f43f5e, #ec4899); --tile-soft: rgba(244, 63, 94, .10); --tile-shadow: rgba(244, 63, 94, .4); }
.tile-sky { --tile-grad: linear-gradient(135deg, #0ea5e9, #6366f1); --tile-soft: rgba(14, 165, 233, .10); --tile-shadow: rgba(14, 165, 233, .4); }
.tile-violet { --tile-grad: linear-gradient(135deg, #8b5cf6, #d946ef); --tile-soft: rgba(139, 92, 246, .10); --tile-shadow: rgba(139, 92, 246, .4); }

/* Welcome banner */
.erp-hero { background: var(--erp-grad); color: #fff; border: 0; overflow: hidden; position: relative; }
.erp-hero h2, .erp-hero h3 { color: #fff; }
.erp-hero::before, .erp-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.erp-hero::before { width: 260px; height: 260px; right: -60px; top: -120px; animation: erp-float 9s ease-in-out infinite; }
.erp-hero::after { width: 160px; height: 160px; right: 160px; bottom: -90px; animation: erp-float 11s ease-in-out infinite reverse; }
.erp-hero .card-body { position: relative; z-index: 1; }
.erp-hero .text-secondary, .erp-hero .text-muted { color: rgba(255, 255, 255, .82) !important; }
.erp-hero .badge { background: rgba(255, 255, 255, .18) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .25); }

/* Quick links (module home pages) */
.erp-quick { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-radius: var(--erp-radius); background: var(--erp-surface); border: 1px solid var(--erp-line); box-shadow: var(--erp-shadow); color: var(--erp-text) !important; text-decoration: none !important; height: 100%; }
.erp-quick:hover { transform: translateY(-3px); box-shadow: var(--erp-shadow-hover); border-color: rgba(var(--erp-c1-rgb), .35); }
.erp-quick .erp-tile-icon { width: 40px; height: 40px; }
.erp-quick-title { font-weight: 700; color: var(--erp-heading); }
.erp-quick-text { font-size: .8rem; color: var(--erp-muted); }

/* Empty states */
.erp-empty { text-align: center; padding: 2.5rem 1rem; color: var(--erp-muted); }
.erp-empty .ti { font-size: 2.6rem; display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--erp-tint); color: var(--erp-c1); margin-bottom: .75rem; }
.erp-empty-title { font-weight: 700; color: var(--erp-heading); margin-bottom: .2rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--erp-radius-sm); font-weight: 600; }
.btn:not(.btn-link):hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:not([class*="btn-"]), .btn-outline-secondary { background: var(--erp-surface); border-color: var(--erp-line); color: var(--erp-text); }
.btn:not([class*="btn-"]):hover { border-color: rgba(var(--erp-c1-rgb), .4); color: var(--erp-c1); background: var(--erp-tint); }
.btn-primary { background: var(--erp-grad-btn); border: 0; color: #fff; box-shadow: 0 4px 14px rgba(var(--erp-c1-rgb), .35); }
.btn-primary:hover, .btn-primary:focus { background: var(--erp-grad-btn); filter: brightness(1.08); color: #fff; box-shadow: 0 8px 22px rgba(var(--erp-c1-rgb), .45); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); border: 0; box-shadow: 0 4px 14px rgba(5, 150, 105, .3); }
.btn-danger { background: linear-gradient(135deg, #e11d48, #f43f5e); border: 0; box-shadow: 0 4px 14px rgba(225, 29, 72, .3); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #f97316); border: 0; color: #fff; box-shadow: 0 4px 14px rgba(245, 158, 11, .3); }
.btn-info { background: linear-gradient(135deg, #0ea5e9, #6366f1); border: 0; color: #fff; }
.btn-sm { border-radius: calc(var(--erp-radius-sm) - 2px); }

/* ---------- Forms ---------- */
.form-control, .form-select, .input-group-text { border-radius: var(--erp-radius-sm); border-color: var(--erp-line); background-color: var(--erp-surface); color: var(--erp-text); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--erp-c1-rgb), .55); box-shadow: 0 0 0 4px rgba(var(--erp-c1-rgb), .15); background-color: var(--erp-surface); color: var(--erp-text); }
.form-control::placeholder { color: var(--erp-muted); opacity: .75; }
.form-label { font-weight: 600; color: var(--erp-heading); }
.form-check-input:checked { background-color: var(--erp-c1); border-color: var(--erp-c1); }
.form-control-color { width: 3.2rem; padding: .25rem; }

/* ---------- Tables ---------- */
.table { --tblr-table-bg: transparent; color: var(--erp-text); border-color: var(--erp-line); }
.table > :not(caption) > * > * { border-bottom-color: var(--erp-line); color: inherit; }
.table > thead th, .card-table > thead th {
    background: var(--erp-tint) !important; color: var(--erp-thead) !important; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    border-bottom: 1px solid var(--erp-line);
}
.table > tbody > tr:hover > *, .card-table > tbody > tr:hover > * { background: rgba(var(--erp-c1-rgb), .045); }
.table > tbody > tr { animation: erp-fade-in .35s ease both; }
.table tfoot td, .table tfoot th, tr.erp-total > * { font-weight: 700; background: var(--erp-surface-2); }
.erp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Badges, status pills and alerts ---------- */
.badge { border-radius: 999px; font-weight: 600; }
.erp-status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.erp-status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.erp-status-green { color: #047857; background: rgba(16, 185, 129, .13); }
.erp-status-amber { color: #b45309; background: rgba(245, 158, 11, .15); }
.erp-status-red { color: #be123c; background: rgba(244, 63, 94, .13); }
.erp-status-blue { color: #1d4ed8; background: rgba(59, 130, 246, .13); }
.erp-status-grey { color: #475569; background: rgba(100, 116, 139, .14); }
[data-bs-theme="dark"] .erp-status-green { color: #6ee7b7; }
[data-bs-theme="dark"] .erp-status-amber { color: #fcd34d; }
[data-bs-theme="dark"] .erp-status-red { color: #fda4af; }
[data-bs-theme="dark"] .erp-status-blue { color: #93c5fd; }
[data-bs-theme="dark"] .erp-status-grey { color: #cbd5e1; }
.alert { border: 0; border-left: 4px solid currentColor; border-radius: 12px; box-shadow: var(--erp-shadow); animation: erp-slide-in .4s var(--erp-ease) both; }
.alert.erp-hide { opacity: 0; transform: translateY(-6px); transition: opacity .4s ease, transform .4s ease; }
.alert-success { background: #ecfdf5; color: #047857; }
.alert-danger { background: #fff1f2; color: #be123c; }
.alert-info { background: #eff6ff; color: #1d4ed8; }
.alert-warning { background: #fffbeb; color: #b45309; }
[data-bs-theme="dark"] .alert-success { background: rgba(16, 185, 129, .14); color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger { background: rgba(244, 63, 94, .14); color: #fda4af; }
[data-bs-theme="dark"] .alert-info { background: rgba(59, 130, 246, .14); color: #93c5fd; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .14); color: #fcd34d; }
.page-item.active .page-link { background: var(--erp-grad-btn); border: 0; }
.page-link { background: var(--erp-surface); border-color: var(--erp-line); color: var(--erp-text); }
code { color: var(--erp-c3); background: var(--erp-tint); padding: .1rem .35rem; border-radius: 6px; }

/* Buttons that are submitting (erp-ui.js) */
.btn.erp-busy { pointer-events: none; opacity: .85; }
.btn.erp-busy::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .5em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: erp-spin .7s linear infinite; }

/* ---------- Reports ---------- */
.erp-report-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.erp-report-card { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; border-radius: var(--erp-radius-sm); border: 1px solid var(--erp-line); background: var(--erp-surface); color: var(--erp-text) !important; text-decoration: none !important; font-weight: 600; font-size: .86rem; }
.erp-report-card .erp-tile-icon { width: 34px; height: 34px; border-radius: 10px; }
.erp-report-card .erp-tile-icon .ti { font-size: 1.1rem; }
.erp-report-card.active { border-color: transparent; background: var(--erp-grad-btn); color: #fff !important; box-shadow: 0 8px 20px rgba(var(--erp-c1-rgb), .35); }
.erp-report-card.active .erp-tile-icon { background: rgba(255, 255, 255, .22); box-shadow: none; }
.erp-report-group { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--erp-muted); margin: .25rem 0 .4rem; }
.erp-filter { background: var(--erp-surface-2); border-radius: var(--erp-radius); padding: .9rem 1rem; border: 1px dashed var(--erp-line); }

/* ---------- Import stepper and drop zone ---------- */
.erp-steps { display: flex; gap: .5rem; counter-reset: step; flex-wrap: wrap; }
.erp-step { flex: 1 1 160px; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: var(--erp-radius-sm); background: var(--erp-surface); border: 1px solid var(--erp-line); font-weight: 600; font-size: .86rem; color: var(--erp-muted); }
.erp-step::before { counter-increment: step; content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--erp-tint-2); color: var(--erp-c1); font-weight: 800; }
.erp-step.done::before { content: "✓"; background: #10b981; color: #fff; }
.erp-step.current { color: var(--erp-heading); border-color: rgba(var(--erp-c1-rgb), .4); box-shadow: 0 0 0 4px rgba(var(--erp-c1-rgb), .08); }
.erp-step.current::before { background: var(--erp-grad-btn); color: #fff; }
.erp-drop { position: relative; display: block; border: 2px dashed rgba(var(--erp-c1-rgb), .35); border-radius: var(--erp-radius); background: var(--erp-tint); padding: 1.8rem 1rem; text-align: center; cursor: pointer; }
.erp-drop:hover, .erp-drop.over { border-color: var(--erp-c1); background: var(--erp-tint-2); }
.erp-drop.over { transform: scale(1.01); }
.erp-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.erp-drop .ti { font-size: 2.2rem; color: var(--erp-c1); }
.erp-drop-name { font-weight: 700; color: var(--erp-heading); }

/* ---------- Login pages ---------- */
body.erp-auth { background: linear-gradient(-45deg, var(--erp-s2), var(--erp-c2), var(--erp-c3), var(--erp-c1)); background-size: 400% 400%; animation: erp-gradient 18s ease infinite; min-height: 100vh; }
.erp-auth .erp-blob { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .45; z-index: 0; pointer-events: none; }
.erp-auth .erp-blob.b1 { width: 380px; height: 380px; background: color-mix(in srgb, var(--erp-c2) 60%, #fff); top: -80px; left: -80px; animation: erp-float 12s ease-in-out infinite; }
.erp-auth .erp-blob.b2 { width: 320px; height: 320px; background: color-mix(in srgb, var(--erp-c3) 60%, #fff); bottom: -60px; right: -60px; animation: erp-float 14s ease-in-out infinite reverse; }
.erp-auth .page { position: relative; z-index: 1; background: transparent; }
.erp-auth .card { background: var(--erp-glass); backdrop-filter: blur(12px); border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(17, 12, 60, .35); animation: erp-rise .6s var(--erp-ease) both; }
.erp-auth h1 { color: #fff; font-weight: 800; text-shadow: 0 2px 12px rgba(0, 0, 0, .2); animation: erp-fade-down .5s var(--erp-ease) both; }
.erp-auth-logo { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto .9rem; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); animation: erp-pop .6s var(--erp-ease) both; }
.erp-auth-logo img { width: 100%; height: 100%; object-fit: contain; }
.erp-auth-logo span { font-size: 2rem; font-weight: 800; background: var(--erp-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.erp-auth-foot { color: rgba(255, 255, 255, .75); }

/* ---------- Logo boxes ---------- */
.logo-box { width: 72px; height: 72px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: var(--erp-grad-soft); border: 1px dashed rgba(var(--erp-c1-rgb), .3); flex: none; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-placeholder { font-size: 1.8rem; font-weight: 800; color: var(--erp-c1); }

/* ---------- Appearance page ---------- */
.erp-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.erp-swatch { position: relative; border: 2px solid var(--erp-line); border-radius: var(--erp-radius-sm); padding: .5rem; cursor: pointer; background: var(--erp-surface); text-align: center; font-weight: 600; font-size: .82rem; }
.erp-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.erp-swatch .erp-swatch-colours { height: 42px; border-radius: 8px; margin-bottom: .4rem; }
.erp-swatch:hover { transform: translateY(-2px); box-shadow: var(--erp-shadow); }
.erp-swatch:has(input:checked) { border-color: var(--erp-c1); box-shadow: 0 0 0 4px rgba(var(--erp-c1-rgb), .15); }
.erp-swatch:has(input:checked)::after { content: "✓"; position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--erp-c1); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.erp-choice { display: flex; flex-wrap: wrap; gap: .4rem; }
.erp-choice label { cursor: pointer; }
.erp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.erp-choice span { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--erp-line); background: var(--erp-surface); font-weight: 600; font-size: .85rem; }
.erp-choice input:checked + span { background: var(--erp-grad-btn); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(var(--erp-c1-rgb), .3); }
.erp-choice input:focus-visible + span { outline: 2px solid var(--erp-c1); outline-offset: 2px; }
.erp-preview { position: sticky; top: 80px; }
.erp-mini { display: flex; height: 260px; border-radius: var(--erp-radius); overflow: hidden; border: 1px solid var(--erp-line); background: var(--erp-bg); box-shadow: var(--erp-shadow); }
.erp-mini-side { width: 30%; background: var(--erp-side-bg); padding: .6rem .4rem; }
.erp-mini-side i { display: block; height: 8px; border-radius: 4px; background: var(--erp-side-line); margin: .45rem .3rem; }
.erp-mini-side i.on { height: 16px; background: var(--erp-grad-btn); }
.erp-mini-main { flex: 1; padding: .7rem; display: flex; flex-direction: column; gap: .5rem; }
.erp-mini-hero { height: 54px; border-radius: var(--erp-radius-sm); background: var(--erp-grad); }
.erp-mini-row { display: flex; gap: .5rem; }
.erp-mini-card { flex: 1; height: 54px; border-radius: var(--erp-radius-sm); background: var(--erp-surface); border: 1px solid var(--erp-line); padding: .4rem; }
.erp-mini-card b { display: block; width: 18px; height: 18px; border-radius: 6px; background: var(--erp-grad-btn); }
.erp-section-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--erp-heading); margin-bottom: .75rem; }
.erp-section-title .ti { color: var(--erp-c1); }

/* ---------- Receipts ---------- */
.receipt-colour { position: relative; overflow: hidden; }
.receipt-colour::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--erp-grad); }
.receipt-head { display: flex; align-items: center; gap: 1rem; padding-bottom: .9rem; margin-bottom: 1rem; border-bottom: 2px dashed rgba(var(--erp-c1-rgb), .25); }
.receipt-head.centered { flex-direction: column; text-align: center; gap: .4rem; }
.receipt-head.centered .text-end { text-align: center !important; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.receipt-head.compact { gap: .6rem; padding-bottom: .5rem; }
.receipt-head.compact .receipt-logo { width: 40px; height: 40px; border-radius: 10px; }
.receipt-head.compact h2 { font-size: 1.1rem; }
.receipt-logo { width: 68px; height: 68px; flex: none; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: #fff; border: 1px solid rgba(var(--erp-c1-rgb), .15); }
.receipt-logo img { width: 100%; height: 100%; object-fit: contain; }
.receipt-logo span { font-size: 1.9rem; font-weight: 800; color: var(--erp-c1); }
.receipt-badge { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: var(--erp-grad); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.receipt-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; font-size: 1.05rem; color: var(--erp-c1); margin: .2rem 0; }
.receipt-table thead th { background: var(--erp-tint) !important; }
.receipt-stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 4.5rem; font-weight: 900; color: rgba(225, 29, 72, .14); border: 8px solid rgba(225, 29, 72, .14); padding: 0 1.5rem; border-radius: 16px; pointer-events: none; letter-spacing: .1em; }
/* Black and white receipts */
.receipt-mono::before { background: #111 !important; }
.receipt-mono .receipt-badge { background: #111; }
.receipt-mono .receipt-no, .receipt-mono .receipt-logo span { color: #111; }
.receipt-mono .receipt-head { border-bottom-color: #999; }
.receipt-mono .receipt-table thead th { background: #f1f1f1 !important; color: #111 !important; }

/* ---------- Spacing: compact ---------- */
.erp-compact .card-body { padding: .9rem 1rem; }
.erp-compact .card-header, .erp-compact .card-footer { padding: .6rem 1rem; }
.erp-compact .table > :not(caption) > * > * { padding-top: .35rem; padding-bottom: .35rem; }
.erp-compact .page-header { margin-top: .75rem; }
.erp-compact .page-body { margin-top: .75rem; }
.erp-compact .navbar-vertical .nav-link { padding-top: .35rem; padding-bottom: .35rem; }

.footer { border-top: 0; }

/* ---------- Keyframes ---------- */
@keyframes erp-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes erp-fade-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes erp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes erp-slide-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes erp-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes erp-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes erp-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, 22px); } }
@keyframes erp-gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes erp-spin { to { transform: rotate(360deg); } }

.erp-no-motion *, .erp-no-motion *::before, .erp-no-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    :root, [data-bs-theme] { --erp-bg: #fff; --erp-surface: #fff; --erp-text: #111; --erp-heading: #111; --erp-muted: #444; --erp-line: #ddd; color-scheme: light; }
    body { background: #fff !important; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .card { box-shadow: none !important; }
    #erp-progress, .erp-mode-toggle { display: none; }
    .receipt-colour::before, .receipt-badge, .receipt-table thead th, .table > thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
[data-bs-theme="dark"] .receipt-no, [data-bs-theme="dark"] .receipt-logo span { color: var(--tblr-link-color); }
