/* ============================================================
   css/style.css - 客户管理系统样式
   设计风格: 简洁现代, 以蓝/绿/红三色区分状态
   ============================================================ */

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
                 "Microsoft YaHei", Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- 顶部导航栏 ---------- */
.navbar {
    background: #2c3e50;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .logo {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}
.navbar .nav-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 8px;
    padding: 4px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.active { background: #3498db; }
.navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #bdc3c7;
}
.navbar .nav-right button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.navbar .nav-right button:hover { background: #c0392b; }

/* ---------- 主容器 ---------- */
.container {
    max-width: 1920px;
    margin: 20px auto;
    padding: 0 32px;
}

/* ---------- 卡片 / 汇总块 ---------- */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.card h2 {
    margin-top: 0;
    font-size: 16px;
    color: #34495e;
    border-left: 4px solid #3498db;
    padding-left: 10px;
}

/* 汇总卡片网格 */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.summary-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-top: 3px solid #3498db;
}
.summary-item.green  { border-top-color: #27ae60; }
.summary-item.red    { border-top-color: #e74c3c; }
.summary-item.orange { border-top-color: #f39c12; }
.summary-item.purple { border-top-color: #9b59b6; }

.summary-item .label {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 6px;
}
.summary-item .value {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
}
.summary-item.red .value { color: #e74c3c; }
.summary-item.green .value { color: #27ae60; }
.summary-item .sub-note {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 4px;
}

/* ---------- 筛选栏 ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.filter-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
}
.filter-bar .filter-btn {
    padding: 8px 16px;
    border: 1px solid #bdc3c7;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-bar .filter-btn:hover { background: #ecf0f1; }
.filter-bar .filter-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}
.btn-primary {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { background: #2980b9; }
.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.btn-danger:hover { background: #c0392b; }
.btn-secondary {
    background: #95a5a6;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

/* ---------- 表格 ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
th {
    background: #34495e;
    color: #fff;
    padding: 12px 10px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
td {
    padding: 12px 10px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
}
td.wrap { white-space: normal; }
tr:hover td { background: #f8f9fa; }
tr:last-child td { border-bottom: none; }

/* 金额高亮 */
td.amount-high { color: #e74c3c; font-weight: bold; }
td.amount-ok   { color: #27ae60; font-weight: bold; }
td.customer-no {
    font-weight: bold;
    color: #2980b9;
}

/* ---------- 状态按钮 (可点击切换) ---------- */
.status-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    user-select: none;
}
.status-btn:hover { opacity: 0.85; }
.status-btn.green  { background: #d5f5e3; color: #196f3d; }
.status-btn.red    { background: #fadbd8; color: #922b21; }
.status-btn.orange { background: #fdebd0; color: #a04000; }
.status-btn.gray   { background: #e5e7e9; color: #566573; }
.status-btn.blue   { background: #d4e6f1; color: #1a5276; }
.status-btn.purple { background: #ebdef0; color: #6c3483; }

/* ---------- 表单 ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px 24px;
}
.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #34495e;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.form-group textarea {
    min-height: 60px;
    resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}
.form-group .hint {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 4px;
}
.form-section-title {
    grid-column: 1 / -1;
    font-size: 14px;
    color: #2c3e50;
    font-weight: bold;
    padding-top: 8px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 6px;
    margin-bottom: 2px;
}

/* 复选框组 (卡片式) */
.checkbox-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.checkbox-cards label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    transition: all 0.2s;
    font-weight: normal;
    margin-bottom: 0;
}
.checkbox-cards label:hover { background: #ecf0f1; }
.checkbox-cards input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* 操作按钮行 */
.form-actions {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #ecf0f1;
}
.form-actions button,
.form-actions a {
    margin: 0 6px;
    padding: 10px 28px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    display: inline-block;
    text-decoration: none;
}

/* ---------- 登录页 ---------- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
    background: #fff;
    border-radius: 10px;
    padding: 40px;
    width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.login-card h1 {
    text-align: center;
    margin: 0 0 24px 0;
    color: #2c3e50;
    font-size: 22px;
}
.login-card .form-group input {
    padding: 10px 12px;
    font-size: 14px;
}
.login-card button {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
}
.login-card button:hover { background: #2980b9; }
.login-hint {
    margin-top: 14px;
    font-size: 12px;
    color: #95a5a6;
    text-align: center;
}

/* ---------- 提示消息 (toast) ---------- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out;
    max-width: 360px;
}
.toast.success { background: #27ae60; }
.toast.error   { background: #e74c3c; }
.toast.info    { background: #3498db; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---------- 详情页字段 ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px 24px;
}
.detail-item {
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
}
.detail-item .label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 4px;
}
.detail-item .value {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
    word-break: break-all;
}
.detail-item .value.money { color: #e74c3c; font-weight: bold; }
.detail-item .value.money.green { color: #27ae60; }
.detail-item .value.empty { color: #bdc3c7; font-weight: normal; }

/* 空状态 */
.empty-state {
    padding: 40px;
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
}

/* 维护费记录 - 表格小 */
table.mini th { padding: 8px; font-size: 12px; }
table.mini td { padding: 8px; font-size: 13px; }

/* 编号提示条 */
.no-hint-bar {
    background: #eaf4fd;
    border-left: 4px solid #3498db;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #2c3e50;
}
.no-hint-bar strong { color: #2980b9; }
.no-hint-bar .suggest-btn {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 10px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.no-hint-bar .suggest-btn:hover { background: #2980b9; }

/* 响应式 */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .navbar { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .navbar .logo { font-size: 15px; }
    .navbar .nav-links a { margin: 0 2px; padding: 4px 8px; font-size: 12px; }
    table { font-size: 12px; }
    th, td { padding: 8px 6px; }
}
