body {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle-btn {
    border-radius: 999px !important;
    font-weight: 600 !important;
}

html[data-theme='dark'] body {
    background: #0b1220 !important;
    color: #e5e7eb;
}

html[data-theme='dark'] .site-layout .site-layout-background,
html[data-theme='dark'] .cp-layout .site-layout-background {
    background: #121826 !important;
    color: #e5e7eb !important;
    border: 1px solid #253046;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

html[data-theme='dark'] .ant-layout-header {
    background: #121826 !important;
    border-bottom: 1px solid #253046 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme='dark'] .header-title,
html[data-theme='dark'] .cp-header-title,
html[data-theme='dark'] .ant-page-header-heading-title,
html[data-theme='dark'] .ant-modal-title,
html[data-theme='dark'] .ant-card-head-title,
html[data-theme='dark'] .ant-statistic-content {
    color: #dbeafe !important;
}

html[data-theme='dark'] .header-content span,
html[data-theme='dark'] .cp-header-content span,
html[data-theme='dark'] .ant-table-tbody > tr > td,
html[data-theme='dark'] .ant-form-item-label > label,
html[data-theme='dark'] .ant-descriptions-item-label,
html[data-theme='dark'] .ant-descriptions-item-content,
html[data-theme='dark'] .ant-drawer-title,
html[data-theme='dark'] .ant-pagination-item a,
html[data-theme='dark'] .ant-empty-description,
html[data-theme='dark'] .ant-alert-message,
html[data-theme='dark'] .ant-alert-description,
html[data-theme='dark'] .ant-select-selection-item,
html[data-theme='dark'] .ant-select-selection-placeholder,
html[data-theme='dark'] .ant-checkbox-wrapper,
html[data-theme='dark'] .ant-radio-wrapper,
html[data-theme='dark'] .ant-tabs-tab,
html[data-theme='dark'] .ant-typography,
html[data-theme='dark'] .ant-btn,
html[data-theme='dark'] .ant-page-header-heading-sub-title,
html[data-theme='dark'] .ant-statistic-title,
html[data-theme='dark'] .ant-layout-footer,
html[data-theme='dark'] .ant-tag,
html[data-theme='dark'] .ant-message,
html[data-theme='dark'] .ant-result-subtitle,
html[data-theme='dark'] .ant-result-title,
html[data-theme='dark'] .ant-list-item,
html[data-theme='dark'] .ant-list-item-meta-description,
html[data-theme='dark'] .ant-list-item-meta-title,
html[data-theme='dark'] .ant-timeline-item-content,
html[data-theme='dark'] .ant-collapse-header,
html[data-theme='dark'] .ant-collapse-content-box,
html[data-theme='dark'] .ant-input-affix-wrapper,
html[data-theme='dark'] .ant-input-number,
html[data-theme='dark'] .ant-picker,
html[data-theme='dark'] .ant-picker-input > input,
html[data-theme='dark'] .ant-select-selector,
html[data-theme='dark'] .ant-input,
html[data-theme='dark'] .ant-input::placeholder,
html[data-theme='dark'] textarea.ant-input,
html[data-theme='dark'] select,
html[data-theme='dark'] option,
html[data-theme='dark'] .ant-btn-link {
    color: #e5e7eb !important;
}

html[data-theme='dark'] .header-content .ant-btn-link:hover,
html[data-theme='dark'] .cp-header-content .ant-btn-link:hover,
html[data-theme='dark'] .ant-btn-link:hover {
    color: #93c5fd !important;
}

html[data-theme='dark'] .ant-card,
html[data-theme='dark'] .ant-modal-content,
html[data-theme='dark'] .ant-drawer-content,
html[data-theme='dark'] .ant-popover-inner,
html[data-theme='dark'] .ant-popconfirm-inner-content,
html[data-theme='dark'] .ant-dropdown-menu,
html[data-theme='dark'] .ant-select-dropdown,
html[data-theme='dark'] .ant-picker-panel-container,
html[data-theme='dark'] .ant-notification-notice,
html[data-theme='dark'] .ant-message-notice-content,
html[data-theme='dark'] .ant-collapse,
html[data-theme='dark'] .ant-list,
html[data-theme='dark'] .ant-tabs-content-holder,
html[data-theme='dark'] .ant-descriptions,
html[data-theme='dark'] .ant-statistic {
    background: #121826 !important;
    color: #e5e7eb !important;
    border-color: #253046 !important;
}

html[data-theme='dark'] .ant-card-head,
html[data-theme='dark'] .ant-table-thead > tr > th,
html[data-theme='dark'] .ant-modal-header,
html[data-theme='dark'] .ant-drawer-header,
html[data-theme='dark'] .ant-collapse > .ant-collapse-item > .ant-collapse-header,
html[data-theme='dark'] .ant-descriptions-bordered .ant-descriptions-item-label,
html[data-theme='dark'] .ant-descriptions-bordered .ant-descriptions-view,
html[data-theme='dark'] .ant-alert {
    background: #0f172a !important;
    border-color: #253046 !important;
}

html[data-theme='dark'] .ant-table,
html[data-theme='dark'] .ant-table-container,
html[data-theme='dark'] .ant-table-content {
    background: #121826 !important;
    border-color: #253046 !important;
}

html[data-theme='dark'] .ant-table-thead > tr > th {
    color: #dbeafe !important;
    border-bottom: 2px solid #335dff !important;
}

html[data-theme='dark'] .ant-table-tbody > tr,
html[data-theme='dark'] .ant-table-tbody > tr:nth-child(even) {
    background: #121826 !important;
}

html[data-theme='dark'] .ant-table-tbody > tr:hover > td {
    background: #182338 !important;
}

html[data-theme='dark'] .ant-table-tbody > tr > td,
html[data-theme='dark'] .ant-table-thead > tr > th,
html[data-theme='dark'] .ant-card-head,
html[data-theme='dark'] .ant-card,
html[data-theme='dark'] .ant-modal-header,
html[data-theme='dark'] .ant-modal-footer,
html[data-theme='dark'] .ant-drawer-header,
html[data-theme='dark'] .ant-drawer-body,
html[data-theme='dark'] .ant-list-item,
html[data-theme='dark'] .ant-collapse > .ant-collapse-item,
html[data-theme='dark'] .ant-input,
html[data-theme='dark'] .ant-input-affix-wrapper,
html[data-theme='dark'] .ant-input-number,
html[data-theme='dark'] .ant-input-number-input,
html[data-theme='dark'] .ant-select-selector,
html[data-theme='dark'] .ant-picker,
html[data-theme='dark'] .ant-pagination-item,
html[data-theme='dark'] .ant-pagination-prev .ant-pagination-item-link,
html[data-theme='dark'] .ant-pagination-next .ant-pagination-item-link,
html[data-theme='dark'] .ant-tabs-nav,
html[data-theme='dark'] .ant-tabs-tab,
html[data-theme='dark'] .ant-descriptions-bordered .ant-descriptions-item-content {
    border-color: #253046 !important;
}

html[data-theme='dark'] .ant-input,
html[data-theme='dark'] .ant-input-affix-wrapper,
html[data-theme='dark'] .ant-input-number,
html[data-theme='dark'] .ant-input-number-input,
html[data-theme='dark'] .ant-select-selector,
html[data-theme='dark'] .ant-picker,
html[data-theme='dark'] textarea.ant-input,
html[data-theme='dark'] select {
    background: #0f172a !important;
}

html[data-theme='dark'] .ant-btn-default,
html[data-theme='dark'] .theme-toggle-btn {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

html[data-theme='dark'] .ant-btn-default:hover,
html[data-theme='dark'] .theme-toggle-btn:hover {
    border-color: #60a5fa !important;
    color: #93c5fd !important;
}

html[data-theme='dark'] .ant-pagination-item-active,
html[data-theme='dark'] .ant-tabs-tab.ant-tabs-tab-active {
    border-color: #335dff !important;
}

html[data-theme='dark'] .ant-pagination-item-active a,
html[data-theme='dark'] .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
    color: #93c5fd !important;
}

html[data-theme='dark'] .ant-modal-close,
html[data-theme='dark'] .ant-drawer-close,
html[data-theme='dark'] .ant-select-arrow,
html[data-theme='dark'] .ant-picker-suffix,
html[data-theme='dark'] .ant-input-clear-icon,
html[data-theme='dark'] .ant-pagination-item-link-icon,
html[data-theme='dark'] .anticon {
    color: #cbd5e1 !important;
}

html[data-theme='dark'] a {
    color: #93c5fd;
}

html[data-theme='dark'] a:hover {
    color: #bfdbfe;
}

body {
    background:
        radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.12), transparent 32%),
        radial-gradient(circle at 86% 8%, rgba(20, 184, 166, 0.10), transparent 28%),
        #f4f7fb !important;
}

.admin-shell {
    background: transparent !important;
}

.admin-sider {
    background: linear-gradient(180deg, #0f172a 0%, #111827 46%, #172554 100%) !important;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.16);
}

.admin-sider .ant-layout-sider-children {
    background: transparent !important;
}

.logo {
    height: 64px !important;
    font-size: 20px !important;
    letter-spacing: 1.4px !important;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(45, 212, 191, 0.10)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.ant-menu-dark,
.ant-menu-dark .ant-menu-sub,
.ant-menu-dark .ant-menu-inline.ant-menu-sub {
    background: transparent !important;
}

.ant-menu-dark .ant-menu-item,
.ant-menu-dark .ant-menu-submenu-title {
    height: 42px !important;
    line-height: 42px !important;
    margin: 5px 10px !important;
    border-radius: 12px !important;
    color: rgba(255, 255, 255, 0.74) !important;
}

.ant-menu-dark .ant-menu-item:hover,
.ant-menu-dark .ant-menu-submenu-title:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
}

.ant-menu-dark .ant-menu-item-selected {
    background: linear-gradient(135deg, #2563eb, #14b8a6) !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.34);
}

.admin-header,
.ant-layout-header {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
}

.header-title {
    color: #0f172a !important;
    font-size: 19px !important;
    font-weight: 800 !important;
}

.header-content span {
    color: #475569 !important;
}

.admin-content {
    background: transparent !important;
}

.site-layout .site-layout-background,
.cp-layout .site-layout-background {
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 22px !important;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(14px);
}

.ant-page-header {
    padding: 8px 0 18px !important;
}

.ant-page-header-heading-title {
    color: #0f172a !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

.ant-page-header-heading-sub-title {
    color: #64748b !important;
}

.ant-card {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(226, 232, 240, 0.92) !important;
    border-radius: 18px !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07) !important;
    overflow: hidden;
}

.ant-card-hoverable:hover,
.ant-card:hover {
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.11) !important;
}

.ant-card-head {
    min-height: 48px !important;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.86)) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.84) !important;
}

.ant-card-head-title {
    color: #0f172a !important;
    font-size: 15px !important;
    font-weight: 750 !important;
}

.ant-btn {
    border-radius: 10px !important;
    font-weight: 650 !important;
    box-shadow: none !important;
}

.ant-btn-primary {
    background: linear-gradient(135deg, #2563eb, #14b8a6) !important;
    border-color: transparent !important;
}

.ant-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #0f766e) !important;
    border-color: transparent !important;
}

.ant-btn-default {
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

.ant-btn-default:hover {
    background: #eff6ff !important;
    border-color: #60a5fa !important;
    color: #1d4ed8 !important;
}

.ant-btn-danger,
.ant-btn-dangerous {
    border-color: transparent !important;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.18) !important;
}

.ant-input,
.ant-input-affix-wrapper,
.ant-input-number,
.ant-picker,
.ant-select-selector,
textarea.ant-input,
select {
    border-radius: 10px !important;
    border-color: #cbd5e1 !important;
}

.ant-input:hover,
.ant-input-affix-wrapper:hover,
.ant-input-number:hover,
.ant-picker:hover,
.ant-select-selector:hover,
textarea.ant-input:hover,
select:hover {
    border-color: #60a5fa !important;
}

.ant-input:focus,
.ant-input-affix-wrapper-focused,
.ant-input-number-focused,
.ant-picker-focused,
textarea.ant-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14) !important;
}

.ant-table {
    border: 1px solid rgba(226, 232, 240, 0.92) !important;
    border-radius: 16px !important;
    overflow: hidden;
}

.ant-table-thead > tr > th {
    background: #f8fafc !important;
    color: #334155 !important;
    border-bottom: 1px solid #dbeafe !important;
    font-weight: 400 !important;
}

.ant-table-tbody > tr:nth-child(even) {
    background: #fbfdff !important;
}

.ant-table-tbody > tr:hover > td {
    background: #eff6ff !important;
}

.ant-table-tbody > tr > td {
    color: #334155 !important;
    border-bottom-color: #eef2f7 !important;
    font-weight: 400 !important;
}

.ant-table,
.ant-table * {
    font-weight: 400 !important;
}

.ant-tag {
    border-radius: 999px !important;
    font-weight: 600;
    padding: 1px 8px !important;
}

.ant-alert {
    border-radius: 14px !important;
}

.ant-modal-content,
.ant-drawer-content {
    border-radius: 18px !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22) !important;
}

.ant-modal-header {
    background: linear-gradient(135deg, #2563eb, #14b8a6) !important;
}

.page-controls,
.pagination-controls,
.admin-pagination,
.table-pagination {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.filter-row {
    padding-top: 4px;
}

.filter-row div[style*="font-weight: 500"] {
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.copy-field {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    border-radius: 10px !important;
    color: #475569 !important;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.96)) !important;
    border: 1px solid rgba(191, 219, 254, 0.9) !important;
    border-radius: 20px !important;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.10) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 52px rgba(37, 99, 235, 0.15) !important;
}

.stat-card::before {
    height: 4px !important;
    background: linear-gradient(90deg, #2563eb, #14b8a6) !important;
}

.stat-card .stat-value {
    color: #1d4ed8 !important;
}

.stat-card .stat-label {
    color: #64748b !important;
    font-weight: 750 !important;
}

.ant-card-hoverable {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ant-card-hoverable:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, 0.72) !important;
}

.ant-card .ant-typography h4,
.ant-card h4.ant-typography {
    color: #0f172a !important;
    font-weight: 800 !important;
    margin-bottom: 6px !important;
}

.ant-card .ant-typography,
.ant-card p.ant-typography {
    color: #64748b !important;
}

.ant-card .anticon[style*="font-size: 48px"] {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(20, 184, 166, 0.10));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.ant-table img {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ant-modal-body img {
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.ant-form-item-label > label {
    color: #334155 !important;
    font-weight: 700;
}

.ant-form-item-control-input-content > div[style*="font-size:12px"],
.text-muted {
    color: #64748b !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 9px;
    line-height: 1.6;
}

.ant-switch-checked {
    background: linear-gradient(135deg, #2563eb, #14b8a6) !important;
}

.ant-pagination-item {
    border-radius: 10px !important;
    border-color: #cbd5e1 !important;
}

.ant-pagination-item-active {
    border-color: #2563eb !important;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
}

.ant-pagination-item-active a {
    color: #2563eb !important;
    font-weight: 800;
}

.ant-radio-button-wrapper {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
    font-weight: 650;
}

.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
    color: #2563eb !important;
    border-color: #2563eb !important;
    background: #eff6ff !important;
    box-shadow: -1px 0 0 0 #2563eb !important;
}

input[type="file"] {
    max-width: 240px;
    padding: 6px 8px;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
}

.account-link,
.user-link,
.ip-link,
.behavior-link,
.message-read-count-link {
    color: #2563eb !important;
    font-weight: 400 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    cursor: pointer;
}

.account-link:hover,
.user-link:hover,
.ip-link:hover,
.behavior-link:hover,
.message-read-count-link:hover {
    color: #0f766e !important;
    text-decoration: underline !important;
}

.action-buttons .ant-btn,
.ant-table .ant-space .ant-btn-sm {
    min-height: 28px;
}

.customer-table-scroll-top,
.log-table-scroll-top,
.log-table-scroll,
.table-scroll {
    scrollbar-color: #94a3b8 #e2e8f0;
}

.customer-table-inner {
    min-width: 1320px;
}

.log-table-inner {
    min-width: 1320px;
}

.customer-table-scroll-spacer {
    width: 1320px;
}

.log-table-scroll-spacer {
    width: 1320px;
}

.action-buttons,
.log-action-buttons {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

textarea.ant-input {
    line-height: 1.7 !important;
    padding: 10px 12px !important;
}

.ant-card textarea.ant-input[rows="24"] {
    min-height: 520px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        #fbfdff;
    background-size: 36px 100%;
}

.ant-alert-info {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(240, 253, 250, 0.92)) !important;
    border-color: #bfdbfe !important;
}

.ant-alert-success {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

.ant-alert-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
}

.ant-alert-error {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

.ant-table a {
    color: #2563eb;
    font-weight: 400 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.ant-table a:hover {
    color: #0f766e;
}

.log-message,
.log-user,
.log-location,
.behavior-message,
.behavior-detail,
.read-cell-wrap,
.cell-text {
    color: #334155;
    line-height: 1.6;
}

.hardware-edit-link {
    display: inline-flex;
    align-items: center;
    margin-top: 4px;
    color: #64748b !important;
    font-weight: 400 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.hardware-edit-link:hover {
    color: #2563eb !important;
}

.ant-descriptions,
.ant-list,
.ant-collapse {
    border-radius: 16px !important;
    overflow: hidden;
}

.ant-empty-description {
    color: #94a3b8 !important;
}

.ant-message-notice-content,
.ant-notification-notice {
    border-radius: 14px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16) !important;
}

html[data-theme='dark'] body {
    background:
        radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.18), transparent 32%),
        radial-gradient(circle at 86% 8%, rgba(20, 184, 166, 0.14), transparent 28%),
        #020617 !important;
}

html[data-theme='dark'] .admin-sider {
    background: linear-gradient(180deg, #020617 0%, #0f172a 54%, #172554 100%) !important;
}

html[data-theme='dark'] .site-layout .site-layout-background,
html[data-theme='dark'] .cp-layout .site-layout-background,
html[data-theme='dark'] .ant-card,
html[data-theme='dark'] .ant-modal-content,
html[data-theme='dark'] .ant-drawer-content {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(51, 65, 85, 0.92) !important;
}

html[data-theme='dark'] .admin-header,
html[data-theme='dark'] .ant-layout-header {
    background: rgba(15, 23, 42, 0.82) !important;
}

html[data-theme='dark'] .ant-card-head,
html[data-theme='dark'] .ant-table-thead > tr > th,
html[data-theme='dark'] .page-controls,
html[data-theme='dark'] .pagination-controls,
html[data-theme='dark'] .admin-pagination,
html[data-theme='dark'] .table-pagination {
    background: rgba(15, 23, 42, 0.98) !important;
}

html[data-theme='dark'] .stat-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92)) !important;
    border-color: rgba(51, 65, 85, 0.96) !important;
}

html[data-theme='dark'] .ant-card .ant-typography h4,
html[data-theme='dark'] .ant-card h4.ant-typography,
html[data-theme='dark'] .ant-form-item-label > label {
    color: #dbeafe !important;
}

html[data-theme='dark'] .ant-form-item-control-input-content > div[style*="font-size:12px"],
html[data-theme='dark'] .text-muted,
html[data-theme='dark'] input[type="file"] {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1 !important;
}

html[data-theme='dark'] .ant-card textarea.ant-input[rows="24"] {
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        #0f172a !important;
}

html[data-theme='dark'] .ant-alert-info,
html[data-theme='dark'] .ant-alert-success,
html[data-theme='dark'] .ant-alert-warning,
html[data-theme='dark'] .ant-alert-error {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: #334155 !important;
}

html[data-theme='dark'] .log-message,
html[data-theme='dark'] .log-user,
html[data-theme='dark'] .log-location,
html[data-theme='dark'] .behavior-message,
html[data-theme='dark'] .behavior-detail,
html[data-theme='dark'] .read-cell-wrap,
html[data-theme='dark'] .cell-text {
    color: #e5e7eb;
}

.admin-shell,
.admin-main-layout,
.admin-content,
.site-layout-background {
    min-width: 0;
}

.admin-content {
    overflow-x: hidden;
}

.site-layout-background {
    overflow-x: auto;
}

.ant-card,
.ant-page-header,
.ant-table-wrapper {
    max-width: 100%;
}

.ant-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ant-table {
    min-width: 720px;
}

.ant-table-cell {
    word-break: break-word;
}

.page-controls,
.pagination-controls,
.admin-pagination,
.table-pagination {
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .admin-shell {
        display: block !important;
    }

    .admin-sider {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 0 0 auto !important;
    }

    .admin-sider .ant-layout-sider-children {
        max-height: 42vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-sider .ant-layout-sider-trigger {
        display: none;
    }

    .logo {
        height: 48px;
        font-size: 16px;
    }

    .admin-main-layout {
        width: 100% !important;
    }

    .admin-header {
        height: auto !important;
        line-height: normal !important;
    }

    .header-content {
        min-height: 56px;
        padding: 10px 12px !important;
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px;
    }

    .header-title {
        font-size: 17px !important;
    }

    .header-content .ant-space {
        width: 100%;
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px !important;
    }

    .header-content .ant-space-item {
        margin-right: 0 !important;
    }

    .admin-content {
        margin: 12px 8px 0 !important;
    }

    .site-layout .site-layout-background {
        padding: 12px !important;
        border-radius: 4px;
    }

    .ant-page-header {
        padding: 8px 0 !important;
    }

    .ant-page-header-heading {
        display: block !important;
    }

    .ant-page-header-heading-left,
    .ant-page-header-heading-extra {
        width: 100%;
    }

    .ant-page-header-heading-extra {
        margin-top: 10px;
        margin-left: 0 !important;
    }

    .ant-page-header-heading-extra .ant-space {
        width: 100%;
        display: flex !important;
        flex-wrap: wrap;
    }

    .ant-page-header-heading-title {
        font-size: 18px !important;
        line-height: 1.35 !important;
    }

    .ant-card {
        margin-bottom: 12px !important;
    }

    .ant-card-body {
        padding: 12px !important;
    }

    .ant-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .ant-row > .ant-col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 12px;
    }

    .filter-row .ant-space,
    .ant-card .ant-space {
        display: flex !important;
        flex-wrap: wrap;
        width: 100%;
    }

    .filter-row .ant-input,
    .filter-row .ant-select,
    .filter-row .ant-picker,
    .filter-row .ant-btn {
        width: 100%;
    }

    .ant-table-wrapper {
        margin-left: -4px;
        margin-right: -4px;
    }

    .ant-table {
        min-width: 760px;
    }

    .ant-table-thead > tr > th,
    .ant-table-tbody > tr > td {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    .ant-table-tbody .ant-space {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px !important;
    }

    .ant-table-tbody .ant-btn {
        margin: 0 !important;
    }

    .ant-pagination {
        display: flex !important;
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .page-controls,
    .pagination-controls,
    .admin-pagination,
    .table-pagination,
    .ant-card > div[style*="justify-content: space-between"],
    div[style*="justify-content: space-between"][style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .page-controls > div,
    .pagination-controls > div,
    .admin-pagination > div,
    .table-pagination > div,
    div[style*="justify-content: space-between"][style*="display: flex"] > div {
        width: 100%;
        flex-wrap: wrap;
    }

    div[style*="gap: 16px"][style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    select {
        max-width: 100%;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    .copy-field,
    .read-cell-wrap,
    .cell-text,
    .behavior-message,
    .behavior-detail,
    div[style*="max-width:300px"],
    div[style*="max-width:320px"],
    div[style*="max-width:420px"] {
        max-width: 220px !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    .behavior-table-inner {
        min-width: 1100px !important;
    }

    .customer-table-inner {
        min-width: 1100px !important;
    }

    .log-table-inner {
        min-width: 1100px !important;
    }

    .behavior-table-scroll-spacer {
        width: 1100px !important;
    }

    .customer-table-scroll-spacer {
        width: 1100px !important;
    }

    .log-table-scroll-spacer {
        width: 1100px !important;
    }

    .behavior-table-scroll,
    .behavior-table-scroll-top,
    .log-table-scroll,
    .log-table-scroll-top,
    .customer-table-scroll-top,
    .table-scroll {
        margin-left: -4px;
        margin-right: -4px;
    }

    .ant-modal {
        max-width: calc(100vw - 24px) !important;
        margin: 12px auto !important;
    }

    .ant-modal-content {
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .ant-modal-body {
        padding: 14px !important;
    }

    .ant-form-item {
        margin-bottom: 14px !important;
    }
}

@media (max-width: 480px) {
    .admin-content {
        margin: 8px 6px 0 !important;
    }

    .site-layout .site-layout-background {
        padding: 10px !important;
    }

    .header-content {
        padding: 8px 10px !important;
    }

    .ant-btn {
        white-space: normal !important;
        height: auto !important;
        min-height: 32px;
    }

    .ant-table {
        min-width: 680px;
    }
}
