body {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(220, 53, 69, 0.08), transparent 25%),
        #f4f7fb;
    color: #1f2937;
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

body.embedded-page {
    background: #ffffff;
}

body.embedded-page .topbar,
body.embedded-page .sidebar-wrap,
body.embedded-page .mobile-sidebar-backdrop,
body.embedded-page .sidebar-collapse-toggle,
body.embedded-page .mobile-sidebar-toggle,
body.embedded-page .mobile-sidebar-close {
    display: none !important;
}

body.embedded-page .app-shell,
body.embedded-page .app-shell .row,
body.embedded-page .content-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.topbar {
    background: linear-gradient(120deg, #0f172a, #1d4ed8 55%, #0ea5e9);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.topbar .navbar-brand,
.topbar .navbar-brand:hover,
.topbar .navbar-brand:focus {
    color: #ffffff;
}

.mobile-sidebar-toggle {
    width: 2.4rem;
    height: 2.4rem;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.mobile-sidebar-toggle .bi {
    font-size: 1.2rem;
    line-height: 1;
}

.brand-mark,
.avatar-circle {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.app-shell {
    padding-top: 1rem;
}

@media (min-width: 768px) {
    .app-shell .row {
        --app-sidebar-width: 9.5rem;
        --app-sidebar-collapsed-width: 2.75rem;
        display: flex;
        flex-wrap: nowrap;
    }

    .app-shell .sidebar-wrap {
        flex: 0 0 var(--app-sidebar-width);
        width: var(--app-sidebar-width);
        max-width: var(--app-sidebar-width);
        transition: flex-basis 0.2s ease, width 0.2s ease, max-width 0.2s ease;
    }

    .app-shell .content-wrap {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        transition: flex-basis 0.2s ease;
    }

    .app-shell.sidebar-collapsed .sidebar-wrap {
        flex: 0 0 var(--app-sidebar-collapsed-width);
        width: var(--app-sidebar-collapsed-width);
        max-width: var(--app-sidebar-collapsed-width);
    }

    .app-shell.sidebar-collapsed .content-wrap {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
    }
}

.sidebar-wrap {
    padding: 1rem 0.35rem 1.5rem 0.35rem;
    position: relative;
    overflow: visible;
    z-index: 30;
}

.sidebar-panel {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-radius: 1.25rem;
    padding: 0.5rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    min-height: calc(100vh - 110px);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.mobile-sidebar-close {
    display: none;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0.35rem 0.5rem 0.6rem;
    text-align: left;
}

.sidebar-collapse-toggle {
    position: absolute;
    top: 1rem;
    right: -0.9rem;
    width: 1.9rem;
    height: 1.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.28);
    z-index: 5;
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-collapse-toggle:hover {
    transform: scale(1.04);
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

.sidebar-collapse-toggle .bi {
    font-size: 0.95rem;
}

.mobile-sidebar-backdrop {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-panel {
    transform: translateX(calc(-100% + 2.75rem));
    box-shadow: none;
    background: transparent;
}

.app-shell.sidebar-collapsed .sidebar-title,
.app-shell.sidebar-collapsed .menu-section {
    opacity: 0;
    pointer-events: none;
}

.app-shell.sidebar-collapsed .sidebar-panel {
    min-height: 0;
    padding: 0;
}

.app-shell.sidebar-collapsed .sidebar-wrap {
    padding: 0;
}

.app-shell.sidebar-collapsed .sidebar-collapse-toggle {
    top: 1rem;
    right: 0.35rem;
    transform: none;
    box-shadow: 0 12px 22px rgba(59, 130, 246, 0.22);
}

.menu-group-toggle {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.65rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    text-align: left;
    border-radius: 0.5rem;
    box-shadow: none;
    transition: all 0.2s ease;
}

.menu-group-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.menu-group-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.menu-group-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.menu-section + .menu-section {
    margin-top: 0.25rem;
}

.menu-group-toggle:hover {
    background: rgba(255, 255, 255, 0.6);
}

.menu-section.active .menu-group-toggle,
.menu-group-toggle.expanded,
.menu-group-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.8);
}

.menu-group-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #64748b;
    line-height: 1.2;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.menu-section.active .menu-group-title,
.menu-group-toggle.expanded .menu-group-title,
.menu-group-toggle[aria-expanded="true"] .menu-group-title {
    color: #1d4ed8;
}

.menu-group-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
    font-size: 0.85rem;
}

.menu-group-toggle.expanded .menu-group-arrow,
.menu-group-toggle[aria-expanded="true"] .menu-group-arrow {
    transform: rotate(180deg);
    color: #1d4ed8;
}

.menu-group-body {
    padding: 0 0.5rem 0.5rem 0.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.app-menu .list-group-item {
    border: 0;
    border-radius: 0.5rem;
    margin-bottom: 0.2rem;
    padding: 0.55rem 0.6rem;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    box-shadow: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-menu .list-group-item span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.app-menu .list-group-item:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #1d4ed8;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
}

.list-group-item.active {
    background: #ffffff;
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.planned-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem 0;
}

.planned-menu-item {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    background: rgba(255, 255, 255, 0.88);
    border: 1px dashed #cbd5e1;
}

.content-wrap {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 1rem;
    padding-right: 1rem;
}

.page-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #0f172a;
}

.card {
    border-radius: 1.2rem;
}

.modern-card {
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.entity-edit-modal .modal-dialog {
    max-width: min(760px, calc(100vw - 1.5rem));
    margin: 1rem auto;
}

.entity-edit-modal .modal-content {
    border-radius: 1.1rem;
    overflow: hidden;
}

.entity-edit-modal .modal-header {
    padding: 1rem 1rem 0.35rem;
    align-items: flex-start;
}

.entity-edit-modal .modal-body {
    padding: 0.85rem 1rem 1rem;
    overflow-x: hidden;
}

.entity-edit-modal .modal-footer {
    padding: 0.25rem 1rem 1rem;
}

.entity-edit-form {
    display: flex;
    flex-direction: column;
}

.entity-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.entity-edit-field {
    min-width: 0;
}

.entity-edit-field.span-2 {
    grid-column: 1 / -1;
}

.entity-edit-modal .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.entity-edit-modal .form-control,
.entity-edit-modal .form-select {
    min-width: 0;
}

.entity-edit-modal .form-select[multiple] {
    min-height: 14rem;
}

@media (max-width: 767.98px) {
    .entity-edit-grid {
        grid-template-columns: 1fr;
    }

    .entity-edit-field.span-2 {
        grid-column: auto;
    }
}

.customer-soft-card {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.7);
}

.customer-soft-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
}

.customer-soft-primary {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.96));
}

.customer-soft-info {
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.95), rgba(255, 255, 255, 0.97));
}

.customer-soft-violet {
    background: linear-gradient(180deg, rgba(245, 243, 255, 0.96), rgba(255, 255, 255, 0.97));
}

.customer-soft-warning {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.97));
}

.customer-soft-danger {
    background: linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 255, 255, 0.97));
}

.customer-soft-slate {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}

.customer-soft-block {
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.customer-soft-block-primary {
    background: linear-gradient(135deg, #eff6ff, #f8fbff);
}

.customer-soft-block-violet {
    background: linear-gradient(135deg, #f5f3ff, #faf7ff);
}

.customer-soft-block-slate {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.stat-card {
    overflow: hidden;
    position: relative;
}

.customer-funnel-row {
    overflow: visible;
    padding-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    flex-wrap: nowrap;
    gap: 1rem;
}

.customer-funnel-col {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
}

.customer-funnel-col .stat-card {
    min-height: 120px;
}

.customer-funnel-col .card-body {
    padding: 1.05rem 1.1rem;
}

.customer-funnel-col .display-6 {
    font-size: 1.9rem;
    line-height: 1.1;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    top: -30px;
    right: -20px;
}

.stat-card-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.stat-card-secondary {
    background: linear-gradient(135deg, #475569, #64748b);
}

.stat-card-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.stat-card-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.stat-card-info {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.stat-card-danger {
    background: linear-gradient(135deg, #dc2626, #f43f5e);
}

.stat-card-dark {
    background: linear-gradient(135deg, #0f172a, #334155);
}

@media (max-width: 991.98px) {
    .customer-funnel-row {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.35rem;
        gap: 0.8rem;
    }

    .customer-funnel-col {
        flex: 0 0 168px;
        width: 168px;
    }

    .customer-funnel-col .stat-card {
        min-height: 108px;
    }

    .customer-funnel-col .display-6 {
        font-size: 1.6rem;
    }
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1.35rem;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
    height: 100%;
}

.feature-icon {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.feature-desc {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.feature-desc code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-list {
    display: grid;
    gap: 0.85rem;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #e2e8f0;
}

.summary-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.35rem;
    padding: 1.4rem;
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.summary-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    top: -34px;
    right: -28px;
    background: rgba(255, 255, 255, 0.08);
}

.summary-card-primary {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
}

.summary-card-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.summary-card-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.summary-card-danger {
    background: linear-gradient(135deg, #dc2626, #f43f5e);
}

.summary-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    margin-bottom: 0.9rem;
    font-size: 1.35rem;
    background: rgba(255, 255, 255, 0.16);
}

.mall-binding-list {
    display: grid;
    gap: 0.95rem;
}

.mall-binding-item {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #fff8ef, #ffffff);
    border: 1px solid #f1e4d2;
}

.mall-binding-title {
    font-weight: 700;
    color: #7c2d12;
    margin-bottom: 0.35rem;
}

.mall-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.mall-kpi-item {
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 1px solid #e2e8f0;
}

.mall-kpi-label {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.mall-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.mall-quick-links .list-group-item {
    border: 0;
    border-radius: 1rem;
    margin-bottom: 0.55rem;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f8fafc;
    color: #1f2937;
}

.mall-quick-links .list-group-item:hover {
    background: #eef4ff;
}

.mall-list-row {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

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

.role-create-permission-box {
    max-height: 28rem;
    overflow: auto;
}

.detail-list-compact {
    gap: 0.55rem;
}

.detail-list-compact > div {
    padding-bottom: 0.5rem;
}

.detail-list span {
    color: #64748b;
}

.detail-list strong {
    color: #0f172a;
    text-align: right;
}

.lead-api-panel {
    position: relative;
}

.lead-api-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.lead-api-quick-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.95rem;
    padding: 0.9rem 1rem;
}

.lead-api-quick-item span {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.lead-api-quick-item strong {
    display: block;
    color: #0f172a;
    font-size: 0.94rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.lead-api-quick-item code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .lead-api-quick-grid {
        grid-template-columns: 1fr;
    }
}

.metric-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
}

.metric-label {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.timeline-item {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1rem;
    border-left: 2px solid #dbeafe;
}

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

.timeline-dot {
    position: absolute;
    left: -0.47rem;
    top: 0.2rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.timeline-content {
    background: linear-gradient(135deg, #f8fbff, #ffffff);
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    padding: 1rem;
}

.info-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
}

.info-block:last-child {
    margin-bottom: 0;
}

.btn-soft-primary,
.btn-soft-warning,
.btn-soft-success,
.btn-soft-danger {
    border: 0;
    font-weight: 600;
}

.btn-soft-primary {
    background: #e0edff;
    color: #1d4ed8;
}

.btn-soft-warning {
    background: #fff3db;
    color: #b45309;
}

.btn-soft-success {
    background: #dcfce7;
    color: #15803d;
}

.btn-soft-danger {
    background: #ffe4e6;
    color: #be123c;
}

.app-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
}

.app-table tbody td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.lead-remark-cell {
    max-width: 220px;
}

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

.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.line-clamp-1 {
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    -webkit-line-clamp: 3;
}

.warehouse-review-table tbody td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    line-height: 1.35;
}

.warehouse-review-table .btn.btn-sm {
    --bs-btn-padding-y: 0.15rem;
    --bs-btn-padding-x: 0.45rem;
    font-size: 0.75rem;
}

.warehouse-review-table .fw-semibold,
.warehouse-review-table .small {
    margin-bottom: 0.1rem;
}

.service-order-filter-form,
.service-order-filter-form .col-12,
.service-order-filter-form .col-md-6,
.service-order-filter-form .col-xl-2,
.service-order-filter-form .col-xl-3,
.service-order-filter-form .col-xl-4 {
    min-width: 0;
}

.service-order-filter-form .form-control,
.service-order-filter-form .form-select {
    width: 100%;
    min-width: 0;
}

.service-order-filter-keyword {
    flex: 1 1 14rem;
    max-width: 20rem;
}

.service-order-filter-compact {
    flex: 1 1 8.5rem;
    max-width: 10rem;
}

.service-order-filter-per-page {
    flex: 1 1 7rem;
    max-width: 8rem;
}

.service-order-filter-actions {
    min-width: 0;
}

.service-order-edit-card {
    overflow: hidden;
}

.service-order-edit-body {
    padding-bottom: 1.2rem;
}

.service-order-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-order-edit-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.service-order-edit-meta-item {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(219, 234, 254, 0.9);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.98));
}

.service-order-edit-meta-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
}

.service-order-edit-section {
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    background: #f8fafc;
}

.service-order-edit-section-title {
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.service-order-edit-form .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.service-order-edit-form .form-control,
.service-order-edit-form .form-select {
    min-height: 2.7rem;
    border-radius: 0.85rem;
}

.service-order-edit-form .form-control:disabled {
    background: #eef2f7;
    color: #475569;
    opacity: 1;
}

.service-order-basic-info-grid {
    align-items: start;
}

.service-order-edit-compact-row {
    --bs-gutter-x: 0.7rem;
    --bs-gutter-y: 0.55rem;
}

.service-order-edit-compact-row > [class*="col-"] {
    min-width: 0;
}

.service-order-col-wide,
.service-order-col-medium,
.service-order-col-compact {
    min-width: 0;
}

.service-order-edit-form-simple .service-order-edit-compact-row {
    --bs-gutter-x: 0.55rem;
    --bs-gutter-y: 0.5rem;
}

.service-order-edit-form-simple .service-order-edit-compact-row > [class*="col-"] {
    min-width: 0;
}

.service-order-edit-form-simple .service-order-col-wide,
.service-order-edit-form-simple .service-order-col-medium,
.service-order-edit-form-simple .service-order-col-compact {
    min-width: 0;
}

.service-order-edit-inline-value {
    margin-top: 0.32rem;
    padding: 0.15rem 0.1rem 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #64748b;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.service-order-edit-inline-value::-webkit-scrollbar {
    height: 4px;
}

.service-order-edit-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.service-order-edit-footer .btn {
    min-width: 8rem;
}

.service-order-edit-footer-compact {
    justify-content: flex-end;
    align-items: stretch;
    height: 100%;
    margin-top: 0;
}

.service-order-edit-footer-compact .btn {
    width: 100%;
}

.service-order-item-editor {
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 0.9rem;
    background: rgba(248, 250, 252, 0.92);
}

@media (min-width: 1200px) {
    .service-order-edit-compact-row {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .service-order-edit-compact-row > [class*="col-"] {
        width: auto;
        max-width: none;
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        padding-right: calc(var(--bs-gutter-x) * 0.5);
        margin-top: 0;
    }

    .service-order-col-wide {
        flex: 2.2 1 15rem;
    }

    .service-order-col-medium {
        flex: 1.35 1 10.5rem;
    }

    .service-order-col-compact {
        flex: 1 1 8.2rem;
    }

    .service-order-edit-form-simple .service-order-edit-compact-row {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .service-order-edit-form-simple .service-order-edit-compact-row > [class*="col-"] {
        width: auto;
        max-width: none;
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        padding-right: calc(var(--bs-gutter-x) * 0.5);
        margin-top: 0;
    }

    .service-order-edit-form-simple .service-order-col-wide {
        flex: 2.2 1 15rem;
    }

    .service-order-edit-form-simple .service-order-col-medium {
        flex: 1.35 1 10.5rem;
    }

    .service-order-edit-form-simple .service-order-col-compact {
        flex: 1 1 8.2rem;
    }

    .service-order-edit-form .form-control,
    .service-order-edit-form .form-select {
        min-height: 2.5rem;
    }

    .service-order-edit-form-simple .form-control,
    .service-order-edit-form-simple .form-select {
        min-height: 2.5rem;
    }

    .service-order-filter-form {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 0.75rem;
    }

    .service-order-filter-form > [class*="col-"] {
        width: auto;
        padding-right: 0;
        padding-left: 0;
        margin-top: 0;
    }

    .service-order-filter-keyword {
        flex: 1 1 auto;
        max-width: none;
    }

    .service-order-filter-compact {
        flex: 0 1 9rem;
        max-width: none;
    }

    .service-order-filter-per-page {
        flex: 0 1 7rem;
        max-width: none;
    }

    .service-order-filter-actions {
        flex: 0 0 auto;
        margin-left: auto;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .service-order-edit-meta {
        grid-template-columns: 1fr;
    }

    .service-order-edit-section {
        padding: 0.9rem;
    }

    .service-order-edit-inline-value {
        white-space: normal;
        overflow-x: visible;
    }

    .service-order-edit-footer {
        justify-content: stretch;
    }

    .service-order-edit-footer .btn {
        width: 100%;
    }
}

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

.service-order-table {
    font-size: 0.9rem;
}

.service-order-table thead th,
.service-order-table tbody td {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
    padding: 0.55rem 0.5rem;
}

.service-order-table .badge {
    white-space: normal;
}

.service-order-datetime-cell {
    min-width: 7.2rem;
    line-height: 1.35;
}

.service-order-table .btn.btn-sm {
    --bs-btn-padding-y: 0.2rem;
    --bs-btn-padding-x: 0.45rem;
    font-size: 0.78rem;
}

.after-sales-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.after-sales-header-copy {
    min-width: 0;
}

.after-sales-header .page-title {
    font-size: 1.65rem;
}

.after-sales-filter-card .card-body,
.after-sales-request-body {
    padding: 0.95rem 1rem;
}

.after-sales-filter-form .form-control,
.after-sales-filter-form .form-select {
    min-width: 0;
}

.after-sales-filter-actions {
    min-width: 0;
}

.after-sales-request-card {
    overflow: hidden;
}

.after-sales-request-card h5,
.after-sales-request-card .badge,
.after-sales-request-card .form-label,
.after-sales-review-form,
.after-sales-action-group .btn {
    line-height: 1.35;
}

.after-sales-item-list {
    display: grid;
    gap: 0.2rem;
}

.after-sales-action-group .btn {
    --bs-btn-padding-y: 0.28rem;
    --bs-btn-padding-x: 0.55rem;
}

.notification-center-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.notification-center-card {
    overflow: visible;
}

.notification-center-main,
.notification-center-config-card,
.notification-center-log-card {
    position: relative;
}

.notification-center-config-card {
    z-index: 3;
    isolation: isolate;
}

.notification-center-log-card {
    z-index: 1;
}

.notification-center-card-header,
.notification-center-card-body {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

.notification-center-form .form-control,
.notification-center-form .form-select {
    min-width: 0;
}

.notification-center-time-field {
    min-width: 0;
    position: relative;
    z-index: 2;
}

.notification-center-time-field .form-label {
    display: block;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.notification-center-scene-box {
    height: auto;
    padding: 0.75rem !important;
}

.notification-center-scene-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
}

.notification-center-scene-item {
    min-width: fit-content;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.notification-center-scene-item .form-check-label {
    display: inline-block;
    line-height: 1.25;
    word-break: keep-all;
}

.notification-center-actions {
    align-items: center;
    row-gap: 0.5rem;
}

.notification-center-actions .btn {
    white-space: normal;
    line-height: 1.35;
    text-align: center;
}

.notification-center-preview-code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.notification-center-table {
    table-layout: fixed;
}

.notification-center-table thead th,
.notification-center-table tbody td {
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
}

.notification-center-table td.text-nowrap {
    white-space: normal !important;
}

@media (max-width: 1199.98px) {
    .service-order-filter-keyword,
    .service-order-filter-compact,
    .service-order-filter-per-page {
        flex: 1 1 auto;
        max-width: none;
    }

    .service-order-table {
        font-size: 0.84rem;
    }

    .service-order-table thead th,
    .service-order-table tbody td {
        padding: 0.45rem 0.4rem;
    }

    .service-order-datetime-cell {
        min-width: 6.4rem;
    }

    .after-sales-filter-card .card-body,
    .after-sales-request-body {
        padding: 0.85rem 0.9rem;
    }

    .notification-center-card-header,
    .notification-center-card-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .notification-center-scene-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .notification-center-scene-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .notification-center-time-field-wide {
        flex-basis: 100%;
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .after-sales-filter-form {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 0.75rem;
    }

    .after-sales-filter-form > [class*="col-"] {
        width: auto;
        padding-right: 0;
        padding-left: 0;
        margin-top: 0;
    }

    .after-sales-filter-form .col-lg-4 {
        flex: 1 1 auto;
    }

    .after-sales-filter-form .col-lg-3 {
        flex: 0 1 10rem;
    }

    .after-sales-filter-actions {
        flex: 0 0 auto;
        margin-left: auto;
        white-space: nowrap;
    }
}

.payment-voucher-thumb-btn {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0.6rem;
    line-height: 0;
}

.payment-voucher-thumb {
    width: 42px;
    height: 42px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    cursor: zoom-in;
}

.payment-voucher-thumb-btn:hover .payment-voucher-thumb,
.payment-voucher-thumb-btn:focus .payment-voucher-thumb {
    transform: scale(1.9);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    position: relative;
    z-index: 5;
}

#voucherPreviewImage {
    max-height: 70vh;
    object-fit: contain;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

@media (max-width: 991.98px) {
    .mobile-sidebar-toggle {
        display: inline-flex;
        margin-right: 0.75rem;
    }

    .topbar .container-fluid {
        position: relative;
    }

    .sidebar-wrap {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 320px);
        max-width: min(86vw, 320px);
        padding: 0.9rem;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.24s ease;
        z-index: 1045;
    }

    .sidebar-panel {
        min-height: calc(100vh - 1.8rem);
        max-height: calc(100vh - 1.8rem);
        margin-bottom: 0;
        overflow-y: auto;
        border-radius: 1rem;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    }

    .content-wrap {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
    }

    .sidebar-collapse-toggle {
        display: none;
    }

    .mobile-sidebar-close {
        position: absolute;
        top: 0.7rem;
        right: 0.7rem;
        width: 2rem;
        height: 2rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 999px;
        background: #eff6ff;
        color: #1d4ed8;
        z-index: 2;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1040;
    }

    .mobile-sidebar-backdrop[hidden] {
        display: none;
    }

    .app-shell.mobile-sidebar-open .sidebar-wrap {
        display: block;
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .app-shell:not(.mobile-sidebar-open) .sidebar-wrap {
        display: none;
    }

    /* Mobile Simplified Grid Menu (简约到行列) */
    .sidebar-panel {
        background: #f4f7fb !important;
        padding: 0.5rem !important;
    }
    
    .sidebar-title {
        text-align: center;
        font-size: 1rem;
        padding: 1rem 0;
        color: #0f172a;
    }
    
    .menu-group-toggle {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.5rem 0.5rem 0.2rem !important;
        pointer-events: none;
    }
    
    .menu-group-badge,
    .menu-group-desc,
    .menu-group-arrow {
        display: none !important;
    }
    
    .menu-group-title {
        font-size: 0.85rem !important;
        color: #64748b !important;
        font-weight: 600 !important;
    }
    
    .menu-section.active .menu-group-toggle {
        background: transparent !important;
        box-shadow: none !important;
    }
    
    .menu-section .collapse {
        display: block !important;
        height: auto !important;
    }
    
    .menu-group-body {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 0.2rem !important;
        margin-top: 0.2rem !important;
    }
    
    .app-menu {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .app-menu .list-group-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.6rem 0.2rem !important;
        margin-bottom: 0 !important;
        border-radius: 0.8rem !important;
        background: #ffffff !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        border: 1px solid transparent !important;
    }
    
    .app-menu .list-group-item span {
        width: 100%;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 0.2rem;
    }
    
    .list-group-item.active {
        background: #eff6ff !important;
        color: #1d4ed8 !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1) !important;
        border-color: #bfdbfe !important;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .topbar,
    .sidebar-wrap,
    .mobile-sidebar-backdrop,
    .warehouse-no-print,
    .modal {
        display: none !important;
    }

    .app-shell,
    .app-shell .row,
    .content-wrap {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .warehouse-print-area {
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .warehouse-print-area .card-header,
    .warehouse-print-area .table-responsive,
    .warehouse-print-area .px-4 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .warehouse-print-area .table-responsive {
        overflow: visible !important;
    }

    .warehouse-print-area .app-table thead th,
    .warehouse-print-area .app-table tbody td {
        white-space: normal !important;
        font-size: 12px;
        padding: 0.35rem 0.45rem;
        vertical-align: top;
    }

    .warehouse-print-area a {
        color: inherit !important;
        text-decoration: none !important;
    }
}
