﻿/* GoxPifa Admin 鈥?primary #c41e3a */

@font-face {
    font-family: 'UKIJ Tuz Tom';
    src: url('/UKIJTuzTom.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #c41e3a;
    --primary-dark: #9e1830;
    --primary-light: #e8354f;
    --primary-soft: rgba(196, 30, 58, 0.1);
    --sidebar-bg: #1a1d29;
    --sidebar-hover: #252836;
    --sidebar-active: rgba(196, 30, 58, 0.18);
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --body-bg: #f4f6f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #718096;
    --success: #059669;
    --success-bg: #ecfdf5;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --warning: #d97706;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --radius: 10px;
    --radius-sm: 6px;
    --sidebar-width: 284px;
    --topbar-height: 64px;
    --font-zh: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-ug: 'UKIJ Tuz Tom', 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-zh);
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.5;
}

html.rtl body,
html.rtl .sidebar,
html.rtl .topbar,
html.rtl .main-content,
html.rtl .page-header,
html.rtl .card,
html.rtl .form-control,
html.rtl button,
html.rtl input,
html.rtl textarea,
html.rtl select,
html.rtl label,
html.rtl summary,
html.rtl .settings-tab,
html.rtl .settings-tabs__nav,
html.rtl .dash-tab,
html.rtl .dash-tabs__nav,
html.rtl .dash-shortcuts-bar {
    font-family: var(--font-ug);
}

html.rtl { direction: rtl; }

/* Form controls inherit body font (buttons default to system UI otherwise) */
button,
input,
textarea,
select {
    font-family: inherit;
}

/* 鈹€鈹€ Layout 鈹€鈹€ */

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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

html.rtl .sidebar {
    left: auto;
    right: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.sidebar-brand-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.sidebar-brand-text {
    font-size: 1.28rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 10px 16px 8px;
    margin-top: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 1.02rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 4px;
}

.nav-link svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-link.active svg {
    stroke: var(--primary-light);
}

.sidebar-footer {
    padding: 18px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html.rtl .main-wrapper {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    display: flex;
    background: var(--body-bg);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}

.lang-switch form { margin: 0; display: contents; }

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
    font-family: inherit;
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.user-menu__trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition);
}

.user-menu__trigger:hover,
.user-menu.is-open .user-menu__trigger {
    background: var(--body-bg);
}

.user-menu__chevron {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.user-menu.is-open .user-menu__chevron {
    transform: rotate(180deg);
}

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    width: 260px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    overflow: hidden;
    animation: userMenuFadeIn 0.18s ease;
}

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

.user-menu__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--body-bg);
}

.user-menu__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-menu__meta strong {
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu__meta span {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu__items {
    padding: 6px;
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

.user-menu__item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
    color: var(--text-muted);
}

.user-menu__item:hover {
    background: rgba(196, 30, 58, 0.06);
    color: var(--primary);
}

.user-menu__item:hover svg {
    color: var(--primary);
}

.user-menu__item--danger:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.user-menu__item--danger:hover svg {
    color: #dc2626;
}

.user-menu__logout {
    margin: 0;
    border-top: 1px solid var(--border);
    padding-top: 6px;
    margin-top: 4px;
}

html.rtl .user-menu {
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar--lg {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.user-avatar--xl {
    width: 72px;
    height: 72px;
    font-size: 1.35rem;
}

.user-detail-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.6rem;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.user-detail-avatar.has-image {
    background: var(--border);
}

.user-detail-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar.has-image {
    background: var(--border);
}

.user-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.main-content {
    flex: 1;
    padding: 28px;
}

.main-content:has(.dash-page) {
    padding: 32px 40px;
}

/* 鈹€鈹€ Cards & Stats 鈹€鈹€ */

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

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

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-icon.red { background: rgba(196, 30, 58, 0.12); color: var(--primary); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.stat-icon.green { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.stat-icon.orange { background: rgba(217, 119, 6, 0.12); color: var(--warning); }

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

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

/* 鈹€鈹€ Flash Messages 鈹€鈹€ */

.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.flash-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* 鈹€鈹€ Buttons 鈹€鈹€ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    line-height: 1.4;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.35);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--body-bg);
    border-color: #cbd5e0;
}

.btn-danger {
    background: var(--error-bg);
    color: var(--error);
    border-color: rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    background: var(--error);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 7px;
}

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

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

.page-header h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}

/* 鈹€鈹€ Tables 鈹€鈹€ */

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th,
.data-table td {
    padding: 13px 16px;
    text-align: start;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.data-table .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.table-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
}

.table-user-cell__text {
    min-width: 0;
}

.table-user-cell__text strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--body-bg);
    border: 1px solid var(--border);
}

.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: #cbd5e0;
    margin-bottom: 12px;
}

/* 鈹€鈹€ Badges 鈹€鈹€ */

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

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }
.badge-warning { background: #fffbeb; color: var(--warning); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-info { background: #eff6ff; color: #2563eb; }
.badge-danger { background: var(--error-bg); color: var(--error); }

.badge-pending { background: #fffbeb; color: var(--warning); }
.badge-paid { background: #eff6ff; color: #2563eb; }
.badge-delivering { background: #f0fdf4; color: #16a34a; }
.badge-completed { background: var(--success-bg); color: var(--success); }
.badge-cancelled { background: var(--error-bg); color: var(--error); }

/* 鈹€鈹€ Forms 鈹€鈹€ */

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--primary);
    margin-left: 2px;
}

html.rtl .form-label .required {
    margin-left: 0;
    margin-right: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card-bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control.is-invalid,
.form-control:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.bilingual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bilingual-row .form-group {
    margin-bottom: 0;
}

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

.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-soft);
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    flex-wrap: wrap;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 160px;
}

/* 鈹€鈹€ Pagination 鈹€鈹€ */

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 20px 0 0;
    margin: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--card-bg);
}

.pagination li.active span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination li a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 鈹€鈹€ Order Detail 鈹€鈹€ */

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

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.88rem;
}

.detail-item:last-child { border-bottom: none; }

.detail-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.detail-value {
    font-weight: 500;
    text-align: end;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.order-total-row.grand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 14px;
}

/* 鈹€鈹€ Login Page 鈹€鈹€ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d29 0%, #2d1f24 50%, #1a1d29 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.25) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.auth-header {
    background: var(--sidebar-bg);
    padding: 32px 32px 28px;
    text-align: center;
}

.auth-logo {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.auth-header h1 {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.auth-header p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--sidebar-text);
}

.auth-body {
    padding: 32px;
}

.auth-lang {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-footer-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 20px;
}

/* 鈹€鈹€ Settings tabs 鈹€鈹€ */

.settings-section {
    margin-bottom: 32px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list strong {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.text-muted { color: var(--text-muted); }
.text-end { text-align: end; }
.text-primary { color: var(--primary); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 16px; }

.img-preview {
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    object-fit: cover;
    margin-top: 8px;
}

.image-field {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.image-field__preview-box {
    position: relative;
    width: 160px;
    height: 120px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    background: #f8fafc;
    overflow: hidden;
}

.image-field__preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-field__empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.image-field__empty svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    opacity: 0.55;
}

.image-field__upload-btn {
    cursor: pointer;
}

.image-field__upload-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.image-field__url {
    margin-bottom: 0;
}

.is-hidden {
    display: none !important;
}

/* 鈹€鈹€ Responsive 鈹€鈹€ */

@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    html.rtl .sidebar {
        transform: translateX(100%);
    }

    .main-wrapper {
        margin-left: 0;
        margin-right: 0;
    }

    .bilingual-row {
        grid-template-columns: 1fr;
    }

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

    .main-content {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .user-name {
        display: none;
    }

    .main-content:has(.dash-page) {
        padding: 16px;
    }
}

/* 鈹€鈹€ Dashboard 鈹€鈹€ */

.dash-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    margin-bottom: 24px;
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(135deg, #1a1d29 0%, #2a1f28 45%, #3d1520 100%);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(196, 30, 58, 0.18);
}

.dash-hero__content {
    position: relative;
    z-index: 1;
}

.dash-hero__eyebrow {
    margin: 0 0 8px;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.dash-hero__title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.dash-hero__desc {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.72);
}

.dash-hero__meta {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.dash-hero__date,
.dash-hero__revenue {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.dash-hero__date {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.dash-hero__date svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.dash-hero__revenue-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
}

.dash-hero__revenue strong {
    font-size: 1.35rem;
    color: #fecdd3;
}

.dash-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.dash-hero__glow--1 {
    width: 220px;
    height: 220px;
    top: -80px;
    right: 80px;
    background: rgba(196, 30, 58, 0.45);
}

.dash-hero__glow--2 {
    width: 180px;
    height: 180px;
    bottom: -60px;
    left: 40%;
    background: rgba(239, 68, 68, 0.25);
}

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

.dash-stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.dash-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.9;
}

.dash-stat--primary::after { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.dash-stat--blue::after { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.dash-stat--orange::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dash-stat--green::after { background: linear-gradient(90deg, #059669, #34d399); }

.dash-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.dash-stat__icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat__icon svg {
    width: 24px;
    height: 24px;
}

.dash-stat--primary .dash-stat__icon { background: rgba(196, 30, 58, 0.12); color: var(--primary); }
.dash-stat--blue .dash-stat__icon { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.dash-stat--orange .dash-stat__icon { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.dash-stat--green .dash-stat__icon { background: rgba(5, 150, 105, 0.12); color: #059669; }

.dash-stat__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-stat__label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.dash-stat__value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.dash-stat__hint {
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.dash-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.dash-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.dash-action:hover {
    border-color: rgba(196, 30, 58, 0.25);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dash-action__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-action__icon svg {
    width: 18px;
    height: 18px;
}

.dash-action__text {
    font-size: 0.88rem;
    font-weight: 600;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 20px;
    align-items: start;
}

.dash-card__sub {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.dash-card__body {
    padding: 0 !important;
}

.dash-card--accent {
    background: linear-gradient(180deg, #fff 0%, #fff7f8 100%);
    border-color: rgba(196, 30, 58, 0.12);
}

.dash-orders {
    display: flex;
    flex-direction: column;
}

.dash-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.dash-order:last-child {
    border-bottom: none;
}

.dash-order:hover {
    background: #fafbfc;
}

.dash-order__main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dash-order__no {
    font-size: 0.92rem;
    color: var(--text);
}

.dash-order__customer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dash-order__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.dash-order__amount {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    min-width: 72px;
    text-align: right;
}

.dash-order__time {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 64px;
    text-align: right;
}

.dash-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dash-side__title {
    margin: 0 0 16px;
    font-size: 0.95rem;
    font-weight: 600;
}

.dash-overview {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-overview li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
}

.dash-overview li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.dash-overview span {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.dash-overview strong {
    font-size: 1rem;
    color: var(--text);
}

.text-warning {
    color: var(--warning) !important;
}

.dash-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: transform var(--transition);
}

.dash-alert:hover {
    transform: translateX(4px);
}

.dash-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dash-alert--warn {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.dash-alert--info {
    background: #fef2f2;
    color: var(--primary-dark);
    border: 1px solid rgba(196, 30, 58, 0.15);
}

.rtl .dash-order__meta {
    flex-direction: row-reverse;
}

.rtl .dash-alert:hover {
    transform: translateX(-4px);
}

@media (max-width: 1100px) {
    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* Settings tabs */
.settings-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.settings-tab {
    appearance: none;
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.settings-tab:hover {
    background: rgba(196, 30, 58, 0.06);
    color: var(--primary);
}

.settings-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.25);
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
    animation: settingsFadeIn 0.25s ease;
}

@keyframes settingsFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.settings-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
}

.settings-item summary::-webkit-details-marker {
    display: none;
}

.settings-item__form {
    padding: 0 16px 12px;
}

.settings-item__delete {
    padding: 0 16px 14px;
}

.keyword-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08), rgba(196, 30, 58, 0.04));
    border: 1px solid rgba(196, 30, 58, 0.15);
    color: var(--primary-dark);
}

/* Dashboard hot keywords */
.dash-keywords {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-keyword {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, rgba(196, 30, 58, 0.04) 0%, transparent 100%);
    border: 1px solid var(--border);
    transition: transform var(--transition), border-color var(--transition);
}

.dash-keyword:hover {
    transform: translateX(3px);
    border-color: rgba(196, 30, 58, 0.25);
}

.dash-keyword__rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    flex-shrink: 0;
}

.dash-keyword:nth-child(1) .dash-keyword__rank { background: linear-gradient(135deg, #c41e3a, #e11d48); }
.dash-keyword:nth-child(2) .dash-keyword__rank { background: linear-gradient(135deg, #ea580c, #f97316); }
.dash-keyword:nth-child(3) .dash-keyword__rank { background: linear-gradient(135deg, #d97706, #f59e0b); }

.dash-keyword__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-keyword__text strong {
    font-size: 0.9rem;
    color: var(--text);
}

.dash-keyword__text span {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-keyword__icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    opacity: 0.5;
    flex-shrink: 0;
}

.dash-keyword-meta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.rtl .dash-keyword:hover {
    transform: translateX(-3px);
}

@media (max-width: 640px) {
    .settings-tabs__nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .settings-tab {
        white-space: nowrap;
    }
}

/* 鈹€鈹€ Dashboard v2 (optimized spacing) 鈹€鈹€ */

.dash-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dash-kpi {
    position: relative;
    width: auto;
    min-height: 136px;
    padding: 16px 14px 14px;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform var(--transition), box-shadow var(--transition);
}

.dash-kpi:hover {
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 12px 28px rgba(0, 0, 0, 0.08);
}

.dash-kpi__glow {
    position: absolute;
    top: -20px;
    inset-inline-end: -20px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    filter: blur(24px);
    opacity: 0.55;
    pointer-events: none;
}

.dash-kpi--primary .dash-kpi__glow { background: rgba(196, 30, 58, 0.45); }
.dash-kpi--blue .dash-kpi__glow { background: rgba(59, 130, 246, 0.4); }
.dash-kpi--orange .dash-kpi__glow { background: rgba(245, 158, 11, 0.45); }
.dash-kpi--green .dash-kpi__glow { background: rgba(5, 150, 105, 0.4); }

.dash-kpi__icon {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
}

.dash-kpi__icon svg {
    width: 20px;
    height: 20px;
}

.dash-kpi--primary .dash-kpi__icon { background: rgba(196, 30, 58, 0.14); color: var(--primary); }
.dash-kpi--blue .dash-kpi__icon { background: rgba(59, 130, 246, 0.14); color: #3b82f6; }
.dash-kpi--orange .dash-kpi__icon { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.dash-kpi--green .dash-kpi__icon { background: rgba(5, 150, 105, 0.14); color: #059669; }

.dash-kpi__trend {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 2;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.dash-kpi__trend.up {
    background: rgba(236, 253, 245, 0.92);
    color: #059669;
}

.dash-kpi__trend.down {
    background: rgba(254, 242, 242, 0.92);
    color: #dc2626;
}

.dash-kpi__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-kpi__label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dash-kpi__value {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -0.02em;
}

.dash-kpi__hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
}

/* 主栅格：左订单+图表，右侧栏跨两行 */
.dash-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 32%);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    min-height: calc(100vh - var(--topbar-height) - 220px);
}

.dash-body > .dash-orders {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dash-body > .dash-orders .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dash-body > .dash-orders .dash-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dash-body > .dash-totals {
    grid-column: 1;
    grid-row: 2;
}

.dash-aside {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: calc(var(--topbar-height) + 16px);
    align-self: start;
    max-height: calc(100vh - var(--topbar-height) - 32px);
    overflow-y: auto;
}

.dash-panel {
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin: 0;
}

.dash-totals__body {
    padding: 16px 18px 18px !important;
}

.dash-panel--grow,
.dash-panel--chart {
    height: auto;
}

.dash-panel__head {
    padding: 16px 20px !important;
    min-height: auto;
    gap: 12px;
}

.dash-panel__head > div {
    min-width: 0;
    flex: 1;
}

.dash-panel__head .btn {
    flex-shrink: 0;
}

.dash-panel__head h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.dash-panel__sub {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 400;
}

.dash-panel__body--flush {
    padding: 0 !important;
}

.dash-panel__body--compact {
    padding: 18px 22px !important;
}

.dash-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
}

.dash-shortcut:hover {
    background: var(--primary-soft);
    transform: none;
}

.dash-shortcut__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1), rgba(196, 30, 58, 0.04));
    border: 1px solid rgba(196, 30, 58, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.dash-shortcuts-bar .dash-shortcut:hover .dash-shortcut__icon {
    background: var(--primary);
    color: #fff;
}

.dash-tabs {
    display: flex;
    flex-direction: column;
}

.dash-tabs__nav {
    display: flex;
    gap: 4px;
    padding: 12px 20px 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.dash-tab {
    appearance: none;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 0.86rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}

.dash-tab:hover { color: var(--primary); }

.dash-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.dash-tab-panel { display: none; }
.dash-tab-panel.active { display: block; }

.dash-feed-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 280px;
    max-height: none;
}

.dash-feed {
    display: flex;
    flex-direction: column;
}

.dash-feed__item {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.dash-feed__item:last-child { border-bottom: none; }
.dash-feed__item:hover { background: #fafbfc; }

.dash-feed__who {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dash-feed__item .user-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}

.dash-feed__item .user-avatar.has-image {
    background: var(--border);
}

.dash-feed__no {
    font-size: 0.88rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
}

.dash-feed__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-feed__name {
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-feed__amount {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    direction: ltr;
    unicode-bidi: isolate;
}

.dash-feed__side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.dash-feed__side .badge {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    max-width: 9.5rem;
}

.dash-empty {
    padding: 24px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.dash-empty--sm {
    padding: 16px;
    font-size: 0.8rem;
}

.dash-totals__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dash-totals__card {
    padding: 14px 14px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    min-width: 0;
}

.dash-totals__card span {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.35;
    letter-spacing: 0;
}

.dash-totals__card strong {
    display: block;
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    direction: ltr;
    unicode-bidi: isolate;
}

.dash-totals__card--primary {
    background: linear-gradient(160deg, rgba(196, 30, 58, 0.1) 0%, rgba(196, 30, 58, 0.03) 100%);
    border-color: rgba(196, 30, 58, 0.18);
}

.dash-totals__card--primary strong {
    color: var(--primary);
}

.dash-panel--week {
    flex-shrink: 0;
}

.dash-panel__body--week {
    padding: 14px 16px 16px !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-aside .dash-panel--week {
    grid-column: unset;
}

.dash-week-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dash-week-stat {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    min-width: 0;
}

.dash-week-stat span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.35;
    letter-spacing: 0;
}

.dash-week-stat strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    direction: ltr;
    unicode-bidi: isolate;
}

.dash-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dash-pill {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
}

.dash-pill em {
    display: block;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.3;
}

.dash-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.dash-status-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--border);
}

.dash-status-item span {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.dash-status-item strong {
    font-size: 0.8rem;
    color: var(--text);
}

.dash-status-item.ok {
    background: #ecfdf5;
    border-color: rgba(5, 150, 105, 0.2);
}

.dash-status-item.ok strong { color: #059669; }

.dash-status-item.warn {
    background: #fff7ed;
    border-color: rgba(217, 119, 6, 0.2);
}

.dash-status-item.warn strong { color: #c2410c; }

.dash-contacts {
    display: flex;
    flex-direction: column;
}

.dash-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
    min-width: 0;
}

.dash-contact:last-child { border-bottom: none; }
.dash-contact:hover { background: #fafbfc; }

.dash-contact .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.82rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    flex-shrink: 0;
}

.dash-contact .user-avatar.has-image {
    background: var(--border);
}

.dash-contact__info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.dash-contact__info strong {
    display: block;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-contact__info span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    unicode-bidi: isolate;
}

.dash-contact__arrow {
    width: 16px;
    height: 16px;
    color: #cbd5e1;
    flex-shrink: 0;
}

.dash-contact:hover .dash-contact__arrow {
    color: var(--primary);
}

html.rtl .dash-contact__arrow {
    transform: scaleX(-1);
}

.dash-kw-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dash-kw-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    background: var(--primary-soft);
    border: 1px solid rgba(196, 30, 58, 0.12);
    color: var(--text);
}

.dash-kw-tag b {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-kw-tag:nth-child(1) b { background: #c41e3a; }
.dash-kw-tag:nth-child(2) b { background: #ea580c; }
.dash-kw-tag:nth-child(3) b { background: #d97706; }

.dash-stock-list {
    display: flex;
    flex-direction: column;
}

.dash-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.dash-stock-item:last-child { border-bottom: none; }
.dash-stock-item:hover { background: #fafbfc; }

.dash-stock-item__info strong {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 180px;
}

.dash-stock-item__qty {
    min-width: 32px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    background: #fff7ed;
    color: #c2410c;
}

.dash-stock-item__qty.critical {
    background: #fef2f2;
    color: var(--primary);
}

.dash-alerts--compact {
    margin-top: 0;
    gap: 6px;
}

.dash-alerts--compact .dash-alert {
    padding: 8px 10px;
    font-size: 0.76rem;
}

html.rtl .dash-body {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 36%);
}

html.rtl .dash-feed__side {
    justify-content: flex-start;
}

html.rtl .dash-panel__head {
    gap: 10px;
    align-items: flex-start;
}

html.rtl .dash-panel__head h2,
html.rtl .dash-panel__sub {
    word-break: break-word;
}

html.rtl .dash-kpi__label,
html.rtl .dash-kpi__hint,
html.rtl .dash-totals__card span,
html.rtl .dash-week-stat span,
html.rtl .dash-pill {
    letter-spacing: 0;
    line-height: 1.35;
}

html.rtl .dash-tab {
    white-space: nowrap;
    flex-shrink: 0;
}

html.rtl .dash-totals__grid {
    gap: 8px;
}

.rtl .dash-hero__chips {
    justify-content: flex-start;
}

@media (max-width: 1100px) {
    .dash-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        min-height: auto;
    }

    .dash-body > .dash-orders .card-body,
    .dash-body > .dash-orders .dash-tabs {
        flex: none;
        min-height: auto;
    }

    .dash-feed-scroll {
        flex: none;
        max-height: 320px;
    }

    .dash-body > .dash-orders,
    .dash-body > .dash-totals,
    .dash-aside {
        grid-column: 1;
        grid-row: auto;
    }

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

    .dash-feed__item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .dash-feed__body {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-inline-start: 48px;
    }

    .dash-aside {
        position: static;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .dash-aside .dash-panel--week {
        grid-column: 1 / -1;
    }

    .dash-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .dash-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .dash-aside {
        grid-template-columns: 1fr;
    }

    .dash-totals__grid,
    .dash-week-grid,
    .dash-pills {
        grid-template-columns: 1fr;
    }

    .dash-feed__body {
        padding-inline-start: 0;
    }
}

/* User debts */
.debt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.debt-total-badge {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--warning);
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 6px 12px;
    border-radius: 999px;
}

.debt-amount-cell {
    color: var(--warning);
}

.debt-form {
    padding: 16px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

html.rtl .debt-card-header {
    flex-direction: row-reverse;
}

html.rtl .debt-form .form-row {
    flex-direction: row-reverse;
}

/* Admin modal */
body.modal-open {
    overflow: hidden;
}

.admin-modal[hidden] {
    display: none !important;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.admin-modal__dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-modal__header,
.admin-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.admin-modal__footer {
    border-bottom: none;
    border-top: 1px solid var(--border);
}

.admin-modal__header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.admin-modal__subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.admin-modal__close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
}

.admin-modal__body {
    padding: 0;
    overflow-y: auto;
}

.debt-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 22px 0;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.debt-modal-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.debt-modal-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
}

.debt-modal-tab.active {
    color: var(--primary);
    background: var(--card-bg);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.debt-tab-panel {
    display: none;
    padding: 20px 22px;
}

.debt-tab-panel.active {
    display: block;
}

.debt-items-section {
    margin-bottom: 16px;
}

.debt-items-section__head,
.debt-records-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.debt-records-section__head h3 {
    margin: 0;
    font-size: 1rem;
}

.debt-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debt-item-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 90px minmax(110px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.debt-item-remove {
    align-self: end;
    min-width: 72px;
}

.debt-records-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.debt-records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
}

.debt-record-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: #fff;
}

.debt-record-card__head,
.debt-record-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.debt-record-card__amount {
    font-weight: 700;
    color: var(--warning);
}

.debt-record-card__items {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.debt-record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.9rem;
}

html.rtl .debt-items-section__head,
html.rtl .debt-records-section__head,
html.rtl .debt-record-card__head,
html.rtl .debt-record-card__foot,
html.rtl .debt-record-item {
    flex-direction: row-reverse;
}

.admin-modal__dialog--rtl,
.admin-modal__dialog[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: var(--font-ug);
}

/* RTL: 标题信息在右，关闭按钮在左，标签从右侧开始 */
.admin-modal__dialog--rtl .admin-modal__header,
.admin-modal__dialog[dir="rtl"] .admin-modal__header {
    flex-direction: row;
    direction: rtl;
}

.admin-modal__dialog--rtl .admin-modal__header > div,
.admin-modal__dialog[dir="rtl"] .admin-modal__header > div {
    text-align: right;
}

.admin-modal__dialog--rtl .debt-modal-tabs,
.admin-modal__dialog[dir="rtl"] .debt-modal-tabs {
    flex-direction: row;
    direction: rtl;
    justify-content: flex-start;
}

.admin-modal__dialog--rtl .admin-modal__footer,
.admin-modal__dialog[dir="rtl"] .admin-modal__footer {
    flex-direction: row;
    direction: rtl;
}

.admin-modal__dialog--rtl .debt-items-section__head,
.admin-modal__dialog[dir="rtl"] .debt-items-section__head {
    flex-direction: row;
    direction: rtl;
    justify-content: space-between;
}

.admin-modal__dialog--rtl .debt-records-section__head,
.admin-modal__dialog[dir="rtl"] .debt-records-section__head {
    flex-direction: row;
    direction: rtl;
    justify-content: flex-start;
}

.admin-modal__dialog--rtl .debt-record-card__head,
.admin-modal__dialog[dir="rtl"] .debt-record-card__head,
.admin-modal__dialog--rtl .debt-record-card__foot,
.admin-modal__dialog[dir="rtl"] .debt-record-card__foot,
.admin-modal__dialog--rtl .debt-record-item,
.admin-modal__dialog[dir="rtl"] .debt-record-item {
    flex-direction: row;
    direction: rtl;
}

.admin-modal__dialog--rtl .form-row,
.admin-modal__dialog[dir="rtl"] .form-row {
    flex-direction: row;
    direction: rtl;
}

.admin-modal__dialog--rtl .debt-item-row,
.admin-modal__dialog[dir="rtl"] .debt-item-row {
    direction: rtl;
}

.admin-modal__dialog--rtl .form-label,
.admin-modal__dialog[dir="rtl"] .form-label,
.admin-modal__dialog--rtl .form-hint,
.admin-modal__dialog[dir="rtl"] .form-hint,
.admin-modal__dialog--rtl .form-control,
.admin-modal__dialog[dir="rtl"] .form-control,
.admin-modal__dialog--rtl .form-error,
.admin-modal__dialog[dir="rtl"] .form-error {
    text-align: right;
}

.admin-modal__dialog--rtl .empty-state,
.admin-modal__dialog[dir="rtl"] .empty-state {
    text-align: center;
}

@media (max-width: 720px) {
    .admin-modal {
        padding: 12px;
    }

    .debt-item-row {
        grid-template-columns: 1fr;
    }
}

