/* ========================================
   旭日人事管理系统 V1.0 - 传统企业风格样式表
   ======================================== */

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Microsoft YaHei", "SimSun", "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    color: #333;
    background: #eef2f7;
    -webkit-font-smoothing: antialiased;
}
a { color: #2b5b84; text-decoration: none; }
a:hover { color: #1a3c6e; text-decoration: underline; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: 12px; }
table { border-collapse: collapse; width: 100%; }

/* ---- Login Page ---- */
.login-wrapper {
    width: 100%; height: 100vh;
    background: linear-gradient(135deg, #1a3c6e 0%, #2b5b84 50%, #3b7ab8 100%);
    display: flex; align-items: center; justify-content: center;
}
.login-box {
    width: 420px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.login-header {
    background: #1a3c6e;
    padding: 28px 30px 24px;
    text-align: center;
    border-bottom: 3px solid #c49a3c;
}
.login-header h1 { color: #fff; font-size: 20px; font-weight: bold; letter-spacing: 4px; }
.login-header p { color: #b8cfe0; font-size: 12px; margin-top: 6px; letter-spacing: 1px; }
.login-body { padding: 30px 35px 35px; }
.login-body .form-row { margin-bottom: 18px; }
.login-body .form-row label { display: block; font-size: 12px; color: #555; margin-bottom: 6px; font-weight: bold; }
.login-body .form-row input[type="text"],
.login-body .form-row input[type="password"] {
    width: 100%; height: 36px; line-height: 36px; padding: 0 10px;
    border: 1px solid #c5d3e3; background: #f9fbfd; color: #333; outline: none;
}
.login-body .form-row input:focus { border-color: #2b5b84; background: #fff; }
.login-error { color: #c0392b; font-size: 12px; margin-bottom: 12px; min-height: 20px; }
.login-btn { width: 100%; height: 40px; background: #2b5b84; color: #fff; border: 1px solid #1a3c6e; font-size: 14px; font-weight: bold; letter-spacing: 6px; cursor: pointer; }
.login-btn:hover { background: #1a3c6e; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-footer { text-align: center; padding: 0 35px 20px; color: #999; font-size: 11px; }

/* ---- App Container ---- */
.app-container { display: flex; flex-direction: column; height: 100vh; }

/* Header / Top Bar */
.header {
    height: 50px;
    background: #1a3c6e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    flex-shrink: 0;
    border-bottom: 2px solid #c49a3c;
}
.header-left { display: flex; align-items: center; }
.header-right { display: flex; align-items: center; gap: 10px; color: #b8cfe0; font-size: 12px; }
.header-right .separator { color: #4a6d8c; margin: 0 4px; }
.header-right a { color: #b8cfe0; font-size: 12px; cursor: pointer; }
.header-right a:hover { color: #fff; text-decoration: none; }
.logo-area { display: flex; align-items: center; gap: 8px; }
.logo-icon { color: #c49a3c; font-size: 22px; }
.logo-text { color: #fff; font-size: 16px; font-weight: bold; letter-spacing: 2px; }
.logo-text span { color: #c49a3c; font-size: 11px; margin-left: 8px; font-weight: normal; letter-spacing: 0; }

/* Main Area */
.main-area { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 200px;
    background: #243547;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #1a2d3d;
    display: flex;
    flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #3a5068; border-radius: 2px; }
.sidebar-header {
    padding: 10px 15px;
    color: #8ca3b8;
    font-size: 12px;
    font-weight: bold;
    background: #1e3045;
    letter-spacing: 1px;
    border-bottom: 1px solid #1a2d3d;
}
.nav-list { padding: 0; flex: 1; }
.nav-group-title {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #8ca3b8;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    background: #1e3045;
    letter-spacing: 1px;
    border-bottom: 1px solid #1a2d3d;
}
.nav-group-title:hover { background: #263d55; color: #b8cfe0; }
.nav-group-title .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
}
.nav-group-title .arrow.collapsed { transform: rotate(-90deg); }
.nav-sublist { padding: 0; }
.nav-sublist.collapsed { display: none; }
.nav-item {
    display: block;
    padding: 9px 15px 9px 30px;
    color: #8ca3b8;
    font-size: 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    border-bottom: 1px solid rgba(26,45,61,0.5);
}
.nav-item:hover { background: #2a4560; color: #dce8f2; border-left-color: #3b8cc4; }
.nav-item.active { background: #2b5b84; color: #fff; border-left-color: #c49a3c; }

/* Sidebar Dept Filter */
.sidebar-dept-filter { padding: 10px; border-top: 1px solid #1a2d3d; }
.sidebar-dept-title { color: #8ca3b8; font-size: 11px; margin-bottom: 6px; font-weight: bold; }
.sidebar-dept-filter select {
    width: 100%; height: 26px; padding: 0 4px;
    border: 1px solid #3a5068; background: #1e3045; color: #b8cfe0;
    font-size: 11px; outline: none;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #eef2f7;
    display: flex;
    flex-direction: column;
}

/* Breadcrumb */
.breadcrumb {
    height: 32px;
    background: #dce3ec;
    border-bottom: 1px solid #c5d3e3;
    display: flex;
    align-items: center;
    padding: 0 15px;
    flex-shrink: 0;
    font-size: 12px;
    color: #666;
}

/* Page Section */
.page-section { display: none; padding: 15px; flex: 1; }
.page-section.active { display: block; }
.page-title {
    font-size: 15px;
    font-weight: bold;
    color: #1a3c6e;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid #2b5b84;
}

/* ---- Stat Cards (Dashboard) ---- */
.stat-row { display: flex; gap: 12px; margin-bottom: 15px; }
.stat-card {
    flex: 1;
    background: #fff;
    border: 1px solid #c5d3e3;
    padding: 15px 10px;
    text-align: center;
}
.stat-card .stat-value { font-size: 26px; font-weight: bold; color: #2b5b84; line-height: 1.3; }
.stat-card .stat-label { font-size: 12px; color: #888; margin-top: 4px; }
.stat-card.blue { border-top: 3px solid #2b5b84; }
.stat-card.green { border-top: 3px solid #3a8a5c; }
.stat-card.green .stat-value { color: #3a8a5c; }
.stat-card.orange { border-top: 3px solid #d4820a; }
.stat-card.orange .stat-value { color: #d4820a; }
.stat-card.highlight { border-top: 3px solid #c49a3c; }
.stat-card.highlight .stat-value { color: #c49a3c; }
.stat-card.red { border-top: 3px solid #c0392b; }
.stat-card.red .stat-value { color: #c0392b; }

/* ---- Dashboard Cards ---- */
.dashboard-row { display: flex; gap: 12px; margin-bottom: 15px; }
.dashboard-card {
    flex: 1;
    background: #fff;
    border: 1px solid #c5d3e3;
}
.dashboard-card.wide { flex: 2; }
.card-header {
    background: linear-gradient(to bottom, #f5f7fa, #e8edf3);
    border-bottom: 1px solid #c5d3e3;
    padding: 8px 12px;
    font-size: 13px;
    color: #1a3c6e;
    font-weight: bold;
}
.card-body { padding: 12px; }

/* Quick Links */
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-links a {
    display: inline-block;
    padding: 6px 14px;
    background: #eef4fa;
    border: 1px solid #c5d3e3;
    color: #2b5b84;
    font-size: 12px;
    cursor: pointer;
}
.quick-links a:hover { background: #2b5b84; color: #fff; text-decoration: none; }

/* Mini Chart */
.mini-chart { padding: 6px 0; }
.mini-chart .bar-row { display: flex; align-items: center; margin-bottom: 6px; font-size: 11px; }
.mini-chart .bar-label { width: 150px; text-align: right; padding-right: 8px; color: #666; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-chart .bar-track { flex: 1; height: 16px; background: #eef2f7; position: relative; }
.mini-chart .bar-fill { height: 100%; background: #2b5b84; min-width: 2px; }
.mini-chart .bar-fill.gold { background: #c49a3c; }
.mini-chart .bar-fill.green { background: #3a8a5c; }
.mini-chart .bar-value { width: 55px; text-align: right; color: #333; font-weight: bold; flex-shrink: 0; }

/* ---- Toolbar ---- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.toolbar label { font-size: 12px; color: #555; }
.toolbar input[type="text"],
.toolbar input[type="date"] {
    height: 26px; padding: 0 8px; border: 1px solid #c5d3e3; background: #fff;
    width: 140px; outline: none;
}
.toolbar select {
    height: 26px; padding: 0 4px; border: 1px solid #c5d3e3; background: #fff; outline: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 5px 14px;
    background: #2b5b84;
    color: #fff;
    border: 1px solid #1a3c6e;
    cursor: pointer;
    font-size: 12px;
}
.btn:hover { background: #1a3c6e; }
.btn-secondary { background: #7f8c9b; border-color: #6b7785; }
.btn-secondary:hover { background: #6b7785; }

/* ---- Data Table ---- */
.data-table { width: 100%; }
.data-table th {
    background: #dce8f2;
    color: #1a3c6e;
    font-weight: bold;
    padding: 7px 8px;
    text-align: left;
    border: 1px solid #c5d3e3;
    font-size: 12px;
    white-space: nowrap;
}
.data-table td {
    padding: 6px 8px;
    border: 1px solid #e0e7ef;
    font-size: 12px;
    color: #333;
}
.data-table tr:nth-child(even) { background: #f9fbfd; }
.data-table tr:hover { background: #eef4fa; }
.data-table.compact td { padding: 5px 8px; }
.data-table .center { text-align: center; }
.data-table .actions a { color: #2b5b84; margin-right: 8px; font-size: 12px; cursor: pointer; }
.data-table .actions a:hover { text-decoration: underline; }
.data-table .actions a.del { color: #c0392b; }

/* Status Tags */
.status { font-size: 11px; padding: 1px 6px; display: inline-block; }
.status-active { background: #e6f7e9; color: #2d6d47; border: 1px solid #b8dfc2; }
.status-inactive { background: #fde8e8; color: #a02e22; border: 1px solid #f0b8b8; }
.status-pending { background: #fff5e0; color: #b06d08; border: 1px solid #f0d888; }
.status-done { background: #e0ecf7; color: #1a3c6e; border: 1px solid #a8c4e0; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 12px;
    color: #666;
}
.pagination .page-info { color: #888; }
.btn-page {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid #c5d3e3;
    background: #fff;
    color: #2b5b84;
    font-size: 12px;
    cursor: pointer;
    margin: 0 1px;
}
.btn-page:hover { background: #eef4fa; }
.btn-page.active { background: #2b5b84; color: #fff; border-color: #1a3c6e; }
.btn-page:disabled { color: #ccc; cursor: default; }

/* ---- Tabs ---- */
.tab-bar { display: flex; border-bottom: 2px solid #2b5b84; background: #e8edf3; margin-bottom: 12px; }
.tab-item {
    padding: 7px 18px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    border: 1px solid #c5d3e3;
    border-bottom: none;
    background: #dce3ec;
    margin-right: 2px;
}
.tab-item:hover { background: #eef4fa; color: #2b5b84; }
.tab-item.active { background: #2b5b84; color: #fff; border-color: #2b5b84; font-weight: bold; }

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff;
    border: 1px solid #c5d3e3;
    width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-header {
    background: linear-gradient(to bottom, #2b5b84, #1a3c6e);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
}
.modal-close { color: #b8cfe0; cursor: pointer; font-size: 18px; background: none; border: none; padding: 0 4px; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 15px; }

/* Detail Table (inside modal) */
.detail-table { width: 100%; }
.detail-table td { padding: 6px 8px; border: 1px solid #e0e7ef; font-size: 12px; }
.detail-table .label { background: #f5f7fa; color: #555; font-weight: bold; width: 80px; text-align: right; }

/* Form Elements */
.form-row { display: flex; align-items: flex-start; margin-bottom: 12px; }
.form-row label {
    width: 80px; text-align: right; padding-right: 8px; line-height: 28px;
    font-size: 12px; color: #555; flex-shrink: 0;
}
.form-row label .required { color: #c0392b; margin-right: 2px; }
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
    height: 28px; padding: 0 8px; border: 1px solid #c5d3e3; background: #fff;
    color: #333; outline: none; min-width: 200px;
}
.form-row textarea { height: 80px; padding: 6px 8px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: #2b5b84; }
.form-actions { text-align: right; padding-top: 10px; }
.form-actions .btn { margin-left: 8px; }

/* ---- Status Bar (Bottom) ---- */
.status-bar {
    height: 24px;
    background: #dce3ec;
    border-top: 1px solid #c5d3e3;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 11px;
    color: #888;
    justify-content: space-between;
    flex-shrink: 0;
}

/* ---- Toast ---- */
.toast-container {
    position: fixed; top: 60px; right: 20px; z-index: 2000;
}
.toast {
    padding: 10px 20px;
    margin-bottom: 8px;
    background: #2b5b84;
    color: #fff;
    font-size: 12px;
    border: 1px solid #1a3c6e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}
.toast-error { background: #c0392b; border-color: #a02e22; }
.toast-success { background: #3a8a5c; border-color: #2d6d47; }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Spinner (loading) ---- */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid #b8cfe0;
    border-top-color: #c49a3c;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-red { color: #c0392b; }
.text-green { color: #3a8a5c; }
.text-blue { color: #2b5b84; }
.text-orange { color: #d4820a; }
.text-gray { color: #999; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.bold { font-weight: bold; }

/* ---- Print styles ---- */
@media print {
    .sidebar, .header, .breadcrumb, .toolbar, .pagination, .status-bar { display: none !important; }
    .content-area { padding: 0; }
}
