/* ========== 洛哈斯水处理报价系统样式 ========== */

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

body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* ========== 公用样式 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.clearfix:after {
    content: "";
    display: block;
    clear: both;
}

.fl { float: left; }
.fr { float: right; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-main { color: #0078D7; }

/* ========== 按钮样式 ========== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #0078D7;
    color: #fff;
}
.btn-primary:hover {
    background: #005A9E;
}

.btn-success {
    background: #28a745;
    color: #fff;
}
.btn-success:hover {
    background: #1e7e34;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}
.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background: #bd2130;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}
.btn-secondary:hover {
    background: #5a6268;
}

/* ========== 头部样式 ========== */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .logo h2 {
    color: #0078D7;
    font-size: 20px;
}

.header .logo span {
    font-size: 12px;
    color: #999;
}

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

.header .user-name {
    font-weight: bold;
}

.header .logout {
    color: #dc3545;
    text-decoration: none;
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    width: 260px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar .menu-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .menu-item:hover {
    background: #e8f4fd;
    color: #0078D7;
}

.sidebar .menu-item.active {
    background: #e8f4fd;
    color: #0078D7;
    border-left-color: #0078D7;
}

.sidebar .menu-item i {
    margin-right: 10px;
    width: 20px;
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 3px solid #0078D7;
}

.stat-card .number {
    font-size: 32px;
    font-weight: bold;
    color: #0078D7;
    margin: 10px 0;
}

.stat-card .label {
    color: #666;
    font-size: 14px;
}

/* ========== 表格样式 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

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

.data-table .actions {
    display: flex;
    gap: 8px;
}

.data-table .actions a {
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0078D7;
    box-shadow: 0 0 5px rgba(0,120,215,0.3);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* ========== 产品明细表格 ========== */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.items-table th,
.items-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
}

.items-table th {
    background: #f8f9fa;
}

.items-table input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.items-table .amount {
    background: #f5f5f5;
    text-align: right;
}

.btn-add-row {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
}

.del-row {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* ========== 分页样式 ========== */
.pagination {
    margin-top: 25px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
}

.pagination a:hover,
.pagination .active {
    background: #0078D7;
    border-color: #0078D7;
    color: #fff;
}

/* ========== 弹窗样式 ========== */
.modal {
    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.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    padding: 25px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* ========== 登录页面样式 ========== */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0078D7 0%, #005A9E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h1 {
    text-align: center;
    color: #0078D7;
    margin-bottom: 10px;
}

.login-box .sub {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
}

.login-box .error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}