* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #667eea 0%, #764ba2 50%, #6a11cb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* 背景装饰 */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -120px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
}

.shape-3 {
    width: 200px;
    height: 200px;
    top: 40%;
    right: 10%;
    opacity: 0.5;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 48px 40px 36px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    animation: cardIn 0.5s ease;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.login-title {
    text-align: center;
    color: #333;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.login-subtitle {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-bottom: 36px;
    letter-spacing: 0.5px;
}

.login-form {
    margin-bottom: 24px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.6;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fafbfc;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-group input::placeholder {
    color: #bbb;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(102, 126, 234, 0.45);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    color: #ccc;
    font-size: 12px;
    margin: 0;
}

.btn-sm {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    background: #f56c6c;
}

.btn-danger:hover {
    background: #e64c4c;
}

.btn-success {
    background: #67c23a;
}

.btn-success:hover {
    background: #529b2e;
}

.btn-warning {
    background: #e6a23c;
}

.btn-warning:hover {
    background: #d4881f;
}

/* 管理后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #304156;
    color: #bfcbd9;
    flex-shrink: 0;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    border-bottom: 1px solid #1f2d3d;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu li:hover,
.sidebar-menu li.active {
    background: #263445;
    color: #fff;
    border-left-color: #667eea;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar h2 {
    font-size: 18px;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info .username {
    color: #666;
    font-size: 14px;
}

.logout-btn {
    color: #f56c6c;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    text-decoration: underline;
}

.content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar .title {
    font-size: 16px;
    font-weight: 600;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-item label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.filter-item select,
.filter-item input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-item select:focus,
.filter-item input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

/* 自定义选择框 */
.custom-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 140px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}

.custom-select:hover {
    border-color: #667eea;
}

.custom-select .select-arrow {
    color: #999;
    margin-left: 8px;
    font-size: 18px;
    line-height: 1;
}

/* 自定义下拉框 */
.custom-dropdown {
    position: relative;
}
.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}
.dropdown-trigger:hover {
    border-color: #667eea;
}
.dropdown-arrow {
    color: #999;
    font-size: 12px;
    transition: transform 0.2s;
}
.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
}
.custom-dropdown.open .dropdown-menu {
    display: block;
}
.dropdown-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.dropdown-option:hover {
    background: #f5f7fa;
    color: #667eea;
}
.dropdown-option.selected {
    background: #eef1ff;
    color: #667eea;
    font-weight: 500;
}

/* 客户选择弹窗 */
.picker-search-box {
    margin-bottom: 16px;
}

.picker-search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.picker-search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.picker-list {
    max-height: 320px;
    overflow-y: auto;
}

.picker-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.picker-item:hover {
    background: #f5f7fa;
}

.picker-item.picker-selected {
    color: #667eea;
    font-weight: 600;
}

.picker-empty {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 14px;
}

/* 日历选择器 */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
}

.calendar-nav:hover {
    background: #f5f7fa;
}

.calendar-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 13px;
    color: #999;
    padding: 4px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
}

.calendar-day:hover {
    background: #f5f7fa;
}

.calendar-day.today {
    border: 1px solid #667eea;
    color: #667eea;
}

.calendar-day.selected {
    background: #667eea;
    color: #fff;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
}

/* 表格 */
.data-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
}

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

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

.action-btns {
    display: flex;
    gap: 8px;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    width: 420px;
    max-width: 90%;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-actions .btn {
    width: auto;
    padding: 8px 20px;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: #67c23a;
}

.toast.error {
    background: #f56c6c;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card .label {
    color: #999;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 库存徽章 */
.stock-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #f0f9eb;
    color: #67c23a;
    font-weight: 600;
    font-size: 13px;
}
.stock-badge.out {
    background: #fef0f0;
    color: #f56c6c;
}

/* 入库数量颜色 */
.inbound-qty {
    color: #67c23a;
    font-weight: 600;
}

/* 表单组（弹窗内） */
.form-group {
    margin-bottom: 18px;
}
.form-group:last-child {
    margin-bottom: 0;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.form-group label .required {
    color: #f56c6c;
    margin-left: 2px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #c0c4cc;
}

/* 商品选择展示卡片 */
.product-pick-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f5f7fa;
    border: 1px dashed #dcdfe6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.product-pick-card:hover {
    border-color: #667eea;
    background: #f0f2ff;
}
.product-pick-card .pick-placeholder {
    color: #909399;
    font-size: 14px;
}
.product-pick-card .pick-name {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
}
.product-pick-card .pick-arrow {
    color: #c0c4cc;
    font-size: 20px;
    line-height: 1;
}
.product-pick-card.picked {
    border-style: solid;
    border-color: #667eea;
    background: #ecf5ff;
}

/* 库存展示行 */
.stock-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #909399;
}
.stock-info-row .stock-value {
    font-weight: 600;
    color: #67c23a;
}
.stock-info-row .stock-value.out {
    color: #f56c6c;
}

/* 数量步进器 */
.qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    overflow: hidden;
    width: 160px;
}
.qty-stepper button {
    width: 40px;
    height: 38px;
    border: none;
    background: #f5f7fa;
    font-size: 18px;
    color: #606266;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
}
.qty-stepper button:hover {
    background: #e9eef5;
    color: #667eea;
}
.qty-stepper button:disabled {
    color: #c0c4cc;
    cursor: not-allowed;
    background: #f5f7fa;
}
.qty-stepper input {
    flex: 1;
    height: 38px;
    border: none;
    border-left: 1px solid #dcdfe6;
    border-right: 1px solid #dcdfe6;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 入库预览条 */
.inbound-preview {
    margin-top: 4px;
    padding: 10px 14px;
    background: #f0f9eb;
    border-radius: 6px;
    font-size: 13px;
    color: #67c23a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.inbound-preview .preview-from {
    color: #909399;
}
.inbound-preview .preview-arrow {
    color: #c0c4cc;
}
.inbound-preview .preview-to {
    font-weight: 600;
}

/* 弹窗加宽 */
.modal.inbound-modal {
    width: 460px;
}
