/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f7fa;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #606266;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #409eff;
}

.captcha-group {
    display: flex;
    gap: 10px;
}

.captcha-group input {
    flex: 1;
}

.captcha-img {
    width: 120px;
    height: 40px;
    background: #f5f7fa;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
    user-select: none;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #409eff;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #66b1ff;
}

.btn-primary:disabled {
    background: #a0cfff;
    cursor: not-allowed;
}

.btn:disabled,
.btn-sm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 后台管理系统布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 220px;
    background: #304156;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.2s ease;
}

.sidebar-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2b3a4d;
    font-size: 18px;
    font-weight: bold;
    padding: 0 44px 0 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.sidebar-toggle {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: #bfcbd9;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #263445;
    color: #fff;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
}

.sidebar-menu a span {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
}

body.sidebar-collapsed .sidebar {
    width: 64px;
}

body.sidebar-collapsed .sidebar-logo {
    padding: 0;
    text-indent: -999px;
}

body.sidebar-collapsed .sidebar-toggle {
    right: 16px;
}

body.sidebar-collapsed .sidebar-menu a {
    padding: 14px 22px;
    gap: 22px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s ease;
}

body.sidebar-collapsed .main-content {
    margin-left: 64px;
}

/* 顶部导航 */
.header {
    height: 60px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-user span {
    color: #606266;
}

.btn-logout {
    background: #f56c6c;
    color: #fff;
    padding: 6px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout:hover {
    background: #f78989;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ebeef5;
}

.card-header h3 {
    font-size: 16px;
    color: #303133;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.table th {
    background: #f5f7fa;
    color: #606266;
    font-weight: 600;
}

.table tr:hover {
    background: #f5f7fa;
}

.core-ent-table-item {
    line-height: 1.5;
    margin-bottom: 4px;
}

.core-ent-table-item:last-child {
    margin-bottom: 0;
}

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.tag-pending {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.tag-done {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.tag-level-normal {
    background: #f0f9ff;
    color: #409eff;
    border: 1px solid #b3d8ff;
}

.tag-level-high {
    background: #fdf6ec;
    color: #e6a23c;
    border: 1px solid #f5dab1;
}

.tag-level-urgent {
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fbc4c4;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-edit {
    background: #409eff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-edit:hover {
    background: #66b1ff;
}

.btn-add {
    background: #67c23a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px 16px;
}

.btn-add:hover {
    background: #85ce61;
}

/* 筛选表单 */
.filter-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-form .form-group {
    margin-bottom: 0;
}

.filter-form select {
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

/* 统计页面 */
.stats-refresh-btn {
    width: auto;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stats-summary-double {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-card {
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 18px;
    background: #fafcff;
}

.stats-amount-card {
    background: #f6ffed;
}

.stats-commission-card {
    background: #fff7e6;
}

.stats-label {
    color: #606266;
    font-size: 13px;
    margin-bottom: 10px;
}

.stats-value {
    color: #303133;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.stats-ratio {
    color: #409eff;
}

.stats-amount-value,
.stats-amount-text {
    color: #52c41a;
}

.stats-commission-value,
.stats-commission-text {
    color: #fa8c16;
}

.stats-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid #ebeef5;
}

.stats-tab {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #606266;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
}

.stats-tab:hover,
.stats-tab.active {
    color: #409eff;
    border-bottom-color: #409eff;
}

.stats-panel {
    display: none;
}

.stats-panel.active {
    display: block;
}

.stats-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    background: #fff;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: 100px minmax(120px, 1fr) 150px;
    gap: 12px;
    align-items: center;
}

.stats-amount-row {
    align-items: start;
}

.stats-bar-label {
    color: #606266;
    font-size: 13px;
    white-space: nowrap;
}

.stats-bar-track {
    height: 16px;
    background: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
}

.stats-bar-total {
    height: 100%;
    background: #c6e2ff;
    border-radius: 8px;
    overflow: hidden;
}

.stats-bar-deal {
    height: 100%;
    background: #409eff;
}

.stats-bar-amount {
    height: 100%;
    background: #52c41a;
    border-radius: 8px;
}

.stats-bar-commission {
    height: 100%;
    background: #fa8c16;
    border-radius: 8px;
}

.stats-bar-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-bar-line {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.stats-bar-name {
    color: #606266;
    font-size: 12px;
    white-space: nowrap;
}

.stats-bar-value {
    color: #303133;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.stats-amount-bar-value {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.stats-ratio-text {
    color: #409eff;
    font-weight: 500;
}

.stats-empty {
    padding: 28px;
    color: #909399;
    text-align: center;
}

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

@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }

    .stats-bar-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stats-bar-value {
        text-align: left;
    }

    .field-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .core-ent-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .core-ent-fields {
        grid-template-columns: 1fr;
    }

    .core-ent-remove {
        grid-column: 2;
        justify-self: flex-start;
    }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    color: #409eff;
    border-color: #409eff;
}

.pagination button:disabled {
    cursor: not-allowed;
    color: #c0c4cc;
}

.pagination span {
    color: #606266;
}

/* 表单页面 */
.form-page {
    max-width: 800px;
}

.form-page .form-group {
    margin-bottom: 20px;
}

.form-page label {
    display: block;
    margin-bottom: 8px;
    color: #606266;
    font-weight: 500;
}

.form-page label .required {
    color: #f56c6c;
    margin-right: 4px;
}

.form-page input,
.form-page select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

.form-page input:focus,
.form-page select:focus {
    outline: none;
    border-color: #409eff;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.field-header label {
    margin-bottom: 0;
}

.modal-body .field-header label,
.form-page .field-header label {
    margin-bottom: 0;
}

.core-ent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.core-ent-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    background: #fafcff;
}

.core-ent-index {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background: #409eff;
    color: #fff;
    font-size: 12px;
}

.core-ent-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.core-ent-field {
    display: flex;
    gap: 8px;
}

.core-ent-field input {
    flex: 1;
    min-width: 0;
}

.core-ent-remove {
    margin-top: 3px;
}

.btn-cancel {
    background: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background: #ecf5ff;
}

/* 附件上传区域 */
.attachment-area {
    margin-top: 20px;
}

.attachment-list {
    margin-top: 15px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f5f7fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

.attachment-item .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.attachment-item .file-name {
    color: #303133;
}

.attachment-item .file-size {
    color: #909399;
    font-size: 12px;
}

.attachment-item .file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-remove {
    background: #f56c6c;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove:hover {
    background: #f78989;
}

.btn-upload {
    background: #409eff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-upload:hover {
    background: #66b1ff;
}

.btn-download {
    background: #67c23a;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
}

.btn-download:hover {
    background: #85ce61;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

.message-success {
    background: #67c23a;
}

.message-error {
    background: #f56c6c;
}

.message-warning {
    background: #e6a23c;
}

@keyframes slideDown {
    from {
        opacity: 0;
        top: -20px;
    }
    to {
        opacity: 1;
        top: 20px;
    }
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: "加载中...";
    color: #909399;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 40px;
    color: #909399;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ebeef5;
}

.modal-header h3 {
    font-size: 18px;
    color: #303133;
    margin: 0;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #909399;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #303133;
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: #606266;
    font-weight: 500;
}

.modal-body label .required {
    color: #f56c6c;
    margin-right: 4px;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: #409eff;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

.form-col-wide {
    flex: 2;
}

.form-col-narrow {
    flex: 1;
}

.form-col label {
    display: block;
    margin-bottom: 8px;
    color: #606266;
    font-weight: 500;
}

.form-col label .required {
    color: #f56c6c;
    margin-right: 4px;
}

.form-col input,
.form-col select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

.form-col input:focus,
.form-col select:focus {
    outline: none;
    border-color: #409eff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 富文本编辑器样式 */
.rich-editor-container {
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    overflow: hidden;
}

.rich-editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: #f5f7fa;
    border-bottom: 1px solid #dcdfe6;
    flex-wrap: wrap;
}

.rich-editor-toolbar button {
    padding: 5px 10px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #606266;
    transition: all 0.2s;
}

.rich-editor-toolbar button:hover {
    background: #ecf5ff;
    border-color: #409eff;
    color: #409eff;
}

.rich-editor-toolbar button.active {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.rich-editor-toolbar .separator {
    width: 1px;
    background: #dcdfe6;
    margin: 0 5px;
}

.rich-editor-content {
    min-height: 200px;
    padding: 12px;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
}

.rich-editor-content:focus {
    background: #fafafa;
}

.rich-editor-content img {
    max-width: 100%;
    height: auto;
}

.rich-editor-content a {
    color: #409eff;
    text-decoration: none;
}

.rich-editor-content a:hover {
    text-decoration: underline;
}

.rich-editor-content blockquote {
    border-left: 4px solid #409eff;
    padding-left: 12px;
    margin: 10px 0;
    color: #606266;
    background: #f5f7fa;
    padding: 10px 12px;
}

.rich-editor-content pre {
    background: #f5f7fa;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.rich-editor-content code {
    background: #f5f7fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #e6a23c;
}

/* Markdown渲染样式 */
.markdown-rendered {
    line-height: 1.8;
    font-size: 14px;
    color: #303133;
}

.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #303133;
}

.markdown-rendered h1 {
    font-size: 24px;
    border-bottom: 2px solid #ebeef5;
    padding-bottom: 8px;
}

.markdown-rendered h2 {
    font-size: 20px;
    border-bottom: 1px solid #ebeef5;
    padding-bottom: 6px;
}

.markdown-rendered h3 {
    font-size: 18px;
}

.markdown-rendered h4 {
    font-size: 16px;
}

.markdown-rendered p {
    margin: 10px 0;
}

.markdown-rendered a {
    color: #409eff;
    text-decoration: none;
}

.markdown-rendered a:hover {
    text-decoration: underline;
}

.markdown-rendered strong {
    font-weight: bold;
    color: #303133;
}

.markdown-rendered em {
    font-style: italic;
}

.markdown-rendered ul,
.markdown-rendered ol {
    margin: 10px 0;
    padding-left: 30px;
}

.markdown-rendered li {
    margin: 5px 0;
}

.markdown-rendered blockquote {
    border-left: 4px solid #409eff;
    padding: 10px 15px;
    margin: 10px 0;
    background: #f5f7fa;
    color: #606266;
}

.markdown-rendered code {
    background: #f5f7fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #e6a23c;
}

.markdown-rendered pre {
    background: #f5f7fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.markdown-rendered pre code {
    background: none;
    padding: 0;
    color: #303133;
}

.markdown-rendered hr {
    border: none;
    border-top: 2px solid #ebeef5;
    margin: 20px 0;
}

.markdown-rendered table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.markdown-rendered table th,
.markdown-rendered table td {
    border: 1px solid #ebeef5;
    padding: 8px 12px;
    text-align: left;
}

.markdown-rendered table th {
    background: #f5f7fa;
    font-weight: bold;
}

.markdown-rendered img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

@media (max-width: 768px) {
    body {
        font-size: 13px;
        min-width: 0;
    }

    .login-container {
        padding: 16px;
        align-items: flex-start;
    }

    .login-box {
        width: 100%;
        padding: 24px 18px;
        margin-top: 8vh;
    }

    .login-box h2 {
        font-size: 20px;
        margin-bottom: 22px;
    }

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

    .sidebar,
    body.sidebar-collapsed .sidebar {
        position: sticky;
        top: 0;
        z-index: 900;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .sidebar-logo,
    body.sidebar-collapsed .sidebar-logo {
        height: 48px;
        justify-content: flex-start;
        padding: 0 56px 0 14px;
        text-indent: 0;
        font-size: 16px;
    }

    .sidebar-toggle,
    body.sidebar-collapsed .sidebar-toggle {
        top: 8px;
        right: 12px;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0;
        background: #304156;
    }

    .sidebar-menu li {
        flex: 0 0 auto;
    }

    .sidebar-menu a,
    body.sidebar-collapsed .sidebar-menu a {
        padding: 12px 14px;
        gap: 8px;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .header {
        height: auto;
        min-height: 52px;
        padding: 10px 12px;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .header-user span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content {
        padding: 12px;
    }

    .card {
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: none;
    }

    .card-header {
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .card-header h3 {
        line-height: 1.8;
    }

    .card-header .btn,
    .stats-refresh-btn {
        width: auto;
        flex: 0 0 auto;
        padding: 8px 12px;
    }

    .filter-form {
        flex-direction: column;
        gap: 10px;
    }

    .filter-form .form-group,
    .filter-form input,
    .filter-form select,
    .filter-form .btn {
        width: 100%;
        min-width: 0;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 720px;
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
        vertical-align: top;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination {
        gap: 8px;
        flex-wrap: wrap;
    }

    .modal.show {
        align-items: flex-start;
    }

    .modal-content {
        width: 100%;
        max-width: none;
        max-height: 100dvh;
        border-radius: 0;
    }

    .modal-header,
    .modal-body {
        padding: 14px;
    }

    .modal-body .form-group > div[style*="display: flex"] {
        flex-wrap: wrap;
    }

    .modal-body .form-group > div[style*="display: flex"] .btn {
        flex: 0 0 auto;
    }

    .form-row {
        display: block;
        margin-bottom: 0;
    }

    .form-col,
    .form-col-wide,
    .form-col-narrow {
        margin-bottom: 14px;
    }

    .form-actions {
        gap: 10px;
        flex-wrap: wrap;
    }

    .form-actions .btn,
    .form-actions .btn-cancel {
        flex: 1 1 120px;
    }

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

    .field-header .btn {
        align-self: flex-start;
    }

    .core-ent-row {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .core-ent-index {
        width: 22px;
        height: 22px;
        line-height: 22px;
    }

    .core-ent-fields {
        grid-template-columns: 1fr;
    }

    .core-ent-field {
        flex-wrap: wrap;
    }

    .core-ent-field .btn {
        flex: 0 0 auto;
    }

    .core-ent-remove {
        grid-column: 2;
        justify-self: flex-start;
    }

    .attachment-item,
    .attachment-item .file-info,
    .attachment-item .file-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .attachment-item {
        gap: 8px;
    }

    .attachment-item .file-name {
        word-break: break-all;
    }

    .stats-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .stats-tab {
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    .stats-summary,
    .stats-summary-double {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-card {
        padding: 14px;
    }

    .stats-value {
        font-size: 22px;
    }

    .stats-chart {
        padding: 12px;
    }

    .stats-bar-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stats-bar-value,
    .stats-amount-bar-value {
        text-align: left;
    }

    .message {
        width: calc(100% - 24px);
        top: 12px;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .table {
        min-width: 680px;
    }

    .captcha-group {
        flex-direction: column;
    }

    .captcha-img {
        width: 100%;
    }

    .btn,
    .btn-upload,
    .btn-add,
    .btn-cancel,
    .btn-logout {
        padding-left: 12px;
        padding-right: 12px;
    }
}
