/* ============================================================
   考勤系统公共样式 —— 中性商务主题
   ============================================================ */

:root {
    --brand: #3a6ea5;
    --brand-dark: #2c4a7c;
    --brand-light: #eef2f9;
    --danger: #d93025;
    --warning: #e08600;
    --text-main: #1f2329;
    --text-sub: #646a73;
    --border: #e5e6eb;
    --bg-page: #f4f6f8;
}

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c4a7c 0%, #3a6ea5 55%, #4d86c4 100%);
    position: relative;
    overflow: hidden;
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* 背景装饰：电网线条纹理 */
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.login-page::after {
    content: "";
    position: absolute;
    width: 620px;
    height: 620px;
    right: -180px;
    top: -220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .12) 0%, transparent 70%);
    pointer-events: none;
}

.login-box {
    position: relative;
    z-index: 2;
    width: 400px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px 32px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand .logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
}

.login-brand h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 6px;
    letter-spacing: 1px;
}

.login-brand p {
    font-size: 13px;
    color: var(--text-sub);
    margin: 0;
}

.login-form .layui-form-item {
    margin-bottom: 22px;
}

.login-form .layui-input {
    height: 44px;
    border-radius: 8px;
    border-color: var(--border);
    transition: border-color .2s, box-shadow .2s;
}

.login-form .layui-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 155, 119, .12);
}

.login-btn {
    width: 100%;
    height: 44px;
    line-height: 44px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}

.login-btn:hover {
    opacity: .92;
}

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

.login-btn.disabled {
    opacity: .6;
    cursor: not-allowed;
}

.login-tip {
    margin-top: 18px;
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.8;
}

.login-tip code {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 1px 6px;
    border-radius: 4px;
}

/* ---------- 管理端框架 ---------- */
.admin-header {
    height: 60px;
    background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.admin-header .logo {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-header .logo .mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-header .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
}

.admin-header .user-info .divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, .3);
}

.admin-side {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 200px;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 99;
}

/* 说明：Layui 的 .layui-nav 默认带深色底（#2f363c）与白色文字，
   与本系统的浅色主题冲突，必须整体覆盖，否则深底深字看不清。
   这里把导航恢复为浅色侧栏 + 主色高亮。 */
.admin-side .layui-nav-tree {
    border: none;
    background: transparent;
    padding: 8px 0;
    box-shadow: none;
}

.admin-side .layui-nav-tree .layui-nav-item a {
    height: 46px;
    line-height: 46px;
    padding: 0 20px 0 16px;
    color: var(--text-main);
    font-size: 14px;
    border-radius: 0;
    transition: background .2s, color .2s;
}

/* 悬停 */
.admin-side .layui-nav-tree .layui-nav-item a:hover {
    background: #f4f6f8;
    color: var(--brand-dark);
}

/* 选中项：浅蓝底 + 深蓝字 + 左侧主色竖条 */
.admin-side .layui-nav-tree .layui-this,
.admin-side .layui-nav-tree .layui-this a,
.admin-side .layui-nav-tree .layui-this a:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 500;
}

.admin-side .layui-nav-tree .layui-this a {
    position: relative;
}

.admin-side .layui-nav-tree .layui-this a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--brand);
    border-radius: 0 3px 3px 0;
}

/* 图标颜色随文字 */
.admin-side .layui-nav-tree .layui-nav-item a .layui-icon {
    color: inherit;
    margin-right: 8px;
    font-size: 15px;
}

.admin-body {
    position: absolute;
    top: 60px;
    left: 200px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-page);
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
    font-family: "DIN Alternate", Helvetica, Arial, sans-serif;
}

.stat-card .unit {
    font-size: 13px;
    color: var(--text-sub);
    margin-left: 4px;
    font-weight: 400;
}

.stat-card .icon {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card.green .icon { background: var(--brand-light); color: var(--brand); }
.stat-card.green .value { color: var(--brand-dark); }
.stat-card.orange .icon { background: #fef3e0; color: var(--warning); }
.stat-card.orange .value { color: var(--warning); }
.stat-card.red .icon { background: #fdeaea; color: var(--danger); }
.stat-card.red .value { color: var(--danger); }
.stat-card.blue .icon { background: #e8f1fd; color: #1a73e8; }
.stat-card.blue .value { color: #1a73e8; }

/* ---------- 表格增强 ---------- */
.layui-table-view {
    border-radius: 8px;
    overflow: hidden;
}

.layui-table-header th {
    background: #fafbfc !important;
    color: var(--text-sub);
    font-weight: 500;
    font-size: 13px;
}

.status-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 18px;
}

.status-tag.normal { background: #e6f4ea; color: #1a7f37; }
.status-tag.abnormal { background: #fdeaea; color: var(--danger); }
.status-tag.enabled { background: #e6f4ea; color: #1a7f37; }
.status-tag.disabled { background: #f2f3f5; color: #8f959e; }
.status-tag.warn { background: #fff3e8; color: #d25f00; }

/* ---------- 列表页筛选区（统一规范） ----------
   列表页顶部的条件区统一用这套类名，避免各页各写内联样式导致错位与大小不一：
     .toolbar       容器：白底卡片；控件垂直居中；行距/列距统一；窄屏整体换行
     .filter-group  一组条件（标签 + 1~N 个控件）；内部 nowrap，所以起止日期与「至」不会被拆开
     .filter-label  条件标签：与控件同高、同字号，天然对齐
     .filter-input  文本输入（200px）
     .filter-select 原生下拉（140px）
     .filter-date   日期输入（150px）
     .filter-text   与控件同高对齐的说明文字；.filter-hint 为可换行的长提示
     .filter-right  右侧动作区（新增 / 导出 / 口径切换）
   控件统一：高度 34px、圆角 4px、字号 13px、边框用 --border；按钮同样 34px，与输入框等高。
--------------------------------------------------------------- */
.toolbar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.toolbar .filter-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.toolbar .filter-right {
    margin-left: auto;
}

.toolbar .filter-label {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 34px;
    white-space: nowrap;
}

.toolbar .filter-input,
.toolbar .filter-select,
.toolbar .filter-date,
.toolbar .layui-input,
.toolbar .layui-select {
    height: 34px;
    line-height: 34px;
    box-sizing: border-box;
    font-size: 13px;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 10px;
    transition: border-color .2s, box-shadow .2s;
}

.toolbar .filter-input { width: 200px; }
.toolbar .filter-select { width: 140px; padding-right: 6px; }
.toolbar .filter-date { width: 150px; padding: 0 8px; }

.toolbar .filter-input:focus,
.toolbar .filter-select:focus,
.toolbar .filter-date:focus,
.toolbar .layui-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(58, 110, 165, .12);
    outline: none;
}

/* 按钮与输入框等高；按钮间距交给 .filter-group 的 gap，去掉 layui 的相邻按钮外边距 */
.toolbar .layui-btn {
    height: 34px;
    line-height: 34px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 4px;
}

.toolbar .filter-group .layui-btn + .layui-btn {
    margin-left: 0;
}

.toolbar .filter-text {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 34px;
    white-space: nowrap;
}

.toolbar .filter-hint {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.6;
    flex: 1 1 auto;
    min-width: 0;
}

/* 窄屏：控件收窄，条件组整体换行，不会出现孤立的「至」 */
@media (max-width: 900px) {
    .toolbar .filter-input { width: 160px; }
    .toolbar .filter-date { width: 140px; }
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sub);
    font-size: 14px;
}

.empty-state .icon {
    font-size: 56px;
    color: #d8dce0;
    margin-bottom: 12px;
}
