/* ──────────── Tokens ──────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    color: #2d3436;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
body.dark-mode { background: #121218; color: #e0e0e0; }
a { color: #6c5ce7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ──────────── Login screen ──────────── */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(ellipse at 20% 30%, rgba(108,92,231,0.12), transparent 60%),
                radial-gradient(ellipse at 80% 70%, rgba(108,92,231,0.08), transparent 60%);
}
body.dark-mode .login-screen {
    background: radial-gradient(ellipse at 20% 30%, rgba(108,92,231,0.18), transparent 60%),
                radial-gradient(ellipse at 80% 70%, rgba(108,92,231,0.12), transparent 60%),
                #121218;
}
.login-card {
    background: white;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 380px;
}
body.dark-mode .login-card { background: #1e1e28; box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-title { font-size: 17px; font-weight: 700; }
.login-subtitle { font-size: 12px; color: #888; margin-top: 1px; }
body.dark-mode .login-subtitle { color: #777; }
.login-error {
    color: #c62828;
    font-size: 12px;
    min-height: 16px;
    margin-bottom: 8px;
    transition: opacity 0.2s;
}
.login-submit {
    width: 100%;
    padding: 12px;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}
.login-submit:hover { background: #5a4bd1; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,92,231,0.3); }
.login-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ──────────── App shell ──────────── */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar (mirrors small_business) */
.sidebar {
    width: 220px;
    background: #1a1a2e;
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; padding: 0 4px; }
.sidebar-logo {
    width: 36px; height: 36px;
    background: #6c5ce7;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    flex-shrink: 0;
}
.sidebar-title { font-size: 15px; font-weight: 700; }
.sidebar-subtitle { font-size: 11px; color: rgba(255,255,255,0.5); }
.sidebar-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 12px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.15s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active { background: #6c5ce7; color: white; font-weight: 600; }
.sidebar-link.active i { color: white; }
.sidebar-tool {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.sidebar-tool:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-tool-icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    flex-shrink: 0;
}
.sidebar-tool-badge {
    background: #6c5ce7;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    display: none;
}
.sidebar-tool-badge.visible { display: inline; }
.sidebar-spacer { flex: 1; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 4px; }

/* Main content */
.main-content {
    flex: 1;
    padding: 32px 40px;
    margin-left: 220px;
    min-width: 0;
}
body.dark-mode .main-content { background: #121218; }
.view { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}
.header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
body.dark-mode .header h1 { color: #f0f0f0; }
.header .subtitle { color: #888; font-size: 13px; }
body.dark-mode .header .subtitle { color: #777; }
.header-actions { display: flex; gap: 8px; }
.ghost-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}
.ghost-btn:hover { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.18); color: #2d3436; }
body.dark-mode .ghost-btn { color: #aaa; border-color: rgba(255,255,255,0.1); }
body.dark-mode .ghost-btn:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.2); color: #e0e0e0; }

/* ──────────── Summary cards ──────────── */
.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
body.dark-mode .summary-card { background: #1e1e28; box-shadow: 0 1px 3px rgba(0,0,0,0.3); border: 1px solid #2a2a38; }
.summary-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.summary-icon.green { background: #e8f5e9; color: #2e7d32; }
.summary-icon.red { background: #ffeaea; color: #c62828; }
.summary-icon.blue { background: #e8eaf6; color: #1565c0; }
.summary-icon.orange { background: #fff3e0; color: #e65100; }
body.dark-mode .summary-icon.green { background: rgba(46,125,50,0.15); color: #66bb6a; }
body.dark-mode .summary-icon.red { background: rgba(198,40,40,0.15); color: #ef5350; }
body.dark-mode .summary-icon.blue { background: rgba(21,101,192,0.15); color: #42a5f5; }
body.dark-mode .summary-icon.orange { background: rgba(230,81,0,0.15); color: #ffa726; }
.summary-card .label { font-size: 12px; color: #888; margin-bottom: 2px; }
body.dark-mode .summary-card .label { color: #aaa; }
.summary-card .value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.summary-card .value.green { color: #2e7d32; }
.summary-card .value.red { color: #c62828; }
.summary-card .value.blue { color: #1565c0; }
.summary-card .value.orange { color: #e65100; }
body.dark-mode .summary-card .value.green { color: #4caf50; }
body.dark-mode .summary-card .value.red { color: #ef5350; }
body.dark-mode .summary-card .value.blue { color: #42a5f5; }
body.dark-mode .summary-card .value.orange { color: #ffa726; }
.summary-card .comparison { font-size: 11px; margin-top: 4px; color: #888; }
body.dark-mode .summary-card .comparison { color: #777; }

/* ──────────── Panel ──────────── */
.panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
body.dark-mode .panel { background: #1e1e28; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.panel-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #555; }
body.dark-mode .panel-title { color: #aaa; }
.panel-subtitle { font-size: 12px; color: #888; margin-top: 2px; }
body.dark-mode .panel-subtitle { color: #666; }

/* Charts row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.chart-panel { margin-bottom: 0; }
.chart-container { position: relative; height: 280px; }

/* ──────────── Tables ──────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}
body.dark-mode thead th { color: #666; border-bottom-color: #2a2a38; }
tbody td { padding: 12px 14px; border-bottom: 1px solid #f3f3f3; font-size: 13px; }
body.dark-mode tbody td { border-bottom-color: #222230; color: #ccc; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(0,0,0,0.02); }
body.dark-mode tbody tr:hover { background: rgba(255,255,255,0.02); }
.amount { text-align: right; font-variant-numeric: tabular-nums; }
.row-mono { font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace; font-size: 12px; color: #555; }
body.dark-mode .row-mono { color: #999; }
.muted { color: #aaa; font-weight: 400; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.badge-trial { background: rgba(108,92,231,0.15); color: #6c5ce7; }
.badge-active { background: rgba(46,125,50,0.15); color: #2e7d32; }
.badge-suspended { background: rgba(255,152,0,0.15); color: #ef6c00; }
.badge-cancelled { background: rgba(198,40,40,0.15); color: #c62828; }
.badge-success { background: rgba(46,125,50,0.15); color: #2e7d32; }
.badge-error { background: rgba(198,40,40,0.15); color: #c62828; }
.badge-warning { background: rgba(255,152,0,0.15); color: #ef6c00; }
body.dark-mode .badge-trial { background: rgba(108,92,231,0.25); color: #a29bfe; }
body.dark-mode .badge-active { background: rgba(46,125,50,0.2); color: #66bb6a; }
body.dark-mode .badge-suspended { background: rgba(255,152,0,0.2); color: #ffa726; }
body.dark-mode .badge-cancelled { background: rgba(198,40,40,0.2); color: #ef5350; }
body.dark-mode .badge-success { background: rgba(46,125,50,0.2); color: #66bb6a; }
body.dark-mode .badge-error { background: rgba(198,40,40,0.2); color: #ef5350; }
body.dark-mode .badge-warning { background: rgba(255,152,0,0.2); color: #ffa726; }

/* Action buttons inside tables */
.btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.12);
    background: transparent;
    transition: all 0.15s;
    margin-right: 6px;
    color: inherit;
}
.btn:hover { background: rgba(0,0,0,0.04); }
.btn.primary { background: #6c5ce7; color: white; border-color: #6c5ce7; }
.btn.primary:hover { background: #5a4bd1; border-color: #5a4bd1; }
.btn.success { color: #2e7d32; border-color: rgba(46,125,50,0.3); }
.btn.success:hover { background: rgba(46,125,50,0.06); }
.btn.danger { color: #c62828; border-color: rgba(198,40,40,0.3); }
.btn.danger:hover { background: rgba(198,40,40,0.06); }
body.dark-mode .btn { border-color: rgba(255,255,255,0.12); color: #ccc; }
body.dark-mode .btn:hover { background: rgba(255,255,255,0.04); }
body.dark-mode .btn.success { color: #66bb6a; border-color: rgba(46,125,50,0.4); }
body.dark-mode .btn.success:hover { background: rgba(46,125,50,0.12); }
body.dark-mode .btn.danger { color: #ef5350; border-color: rgba(198,40,40,0.4); }
body.dark-mode .btn.danger:hover { background: rgba(198,40,40,0.12); }

/* ──────────── Modals ──────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.visible { display: flex; }
.modal {
    background: white;
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
body.dark-mode .modal { background: #1e1e28; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.modal-wide { max-width: 720px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.modal h3 { font-size: 18px; font-weight: 700; }
.modal-subtitle { font-size: 12px; color: #888; margin-top: 2px; }
body.dark-mode .modal-subtitle { color: #777; }
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(0,0,0,0.05); color: #2d3436; }
body.dark-mode .modal-close { color: #888; }
body.dark-mode .modal-close:hover { background: rgba(255,255,255,0.05); color: #e0e0e0; }
.modal-icon {
    width: 56px; height: 56px;
    background: rgba(255,152,0,0.15);
    color: #ef6c00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.modal p { color: #555; font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
body.dark-mode .modal p { color: #aaa; }
.modal-body { margin-bottom: 16px; }
.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}
.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.modal-btn.cancel {
    background: transparent;
    color: #777;
    border: 1px solid rgba(0,0,0,0.12);
}
.modal-btn.cancel:hover { background: rgba(0,0,0,0.04); color: #2d3436; }
.modal-btn.confirm { background: #6c5ce7; color: white; }
.modal-btn.confirm:hover { background: #5a4bd1; }
.modal-btn.confirm:disabled { opacity: 0.6; cursor: not-allowed; }
.modal-btn.danger { background: #c62828; color: white; }
.modal-btn.danger:hover { background: #ad1f1f; }
body.dark-mode .modal-btn.cancel { color: #aaa; border-color: rgba(255,255,255,0.12); }
body.dark-mode .modal-btn.cancel:hover { background: rgba(255,255,255,0.04); color: #e0e0e0; }

/* Form fields inside modals + login */
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { margin-bottom: 14px; }
label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
body.dark-mode label { color: #aaa; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #2d3436;
    transition: border 0.15s;
}
input:focus, textarea:focus { outline: none; border-color: #6c5ce7; }
body.dark-mode input, body.dark-mode textarea {
    background: #2a2a38;
    border-color: #353548;
    color: #e0e0e0;
}
body.dark-mode input:focus, body.dark-mode textarea:focus { border-color: #6c5ce7; }

/* Result box (newly issued license) */
.result-box {
    background: #f5faf5;
    border: 1px solid rgba(46,125,50,0.4);
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}
body.dark-mode .result-box { background: rgba(46,125,50,0.1); border-color: rgba(46,125,50,0.4); }
.result-box .label { font-size: 11px; color: #2e7d32; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
body.dark-mode .result-box .label { color: #66bb6a; }
.result-box .key {
    font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    word-break: break-all;
    user-select: all;
    padding: 8px 0;
}
.result-box .hint { font-size: 11px; color: #666; margin-top: 6px; }
body.dark-mode .result-box .hint { color: #888; }

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}
.empty-state .empty-icon { color: #c5c5d0; width: 32px; height: 32px; margin: 0 auto 8px; display: block; }
body.dark-mode .empty-state .empty-icon { color: #3a3a48; }
.empty-state .empty-title { font-size: 14px; font-weight: 500; color: #888; margin-bottom: 4px; }
body.dark-mode .empty-state .empty-title { color: #666; }
.empty-state .empty-hint { font-size: 12px; color: #b0b0b8; }
body.dark-mode .empty-state .empty-hint { color: #444; }

/* ──────────── Public register page (kept simple, matches palette) ──────────── */
body.register-page { padding: 32px 40px; max-width: 720px; margin: 0 auto; }
body.register-page h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
body.register-page .subtitle { color: #888; font-size: 14px; margin-bottom: 24px; }
body.register-page .card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.register-page form { max-width: 480px; }
body.register-page .submit {
    padding: 12px 24px;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
body.register-page .submit:hover { background: #5a4bd1; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,92,231,0.3); }
body.register-page .submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
body.register-page .error-box {
    background: #fbf5f5;
    border: 1px solid #c62828;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 14px;
    color: #c62828;
    font-size: 13px;
}

/* ──────────── Activity by customer filter + sort + license groups ──────────── */
.activity-filter-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #666; flex-wrap: wrap; }
body.dark-mode .activity-filter-row { color: #aaa; }
.activity-filter-row label { display: inline-flex; align-items: center; gap: 6px; }
.activity-filter-row input[type="date"] { padding: 5px 8px; font-size: 12px; border: 1px solid rgba(0,0,0,0.12); border-radius: 6px; background: white; color: #1a1a2e; }
body.dark-mode .activity-filter-row input[type="date"] { background: #1a1a24; border-color: rgba(255,255,255,0.12); color: #f0f0f0; color-scheme: dark; }
.activity-filter-row .ghost-btn { padding: 5px 12px; font-size: 12px; }
.activity-filter-status { font-size: 11px; color: #6c5ce7; margin-left: 4px; }
body.dark-mode .activity-filter-status { color: #b39dff; }

.activity-by-customer-table th.sortable { cursor: pointer; user-select: none; position: relative; }
.activity-by-customer-table th.sortable:hover { color: #6c5ce7; }
body.dark-mode .activity-by-customer-table th.sortable:hover { color: #b39dff; }
.activity-by-customer-table th.sortable .sort-arrow { display: inline-block; margin-left: 4px; opacity: 0.4; font-size: 10px; }
.activity-by-customer-table th.sortable.sorted .sort-arrow { opacity: 1; color: #6c5ce7; }
body.dark-mode .activity-by-customer-table th.sortable.sorted .sort-arrow { color: #b39dff; }

.license-group { margin-top: 10px; }
.license-group:first-child { margin-top: 0; }
.license-group-header { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(108,92,231,0.06); border-left: 3px solid #6c5ce7; border-radius: 4px; font-size: 11px; font-weight: 600; color: #1a1a2e; }
body.dark-mode .license-group-header { background: rgba(149,128,255,0.08); border-left-color: #b39dff; color: #f0f0f0; }
.license-group-header .license-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: 0.75; font-weight: 500; }
.license-group-header .license-meta { margin-left: auto; opacity: 0.8; font-weight: 500; }

/* ──────────── Activity by customer (expandable rows) ──────────── */
.activity-by-customer-table tbody tr.customer-row { cursor: pointer; }
.activity-by-customer-table tbody tr.customer-row:hover { background: rgba(108,92,231,0.04); }
body.dark-mode .activity-by-customer-table tbody tr.customer-row:hover { background: rgba(149,128,255,0.06); }
.activity-by-customer-table .expand-cell { color: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; }
body.dark-mode .activity-by-customer-table .expand-cell { color: rgba(255,255,255,0.45); }
.activity-by-customer-table .expand-cell .chev { transition: transform 0.15s; display: inline-block; }
.activity-by-customer-table tr.customer-row.expanded .chev { transform: rotate(90deg); }
.activity-by-customer-table tr.detail-row td { padding: 0; background: rgba(0,0,0,0.02); }
body.dark-mode .activity-by-customer-table tr.detail-row td { background: rgba(255,255,255,0.02); }
.activity-by-customer-table tr.detail-row { display: none; }
.activity-by-customer-table tr.detail-row.visible { display: table-row; }
.activity-detail-wrap { padding: 8px 14px 12px 40px; }
.activity-detail-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.activity-detail-table th, .activity-detail-table td { padding: 6px 10px; text-align: left; }
.activity-detail-table th { font-size: 10px; text-transform: uppercase; color: #888; font-weight: 600; letter-spacing: 0.3px; border-bottom: 1px solid rgba(0,0,0,0.08); }
body.dark-mode .activity-detail-table th { color: #aaa; border-color: rgba(255,255,255,0.08); }
.activity-detail-table tbody tr:not(:last-child) td { border-bottom: 1px solid rgba(0,0,0,0.04); }
body.dark-mode .activity-detail-table tbody tr:not(:last-child) td { border-bottom: 1px solid rgba(255,255,255,0.04); }
.activity-detail-empty { padding: 12px 0; color: #888; font-style: italic; font-size: 12px; }
.model-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; background: rgba(108,92,231,0.10); color: #6c5ce7; font-size: 11px; font-weight: 600; margin-right: 4px; white-space: nowrap; }
body.dark-mode .model-pill { background: rgba(149,128,255,0.15); color: #b39dff; }
.model-pill-count { font-weight: 500; opacity: 0.75; }

/* ──────────── License tier breakdown ──────────── */
.tier-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tier-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #f9fafc; border: 1px solid #e7e9ee; }
body.dark-mode .tier-card { background: #1a1a24; border-color: #2a2a38; }
.tier-card-pill { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; flex-shrink: 0; }
.tier-pill-trial    { background: rgba(230,126,34,0.15); color: #e67e22; }
.tier-pill-solo     { background: rgba(69,90,100,0.18);  color: #455a64; }
.tier-pill-pro      { background: rgba(46,125,50,0.15);  color: #2e7d32; }
.tier-pill-unknown  { background: rgba(108,92,231,0.15); color: #6c5ce7; }
body.dark-mode .tier-pill-trial   { background: rgba(255,167,38,0.18); color: #ffa726; }
body.dark-mode .tier-pill-solo    { background: rgba(144,164,174,0.18); color: #b0bec5; }
body.dark-mode .tier-pill-pro     { background: rgba(102,187,106,0.18); color: #81c784; }
body.dark-mode .tier-pill-unknown { background: rgba(149,128,255,0.20); color: #b39dff; }
.tier-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tier-card-count { font-size: 18px; font-weight: 700; color: #1a1a2e; line-height: 1.1; }
body.dark-mode .tier-card-count { color: #f0f0f0; }
.tier-card-sub { font-size: 11px; color: #888; }
body.dark-mode .tier-card-sub { color: #aaa; }
.tier-card-grace { font-size: 10px; color: #e67e22; margin-top: 1px; }

/* ──────────── Customers inline expand (replaces legacy Licenses modal) ──────────── */
.customers-table tbody tr.customer-summary-row .expand-cell { cursor: pointer; color: rgba(0,0,0,0.4); user-select: none; }
body.dark-mode .customers-table tbody tr.customer-summary-row .expand-cell { color: rgba(255,255,255,0.45); }
.customers-table tbody tr.customer-summary-row:hover .expand-cell { color: #6c5ce7; }
.customers-table tbody tr.customer-summary-row .chev { display: inline-block; transition: transform 0.15s; }
.customers-table tbody tr.customer-summary-row.expanded .chev { transform: rotate(90deg); }

.customers-table tbody tr.customer-detail-row { display: none; }
.customers-table tbody tr.customer-detail-row.visible { display: table-row; }
.customers-table tbody tr.customer-detail-row td { padding: 0; background: rgba(0,0,0,0.02); border-bottom: 2px solid rgba(108,92,231,0.15); }
body.dark-mode .customers-table tbody tr.customer-detail-row td { background: rgba(255,255,255,0.02); border-bottom-color: rgba(149,128,255,0.18); }

.customer-detail-wrap { padding: 16px 24px 20px 40px; }
.customer-detail-loading { padding: 12px; color: #888; font-style: italic; font-size: 13px; }
.customer-detail-empty { padding: 12px; color: #888; font-style: italic; font-size: 13px; }
.customer-detail-licenses { display: flex; flex-direction: column; gap: 12px; }
.customer-detail-actions { margin-top: 14px; }

.lic-card { background: white; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; overflow: hidden; }
body.dark-mode .lic-card { background: #1a1a24; border-color: rgba(255,255,255,0.08); }

.lic-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(108,92,231,0.04); border-bottom: 1px solid rgba(0,0,0,0.06); flex-wrap: wrap; }
body.dark-mode .lic-card-header { background: rgba(149,128,255,0.06); border-bottom-color: rgba(255,255,255,0.06); }
.lic-card-key { font-size: 12px; opacity: 0.8; }
.lic-card-meta { font-size: 11px; color: #888; }
body.dark-mode .lic-card-meta { color: #aaa; }
.lic-card-status { margin-left: auto; }
.lic-card-requests { font-size: 11px; color: #888; font-weight: 500; }

.lic-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }

.lic-section-header { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #666; margin-bottom: 6px; }
body.dark-mode .lic-section-header { color: #aaa; }
.lic-section-empty { padding: 8px 4px; font-size: 12px; color: #999; font-style: italic; }

.lic-device-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 8px 4px; border-top: 1px solid rgba(0,0,0,0.04); font-size: 12px; }
body.dark-mode .lic-device-row { border-top-color: rgba(255,255,255,0.04); }
.lic-device-row:first-of-type { border-top: none; }
.lic-device-row.revoked { opacity: 0.5; }
.lic-device-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lic-device-name { font-weight: 600; }
.lic-device-id { font-size: 11px; color: #888; }
body.dark-mode .lic-device-id { color: #999; }
.lic-device-via { font-size: 10px; color: #6c5ce7; }
body.dark-mode .lic-device-via { color: #b39dff; }
.lic-device-times { font-size: 10px; color: #888; text-align: right; }
body.dark-mode .lic-device-times { color: #999; }

.btn.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ──────────── Responsive ──────────── */
@media (max-width: 1024px) {
    .summary-cards { grid-template-columns: 1fr 1fr; }
    .charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; padding: 20px; }
    .summary-cards { grid-template-columns: 1fr; }
}
