/* ============================================================
   可梵企业网站管理系统 - 后台专用样式
   主色调：蓝色系
   类名前缀：admin-
   ============================================================ */

/* ========== CSS变量 ========== */
:root {
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-primary-light: #dbeafe;
    --admin-success: #16a34a;
    --admin-warning: #d97706;
    --admin-danger: #dc2626;
    --admin-info: #0891b2;
    --admin-bg: #f1f5f9;
    --admin-sidebar-bg: #1e293b;
    --admin-sidebar-hover: #334155;
    --admin-sidebar-active: #2563eb;
    --admin-sidebar-text: #cbd5e1;
    --admin-sidebar-text-active: #ffffff;
    --admin-header-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #1e293b;
    --admin-text-secondary: #64748b;
    --admin-radius: 6px;
    --admin-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --admin-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --admin-sidebar-width: 240px;
    --admin-header-height: 56px;
}

/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--admin-text);
    background: var(--admin-bg);
    line-height: 1.6;
}
a { color: var(--admin-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ========== Login Page ========== */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}
.admin-login-box {
    width: 100%;
    max-width: 400px;
    margin: 0 16px;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.admin-login-logo {
    text-align: center;
    margin-bottom: 30px;
}
.admin-login-logo h1 {
    font-size: 22px;
    color: var(--admin-text);
    margin-bottom: 4px;
}
.admin-login-logo p {
    color: var(--admin-text-secondary);
    font-size: 13px;
}
.admin-login-error {
    background: #fef2f2;
    color: var(--admin-danger);
    padding: 10px 14px;
    border-radius: var(--admin-radius);
    margin-bottom: 16px;
    font-size: 13px;
    display: none;
}
.admin-login-error.show { display: block; }

/* ========== Layout ========== */
.admin-layout { display: flex; min-height: 100vh; }

/* ========== Sidebar ========== */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: var(--admin-sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: width .2s;
}
.admin-sidebar-logo {
    height: var(--admin-header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.1);
    white-space: nowrap;
    overflow: hidden;
}
.admin-sidebar-logo .logo-icon {
    width: 28px; height: 28px;
    background: var(--admin-primary);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px;
    font-size: 14px;
    flex-shrink: 0;
}
.admin-menu { list-style: none; padding: 8px 0; }
.admin-menu-group-title {
    padding: 12px 20px 6px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.admin-menu-item {
    position: relative;
}
.admin-menu-item > a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--admin-sidebar-text);
    font-size: 14px;
    transition: all .15s;
    cursor: pointer;
    white-space: nowrap;
}
.admin-menu-item > a:hover {
    background: var(--admin-sidebar-hover);
    color: #fff;
    text-decoration: none;
}
.admin-menu-item.active > a {
    background: var(--admin-sidebar-active);
    color: var(--admin-sidebar-text-active);
}
.admin-menu-item .menu-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    flex-shrink: 0;
}
.admin-menu-item .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform .2s;
}
.admin-menu-item.expanded .arrow { transform: rotate(90deg); }
.admin-menu-sub {
    list-style: none;
    display: none;
    background: rgba(0,0,0,.2);
}
.admin-menu-item.expanded .admin-menu-sub { display: block; }
.admin-menu-sub li a {
    display: block;
    padding: 8px 20px 8px 50px;
    color: var(--admin-sidebar-text);
    font-size: 13px;
    transition: all .15s;
    cursor: pointer;
}
.admin-menu-sub li a:hover { color: #fff; text-decoration: none; }
.admin-menu-sub li.active a {
    color: var(--admin-sidebar-text-active);
    background: var(--admin-sidebar-active);
}

/* ========== Main Area ========== */
.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ========== Header ========== */
.admin-header {
    height: var(--admin-header-height);
    background: var(--admin-header-bg);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--admin-shadow);
}
.admin-header-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}
.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.admin-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--admin-radius);
}
.admin-header-user:hover { background: var(--admin-bg); }
.admin-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--admin-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.admin-user-info { line-height: 1.3; }
.admin-user-name { font-size: 13px; font-weight: 500; }
.admin-user-role { font-size: 11px; color: var(--admin-text-secondary); }

/* ========== Content ========== */
.admin-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
.admin-page { display: none; }
.admin-page.active { display: block; }

/* ========== Cards ========== */
.admin-card {
    background: #fff;
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    margin-bottom: 20px;
}
.admin-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-card-title { font-size: 15px; font-weight: 600; }
.admin-card-body { padding: 20px; }
.admin-card-body.no-padding { padding: 0; }

/* ========== Stats Cards ========== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.admin-stat-card {
    background: #fff;
    border-radius: var(--admin-radius);
    padding: 20px;
    box-shadow: var(--admin-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}
.admin-stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.admin-stat-icon.blue { background: var(--admin-primary-light); color: var(--admin-primary); }
.admin-stat-icon.green { background: #dcfce7; color: var(--admin-success); }
.admin-stat-icon.orange { background: #fef3c7; color: var(--admin-warning); }
.admin-stat-icon.red { background: #fee2e2; color: var(--admin-danger); }
.admin-stat-icon.cyan { background: #cffafe; color: var(--admin-info); }
.admin-stat-info .label { font-size: 12px; color: var(--admin-text-secondary); }
.admin-stat-info .value { font-size: 24px; font-weight: 700; line-height: 1.3; }
.admin-stat-info .sub { font-size: 12px; color: var(--admin-text-secondary); }

/* ========== Tables ========== */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text-secondary);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--admin-border);
}
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table .ops a, .admin-table .ops button {
    margin-right: 8px;
    font-size: 13px;
    cursor: pointer;
}
.admin-table .ops a:last-child, .admin-table .ops button:last-child { margin-right: 0; }
.admin-table .thumb {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--admin-border);
}

/* ========== Badges ========== */
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.admin-badge.success { background: #dcfce7; color: #15803d; }
.admin-badge.warning { background: #fef3c7; color: #b45309; }
.admin-badge.danger { background: #fee2e2; color: #b91c1c; }
.admin-badge.info { background: #cffafe; color: #0e7490; }
.admin-badge.default { background: #f1f5f9; color: #475569; }
.admin-badge.primary { background: var(--admin-primary-light); color: var(--admin-primary); }

/* ========== Buttons ========== */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border-radius: var(--admin-radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.admin-btn:disabled { opacity: .5; cursor: not-allowed; }
.admin-btn-primary { background: var(--admin-primary); color: #fff; border-color: var(--admin-primary); }
.admin-btn-primary:hover { background: var(--admin-primary-dark); }
.admin-btn-default { background: #fff; color: var(--admin-text); border-color: var(--admin-border); }
.admin-btn-default:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.admin-btn-danger { background: #fff; color: var(--admin-danger); border-color: #fecaca; }
.admin-btn-danger:hover { background: var(--admin-danger); color: #fff; }
.admin-btn-success { background: var(--admin-success); color: #fff; border-color: var(--admin-success); }
.admin-btn-sm { padding: 4px 10px; font-size: 12px; }
.admin-btn-lg { padding: 10px 24px; font-size: 15px; }
.admin-btn-block { display: flex; justify-content: center; width: 100%; }

/* ========== Forms ========== */
.admin-form-group { margin-bottom: 16px; }
.admin-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--admin-text);
}
.admin-form-label .req { color: var(--admin-danger); }
.admin-form-control, .admin-form-select, .admin-form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    font-size: 14px;
    color: var(--admin-text);
    background: #fff;
    transition: border-color .15s;
    outline: none;
}
.admin-form-control:focus, .admin-form-select:focus, .admin-form-textarea:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.admin-form-textarea { min-height: 100px; resize: vertical; }
.admin-form-hint { font-size: 12px; color: var(--admin-text-secondary); margin-top: 4px; }
.admin-form-row { display: flex; gap: 16px; }
.admin-form-row > .admin-form-group { flex: 1; }
.admin-form-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ========== Search Bar ========== */
.admin-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.admin-search-bar .admin-form-control,
.admin-search-bar .admin-form-select { width: auto; min-width: 140px; }

/* ========== Pagination ========== */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-pagination-info { font-size: 13px; color: var(--admin-text-secondary); }
.admin-pagination-pages { display: flex; gap: 4px; }
.admin-pagination-pages button {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--admin-border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.admin-pagination-pages button:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.admin-pagination-pages button.active {
    background: var(--admin-primary);
    color: #fff;
    border-color: var(--admin-primary);
}
.admin-pagination-pages button:disabled { opacity: .4; cursor: not-allowed; }

/* ========== Modal ========== */
.admin-modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    overflow-y: auto;
}
.admin-modal-mask.show { display: flex; }
.admin-modal {
    background: #fff;
    border-radius: 8px;
    width: 560px;
    max-width: 95%;
    box-shadow: var(--admin-shadow-lg);
}
.admin-modal-lg { width: 800px; }
.admin-modal-sm { width: 400px; }
.admin-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-modal-title { font-size: 16px; font-weight: 600; }
.admin-modal-close {
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: var(--admin-text-secondary);
    line-height: 1;
}
.admin-modal-close:hover { color: var(--admin-text); }
.admin-modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.admin-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========== Tabs ========== */
.admin-tabs {
    border-bottom: 2px solid var(--admin-border);
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}
.admin-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--admin-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.admin-tab:hover { color: var(--admin-primary); }
.admin-tab.active {
    color: var(--admin-primary);
    border-bottom-color: var(--admin-primary);
    font-weight: 600;
}
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* ========== Toast ========== */
.admin-toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-toast {
    padding: 12px 20px;
    border-radius: var(--admin-radius);
    color: #fff;
    font-size: 14px;
    box-shadow: var(--admin-shadow-lg);
    animation: adminSlideIn .3s ease;
    min-width: 200px;
}
.admin-toast.success { background: var(--admin-success); }
.admin-toast.error { background: var(--admin-danger); }
.admin-toast.warning { background: var(--admin-warning); }
.admin-toast.info { background: var(--admin-info); }
@keyframes adminSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== Rich Text Editor ========== */
.admin-editor-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px;
    background: #f8fafc;
    border: 1px solid var(--admin-border);
    border-bottom: none;
    border-radius: var(--admin-radius) var(--admin-radius) 0 0;
    flex-wrap: wrap;
}
.admin-editor-toolbar button {
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--admin-text);
}
.admin-editor-toolbar button:hover { background: #e2e8f0; }
.admin-editor-area {
    min-height: 300px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 0 0 var(--admin-radius) var(--admin-radius);
    outline: none;
    background: #fff;
    line-height: 1.8;
}
.admin-editor-area:focus { border-color: var(--admin-primary); }
.admin-editor-area img { max-width: 100%; }

/* ========== Upload ========== */
.admin-upload-preview {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-upload-item {
    position: relative;
    width: 100px; height: 100px;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    overflow: hidden;
}
.admin-upload-item img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.admin-upload-item .remove {
    position: absolute;
    top: 2px; right: 2px;
    width: 20px; height: 20px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}
.admin-upload-btn {
    width: 100px; height: 100px;
    border: 2px dashed var(--admin-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--admin-text-secondary);
    font-size: 24px;
    transition: border-color .15s;
}
.admin-upload-btn:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.admin-upload-btn .hint { font-size: 11px; }

/* ========== Tree ========== */
.admin-tree { list-style: none; }
.admin-tree li { padding: 4px 0; }
.admin-tree .tree-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
}
.admin-tree .tree-row:hover { background: #f1f5f9; }
.admin-tree .tree-toggle {
    width: 20px; cursor: pointer;
    display: inline-block;
    text-align: center;
    color: var(--admin-text-secondary);
}
.admin-tree .tree-label { flex: 1; }
.admin-tree .tree-ops { display: none; gap: 6px; }
.admin-tree .tree-row:hover .tree-ops { display: flex; }
.admin-tree .tree-children { list-style: none; padding-left: 24px; }
.admin-tree.collapsed .tree-children { display: none; }

/* ========== Chat (CS) ========== */
.admin-chat-layout {
    display: flex;
    height: calc(100vh - var(--admin-header-height) - 80px);
    min-height: 400px;
}
.admin-chat-sessions {
    width: 260px;
    border-right: 1px solid var(--admin-border);
    overflow-y: auto;
    background: #fff;
}
.admin-chat-session-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
    cursor: pointer;
}
.admin-chat-session-item:hover { background: #f8fafc; }
.admin-chat-session-item.active { background: var(--admin-primary-light); }
.admin-chat-session-name { font-weight: 500; font-size: 13px; }
.admin-chat-session-msg {
    font-size: 12px;
    color: var(--admin-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}
.admin-chat-msg {
    margin-bottom: 12px;
    display: flex;
}
.admin-chat-msg.me { justify-content: flex-end; }
.admin-chat-bubble {
    max-width: 60%;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}
.admin-chat-msg.other .admin-chat-bubble {
    background: #fff;
    border: 1px solid var(--admin-border);
}
.admin-chat-msg.me .admin-chat-bubble {
    background: var(--admin-primary);
    color: #fff;
}
.admin-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--admin-border);
}
.admin-chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    outline: none;
}

/* ========== Empty State ========== */
.admin-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--admin-text-secondary);
}
.admin-empty .icon { font-size: 48px; margin-bottom: 12px; }

/* ========== Utility ========== */
.admin-text-right { text-align: right; }
.admin-text-center { text-align: center; }
.admin-text-danger { color: var(--admin-danger); }
.admin-text-success { color: var(--admin-success); }
.admin-text-secondary { color: var(--admin-text-secondary); }
.admin-mt-10 { margin-top: 10px; }
.admin-mt-20 { margin-top: 20px; }
.admin-mb-10 { margin-bottom: 10px; }
.admin-mb-20 { margin-bottom: 20px; }
.admin-flex { display: flex; }
.admin-flex-between { display: flex; justify-content: space-between; align-items: center; }
.admin-flex-wrap { flex-wrap: wrap; }
.admin-gap-10 { gap: 10px; }
.admin-gap-16 { gap: 16px; }
.admin-hidden { display: none !important; }
.admin-w-full { width: 100%; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.admin-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ========== Detail View ========== */
.admin-desc {
    display: table;
    width: 100%;
}
.admin-desc-item {
    display: table-row;
}
.admin-desc-label {
    display: table-cell;
    padding: 8px 12px;
    background: #f8fafc;
    font-weight: 500;
    width: 140px;
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}
.admin-desc-value {
    display: table-cell;
    padding: 8px 12px;
    border-bottom: 1px solid var(--admin-border);
}

/* ========== Switch ========== */
.admin-switch {
    position: relative;
    display: inline-block;
    width: 40px; height: 22px;
}
.admin-switch input { opacity: 0; width: 0; height: 0; }
.admin-switch .slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    cursor: pointer;
    transition: .2s;
}
.admin-switch .slider:before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 2px; top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}
.admin-switch input:checked + .slider { background: var(--admin-primary); }
.admin-switch input:checked + .slider:before { transform: translateX(18px); }

/* ========== Mobile Sidebar Toggle ========== */
.admin-sidebar-toggle {
    display: none;
    width: 36px; height: 36px;
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    cursor: pointer;
    margin-right: 12px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.admin-sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--admin-text);
    transition: all .2s;
}
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .admin-sidebar-toggle { display: flex; }
    .admin-sidebar {
        width: var(--admin-sidebar-width);
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.3);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-sidebar-backdrop.show { display: block; }
    .admin-main { margin-left: 0; }
    .admin-header { padding: 0 12px; }
    .admin-header-title { font-size: 15px; }
    .admin-content { padding: 12px; }
    .admin-form-row { flex-direction: column; }
    .admin-grid-2, .admin-grid-3, .admin-grid-4 { grid-template-columns: 1fr; }
    .admin-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .admin-stat-card { padding: 14px; gap: 10px; }
    .admin-stat-icon { width: 38px; height: 38px; font-size: 18px; }
    .admin-stat-info .value { font-size: 20px; }
    .admin-card-body { padding: 14px; }
    .admin-modal { width: 95%; margin: 0 auto; }
    .admin-modal-body { max-height: 50vh; }
    .admin-search-bar { flex-direction: column; align-items: stretch; }
    .admin-search-bar .admin-form-control,
    .admin-search-bar .admin-form-select { width: 100%; }
    .admin-pagination { flex-direction: column; align-items: stretch; }
    .admin-pagination-pages { justify-content: center; }
    .admin-chat-layout { flex-direction: column; height: auto; min-height: 500px; }
    .admin-chat-sessions { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--admin-border); }
    .admin-chat-bubble { max-width: 85%; }
    .admin-header-user .admin-user-info { display: none; }
    .admin-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .admin-tab { white-space: nowrap; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 6px; }
    .admin-toast-wrap { top: 10px; right: 10px; left: 10px; }
    .admin-toast { min-width: 0; }
    .admin-editor-toolbar { overflow-x: auto; flex-wrap: nowrap; }
}
@media (max-width: 480px) {
    .admin-stats-grid { grid-template-columns: 1fr; }
    .admin-form-inline { flex-direction: column; align-items: stretch; }
    .admin-modal-lg, .admin-modal { width: 100%; max-width: 100%; }
    .admin-modal-body { padding: 14px; max-height: 60vh; }
    .admin-card-header { flex-wrap: wrap; gap: 8px; }
    .admin-login-box { padding: 24px 20px; margin: 0 12px; }
    .admin-login-logo h1 { font-size: 18px; }
    .admin-header-right .admin-btn { padding: 4px 8px; font-size: 12px; }
}
