@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --border: #e7e5e4;
    --border-light: #f5f5f4;
    --text-primary: #1c1917;
    --text-secondary: #78716c;
    --text-tertiary: #a8a29e;
    --accent: #0c4a6e;
    --accent-light: #e0f2fe;
    --accent-hover: #0369a1;
    --success: #166534;
    --success-bg: #dcfce7;
    --warning: #854d0e;
    --warning-bg: #fef9c3;
    --danger: #991b1b;
    --danger-bg: #fee2e2;
    --purple: #7c3aed;
    --purple-bg: #f5f3ff;
    --teal: #0f766e;
    --teal-bg: #ccfbf1;
    --pink: #db2777;
    --pink-bg: #fce7f3;
    --orange: #c2410c;
    --orange-bg: #ffedd5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.04), 0 10px 24px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Noto Sans SC', -apple-system, sans-serif;
}

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
}

a {
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    padding: 32px 24px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar {
    display: none;
}

.brand {
    margin-bottom: 32px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.brand-tagline {
    margin-top: 4px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-title {
    color: var(--text-tertiary);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.user-card {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
}

.main {
    flex: 1;
    margin-left: 260px;
    padding: 40px 48px;
    max-width: calc(100vw - 260px);
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.flash {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.flash.success {
    background: var(--success-bg);
    color: var(--success);
}

.flash.error {
    background: var(--danger-bg);
    color: var(--danger);
}

.flash.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel {
    padding: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.yellow {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-trend {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: var(--surface);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.table-shell {
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    font-size: 0.875rem;
}

.table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 500;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}

.table td:first-child,
.table th:first-child {
    padding-left: 22px;
}

.table td:last-child,
.table th:last-child {
    padding-right: 22px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge.success,
.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge.success::before,
.badge-success::before {
    background: var(--success);
}

.badge.muted,
.badge-muted {
    background: var(--bg);
    color: var(--text-tertiary);
}

.badge.muted::before,
.badge-muted::before {
    background: var(--text-tertiary);
}

.badge.danger,
.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge.danger::before,
.badge-danger::before {
    background: var(--danger);
}

.badge.warning,
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge.warning::before,
.badge-warning::before {
    background: var(--warning);
}

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

.badge.info::before,
.badge-info::before {
    background: var(--accent);
}

.badge-purple {
    background: var(--purple-bg);
    color: var(--purple);
}
.badge-purple::before { background: var(--purple); }

.badge-teal {
    background: var(--teal-bg);
    color: var(--teal);
}
.badge-teal::before { background: var(--teal); }

.badge-pink {
    background: var(--pink-bg);
    color: var(--pink);
}
.badge-pink::before { background: var(--pink); }

.badge-orange {
    background: var(--orange-bg);
    color: var(--orange);
}
.badge-orange::before { background: var(--orange); }

.badge-delete { background: var(--danger-bg); color: var(--danger); }
.badge-delete::before { background: var(--danger); }
.badge-update { background: var(--accent-light); color: var(--accent); }
.badge-update::before { background: var(--accent); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-pending::before { background: var(--warning); }

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(12, 74, 110, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(12, 74, 110, 0.03) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 18px;
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

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

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 280px;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-body);
    background: var(--surface);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.search-box input:focus ~ svg {
    color: var(--accent);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px;
}

.card-title {
    font-weight: 500;
    font-size: 0.875rem;
}

.card-action {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

.card-action:hover {
    text-decoration: underline;
}.hint {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    margin-top: 6px;
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.text-link {
    color: var(--accent);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

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

.text-sm {
    font-size: 0.875rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.bot-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.bot-avatar.green {
    background: var(--success-bg);
    color: var(--success);
}

.bot-avatar.yellow {
    background: var(--warning-bg);
    color: var(--warning);
}

.bot-avatar.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.bot-name {
    font-weight: 600;
}

.bot-username {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    margin-top: 4px;
}

.plugin-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.plugin-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.plugin-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.plugin-info {
    min-width: 0;
    flex: 1;
}

.plugin-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.plugin-name {
    font-weight: 600;
}

.plugin-version {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 4px;
}

.badge-button {
    border: none;
    cursor: pointer;
    font: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.badge-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    opacity: 0.92;
}

.plugin-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    min-height: 3.2em;
    margin: 0 0 16px;
}

.plugin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.plugin-author {
    color: var(--text-tertiary);
    font-size: 0.82rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.settings-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border-light);
}

.settings-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.settings-desc {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.settings-body {
    padding: 0 22px;
}

.settings-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-row:last-child {
    border-bottom: 0;
}

.settings-label {
    max-width: none;
}

.plugin-settings-control {
    width: 100%;
}

.empty-state {
    padding: 30px 22px;
    color: var(--text-secondary);
}

.plugin-settings-adapter form {
    margin: 0;
}

.plugin-settings-adapter .space-y-6 > * + * {
    margin-top: 24px;
}

.plugin-settings-adapter .form-group {
    margin-bottom: 18px;
}

.plugin-settings-adapter .form-group.mt-2,
.plugin-settings-adapter .mt-2 {
    margin-top: 12px;
}

.plugin-settings-adapter .block {
    display: block;
}

.plugin-settings-adapter .mb-2 {
    margin-bottom: 8px;
}

.plugin-settings-adapter .mt-1 {
    margin-top: 4px;
}

.plugin-settings-adapter .text-sm {
    font-size: 0.9rem;
}

.plugin-settings-adapter .text-xs {
    font-size: 0.78rem;
}

.plugin-settings-adapter .font-semibold {
    font-weight: 600;
}

.plugin-settings-adapter .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.plugin-settings-adapter .text-slate-700,
.plugin-settings-adapter label {
    color: var(--text-primary);
}

.plugin-settings-adapter .text-slate-500 {
    color: var(--text-secondary);
}

.plugin-settings-adapter .w-full,
.plugin-settings-adapter .form-control {
    width: 100%;
}

.plugin-settings-adapter .rounded,
.plugin-settings-adapter .form-control {
    border-radius: var(--radius-sm);
}

.plugin-settings-adapter .border,
.plugin-settings-adapter .form-control {
    border: 1px solid var(--border);
}

.plugin-settings-adapter .border-slate-200 {
    border-color: var(--border);
}

.plugin-settings-adapter .px-3 {
    padding-left: 14px;
    padding-right: 14px;
}

.plugin-settings-adapter .py-2 {
    padding-top: 11px;
    padding-bottom: 11px;
}

.plugin-settings-adapter textarea.w-full,
.plugin-settings-adapter textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.plugin-settings-adapter input.w-full,
.plugin-settings-adapter textarea.w-full,
.plugin-settings-adapter input.form-control,
.plugin-settings-adapter textarea.form-control {
    background: var(--surface);
    color: var(--text-primary);
    font: inherit;
}

.plugin-settings-adapter .bg-blue-600 {
    background: var(--accent);
}

.plugin-settings-adapter .text-white {
    color: #fff;
}

.plugin-settings-adapter button.rounded.bg-blue-600,
.plugin-settings-adapter button.btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active,
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.active .modal,
.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* === Toggle Switch === */
.toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 8px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 999px;
    transition: 0.25s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 4px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.pagination-pages {
    display: flex;
    gap: 4px;
}

.pagination-btn,
.pagination-page {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    color: var(--text-primary);
}

.pagination-btn:hover,
.pagination-page:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-page.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.breadcrumb-item {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-tertiary);
}

/* === User Avatar Small === */
.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* === Badge variants === */
.badge.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

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

.badge.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* === Form elements === */
.form-select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--surface);
    color: var(--text-primary);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    margin-top: 6px;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

/* === Toggle row === */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.toggle-label {
    font-size: 0.9rem;
}

/* === Checkbox group === */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.15s, background 0.15s;
}

.checkbox-item:hover {
    border-color: var(--accent-light);
}

.checkbox-item input {
    accent-color: var(--accent);
    margin: 0;
}

/* === Page header with actions === */
.page-header.flex {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header .btn svg {
    width: 16px;
    height: 16px;
}

/* === Mono text === */
.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
}

/* === Utility text colors === */
.text-secondary {
    color: var(--text-secondary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

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

/* === Table actions === */
.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.table-action-btn {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.table-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.table-action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* === Form error message === */
.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* === Empty state with icon === */
.empty-state-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}

.empty-state-icon svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* === Site card styles === */
.site-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.site-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.site-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.site-card-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.site-card-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.site-card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.site-card-stat svg {
    width: 16px;
    height: 16px;
}

.site-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* === Action row in forms === */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 960px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-light);
    }

    .layout {
        display: block;
    }

    .main {
        margin-left: 0;
        max-width: none;
        padding: 24px;
    }

    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .content-grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .search-box {
        min-width: 100%;
    }
}

/* === Additional form elements === */
.select-input {
    width: auto;
    min-width: 140px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
}

.select-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* === Card action link === */
.card-action {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

.card-action:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* === Text utilities === */
.text-sm {
    font-size: 0.875rem;
}

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

.text-lg {
    font-size: 1.1rem;
}

.text-xl {
    font-size: 1.25rem;
}

/* === Table container === */
.table-container {
    overflow-x: auto;
}

/* === Toolbar layout === */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === Filter form === */
.filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

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

.filter-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* === Empty state with action === */
.empty-state-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
    color: var(--text-tertiary);
}

.empty-state-action p {
    margin: 0 0 12px;
    font-size: 0.9rem;
}

/* ============================================
   Action Links（替代 table-action-btn）
   ============================================ */

.action-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    margin-right: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

.action-link:hover {
    color: var(--accent);
}

.action-link.danger:hover {
    color: var(--danger);
}

/* ============================================
   Bot Cell
   ============================================ */

.bot-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bot-avatar.cyan { background: var(--accent-light); }
.bot-avatar.green { background: var(--success-bg); }
.bot-avatar.yellow { background: var(--warning-bg); }
.bot-avatar.red { background: var(--danger-bg); }
.bot-avatar.purple { background: #f3e8ff; }

.bot-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.bot-username {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Timeline
   ============================================ */

.timeline {
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 24px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.timeline-dot.blue { background: var(--accent); }
.timeline-dot.green { background: var(--success); }
.timeline-dot.yellow { background: var(--warning); }
.timeline-dot.red { background: var(--danger); }
.timeline-dot.purple { background: #7c3aed; }
.timeline-dot.orange { background: #ea580c; }

.timeline-content {
    flex: 1;
}

.timeline-text {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 4px;
}

.timeline-text strong {
    color: var(--accent);
    font-weight: 500;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeUp {
    from { opacity: 0; margin-top: 12px; }
    to { opacity: 1; margin-top: 0; }
}

.page.fadeUp {
    animation: fadeUp 0.4s ease-out both;
}

/* ============================================
   Tabs（与现有 .tab-btn 共存，新页面推荐 .tab-item）
   ============================================ */

.tab-item {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font: inherit;
}

.tab-item:hover {
    color: var(--accent);
}

.tab-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================
   Pagination Item（补充现有 .pagination-page）
   ============================================ */

.pagination-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    background: none;
    border: 1px solid var(--border);
}

.pagination-item:hover {
    background: var(--border-light);
    color: var(--accent);
}

.pagination-item.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: var(--text-tertiary);
    padding: 0 8px;
}

/* ============================================
   Breadcrumb 补充
   ============================================ */

.breadcrumb-separator {
    color: var(--text-tertiary);
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--accent);
}

.breadcrumb-sep {
    color: var(--text-tertiary);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   Info Row
   ============================================ */

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.info-item {
    background: var(--surface);
    padding: 16px 20px;
}

.info-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   Detail Grid
   ============================================ */

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: start;
}

.card-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Bar Chart (CSS only)
   ============================================ */

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    min-width: 40px;
}

.bar-fill.blue { background: var(--accent); }
.bar-fill.green { background: var(--success); }
.bar-fill.yellow { background: var(--warning); }
.bar-fill.red { background: var(--danger); }
.bar-fill.purple { background: #7c3aed; }

/* ============================================
   Pie Chart (CSS only - Donut)
   ============================================ */

.pie-container {
    display: flex;
    align-items: center;
    gap: 24px;
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        var(--accent) 0deg 126deg,
        var(--success) 126deg 216deg,
        var(--warning) 216deg 288deg,
        var(--danger) 288deg 324deg,
        var(--border-light) 324deg 360deg
    );
}

.pie-chart::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: var(--surface);
    border-radius: 50%;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.pie-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ============================================
   Alert
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert.success, .alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert.warning, .alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert.danger, .alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert.info, .alert-info {
    background: var(--accent-light);
    color: var(--accent);
}

/* ============================================
   Utilities
   ============================================ */

.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-display { font-family: var(--font-display); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* === Stat Mini === */
.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-mini-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-mini-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
