/* 智慧外院 管理后台样式 */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f2f4f7;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.6;
}

a { color: #c0392b; text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: #1f2a37;
    color: #cbd5e1;
    flex-shrink: 0;
}
.sidebar .brand {
    padding: 20px 18px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #2f3c4d;
}
.sidebar .brand small { display: block; font-weight: 400; font-size: 12px; color: #94a3b8; margin-top: 4px; }
.sidebar nav a {
    display: block;
    padding: 11px 18px;
    color: #cbd5e1;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #263241; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #263241; color: #fff; border-left-color: #c0392b; }
.sidebar nav a .icon { display: inline-block; width: 20px; color: #94a3b8; }

/* 主区域 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { color: #6b7280; font-size: 13px; }
.content { padding: 20px; }

/* 卡片 */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

/* 统计 */
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.stat {
    flex: 1 1 160px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}
.stat .label { color: #6b7280; font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 6px; color: #111827; }
.stat .value.red { color: #c0392b; }
.stat .value.green { color: #15803d; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef1f4; font-size: 13px; vertical-align: top; }
th { background: #f9fafb; color: #4b5563; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fcfcfd; }
.table-wrap { overflow-x: auto; }

/* 表单 */
.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.form-item { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; }
.form-item label { font-size: 13px; color: #4b5563; }
input[type=text], input[type=number], input[type=password], select, textarea {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #c0392b; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn-primary { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn-primary:hover { background: #a93226; }
.btn-danger { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-gray { background: #f3f4f6; color: #4b5563; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-orange { background: #ffedd5; color: #c2410c; }

/* 提示 */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.info { background: #e0f2fe; color: #075985; }

.muted { color: #9ca3af; font-size: 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.empty { padding: 40px; text-align: center; color: #9ca3af; }
.money { color: #c0392b; font-weight: 600; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1f2a37; }
.login-box { width: 360px; background: #fff; border-radius: 10px; padding: 28px; }
.login-box h1 { margin: 0 0 6px; font-size: 20px; }
.login-box p.sub { margin: 0 0 22px; color: #6b7280; font-size: 13px; }
.login-box .form-item { margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 11px; font-size: 15px; }

.pager { margin-top: 14px; display: flex; gap: 8px; align-items: center; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.detail-list .k { color: #6b7280; }
