@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --brand: #4263eb;
    --brand-strong: #3154dc;
    --brand-soft: #edf2ff;
    --app-bg: #f4f7fc;
    --surface: #fff;
    --surface-muted: #f8faff;
    --line: #e9edf5;
    --ink: #1d273b;
    --muted: #8290a6;
    --shadow: 0 12px 40px rgba(27, 47, 94, .055);
    --sidebar-width: 258px;
    color-scheme: light;
}

[data-bs-theme="dark"] {
    --brand: #7892ff;
    --brand-strong: #91a5ff;
    --brand-soft: #252e4d;
    --app-bg: #101522;
    --surface: #171e2e;
    --surface-muted: #1e2739;
    --line: #2a3448;
    --ink: #e5eaf5;
    --muted: #9ba8bd;
    --shadow: 0 12px 40px rgba(0, 0, 0, .16);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--app-bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--app-bg); color: var(--ink); font-family: 'DM Sans', system-ui, sans-serif; font-size: 14px; transition: background-color .28s ease, color .28s ease; }
h1, h2, h3, .brand-mark { font-family: 'Manrope', 'DM Sans', sans-serif; letter-spacing: -.035em; }
a { text-decoration: none; }
button, a, .form-control, .form-select, .panel-card, .stat-card, .app-card, .side-link, .icon-button, .btn { transition: color .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease, opacity .22s ease; }
.text-primary { color: var(--brand) !important; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong); --bs-btn-active-bg: var(--brand-strong); --bs-btn-active-border-color: var(--brand-strong); --bs-btn-focus-shadow-rgb: 66, 99, 235; box-shadow: 0 7px 16px rgba(66, 99, 235, .18); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(66, 99, 235, .25); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #cfd8ff; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff; }
.form-control, .form-select { min-height: 42px; border-color: var(--line); background-color: var(--surface); color: var(--ink); font-size: 13px; border-radius: 9px; }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-control:focus, .form-select:focus { border-color: var(--brand); background-color: var(--surface); color: var(--ink); box-shadow: 0 0 0 .22rem rgba(66, 99, 235, .13); }
.form-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.form-check-input { cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-enter { animation: page-in .42s cubic-bezier(.2,.7,.2,1) both; }
.page-leaving { opacity: 0; transform: translateY(-5px); transition: opacity .13s ease, transform .13s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.stagger-item { animation: item-in .5s cubic-bezier(.2,.7,.2,1) both; }
.stagger-item:nth-child(2) { animation-delay: .045s; }
.stagger-item:nth-child(3) { animation-delay: .09s; }
.stagger-item:nth-child(4) { animation-delay: .135s; }
@keyframes item-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 1030; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 27px 18px 17px; background: var(--surface); border-right: 1px solid var(--line); transition: transform .3s ease, background-color .28s ease; }
.brand-mark { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; font-size: 17px; line-height: 1.15; }
.brand-mark:hover { color: var(--ink); }
.brand-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #5779ff, #3554dc); color: white; font-size: 18px; box-shadow: 0 7px 16px rgba(66, 99, 235, .24); }
.brand-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-mark small { display: block; margin-top: 5px; color: var(--muted); font: 700 8px 'DM Sans', sans-serif; letter-spacing: .13em; }
.sidebar-label { margin: 39px 11px 12px; color: #a7b1c2; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.side-nav { display: grid; gap: 5px; }
.side-link { display: flex; align-items: center; gap: 13px; min-height: 45px; padding: 0 12px; color: var(--muted); border-radius: 10px; font-size: 13px; font-weight: 600; }
.side-link i { width: 19px; font-size: 16px; }
.side-link:hover { color: var(--brand); background: var(--brand-soft); transform: translateX(2px); }
.side-link.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.support-card { display: grid; grid-template-columns: 35px 1fr; gap: 3px 10px; align-items: center; margin: 0 1px 18px; padding: 14px 12px; background: linear-gradient(135deg, var(--brand-soft), transparent); border: 1px solid var(--line); border-radius: 13px; }
.support-icon { grid-row: span 2; display: grid; width: 33px; height: 33px; place-items: center; color: var(--brand); background: var(--surface); border-radius: 10px; }
.support-card strong { font-size: 11px; }
.support-card small { color: var(--muted); font-size: 10px; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 13px 3px 2px; border-top: 1px solid var(--line); }
.avatar { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; color: #fff; background: linear-gradient(140deg, #7790ff, #475fe1); border-radius: 12px; font-weight: 700; }
.profile-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
.profile-copy b { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: var(--muted); font-size: 10px; }
.profile-row form { margin: 0; }
.icon-button { display: inline-grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: 17px; }
.icon-button:hover { color: var(--brand); background: var(--brand-soft); border-color: var(--line); }
.main-content { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 1020; top: 0; display: flex; align-items: center; min-height: 70px; padding: 0 38px; background: color-mix(in srgb, var(--app-bg) 88%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); backdrop-filter: blur(16px); }
.crumb { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; }
.crumb i { font-size: 9px; }
.crumb strong { color: var(--ink); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 17px; margin-left: auto; }
.server-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.server-status i { width: 7px; height: 7px; background: #27c98b; border-radius: 50%; box-shadow: 0 0 0 4px rgba(39, 201, 139, .12); }
.theme-toggle { background: var(--surface); border-color: var(--line); }
.mobile-menu { display: none; margin-right: 9px; }
.content-wrap { width: min(100%, 1500px); margin: 0 auto; padding: 34px 38px 20px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 7px; font-size: clamp(24px, 2.2vw, 30px); font-weight: 800; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.stat-card, .panel-card, .app-card { height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.stat-card { min-height: 138px; padding: 18px; }
.stat-card:hover, .app-card:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(27, 47, 94, .1); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; font-size: 16px; }
.stat-icon.blue { color: #4263eb; background: #edf2ff; }
.stat-icon.violet { color: #7950d8; background: #f3edff; }
.stat-icon.cyan { color: #1496b8; background: #e8f9ff; }
.stat-icon.orange { color: #e89536; background: #fff5e8; }
[data-bs-theme="dark"] .stat-icon { background: var(--surface-muted); }
.stat-value { margin-top: 14px; font-family: 'Manrope', sans-serif; font-size: 29px; font-weight: 800; letter-spacing: -.045em; }
.stat-note { margin-top: 1px; color: var(--muted); font-size: 10px; }
.panel-card { padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.panel-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 800; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.text-link { color: var(--brand); font-size: 11px; font-weight: 700; }
.text-link:hover { color: var(--brand-strong); }
.count-pill { padding: 3px 8px; color: var(--brand); background: var(--brand-soft); border-radius: 20px; font: 700 10px 'DM Sans', sans-serif; }
.today-count { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 7px 9px; font-size: 10px; font-weight: 700; }
.usage-row { margin-top: 19px; }
.usage-label { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.usage-label > div { display: grid; flex: 1; gap: 3px; }
.usage-label b { font-size: 11px; }
.usage-label small { color: var(--muted); font-size: 10px; }
.usage-label > strong { color: var(--muted); font-size: 10px; }
.app-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; }
.progress { height: 6px; background: var(--surface-muted); border-radius: 8px; }
.progress-bar { background: linear-gradient(90deg, #6682ff, var(--brand)); border-radius: 8px; transition: width .8s cubic-bezier(.2,.7,.2,1); }
.activity-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.activity-icon { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 9px; }
.activity-icon.success { color: #0c9d6f; background: #e7f9f2; }
.activity-icon.neutral { color: var(--brand); background: var(--brand-soft); }
.activity-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
.activity-copy b { overflow: hidden; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; }
.activity-copy small, .activity-row time { color: var(--muted); font-size: 9px; }
.activity-row time { white-space: nowrap; }
.empty-state { display: flex; min-height: 174px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.empty-state > span { display: grid; width: 41px; height: 41px; margin-bottom: 3px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 13px; font-size: 18px; }
.empty-state b { font-size: 12px; }
.empty-state small { color: var(--muted); font-size: 10px; }
.empty-state.compact { min-height: 155px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 25px 1px 0; color: var(--muted); font-size: 10px; }

.generator-card { padding: 20px; background: linear-gradient(125deg, var(--surface), var(--brand-soft)); }
.generator-icon { display: grid; width: 37px; height: 37px; place-items: center; color: var(--brand); background: var(--surface); border-radius: 11px; }
.helper-text { color: var(--muted); font-size: 10px; }
.filter-form { display: flex; align-items: center; gap: 8px; }
.filter-form .form-select { width: auto; min-width: 128px; height: 38px; min-height: 38px; padding-top: 5px; padding-bottom: 5px; font-size: 11px; }
.search-input { width: 210px; height: 38px; min-height: 38px; font-size: 11px; }
.filter-form .btn { height: 38px; color: var(--muted); background: var(--surface-muted); border: 1px solid var(--line); }
.data-table { margin-bottom: 0; color: var(--ink); font-size: 11px; }
.data-table > :not(caption) > * > * { padding: 13px 10px; color: inherit; background: transparent; border-bottom-color: var(--line); }
.data-table thead th { color: var(--muted); background: var(--surface-muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.data-table tbody tr { transition: background-color .2s ease; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }
.license-key { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 700; white-space: nowrap; }
.muted-small { color: var(--muted); font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.available { color: #07875d; background: #e7f9f2; }
.status-badge.active { color: #4263eb; background: #edf2ff; }
.status-badge.suspended { color: #c47b19; background: #fff4e3; }
.status-badge.expired { color: #d34d55; background: #fff0f0; }
[data-bs-theme="dark"] .status-badge.available { color: #59d8ad; background: #193a35; }
[data-bs-theme="dark"] .status-badge.active { color: #91a5ff; background: #252e4d; }
[data-bs-theme="dark"] .status-badge.suspended { color: #f2bf6e; background: #403522; }
[data-bs-theme="dark"] .status-badge.expired { color: #ff8e96; background: #41282e; }
.action-button { white-space: nowrap; font-size: 10px; }
.action-footer { flex-wrap: wrap; gap: 7px; }
.action-footer form { margin: 0; }
.action-footer .btn { white-space: nowrap; }
.table-foot { padding: 12px 1px 0; color: var(--muted); font-size: 9px; }
.modal-content { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-header .btn-close { filter: var(--bs-btn-close-filter, none); }
[data-bs-theme="dark"] .modal-header .btn-close { filter: invert(1); }
.btn-light { --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface-muted); --bs-btn-border-color: var(--line); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-border-color: var(--line); }
.settings-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.settings-copy { display: flex; align-items: center; gap: 12px; }
.settings-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 12px; font-size: 17px; }
.settings-copy div { display: grid; gap: 4px; }
.settings-copy b { font-size: 12px; }
.settings-copy small { color: var(--muted); font-size: 10px; }
.settings-card .form-check { display: flex; align-items: center; gap: 7px; }
.settings-card .form-check-input { float: none; margin: 0; }
.settings-card .form-check-label { color: var(--muted); font-size: 10px; }
.app-card { padding: 18px; }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.app-avatar.large { width: 43px; height: 43px; font-size: 17px; border-radius: 13px; }
.app-code { margin-top: 17px; color: var(--brand); font: 700 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.app-card h2 { margin: 4px 0; font-size: 15px; font-weight: 800; }
.app-card p { margin: 0; color: var(--muted); font-size: 10px; }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 19px; padding-top: 13px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.action-label, .result-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.result-label.good { color: #07875d; }
.role-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 700; }
.role-badge.admin { color: #4263eb; background: var(--brand-soft); }
.role-badge.staff { color: #64748b; background: var(--surface-muted); }
.user-avatar { flex-basis: 31px; width: 31px; height: 31px; border-radius: 10px; font-size: 11px; }
.brand-settings { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px; }
.brand-preview { display: flex; align-items: center; gap: 17px; min-width: 0; }
.brand-preview-logo { display: grid; flex: 0 0 68px; width: 68px; height: 68px; place-items: center; overflow: hidden; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--line); border-radius: 18px; font-size: 28px; }
.brand-preview-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-preview h2 { margin: 0 0 5px; font-size: 17px; font-weight: 800; }
.brand-preview small, .settings-detail small { color: var(--muted); font-size: 10px; }
.brand-actions { display: flex; align-items: center; gap: 9px; }
.brand-actions form { margin: 0; }
.settings-detail { display: flex; align-items: center; gap: 13px; }
.settings-detail > div { display: grid; gap: 4px; }
.settings-detail b { font-size: 12px; }
.notice-modal .modal-content { max-width: 430px; margin: auto; }
.notice-icon { display: inline-grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; font-size: 23px; }
.notice-icon.success { color: #07875d; background: #e7f9f2; }
.notice-icon.danger { color: #d34d55; background: #fff0f0; }
.notice-icon.warning { color: #c47b19; background: #fff4e3; }
[data-bs-theme="dark"] .notice-icon.success { color: #59d8ad; background: #193a35; }
[data-bs-theme="dark"] .notice-icon.danger { color: #ff8e96; background: #41282e; }
[data-bs-theme="dark"] .notice-icon.warning { color: #f2bf6e; background: #403522; }
.toast-alert { animation: page-in .3s ease both; }
.login-page { min-height: 100vh; overflow-x: hidden; background: #f5f7fc; }
.login-shell { position: relative; display: grid; min-height: 100vh; padding: 30px 25px; place-items: center; overflow-x: hidden; background: radial-gradient(ellipse at 14% 12%, rgba(84, 119, 255, .13), transparent 34%), radial-gradient(ellipse at 88% 90%, rgba(52, 179, 220, .12), transparent 35%), #f5f7fc; }
.login-card { position: relative; z-index: 1; width: min(100%, 430px); padding: 38px; background: rgba(255,255,255,.92); border: 1px solid rgba(224,231,243,.9); border-radius: 19px; box-shadow: 0 24px 80px rgba(34, 54, 100, .12); backdrop-filter: blur(15px); }
.login-card .brand-mark { margin-bottom: 33px !important; }
.login-card h1 { letter-spacing: -.04em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; z-index: 2; top: 13px; left: 13px; color: #93a0b5; font-size: 15px; }
.input-icon .form-control { height: 46px; padding-left: 39px; background: #f9faff; }
.login-card .btn { min-height: 47px; font-size: 13px; }
.login-foot { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 9px; }
.login-orb { position: absolute; width: 260px; height: 260px; border-radius: 50%; filter: blur(1px); opacity: .43; animation: orb-float 9s ease-in-out infinite alternate; }
.orb-one { top: -115px; right: 8%; background: linear-gradient(145deg, #b8c5ff, #d6e0ff); }
.orb-two { bottom: -155px; left: 8%; width: 340px; height: 340px; background: linear-gradient(145deg, #b9f1f0, #d7f0ff); animation-delay: -3s; }
@keyframes orb-float { to { transform: translate(20px, 23px) scale(1.05); } }

@media (max-width: 1199.98px) {
    .content-wrap { padding-right: 25px; padding-left: 25px; }
    .topbar { padding-right: 25px; padding-left: 25px; }
    .filter-form { flex-wrap: wrap; }
    .filter-form .search-input { width: 190px; }
}
@media (max-width: 767.98px) {
    :root { --sidebar-width: 258px; }
    .sidebar { transform: translateX(-101%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 15px 0 45px rgba(20, 32, 63, .16); }
    .sidebar-scrim { position: fixed; z-index: 1025; inset: 0; background: rgba(12, 21, 41, .4); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
    .sidebar-scrim.show { opacity: 1; visibility: visible; }
    .main-content { margin-left: 0; }
    .topbar { min-height: 62px; padding: 0 17px; }
    .mobile-menu { display: inline-grid; }
    .content-wrap { padding: 25px 16px 18px; }
    .page-heading { align-items: flex-start; }
    .page-heading .btn { flex: 0 0 auto; padding: 9px 10px; font-size: 10px; }
    .page-heading p:not(.eyebrow) { max-width: 390px; font-size: 11px; line-height: 1.55; }
    .panel-card { padding: 15px; }
    .filter-form { width: 100%; }
    .filter-form .search-input { flex: 1 1 100%; width: 100%; }
    .filter-form .form-select { flex: 1 1 35%; min-width: 0; }
    .data-table { min-width: 780px; }
    .page-footer { font-size: 9px; }
}
@media (max-width: 480px) {
    .server-status { display: none; }
    .crumb { gap: 7px; font-size: 10px; }
    .page-heading h1 { font-size: 23px; }
    .page-heading .btn { font-size: 0; }
    .page-heading .btn i { margin: 0 !important; font-size: 14px; }
    .login-card { padding: 28px 22px; }
    .settings-card { align-items: flex-start; flex-direction: column; }
    .settings-card > form { align-self: flex-end; }
    .brand-settings { align-items: flex-start; flex-direction: column; padding: 18px; }
    .brand-actions { width: 100%; flex-wrap: wrap; }
    .brand-actions .btn { font-size: 11px; }
    .page-footer span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
