/* ============================================================
   危险品运输企业车辆管理系统 - 样式
   ============================================================ */
:root {
    --primary: #1a6bd6;
    --primary-dark: #1257b0;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f2f5f9;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 登录页 ---------------- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f3a7a 0%, #1a6bd6 55%, #3b82f6 100%);
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-icon {
    width: 56px; height: 56px; margin: 0 auto 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a6bd6, #3b82f6);
    color: #fff; font-size: 26px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.login-logo h1 { font-size: 20px; color: #1f2937; margin-bottom: 6px; }
.login-logo p { font-size: 13px; color: #6b7280; }
.login-tip { margin-top: 16px; font-size: 12px; color: #9ca3af; text-align: center; }

/* ---------------- 布局 ---------------- */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 58px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.brand { display: flex; align-items: center; margin-right: 28px; }
.brand-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(135deg, #1a6bd6, #3b82f6);
    color: #fff; font-size: 17px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px;
}
.brand-name { font-size: 17px; font-weight: 700; color: #111827; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
    padding: 8px 16px; border-radius: 6px; color: #374151; font-weight: 500;
}
.main-nav a:hover { background: #f3f4f6; text-decoration: none; }
.main-nav a.active { background: #e8f0fe; color: var(--primary); }
.top-user { display: flex; align-items: center; gap: 10px; }
.user-name { color: #374151; font-weight: 500; }

.main { flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; padding: 24px; }
.footer {
    text-align: center; color: #9ca3af; font-size: 12px;
    padding: 18px; border-top: 1px solid var(--border);
    background: #fff;
}

/* ---------------- 页头 ---------------- */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-head h2 { font-size: 20px; color: #111827; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plate-big { color: var(--primary); font-weight: 700; }

/* ---------------- 统计卡片 ---------------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; margin-bottom: 20px;
}
.stat-card {
    background: #fff; border-radius: var(--radius);
    padding: 18px 20px; border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}
.stat-card.stat-blue   { border-left-color: #3b82f6; }
.stat-card.stat-green  { border-left-color: var(--success); }
.stat-card.stat-orange { border-left-color: var(--warning); }
.stat-card.stat-red    { border-left-color: var(--danger); }
.stat-num { font-size: 28px; font-weight: 700; color: #111827; }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ---------------- 卡片 ---------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.section-title {
    font-size: 16px; font-weight: 600; color: #111827;
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.section-head { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--text-muted); margin-bottom: 12px; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.tabs { display: flex; gap: 4px; }
.tab {
    padding: 8px 18px; border-radius: 6px; color: #4b5563; font-weight: 500;
    background: #f3f4f6;
}
.tab.active { background: var(--primary); color: #fff; }
.tab:hover { text-decoration: none; opacity: .9; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
    width: 260px;
}
.search-form input:focus { outline: none; border-color: var(--primary); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table th { background: #f8fafc; font-weight: 600; color: #374151; }
.table tbody tr:hover { background: #f8fafc; }
.plate { font-weight: 700; color: var(--primary); }
.actions { display: flex; gap: 6px; }
.actions a { white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-block; padding: 8px 16px; border-radius: 6px;
    border: 1px solid var(--border); background: #fff; color: #374151;
    cursor: pointer; font-size: 14px; text-align: center;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px 18px;
}
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; color: #4b5563; margin-bottom: 6px; font-weight: 500; }
.form-group .req { color: var(--danger); }
.form-group input, .form-group select, .form-group textarea {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; width: 100%; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,107,214,.12);
}
.form-section { margin-bottom: 26px; }
.form-section .section-title { margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
input[type="file"] { padding: 6px; }

/* ---------------- 详情 ---------------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px 20px;
}
.detail-item { display: flex; flex-direction: column; padding: 8px 12px; background: #f8fafc; border-radius: 6px; }
.detail-label { font-size: 12px; color: #6b7280; margin-bottom: 2px; }
.detail-value { font-size: 14px; color: #111827; font-weight: 500; word-break: break-all; }
.expire-table .table td:nth-child(2) { font-weight: 600; }
.ins-form {
    margin-top: 18px; padding: 18px; background: #f8fafc;
    border: 1px dashed #cbd5e1; border-radius: 8px;
}
.ins-form h4 { margin-bottom: 14px; color: #111827; }

/* ---------------- 标签 / 徽章 ---------------- */
.tag {
    display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px;
    font-weight: 600;
}
.tag-blue  { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px;
    font-weight: 500;
}
.exp-ok   { background: #dcfce7; color: #15803d; }
.exp-warn { background: #fef3c7; color: #b45309; }
.exp-over { background: #fee2e2; color: #b91c1c; }
.exp-none { background: #f3f4f6; color: #6b7280; }

/* ---------------- 提示 ---------------- */
.alert {
    padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warn    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---------------- 其它 ---------------- */
.empty { text-align: center; color: #9ca3af; padding: 40px 0; }
.error-list {
    background: #fff; border: 1px solid #fecaca; border-radius: 6px;
    padding: 12px 16px; max-height: 260px; overflow: auto; font-size: 13px;
    color: #991b1b;
}
.error-list div { padding: 2px 0; }
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.page-info { color: #6b7280; font-size: 13px; }
