/**
 * X-Content — Design system: indigo + slate
 * Primary: rgb(79 70 229) = #4f46e5
 */
:root {
    --xc-primary: #4f46e5;
    --xc-primary-rgb: 79, 70, 229;
    --xc-primary-light: #6366f1;
    --xc-primary-dark: #4338ca;
    --xc-primary-muted: #312e81;
    --xc-primary-glow: rgba(79, 70, 229, 0.15);
    --xc-primary-surface: #eef2ff;
    --xc-primary-border: #c7d2fe;

    /* alias cho legacy-bridge.css */
    --xc-green: var(--xc-primary);
    --xc-green-light: var(--xc-primary-light);
    --xc-green-dark: var(--xc-primary-dark);
    --xc-green-muted: var(--xc-primary-muted);
    --xc-green-glow: var(--xc-primary-glow);
    --xc-green-surface: var(--xc-primary-surface);
    --xc-green-border: var(--xc-primary-border);

    --xc-dark: #0f172a;
    --xc-dark-2: #1e293b;
    --xc-dark-3: #334155;
    --xc-dark-hover: #1e1b4b;

    --xc-surface: #f8fafc;
    --xc-card: #ffffff;
    --xc-border: #e2e8f0;
    --xc-text: #0f172a;
    --xc-text-muted: #64748b;

    --xc-danger: #dc2626;
    --xc-danger-bg: #fef2f2;
    --xc-danger-border: #fecaca;
}

/* ─── Typography tokens (shell + legacy) ─── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.xc-page-header h1,
.xc-page-header-mobile h1 {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    letter-spacing: -0.02em;
}

.xc-main {
    padding: 12px 12px 16px;
}

@media (min-width: 640px) {
    .xc-main {
        padding: 16px 16px 20px;
    }
}

@media (min-width: 768px) {
    .xc-main {
        padding: 20px 24px 24px;
    }
}

.xc-page-header {
    margin-bottom: 16px;
}

.xc-page-header-mobile {
    margin-bottom: 12px;
}

.xc-flash {
    margin-bottom: 12px;
}

/* ─── Sidebar (một layout duy nhất) ─── */
.xc-sidebar {
    background: linear-gradient(180deg, #1e1b4b 0%, var(--xc-dark) 100%);
    padding: 16px 12px;
}

.xc-sidebar-brand {
    margin-bottom: 20px;
    padding: 0 12px;
}

.xc-sidebar-brand-link {
    color: inherit;
    cursor: pointer;
    transition: opacity 0.15s ease;
    padding-right: 36px;
    text-align: left;
}

@media (min-width: 768px) {
    .xc-sidebar-brand-link {
        padding-right: 0;
    }
}

.xc-sidebar-brand-link:hover {
    opacity: 0.88;
}

.xc-sidebar-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 64px;
    object-fit: contain;
    object-position: left center;
}

.xc-mobile-brand {
    color: inherit;
}

.xc-mobile-brand .xc-sidebar-logo {
    max-height: 36px;
}

.xc-sidebar-title {
    color: #a5b4fc;
}

.xc-sidebar-subtitle {
    color: rgba(165, 180, 252, 0.55);
}

.xc-sidebar-close {
    color: rgba(165, 180, 252, 0.7);
}

.xc-sidebar-close:hover {
    background: rgba(79, 70, 229, 0.25);
    color: #fff;
}

.xc-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xc-nav-section {
    padding: 16px 8px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(129, 140, 248, 0.65);
}

.xc-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
    text-decoration: none;
    line-height: 1.25;
}

.xc-nav-active {
    background: var(--xc-primary) !important;
    color: #fff !important;
}

.xc-nav-hover:hover {
    background: var(--xc-dark-hover) !important;
    color: #fff !important;
}

.xc-sidebar-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(79, 70, 229, 0.25);
}

.xc-sidebar-logout {
    color: rgba(203, 213, 225, 0.85) !important;
}

.xc-mobile-bar {
    background: linear-gradient(90deg, #1e1b4b, var(--xc-dark));
    border-color: rgba(79, 70, 229, 0.35) !important;
}

.xc-mobile-toggle:hover {
    background: rgba(79, 70, 229, 0.25);
}

.xc-mobile-credit {
    color: #a5b4fc;
}

/* ─── Credit pill ─── */
.xc-credit {
    background: var(--xc-primary-surface);
    color: var(--xc-primary-dark);
    border-color: var(--xc-primary-border);
}

/* ─── Buttons ─── */
.xc-btn-primary,
.xc-btn {
    background: var(--xc-primary) !important;
    color: #fff !important;
    border: none !important;
    transition: background 0.2s ease;
}

.xc-btn-primary:hover,
.xc-btn:hover {
    background: var(--xc-primary-dark) !important;
}

.xc-btn-secondary {
    background: var(--xc-dark-2) !important;
    color: #fff !important;
    border: none !important;
}

.xc-btn-secondary:hover {
    background: var(--xc-dark) !important;
}

.xc-btn-outline {
    background: transparent !important;
    color: var(--xc-primary-dark) !important;
    border: 2px solid var(--xc-primary) !important;
}

.xc-btn-outline:hover {
    background: var(--xc-primary-surface) !important;
}

/* ─── Tabs ─── */
.xc-tab-active {
    background: #fff !important;
    color: var(--xc-text) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.xc-tab {
    color: var(--xc-text-muted);
}

.xc-tab:hover {
    color: var(--xc-text);
}

/* ─── Cards ─── */
.xc-card:hover {
    border-color: var(--xc-primary-light) !important;
}

.xc-card-icon {
    background: var(--xc-primary-surface) !important;
    color: var(--xc-primary) !important;
}

.xc-card:hover .xc-card-icon {
    background: var(--xc-primary) !important;
    color: #fff !important;
}

.xc-card-accent {
    border-color: var(--xc-primary-border) !important;
    background: var(--xc-primary-surface) !important;
}

.xc-card-accent strong {
    color: var(--xc-primary-muted) !important;
}

.xc-card-accent p {
    color: var(--xc-primary-dark) !important;
}

/* ─── Forms ─── */
.xc-input:focus {
    border-color: var(--xc-primary) !important;
    box-shadow: 0 0 0 3px var(--xc-primary-glow);
}

/* ─── Alerts ─── */
.xc-alert-success {
    background: var(--xc-primary-surface);
    border: 1px solid var(--xc-primary-border);
    color: var(--xc-primary-muted);
}

.xc-alert-error {
    background: var(--xc-danger-bg);
    border: 1px solid var(--xc-danger-border);
    color: var(--xc-danger);
}

/* Admin cấu hình — full width vùng content */
.xc-admin-panel {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.xc-main > .mb-6.flex.flex-wrap.gap-2 {
    width: 100%;
}
