:root {
    --primary: #285bc7;
    --primary-hover: #204ba6;
    --primary-soft: #edf3ff;
    --success: #15804a;
    --success-soft: #e8f7ef;
    --warning: #b86d08;
    --warning-soft: #fff5df;
    --danger: #d33b49;
    --danger-soft: #fff0f1;
    --ink: #182235;
    --muted: #69768a;
    --subtle: #8c98aa;
    --canvas: #f3f6fa;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --border: #e1e6ef;
    --border-strong: #cfd7e4;
    --sidebar: #121a29;
    --sidebar-hover: #202c41;
    --sidebar-active: #294776;
    --radius: 7px;
    --shadow-sm: 0 1px 2px rgba(19, 31, 52, .04);
    --shadow-md: 0 8px 24px rgba(19, 31, 52, .08);
    --workspace-sidebar-width: 232px;
    --transition: 150ms ease;
    --color-card: var(--surface);
    --color-border: var(--border);
    --color-success: var(--success);
    --color-danger: var(--danger);
    --radius-lg: var(--radius);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 320px; background: var(--canvas); }
body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, summary, label { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(40, 91, 199, .22);
    outline-offset: 2px;
}
::selection { color: var(--ink); background: #dce7ff; }
[hidden], .hidden { display: none !important; }

.page { display: none !important; min-height: 100vh; }
.page.active { display: flex !important; }
.view { display: none !important; }
.view.active { display: block !important; animation: view-in 180ms ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* Authentication */
#page-login {
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: #eef2f7;
}
.login-card {
    width: min(430px, 100%);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 20px 55px rgba(19, 31, 52, .12);
}
.login-card::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 20px;
    background: var(--primary);
    border-radius: 99px;
}
.login-card .logo { margin-bottom: 10px; text-align: center; font-size: 2rem; }
.login-card h2 { margin-bottom: 6px; text-align: center; font-size: 1.42rem; }
.login-card .subtitle { margin-bottom: 24px; color: var(--muted); text-align: center; font-size: .84rem; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; padding: 4px; background: #f0f3f7; border-radius: 7px; }
.auth-tab { flex: 1; min-height: 38px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.auth-tab.active { color: var(--primary); background: #fff; box-shadow: var(--shadow-sm); font-weight: 600; }
.auth-form { animation: view-in 180ms ease; }

/* Workspace shell */
.workspace {
    --workspace-sidebar-width: 232px;
    position: relative;
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--canvas);
}
.workspace-sidebar {
    position: fixed;
    z-index: 120;
    inset: 0 auto 0 0;
    width: var(--workspace-sidebar-width);
    display: flex;
    flex-direction: column;
    color: #bec9da;
    background: var(--sidebar);
    border-right: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
    transition: width var(--transition), transform var(--transition);
}
.workspace-main {
    width: calc(100% - var(--workspace-sidebar-width));
    min-width: 0;
    margin-left: var(--workspace-sidebar-width);
    transition: width var(--transition), margin-left var(--transition);
}
.workspace-brand {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #285bc7;
    border-radius: 7px;
    font-weight: 800;
    letter-spacing: 0;
}
.brand-copy { min-width: 0; white-space: nowrap; }
.brand-copy strong { display: block; color: #fff; font-size: .92rem; }
.brand-copy span { display: block; margin-top: 1px; color: #7f8da4; font-size: .68rem; }
.workspace-nav { flex: 1; padding: 14px 10px; overflow: hidden auto; }
.nav-section-label { margin: 8px 10px 6px; color: #647087; font-size: .63rem; font-weight: 700; white-space: nowrap; }
.workspace-nav a {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 2px 0;
    padding: 9px 11px;
    color: #aeb9ca;
    border-radius: 6px;
    font-size: .83rem;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
}
.workspace-nav a:hover { color: #fff; background: var(--sidebar-hover); }
.workspace-nav a.active { color: #fff; background: var(--sidebar-active); }
.workspace-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: #8eb0ff;
    border-radius: 0 3px 3px 0;
}
.workspace-nav .icon { width: 22px; flex: 0 0 22px; text-align: center; font-size: 1rem; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.badge-count { margin-left: auto; padding: 1px 7px; color: #fff; background: var(--danger); border-radius: 99px; font-size: .65rem; }
.workspace-account {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.workspace-account .user-info { min-width: 0; display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.workspace-account .account-copy strong { display: block; overflow: hidden; color: #eef3fb; text-overflow: ellipsis; }
.workspace-account .account-copy span { display: block; color: #7f8da4; font-size: .66rem; }
.account-row { display: flex; align-items: center; gap: 9px; min-width: 0; margin-bottom: 10px; }
.user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #285bc7;
    border-radius: 50%;
    font-size: .85rem;
}
.account-copy { min-width: 0; color: #c2cada; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-resizer {
    position: fixed;
    z-index: 140;
    inset: 0 auto 0 calc(var(--workspace-sidebar-width) - 3px);
    width: 6px;
    cursor: col-resize;
    touch-action: none;
}
.sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 2px;
    width: 2px;
    height: 52px;
    background: transparent;
    border-radius: 99px;
    transform: translateY(-50%);
}
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizer.is-dragging::after { background: #88a9ef; }
body.is-resizing-sidebar, body.is-resizing-sidebar * { cursor: col-resize !important; user-select: none !important; }
.is-sidebar-collapsed .workspace-brand { justify-content: center; padding-inline: 10px; }
.is-sidebar-collapsed .brand-copy,
.is-sidebar-collapsed .nav-label,
.is-sidebar-collapsed .nav-section-label,
.is-sidebar-collapsed .account-copy,
.is-sidebar-collapsed .badge-count,
.is-sidebar-collapsed .logout-label { display: none; }
.is-sidebar-collapsed .workspace-nav { padding-inline: 8px; }
.is-sidebar-collapsed .workspace-nav a { justify-content: center; gap: 0; padding-inline: 0; }
.is-sidebar-collapsed .workspace-nav .icon { width: auto; flex-basis: auto; }
.is-sidebar-collapsed .workspace-account { padding-inline: 10px; }
.is-sidebar-collapsed .account-row { justify-content: center; }
.is-sidebar-collapsed .workspace-account .btn { width: 36px; margin-inline: auto; padding: 0; justify-content: center; }
.workspace-topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 28px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
}
.workspace-topbar > div { min-width: 0; flex: 1; }
.workspace-topbar > div strong { display: block; font-size: .92rem; }
.workspace-topbar > div span { display: block; margin-top: 1px; color: var(--muted); font-size: .7rem; }
.topbar-context { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 1.15rem; font-weight: 700; }
.topbar-title p { margin-top: 1px; color: var(--muted); font-size: .75rem; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-nav-toggle { display: none; }
.workspace-content { width: 100%; max-width: 1660px; padding: 26px 28px 44px; }
.sidebar-backdrop { display: none; }

/* Shared components */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-header h2 { font-size: 1.25rem; }
.page-header p { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.page-header .count { margin-left: 8px; color: var(--muted); font-size: .78rem; font-weight: 400; }
.card {
    margin-bottom: 18px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-header h3 { font-size: .92rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:hover { background: #f7f9fc; border-color: #b8c3d3; }
.btn.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.success { color: #fff; background: var(--success); border-color: var(--success); }
.btn.success:hover { background: #116b3e; border-color: #116b3e; }
.btn.warning { color: #fff; background: var(--warning); border-color: var(--warning); }
.btn.warning:hover { background: #985a07; border-color: #985a07; }
.btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #b92f3d; border-color: #b92f3d; }
.btn.outline { color: var(--muted); background: #fff; border-color: var(--border-strong); }
.btn.outline:hover { color: #526076; background: #f7f9fc; border-color: #b8c3d3; }
.btn.manage { color: var(--primary); background: var(--primary-soft); border-color: #c9d8f7; }
.btn.manage:hover { color: var(--primary-hover); background: #dfe9fc; border-color: #aebfea; }
.btn.service-bot { color: #11663d; background: var(--success-soft); border-color: #bfe4cf; }
.btn.service-bot:hover { color: #0e5734; background: #d9f1e4; border-color: #9fd4b7; }
.btn.service-anticheat { color: #0f6f70; background: #e8f7f6; border-color: #b8e1df; }
.btn.service-anticheat:hover { color: #0b5c5d; background: #d9f0ee; border-color: #91cfcc; }
.btn.warning-soft { color: #965907; background: var(--warning-soft); border-color: #f0d49d; }
.btn.warning-soft:hover { color: #7f4b05; background: #fbe9c5; border-color: #e4bd71; }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: .74rem; }
.btn.xs { min-height: 30px; padding: 5px 9px; font-size: .7rem; }
.btn.full { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn:disabled, .btn:disabled:hover { opacity: .45; cursor: not-allowed; box-shadow: none; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; color: #526076; font-size: .76rem; font-weight: 600; }
.form-group .hint { display: block; margin-top: 4px; color: var(--subtle); font-size: .7rem; }
.input {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: .8rem;
}
.input:hover { border-color: #b7c1d0; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(40,91,199,.1); outline: 0; }
.input::placeholder { color: #a4afbf; }
textarea.input { min-height: 84px; resize: vertical; }
.input-row { display: flex; align-items: flex-end; gap: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid #e9edf3; vertical-align: middle; }
.table th { color: #6d788a; background: #f8fafc; font-size: .69rem; font-weight: 700; white-space: nowrap; }
.table tbody tr:hover td { background: #fbfcfe; }
.table tr:last-child td { border-bottom: 0; }
.table .mono { font-family: Consolas, monospace; font-size: .74rem; }
.table .cell-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.badge, .lc-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: .67rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge.green, .lc-status.active { color: var(--success); background: var(--success-soft); }
.badge.red, .lc-status.expired, .lc-status.banned { color: var(--danger); background: var(--danger-soft); }
.lc-status.in-use { color: var(--primary); background: var(--primary-soft); }
.badge.yellow { color: var(--warning); background: var(--warning-soft); }
.badge.gray, .lc-status.disabled { color: #687386; background: #edf0f4; }
.badge.purple { color: var(--primary); background: var(--primary-soft); }
.msg { margin-top: 10px; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px; font-size: .78rem; }
.msg.success { color: var(--success); background: var(--success-soft); border-color: #ccebd9; }
.msg.error, .msg.danger { color: var(--danger); background: var(--danger-soft); border-color: #f4d1d5; }
.msg.warning { color: var(--warning); background: var(--warning-soft); border-color: #f4dfb6; }
.msg.info { color: var(--primary); background: var(--primary-soft); border-color: #d7e4ff; }
.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }
.empty-state .icon { margin-bottom: 10px; font-size: 2rem; opacity: .55; }
.empty-state p { font-size: .82rem; }
.stat-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stat-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 6px; }
.stat-icon.blue { color: var(--primary); background: var(--primary-soft); }
.stat-icon.green { color: var(--success); background: var(--success-soft); }
.stat-icon.yellow { color: var(--warning); background: var(--warning-soft); }
.stat-icon.gray { color: var(--muted); background: #edf0f4; }
.stat-value { margin-top: 2px; font-size: 1.35rem; font-weight: 750; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .7rem; }
.filter-bar, .admin-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; margin-bottom: 16px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.filter-bar .form-group, .admin-toolbar .form-group { min-width: 120px; margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pagination button, .pagination span, .pagination select { min-height: 32px; padding: 5px 10px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 5px; font-size: .72rem; }
.pagination button { cursor: pointer; }
.pagination button.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.pagination button:disabled { opacity: .45; cursor: default; }
.pagination .page-info { border-color: transparent; background: transparent; }
.toggle { position: relative; width: 40px; height: 22px; display: inline-block; flex: 0 0 40px; }
.toggle input { width: 0; height: 0; opacity: 0; }
.toggle .slider { position: absolute; inset: 0; background: #cbd4e1; border-radius: 99px; cursor: pointer; transition: background var(--transition); }
.toggle .slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform var(--transition); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* Modal and notifications */
.modal { position: fixed; z-index: 1000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 38, .55); backdrop-filter: blur(3px); }
.modal-box { width: min(500px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 24px 70px rgba(13, 24, 43, .22); }
.modal-box.wide, .modal-box-wide { width: min(760px, 100%); }
.modal-box h3 { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.toast-container { position: fixed; z-index: 9999; top: 16px; right: 16px; display: grid; gap: 8px; }
.toast { max-width: 390px; display: flex; align-items: center; gap: 9px; padding: 11px 14px; color: #fff; border-radius: 7px; box-shadow: var(--shadow-md); font-size: .77rem; }
.toast.success { background: #147b48; }
.toast.error { background: #cc3846; }
.toast.info { background: #285bc7; }
.toast.warning { background: #af6808; }
.toast.removing { opacity: 0; transform: translateX(10px); transition: 180ms ease; }
.copied-feedback { position: absolute; padding: 3px 7px; color: #fff; background: var(--success); border-radius: 4px; font-size: .65rem; }

/* User product workspace */
.user-shell { --workspace-sidebar-width: 72px; }
.user-shell .workspace-content { max-width: 1500px; }
.user-dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, .8fr); gap: 20px; align-items: start; }
.user-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.user-panel-heading h2 { font-size: 1rem; }
.user-panel-heading p { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.license-summary-list { display: grid; gap: 12px; }
.license-summary-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.license-summary-card:hover { border-color: #c7d4eb; box-shadow: 0 8px 20px rgba(19,31,52,.06); }
.license-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.status-cluster { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.license-summary-title { min-width: 0; }
.license-summary-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .94rem; }
.license-mask { margin-top: 3px; color: var(--muted); font-family: Consolas, monospace; font-size: .72rem; }
.license-summary-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.license-summary-stat { min-width: 0; padding: 10px; background: var(--surface-subtle); border: 1px solid #edf0f4; border-radius: 6px; }
.license-summary-stat span { display: block; color: var(--muted); font-size: .66rem; }
.license-summary-stat strong { display: block; margin-top: 3px; overflow: hidden; color: var(--ink); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.license-summary-stat strong.is-valid { color: var(--success); }
.license-summary-stat strong.is-expired { color: var(--warning); }
.license-summary-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.license-summary-meta { color: var(--muted); font-size: .7rem; }
.license-summary-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.user-insights { display: grid; gap: 12px; }
.insight-card { padding: 17px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.insight-label { color: var(--muted); font-size: .7rem; }
.insight-value { margin-top: 4px; font-size: 1.55rem; font-weight: 760; }
.insight-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0f4; color: var(--muted); font-size: .74rem; }
.insight-row:last-child { border-bottom: 0; }
.insight-row strong { color: var(--ink); }
.license-detail-identity { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.license-detail-identity h3 { margin: 2px 0 0; padding: 0; border: 0; font-size: 1.05rem; }
.eyebrow { color: var(--primary); font-size: .65rem; font-weight: 700; }
.license-detail-key { padding: 10px 12px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 6px; color: #52637d; font-family: Consolas, monospace; font-size: .78rem; }
.license-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.license-detail-service { padding: 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; }
.license-detail-service span { color: var(--muted); font-size: .68rem; }
.license-detail-service strong { display: block; margin-top: 4px; font-size: .8rem; }
.license-detail-service small { display: block; margin-top: 3px; color: var(--muted); font-size: .66rem; }
.license-renewal-list { display: grid; gap: 8px; margin-top: 14px; }
.license-renewal-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #edf0f4; font-size: .76rem; }
.license-renewal-row > div { min-width: 0; }
.license-renewal-row strong, .license-renewal-row span { display: block; }
.license-renewal-row span { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.license-detail-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.license-detail-action-group { min-width: 0; }
.license-detail-action-group + .license-detail-action-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f4; }
.license-detail-action-label { margin-bottom: 8px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.license-detail-service-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.license-detail-management-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.license-detail-service-actions .btn, .license-detail-management-actions .btn { min-width: 0; white-space: normal; line-height: 1.25; }

/* Admin operations workspace */
.admin-shell { --workspace-sidebar-width: 232px; }
.admin-shell .workspace-content { max-width: none; padding-top: 22px; }
.admin-metrics { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.admin-table-panel { margin-bottom: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table-panel .card-header { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.admin-table-panel .table-wrap { margin: 0; }
.admin-operations-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr); gap: 14px; margin-bottom: 16px; }
.admin-operations-panel > .card, .admin-operations-panel > .admin-table-panel { margin-bottom: 0; }
.bot-monitor { margin: 10px; padding: 12px; background: #182338; border: 1px solid rgba(255,255,255,.07); border-radius: 6px; }
.bot-monitor-title { margin-bottom: 8px; color: #8290a8; font-size: .65rem; font-weight: 700; }
.bot-monitor-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bot-dot { width: 8px; height: 8px; flex: 0 0 8px; background: #788499; border-radius: 50%; }
.bot-dot.online { background: #35bd78; box-shadow: 0 0 0 3px rgba(53,189,120,.14); }
.bot-dot.offline { background: #ef5b67; }
.bot-dot.starting { background: #e7a83a; }
.bot-status-text { color: #e2e8f2; font-size: .72rem; font-weight: 700; }
.bot-monitor-detail { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.07); }
.bot-detail-line { display: flex; justify-content: space-between; color: #7f8da3; font-size: .63rem; }
.bot-detail-line span:last-child { color: #c4cddd; }

/* Legacy utility compatibility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: .75rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
    .user-dashboard-grid { grid-template-columns: minmax(0, 1fr) 250px; }
    .admin-metrics { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
}
@media (max-width: 960px) {
    .user-dashboard-grid, .admin-operations-panel { grid-template-columns: 1fr; }
    .user-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .workspace-main { width: 100%; margin-left: 0; }
    .workspace-sidebar {
        width: min(282px, 86vw);
        transform: translateX(-100%);
        box-shadow: 15px 0 45px rgba(12,20,34,.18);
    }
    .is-mobile-nav-open .workspace-sidebar { transform: translateX(0); }
    .sidebar-resizer { display: none; }
    .sidebar-backdrop { position: fixed; z-index: 110; inset: 0; background: rgba(12,20,34,.45); }
    .is-mobile-nav-open .sidebar-backdrop { display: block; }
    .mobile-nav-toggle { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; }
    .workspace-topbar { min-height: 62px; padding: 10px 16px; }
    .topbar-title p { display: none; }
    .workspace-content { padding: 18px 16px 32px; }
    .page-header { align-items: flex-start; }
    .filter-bar, .admin-toolbar { align-items: stretch; }
    .filter-bar .form-group, .admin-toolbar .form-group { min-width: calc(50% - 5px); flex: 1; }
    .filter-bar .input, .admin-toolbar .input { width: 100% !important; }
    .admin-metrics { grid-template-columns: 1fr 1fr; }
    .admin-shell .table { min-width: 960px; }
    .admin-shell .table th, .admin-shell .table td { white-space: nowrap; }
    .license-summary-stats, .license-detail-grid { grid-template-columns: 1fr; }
    .user-insights { grid-template-columns: 1fr; }
    .user-shell .workspace-topbar > div span,
    .user-shell .topbar-context { display: none; }
    .user-shell .workspace-topbar { min-height: 56px; }
    .user-shell .table { min-width: 620px; }
    .user-shell .table th, .user-shell .table td { white-space: nowrap; }
    .modal { align-items: flex-end; padding: 8px; }
    .modal-box { width: 100%; max-height: 94vh; border-radius: 8px; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .btn { flex: 1 1 120px; }
    .license-detail-service-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .license-detail-service-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .license-detail-service-actions .btn, .license-detail-management-actions .btn { min-height: 40px; }
    .license-detail-management-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .toast-container { left: 10px; right: 10px; top: 10px; }
    .toast { max-width: none; }
}
@media (max-width: 480px) {
    .workspace-content { padding-inline: 12px; }
    .workspace-topbar { padding-inline: 12px; }
    .topbar-actions .btn:not(.mobile-nav-toggle) { padding-inline: 10px; }
    .filter-bar .form-group, .admin-toolbar .form-group { min-width: 100%; }
    .admin-metrics { grid-template-columns: 1fr; }
    .license-summary-card { padding: 15px; }
    .user-shell .license-summary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .user-shell .license-summary-stat { padding: 8px; }
    .user-shell .license-summary-stat span { font-size: .62rem; }
    .user-shell .license-summary-stat strong { font-size: .72rem; }
    .license-summary-actions { align-items: flex-start; flex-direction: column; }
    .license-summary-buttons { width: 100%; }
    .license-summary-buttons .btn { flex: 1 1 100%; }
    .input-row { flex-direction: column; align-items: stretch; }
}
@media (max-width: 380px) {
    .license-detail-service-actions, .license-detail-management-actions { grid-template-columns: 1fr; }
}
