:root {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-sidebar: #0b1120;
    --bg-sidebar-hover: #172033;
    --bg-sidebar-active: rgba(225, 29, 72, 0.14);

    --text-main: #0f172a;
    --text-body: #334155;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #f8fafc;

    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --brand: #e11d48;
    --brand-hover: #be123c;
    --brand-light: #fff1f2;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --success: #059669;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #d97706;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;

    --danger: #dc2626;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;

    --info: #0284c7;
    --info-light: #f0f9ff;
    --info-border: #bae6fd;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.55;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12.5px;
    background-color: #f1f5f9;
    color: #0f172a;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Auth / Login Screen
   ========================================================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 18% 18%, rgba(225, 29, 72, 0.18) 0%, transparent 42%),
                radial-gradient(circle at 82% 80%, rgba(37, 99, 235, 0.20) 0%, transparent 45%),
                linear-gradient(145deg, #070b14 0%, #0f172a 55%, #111827 100%);
}

.auth-card {
    background: var(--bg-card);
    padding: 38px 36px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.auth-logo-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 14px;
}

.auth-logo-img {
    max-width: 100%;
    max-height: 30px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.auth-security-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-light);
    border: 1px solid var(--success-border);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.auth-header {
    text-align: center;
    margin-bottom: 26px;
}

.auth-header h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 13.5px;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap .form-control {
    padding-right: 72px;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.password-toggle-btn:hover {
    color: var(--text-main);
    background: #e2e8f0;
}

.auth-footer-note {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

/* ==========================================================================
   Main App Layout & Sidebar
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 268px;
    background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
    color: var(--text-inverse);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 0 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 18px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 14px;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.sidebar-brand-card {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
}

.sidebar-logo-badge {
    background: transparent;
    padding: 2px 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
    box-shadow: none;
}

.sidebar-logo-img {
    max-width: 185px;
    width: 100%;
    max-height: 26px;
    height: auto;
    object-fit: contain;
    display: block;
}

.sidebar-brand-meta {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-section-label {
    padding: 12px 20px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 0 10px;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 3px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.16s ease;
    position: relative;
}

.sidebar-menu li a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.16s ease;
}

.sidebar-menu li a:hover {
    color: #ffffff;
    background-color: var(--bg-sidebar-hover);
}

.sidebar-menu li a:hover svg {
    color: #e2e8f0;
}

.sidebar-menu li.active a {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(225, 29, 72, 0.22) 0%, rgba(30, 41, 59, 0.85) 100%);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-menu li.active a svg {
    color: #fb7185;
}

.sidebar-menu li a.sidebar-link-between {
    justify-content: space-between;
}

.sidebar-link-left {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.sidebar-badge-danger {
    background-color: var(--brand);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.25);
}

.sidebar-footer {
    padding: 14px 16px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 12px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    transition: all 0.16s ease;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}

/* ==========================================================================
   Topbar & Workspace
   ========================================================================== */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 64px;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-light);
}

.breadcrumb strong {
    color: var(--text-main);
    font-weight: 700;
}

.breadcrumb-sep {
    color: #cbd5e1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, #9f1239 100%);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.content-body {
    padding: 28px 32px 44px;
    flex-grow: 1;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   Page Header & Metrics
   ========================================================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.page-title p {
    color: var(--text-light);
    margin-top: 4px;
    font-size: 13.5px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.metric-card {
    background: var(--bg-card);
    padding: 20px 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #cbd5e1;
}

.metric-card.accent-primary::before { background: var(--primary); }
.metric-card.accent-success::before { background: var(--success); }
.metric-card.accent-warning::before { background: var(--warning); }
.metric-card.accent-danger::before  { background: var(--danger); }
.metric-card.accent-brand::before   { background: var(--brand); }
.metric-card.accent-info::before    { background: var(--info); }

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

.metric-top .metric-label {
    margin-bottom: 0;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.metric-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

/* ==========================================================================
   Cards & Tables
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 22px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

th {
    background-color: var(--bg-subtle);
    font-weight: 700;
    color: #475569;
    font-size: 11.5px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.12s ease;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background-color: #f8fafc;
}

/* ==========================================================================
   Forms & Interactive Module Picker
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #1e293b;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.form-control:disabled {
    background-color: #f1f5f9;
    color: var(--text-light);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.modules-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.module-item {
    border: 1px solid var(--border-color);
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-subtle);
    transition: all 0.15s ease;
}

.module-item:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.module-item:has(input:checked) {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.module-item:has(input:checked) span {
    color: #1e3a8a;
    font-weight: 600;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

.btn-brand {
    background-color: var(--brand);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(225, 29, 72, 0.25);
}

.btn-brand:hover {
    background-color: var(--brand-hover);
    color: #ffffff;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-strong);
    color: #334155;
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: var(--text-main);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
    color: #ffffff;
}

.btn-danger-soft {
    background-color: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.btn-danger-soft:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.btn-warning {
    background-color: var(--warning);
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #b45309;
    color: #ffffff;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #047857;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 7px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11.5px;
    border-radius: 6px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

td .btn-group {
    flex-wrap: nowrap;
}

/* ==========================================================================
   Badges & Alerts
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-success {
    background-color: var(--success-light);
    border-color: var(--success-border);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    border-color: var(--warning-border);
    color: #b45309;
}

.badge-danger {
    background-color: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-light);
    border-color: var(--info-border);
    color: var(--info);
}

.badge-neutral {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

.badge-pro {
    background-color: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border: 1px solid transparent;
    font-size: 13.5px;
    box-shadow: var(--shadow-xs);
}

.alert-success {
    background-color: var(--success-light);
    border-color: var(--success-border);
    color: #065f46;
}

.alert-danger {
    background-color: var(--danger-light);
    border-color: var(--danger-border);
    color: #991b1b;
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: var(--warning-border);
    color: #92400e;
}

.alert-info {
    background-color: var(--info-light);
    border-color: var(--info-border);
    color: #0c4a6e;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */
.filter-bar {
    background-color: #ffffff;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    margin-bottom: 22px;
}

.filter-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    width: 100%;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 190px;
}

.filter-grid-4 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

/* ==========================================================================
   Detail Grid & Rows
   ========================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 22px;
    margin-bottom: 26px;
}

.detail-section {
    margin-bottom: 18px;
}

.detail-section h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    font-size: 13.5px;
    color: var(--text-light);
}

.detail-value {
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
    text-align: right;
}

.detail-row.flex-col .detail-value {
    text-align: left;
    width: 100%;
}

/* ==========================================================================
   One-Time Plaintext License Key Box & Copyable Blocks
   ========================================================================== */
.license-key-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px dashed #f59e0b;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 26px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.license-key-box h3 {
    color: #92400e;
    font-size: 18px;
    margin-bottom: 8px;
}

.license-key-copy-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 8px;
}

.license-key-box code {
    font-size: 20px;
    font-weight: 800;
    background-color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid #fbbf24;
    display: inline-block;
    color: #0f172a;
    letter-spacing: 0.05em;
}

.license-key-box p.warning-text {
    color: #dc2626;
    font-weight: 600;
    font-size: 12.5px;
    margin-top: 8px;
}

.copyable-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.copyable-wrap code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 12.5px;
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.copyable-wrap .btn {
    flex-shrink: 0;
}

/* ==========================================================================
   Pagination (Fixes Tailwind Default SVG & Layout)
   ========================================================================== */
.pagination-wrapper {
    margin: 20px 0 8px;
    display: flex;
    justify-content: center;
}

.pagination-wrapper nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pagination-wrapper nav svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.pagination-wrapper nav p {
    font-size: 12.5px;
    color: var(--text-light);
}

.pagination-wrapper nav span,
.pagination-wrapper nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 7px;
}

.pagination-wrapper nav a {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-body);
    margin: 0 2px;
}

.pagination-wrapper nav a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ==========================================================================
   Custom Confirmation Modal & Copy Toast
   ========================================================================== */
.confirm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-backdrop.is-open {
    display: flex;
}

.confirm-dialog {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 26px;
    animation: modalPop 0.16s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-dialog-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.confirm-dialog-msg {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.55;
    margin-bottom: 22px;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.copy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Entity Avatar / Row Enhancements
   ========================================================================== */
.entity-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #dbeafe;
}

.entity-meta {
    display: flex;
    flex-direction: column;
}

.entity-sub {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}

.customer-note-box {
    background-color: var(--warning-light);
    border: 1px solid var(--warning-border);
    padding: 12px 14px;
    border-radius: 10px;
}

.metric-link-plain,
.metric-link-plain:hover {
    color: inherit;
    text-decoration: none;
}

.mr-6 {
    margin-right: 6px;
}

/* ==========================================================================
   Utility Helper Classes (Zero Inline Styles Policy Compliant)
   ========================================================================== */
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 28px !important; }
.mt-6 { margin-top: 32px !important; }
.mb-0 { margin-bottom: 0px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-6 { margin-bottom: 24px !important; }
.py-40 { padding-top: 40px !important; padding-bottom: 40px !important; }
.py-20 { padding-top: 20px !important; padding-bottom: 20px !important; }

.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-info { color: var(--info) !important; }
.text-light { color: var(--text-light) !important; }
.text-brand { color: var(--brand) !important; }

.font-normal { font-weight: normal !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: bold !important; }
.font-bold-text { font-weight: 700 !important; }

.text-nowrap { white-space: nowrap !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-sm { font-size: 12px !important; }
.text-xs { font-size: 11px !important; }
.text-md { font-size: 13px !important; }

.btn-block { width: 100% !important; }
.w-full { width: 100% !important; }
.changelog-row td { background-color: var(--bg-subtle); }
.list-unstyled { list-style: none !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-start { align-items: flex-start !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.italic { font-style: italic !important; }
.white-space-pre-line { white-space: pre-line !important; }
.hidden { display: none !important; }

.max-w-800 { max-width: 820px !important; }
.max-w-900 { max-width: 940px !important; }
.max-h-400 { max-height: 400px !important; }
.max-h-350 { max-height: 360px !important; }
.overflow-y-auto { overflow-y: auto !important; }

.grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
.grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
.grid-1-col { grid-template-columns: 1fr !important; }
.grid-modules-fill { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)) !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.pricing-input-sm { max-width: 170px !important; min-width: 135px !important; }

.hr-divider { margin: 22px 0 !important; border: 0 !important; border-top: 1px solid var(--border-color) !important; }
.code-block { font-size: 13px !important; background-color: var(--bg-subtle) !important; padding: 8px 12px !important; border-radius: 8px !important; border: 1px solid var(--border-color) !important; display: block !important; overflow-x: auto !important; }
.module-setting-item { border-left: 3px solid var(--primary) !important; padding: 8px 12px !important; margin-bottom: 6px !important; }

.module-active { border-color: var(--success-border) !important; background-color: var(--success-light) !important; }
.module-active strong { color: var(--success) !important; }
.float-right { float: right !important; }

/* ==========================================================================
   Mobile Drawer & Responsive Breakpoints
   ========================================================================== */
.mobile-close {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s;
}

.mobile-close:hover {
    color: #ffffff;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.mobile-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 960px) {
    .topbar-quick-actions {
        display: none;
    }
    .filter-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-close,
    .mobile-toggle {
        display: inline-flex;
    }

    .topbar {
        padding: 0 16px;
        height: 58px;
    }

    .user-pill span.user-name-text {
        display: none;
    }

    .content-body {
        padding: 18px 16px 32px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .filter-grid-4,
    .grid-2,
    .grid-3,
    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    .filter-bar form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        width: 100% !important;
    }
}
