/* Unfold 风格主题 - 兼容现有 CRM */

/* 表格样式 */
.table-unfold {
    width: 100%;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    border-collapse: separate;
    border-spacing: 0;
}

.table-unfold th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.table-unfold td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.table-unfold tr:hover {
    background-color: #f9fafb;
}

/* 按钮样式 */
.btn-unfold-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #4f46e5;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-unfold-primary:hover {
    background-color: #4338ca;
}

.btn-unfold-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    transition: background-color 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-unfold-secondary:hover {
    background-color: #f9fafb;
}

.btn-unfold-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #dc2626;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-unfold-danger:hover {
    background-color: #b91c1c;
}

/* 卡片样式 */
.card-unfold {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* 状态标签 */
.badge-unfold {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* 动作按钮组 */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 兼容旧 Bootstrap 类 */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9fafb;
}

.table-center {
    text-align: center;
}

.table-center th,
.table-center td {
    text-align: center;
}

/* 搜索框 */
.search-unfold {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.search-unfold input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.875rem;
    width: 100%;
}

/* 分页样式 */
.pagination-unfold {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination-unfold a,
.pagination-unfold span {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    text-decoration: none;
    color: #374151;
}

.pagination-unfold .current {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* 隐藏类 - 用于下拉菜单 */
.hidden {
    display: none;
}

/* 下拉菜单旋转 */
.rotate-90 {
    transform: rotate(90deg);
}

/* CKEditor 5 全宽样式 */
.ck-editor {
    width: 100% !important;
    max-width: 100%;
}

.ck-editor__editable {
    min-height: 300px !important;
}

.ck-editor__editable:focus {
    border-color: #4f46e5 !important;
}

/* 表单样式（Unfold） */
.form-unfold label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.form-unfold input[type="text"],
.form-unfold input[type="number"],
.form-unfold input[type="email"],
.form-unfold input[type="password"],
.form-unfold select,
.form-unfold textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-unfold textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.form-unfold input:focus,
.form-unfold select:focus,
.form-unfold textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.form-unfold .helptext {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* 订单条目表单：产品图 */
.order-item-form .product_detail .product_image {
    display: block;
    width: 14rem;
    height: 14rem;
    object-fit: contain;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}
