/* ==========================================================================
   START.AI - TRUNG TÂM QUẢN LÝ DUYỆT SẢN PHẨM (APPROVAL CENTER)
   CSS Design System: Modern, Polished, Responsive
   ========================================================================== */

/* Button to open Approval Center in main actions bar */
.actions .btn.approval-center-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 0 10px !important;
    height: 28px !important;
    line-height: 28px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    margin-left: 4px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.actions .btn.approval-center-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4) !important;
    transform: translateY(-1px) !important;
}

.actions .btn.approval-center-btn .btn-icon {
    font-size: 16px;
    display: inline-block;
}

/* Modal Overlay */
.ac-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ac-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Container Modal */
.ac-modal-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
    width: 100%;
    max-width: 1260px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ac-modal-overlay.active .ac-modal-container {
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   Header - Compact & Clean
   ========================================================================== */
.ac-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.ac-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
    flex-shrink: 0;
}

.ac-header-titles h2 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.ac-header-titles p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.2;
}

.ac-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-header-badge-today {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #ddd6fe;
}

.ac-header-badge-today strong {
    font-weight: 800;
    color: #6d28d9;
}

.ac-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* Modal Body - Ultra Tight & Compact Spacing */
.ac-modal-body {
    padding: 10px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
}

/* KPI Overview Cards - Slim Horizontal Strip */
.ac-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ac-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.15s ease-in-out;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ac-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.ac-kpi-card.active-kpi {
    border-color: #2563eb;
    background: #f8faff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ac-kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.ac-kpi-card.kpi-total::before { background: #3b82f6; }
.ac-kpi-card.kpi-pending::before { background: #f59e0b; }
.ac-kpi-card.kpi-approved::before { background: #10b981; }
.ac-kpi-card.kpi-today::before { background: #8b5cf6; }

.ac-kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ac-kpi-card.kpi-total .ac-kpi-icon { background: #eff6ff; color: #2563eb; }
.ac-kpi-card.kpi-pending .ac-kpi-icon { background: #fef3c7; color: #d97706; }
.ac-kpi-card.kpi-approved .ac-kpi-icon { background: #ecfdf5; color: #059669; }
.ac-kpi-card.kpi-today .ac-kpi-icon { background: #f5f3ff; color: #7c3aed; }

.ac-kpi-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

.ac-kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ac-kpi-val {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

/* Tabs Bar */
.ac-tabs-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    align-self: flex-start;
}

.ac-tab-btn {
    padding: 5px 12px;
    height: 28px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
}

.ac-tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.ac-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.ac-tab-badge {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 700;
}

.ac-tab-btn.active .ac-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Filters & Search Toolbar - Unified 1-Line Flex (Không rớt dòng) */
.ac-filter-toolbar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

.ac-filter-input-wrap {
    position: relative;
}

.ac-filter-input-wrap.search-wrap {
    flex: 2 1 200px;
}

.ac-filter-input-wrap.cat-wrap {
    flex: 1 1 140px;
    max-width: 170px;
}

.ac-filter-input-wrap.sort-wrap {
    flex: 1 1 130px;
    max-width: 150px;
}

.ac-filter-input-wrap input,
.ac-filter-input-wrap select {
    width: 100%;
    height: 32px;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ac-filter-input-wrap input:focus,
.ac-filter-input-wrap select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.ac-date-range-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1.2 1 210px;
    max-width: 240px;
}

.ac-date-range-wrap span {
    color: #94a3b8;
    font-size: 11px;
    flex-shrink: 0;
}

.ac-date-range-wrap input {
    width: 100%;
    height: 32px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 11px;
    color: #0f172a;
    box-sizing: border-box;
    outline: none;
}

.ac-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ac-filter-btn {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    white-space: nowrap;
}

.ac-filter-btn.btn-submit {
    background: #2563eb;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.ac-filter-btn.btn-submit:hover {
    background: #1d4ed8;
}

.ac-filter-btn.btn-reset {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.ac-filter-btn.btn-reset:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Bulk Action Bar */
.ac-bulk-bar {
    background: #0f172a;
    color: #ffffff;
    border-radius: 14px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
    animation: acSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ac-bulk-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.ac-bulk-badge {
    background: #2563eb;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.ac-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-bulk-btn {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.ac-bulk-btn.btn-approve-all {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.ac-bulk-btn.btn-approve-all:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.ac-bulk-btn.btn-clear {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.ac-bulk-btn.btn-clear:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Data Table Container */
.ac-table-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.ac-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ac-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
    font-size: 13px;
}

.ac-table tr:hover td {
    background: #f8fafc;
}

/* Table elements */
.ac-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #2563eb;
}

.ac-thumb-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.ac-thumb-img:hover {
    transform: scale(1.08);
}

.ac-prod-name-wrap {
    display: flex;
    flex-direction: column;
    max-width: 320px;
}

.ac-prod-title {
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1.35;
    margin-bottom: 4px;
}

.ac-prod-title:hover {
    color: #2563eb;
}

.ac-prod-shortinfo {
    font-size: 12px;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.ac-badge.badge-pending {
    background: #fef3c7;
    color: #b45309;
}

.ac-badge.badge-approved {
    background: #ecfdf5;
    color: #047857;
}

.ac-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending .ac-badge-dot { background: #f59e0b; }
.badge-approved .ac-badge-dot { background: #10b981; }

.ac-price {
    font-weight: 700;
    color: #dc2626;
    font-size: 14px;
}

.ac-seller-name {
    font-weight: 500;
    color: #0f172a;
}

/* Actions in row */
.ac-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ac-act-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.ac-act-btn.btn-view {
    background: #eff6ff;
    color: #2563eb;
}

.ac-act-btn.btn-view:hover {
    background: #dbeafe;
}

.ac-act-btn.btn-edit {
    background: #f0fdf4;
    color: #0284c7;
    border: 1px solid #e0f2fe;
}

.ac-act-btn.btn-edit:hover {
    background: #e0f2fe;
    color: #0369a1;
}

.ac-act-btn.btn-approve {
    background: #ecfdf5;
    color: #059669;
}

.ac-act-btn.btn-approve:hover {
    background: #d1fae5;
}

.ac-act-btn.btn-unapprove {
    background: #fffbeb;
    color: #d97706;
}

.ac-act-btn.btn-unapprove:hover {
    background: #fef3c7;
}

.ac-act-btn.btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

.ac-act-btn.btn-delete:hover {
    background: #fee2e2;
}

/* Empty State & Loading State */
.ac-state-box {
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ac-state-icon {
    font-size: 48px;
    color: #94a3b8;
}

.ac-state-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.ac-state-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.ac-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: acSpin 0.8s linear infinite;
}

@keyframes acSpin {
    to { transform: rotate(360deg); }
}

/* Pagination Bar */
.ac-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
}

.ac-page-info {
    font-size: 13px;
    color: #64748b;
}

.ac-page-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ac-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ac-page-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.ac-page-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.ac-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Detail Preview Sub-modal */
.ac-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.ac-detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.ac-detail-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 840px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.ac-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.ac-detail-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.ac-detail-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ac-detail-top-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.ac-detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ac-detail-main-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.ac-detail-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ac-detail-sub-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.ac-detail-sub-thumb.active {
    border-color: #2563eb;
}

.ac-detail-info-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ac-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin: 0;
}

.ac-detail-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ac-detail-price-box {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 10px 16px;
    border-radius: 12px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 4px;
}

.ac-detail-price-now {
    font-size: 24px;
    font-weight: 800;
    color: #dc2626;
}

.ac-detail-price-old {
    font-size: 15px;
    color: #94a3b8;
    text-decoration: line-through;
}

.ac-detail-meta-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.ac-detail-meta-table td {
    padding: 6px 0;
    vertical-align: top;
}

.ac-detail-meta-table td:first-child {
    color: #64748b;
    width: 110px;
    font-weight: 500;
}

.ac-detail-meta-table td:last-child {
    color: #0f172a;
    font-weight: 600;
}

.ac-detail-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 16px 0 8px 0;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
}

.ac-detail-text-content {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    white-space: pre-line;
}

.ac-detail-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Toast System */
.ac-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.ac-toast {
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: acToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes acToastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.ac-toast.toast-success { border-left: 4px solid #10b981; }
.ac-toast.toast-error { border-left: 4px solid #ef4444; }
.ac-toast.toast-info { border-left: 4px solid #3b82f6; }

.ac-toast-icon {
    font-size: 18px;
}

.toast-success .ac-toast-icon { color: #10b981; }
.toast-error .ac-toast-icon { color: #ef4444; }
.toast-info .ac-toast-icon { color: #3b82f6; }

/* ==========================================================================
   Embedded & Standalone Mode (When used as a dedicated submodule or on /duyet-san-pham)
   ========================================================================== */
.ac-embedded-wrapper,
.ac-standalone-wrapper {
    width: 100% !important;
    max-width: 1260px !important;
    margin: 0 auto !important;
    padding: 10px 0 30px !important;
}

.ac-modal-container.ac-embedded,
.ac-modal-container.ac-standalone {
    position: static !important;
    transform: none !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 0 0 1px #e2e8f0 !important;
    max-height: none !important;
    overflow: visible !important;
    border-radius: 16px !important;
    margin: 0 auto !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.ac-modal-container.ac-embedded .ac-close-btn,
.ac-modal-container.ac-standalone .ac-close-btn {
    display: none !important;
}

.ac-modal-container.ac-embedded .ac-modal-body,
.ac-modal-container.ac-standalone .ac-modal-body {
    overflow: visible !important;
    padding: 10px 16px !important;
    gap: 8px !important;
}

/* Hide legacy shopping elements on dedicated approval page */
body.is-approval-page .view-productgeneral > .actions,
body.is-approval-page .view-productgeneral > #divinput_form,
body.is-approval-page .view-productgeneral > #divDynamicContent,
body.is-approval-page .view-productgeneral > .block-title,
body.is-approval-page .view-productgeneral > .col.product-search,
body.is-approval-page .view-productgeneral .fb-composer-container,
body.is-approval-page .view-productgeneral .product-search-root {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .ac-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ac-detail-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ac-kpi-grid {
        grid-template-columns: 1fr;
    }
    .ac-modal-header {
        padding: 16px;
    }
    .ac-modal-body {
        padding: 16px;
    }
    .ac-filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ac-date-range-wrap {
        flex-direction: column;
    }
    .ac-pagination-bar {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}

/* ==========================================================================
   Edit Product Modal Form Styles
   ========================================================================== */
.ac-edit-modal .ac-detail-card {
    max-width: 860px;
    width: 95%;
}

.ac-edit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ac-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ac-form-group.col-span-2 {
    grid-column: span 2;
}

.ac-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ac-form-label .req {
    color: #ef4444;
    margin-left: 2px;
}

.ac-form-label .hint {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.ac-form-input,
.ac-form-select,
.ac-form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    transition: all 0.2s;
    font-family: inherit;
}

.ac-form-input:focus,
.ac-form-select:focus,
.ac-form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ac-form-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}

.ac-readonly-box {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.ac-edit-images-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ac-edit-images-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ac-edit-img-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #ffffff;
}

.ac-edit-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-edit-img-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 38, 38, 0.85);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
}

.ac-edit-img-remove:hover {
    background: #dc2626;
}

.ac-btn-add-img {
    background: #eff6ff;
    border: 1px dashed #60a5fa;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-start;
}

.ac-btn-add-img:hover {
    background: #dbeafe;
}

@media (max-width: 768px) {
    .ac-edit-form-grid {
        grid-template-columns: 1fr;
    }
    .ac-form-group.col-span-2 {
        grid-column: span 1;
    }
}
