/* ===== 百望云风格 开票后台 UI ===== */
/* 主色：#1677ff 亮蓝 / 侧栏：#eef3ff 浅蓝白 / 内容：#fff 白 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== 登录页 ===== */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #e6f0ff 0%, #f5f7fa 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.login-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 360px;
    background: linear-gradient(180deg, #1677ff 0%, #4096ff 100%);
    opacity: 0.06;
}
.login-container {
    width: 920px;
    height: 540px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(22, 119, 255, 0.12);
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.login-left {
    width: 52%;
    background: linear-gradient(160deg, #1677ff 0%, #4096ff 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 44px;
    position: relative;
}
.login-left::after {
    content: '';
    position: absolute;
    bottom: -60px; right: -60px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.brand-logo {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
    margin-bottom: 24px;
}
.login-left h1 { font-size: 26px; margin-bottom: 10px; font-weight: 600; }
.login-left .subtitle { font-size: 13px; opacity: 0.85; line-height: 1.7; }
.login-left .features { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.login-left .features div { display: flex; align-items: center; gap: 10px; font-size: 13px; opacity: 0.92; }
.login-right {
    width: 48%;
    display: flex; align-items: center; justify-content: center;
    padding: 36px;
}
.login-card { width: 100%; max-width: 320px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; font-weight: 600; color: #262626; }
.login-subtitle { color: #8c8c8c; font-size: 13px; margin-bottom: 28px; }

/* ===== 表单元素 ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px;
    color: #595959;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 11px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
    color: #262626;
    background: #fff;
}
.form-group textarea {
    height: auto;
    padding: 7px 11px;
    resize: vertical;
    line-height: 1.5;
}
.form-group input:hover, .form-group select:hover, .form-group textarea:hover {
    border-color: #4096ff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* ===== 按钮 ===== */
.btn {
    padding: 0 15px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #262626;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}
.btn:hover {
    color: #1677ff;
    border-color: #4096ff;
    background: #fff;
}
.btn:active {
    color: #0958d9;
    border-color: #0958d9;
}
.btn-primary {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
}
.btn-primary:hover {
    background: #4096ff;
    border-color: #4096ff;
    color: #fff;
}
.btn-primary:active {
    background: #0958d9;
    border-color: #0958d9;
    color: #fff;
}
.btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}
.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
    color: #fff;
}
.btn-success {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}
.btn-sm {
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 4px;
}
.btn-login {
    width: 100%;
    height: 40px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 6px;
}
.btn-login:hover { background: #4096ff; }
.btn-login:disabled { background: #91caff; cursor: not-allowed; }

.login-footer {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.login-footer a { color: #1677ff; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 16px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 99999;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    animation: toastIn 0.25s ease;
}
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.warning { background: #faad14; }
.toast.info { background: #1677ff; }
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 主布局 ===== */
.layout {
    display: flex;
    min-height: 100vh;
    background: #fff;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 200px;
    background: #eef3ff;
    color: #333;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    border-right: 1px solid #e0e7ff;
}
.sidebar-header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #1677ff;
    background: #fff;
    border-bottom: 1px solid #e0e7ff;
    letter-spacing: 1px;
}
.sidebar-menu {
    padding: 6px 0;
}
.menu-group {
    margin-bottom: 2px;
}
.menu-group-title {
    padding: 10px 16px 8px;
    font-size: 12px;
    color: #8c8c8c;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.menu-group-title:hover { color: #595959; }
.menu-group-title .arrow {
    font-size: 10px;
    transition: transform 0.2s;
    color: #bfbfbf;
}
.menu-group.collapsed .menu-group-title .arrow {
    transform: rotate(-90deg);
}
.menu-group.collapsed .menu-group-items {
    display: none;
}
.menu-group-items {
    display: block;
}
.menu-item {
    padding: 8px 16px 8px 24px;
    cursor: pointer;
    font-size: 14px;
    color: #595959;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border-left: 3px solid transparent;
    line-height: 1.6;
    position: relative;
}
.menu-item:hover {
    color: #1677ff;
    background: rgba(22, 119, 255, 0.06);
}
.menu-item.active {
    color: #fff;
    background: #1677ff;
    border-left-color: #69b1ff;
    font-weight: 500;
}
.menu-item.active:hover {
    color: #fff;
    background: #1677ff;
}
.menu-item .icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* ===== 主内容区 ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 200px;
    min-height: 100vh;
    background: #fff;
}

/* ===== 顶部栏 ===== */
.header {
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.breadcrumb {
    font-size: 13px;
    color: #666;
}
.breadcrumb .current { color: #262626; font-weight: 500; }
.breadcrumb a { color: #666; text-decoration: none; }
.breadcrumb a:hover { color: #1677ff; }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ent-select {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #262626;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    background: #f5f7fa;
}
.ent-select:hover { background: #eef3ff; color: #1677ff; }
.ent-select .arrow { font-size: 10px; color: #8c8c8c; }

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #262626;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.header-user:hover { background: #f5f7fa; }
.header-user .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1677ff, #4096ff);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 500;
}
.header-user .caret { color: #bfbfbf; font-size: 10px; }

/* ===== 多标签页 ===== */
.tabs-bar {
    height: 36px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-end;
    padding: 0 12px;
    overflow-x: auto;
    flex-shrink: 0;
    gap: 2px;
}
.tabs-bar::-webkit-scrollbar { height: 0; }
.tab-item {
    height: 32px;
    padding: 0 14px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #595959;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
    flex-shrink: 0;
    background: transparent;
    position: relative;
    top: 1px;
}
.tab-item:hover {
    color: #1677ff;
    background: #f5f7fa;
}
.tab-item.active {
    color: #1677ff;
    background: #fff;
    border-color: #f0f0f0;
    border-bottom: 1px solid #fff;
    font-weight: 500;
}
.tab-close {
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    color: #bfbfbf;
    line-height: 1;
}
.tab-close:hover {
    background: #e0e7ff;
    color: #595959;
}
.tab-item.active .tab-close { color: #8c8c8c; }
.tab-item.active .tab-close:hover { background: #eef3ff; color: #1677ff; }

/* ===== 内容区 ===== */
.content {
    flex: 1;
    padding: 16px 20px;
    background: #fff;
}

/* ===== 面板/卡片 ===== */
.panel {
    background: #fff;
    border-radius: 0;
    margin-bottom: 16px;
    border: none;
}
.panel-header {
    padding: 0 0 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #262626;
}
.panel-title .icon { margin-right: 8px; }
.panel-body { padding: 0; }

/* 子页面内的 tab 切换（蓝色下划线式） */
.sub-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}
.sub-tab {
    padding: 8px 0;
    margin-right: 24px;
    font-size: 14px;
    color: #595959;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}
.sub-tab:hover { color: #1677ff; }
.sub-tab.active {
    color: #1677ff;
    border-bottom-color: #1677ff;
    font-weight: 500;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 4px;
    padding: 18px 20px;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.stat-card:hover {
    box-shadow: 0 2px 12px rgba(22, 119, 255, 0.08);
    border-color: #d9e4ff;
}
.stat-card .label {
    font-size: 13px;
    color: #8c8c8c;
    margin-bottom: 8px;
}
.stat-card .value {
    font-size: 26px;
    font-weight: 600;
    color: #262626;
    line-height: 1.3;
    font-family: 'DIN', -apple-system, sans-serif;
}
.stat-card .sub {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}
.stat-card .sub .up { color: #52c41a; }
.stat-card .sub .down { color: #ff4d4f; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
table.table th {
    background: #fafafa;
    padding: 10px 14px;
    text-align: left;
    font-weight: 500;
    color: #595959;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    font-size: 13px;
}
table.table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #262626;
}
table.table tbody tr:hover {
    background: #e6f4ff;
}
table.table tbody tr:last-child td {
    border-bottom: none;
}
.table-empty {
    padding: 50px 0 !important;
    text-align: center;
    color: #bfbfbf !important;
    font-size: 13px;
}

/* ===== 状态小圆点 ===== */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1;
}
.status-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-success::before { background: #52c41a; }
.status-success { color: #52c41a; }
.status-danger::before { background: #ff4d4f; }
.status-danger { color: #ff4d4f; }
.status-warning::before { background: #faad14; }
.status-warning { color: #faad14; }
.status-info::before { background: #1677ff; }
.status-info { color: #1677ff; }
.status-default::before { background: #bfbfbf; }
.status-default { color: #8c8c8c; }

/* 保留 tag 类（兼容已有代码） */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 20px;
    font-weight: 500;
}
.tag-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.tag-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.tag-info { background: #e6f4ff; color: #1677ff; border: 1px solid #91caff; }
.tag-default { background: #fafafa; color: #8c8c8c; border: 1px solid #d9d9d9; }

/* ===== 筛选栏 ===== */
.filter-bar {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; flex: 0 0 auto; min-width: 180px; }
.filter-bar .form-group label { font-size: 12px; color: #8c8c8c; }
.filter-bar .form-group input,
.filter-bar .form-group select { height: 30px; font-size: 13px; }
.filter-bar .actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    padding-bottom: 0;
}
.filter-bar .actions .btn { height: 30px; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 16px 0 0;
}
.pagination button {
    min-width: 30px;
    height: 30px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #595959;
    padding: 0 8px;
}
.pagination button:hover:not(:disabled) {
    color: #1677ff;
    border-color: #1677ff;
}
.pagination button.active {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
}
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .total { font-size: 13px; color: #595959; margin-right: 10px; }

/* ===== 表单区 ===== */
.form-section { margin-bottom: 24px; }
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 3px solid #1677ff;
    line-height: 1.2;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 24px;
}
.form-grid .form-group { margin-bottom: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ===== 明细表 ===== */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #f0f0f0;
}
.detail-table th {
    background: #fafafa;
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    color: #595959;
    border: 1px solid #f0f0f0;
    font-size: 13px;
}
.detail-table td {
    padding: 6px 8px;
    border: 1px solid #f0f0f0;
}
.detail-table input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 13px;
    padding: 4px;
    background: transparent;
    color: #262626;
}
.detail-table input:focus {
    background: #e6f4ff;
    border-radius: 2px;
}
.detail-table select {
    width: 100%;
    border: none;
    outline: none;
    font-size: 13px;
    background: transparent;
    color: #262626;
    cursor: pointer;
}
.detail-table .del-btn {
    color: #ff4d4f;
    cursor: pointer;
    font-size: 12px;
}
.detail-table .del-btn:hover { color: #ff7875; }

/* ===== 金额汇总 ===== */
.amount-summary {
    background: #fafafa;
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    justify-content: flex-end;
    gap: 32px;
    font-size: 14px;
    margin-top: 12px;
    border: 1px solid #f0f0f0;
}
.amount-summary .item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.amount-summary .item .val {
    font-weight: 600;
    color: #ff4d4f;
    font-size: 15px;
}
.amount-summary .item.total .val {
    color: #ff4d4f;
    font-size: 18px;
}

/* ===== 配置状态条 ===== */
.config-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
}
.config-status.warn {
    background: #fffbe6;
    border-color: #ffe58f;
}
.config-status.ok {
    background: #f6ffed;
    border-color: #b7eb8f;
}

/* ===== 快捷操作 ===== */
.quick-item {
    flex: 1;
    min-width: 180px;
    text-decoration: none;
    color: inherit;
}
.quick-item > div {
    padding: 24px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.quick-item:hover > div {
    border-color: #1677ff;
    box-shadow: 0 2px 12px rgba(22, 119, 255, 0.1);
    transform: translateY(-1px);
}
.quick-icon { font-size: 32px; margin-bottom: 8px; }
.quick-title { font-weight: 500; font-size: 14px; color: #262626; }
.quick-desc { font-size: 12px; color: #8c8c8c; margin-top: 4px; }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .login-container {
        width: 95%;
        flex-direction: column;
        height: auto;
    }
    .login-left, .login-right {
        width: 100%;
        padding: 30px 20px;
    }
    .sidebar { width: 60px; }
    .sidebar-header { font-size: 12px; padding: 0 4px; text-align: center; }
    .menu-group-title { display: none; }
    .menu-item span:not(.icon) { display: none; }
    .menu-item { padding-left: 18px; padding-right: 0; }
    .main { margin-left: 60px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .amount-summary {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    .filter-bar .actions { margin-left: 0; width: 100%; justify-content: flex-end; }
}
