/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button, .btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s;
}

button:hover, .btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #3498db;
    color: #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: #fff;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.inline-form {
    display: inline;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, .table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.table th {
    background-color: #ecf0f1;
    font-weight: bold;
}

.table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table tbody tr:hover {
    background-color: #f1f1f1;
}

.text-center {
    text-align: center;
}

/* 导航栏样式 */
.navbar {
    background-color: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
}

.nav-item {
    color: #fff;
    padding: 0 15px;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #3498db;
}

.navbar-user {
    display: flex;
    align-items: center;
}

.user-name {
    margin-right: 15px;
}

/* 页脚样式 */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 20px 0;
    margin-top: 40px;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* 控制面板样式 */
.stats-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    flex: 1;
    min-width: 300px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.pending-approvals {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.approved {
    color: #2ecc71;
    font-weight: bold;
}

.pending {
    color: #f39c12;
    font-weight: bold;
}

/* 考勤日历样式 */
.calendar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 20px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 10px;
}

.weekday {
    text-align: center;
    padding: 10px;
    background-color: #ecf0f1;
    font-weight: bold;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.holiday {
    background-color: #fdf2e9;
}

.past-day {
    opacity: 0.6;
}

.attendance-record {
    margin-top: auto;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.attendance-record.坐班 {
    background-color: #e3f2fd;
    color: #1976d2;
}

.attendance-record.外勤 {
    background-color: #e8f5e9;
    color: #388e3c;
}

.attendance-record.病假 {
    background-color: #fff3e0;
    color: #f57c00;
}

.attendance-record.事假 {
    background-color: #ffebee;
    color: #c62828;
}

.attendance-record.年假 {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.attendance-record.加班 {
    background-color: #e0f2f1;
    color: #00695c;
}

.edit-attendance {
    margin-top: 5px;
    padding: 5px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
	color: #000000; /* 设置按钮文字为黑色 */
}

.edit-attendance:hover {
    background-color: #f5f5f5;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* 报表页面样式 */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.report-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-info {
    background-color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.report-table table {
    width: 100%;
    white-space: nowrap; /* 禁止文字换行 */
    table-layout: auto; /* 自动调整列宽 */
}

.report-table th, .report-table td {
    padding: 8px 12px;
    text-overflow: ellipsis; /* 超出部分显示省略号 */
    overflow: hidden;
}

/* 针对不同列设置最小宽度，避免过窄 */
.report-table th:nth-child(1), .report-table td:nth-child(1) { min-width: 100px; } /* 用户名 */
.report-table th:nth-child(2), .report-table td:nth-child(2) { min-width: 80px; }  /* 姓名 */
.report-table th { min-width: 60px; } /* 其他列最小宽度 */

/* 设置页面样式 */
.settings-tabs {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.settings-form {
    max-width: 500px;
    margin-bottom: 30px;
}

.tab-pane {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tab-pane:last-child {
    border-bottom: none;
}

/* 提示消息样式 */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar-menu {
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-header, .calendar-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
/* 新增样式 */
.rejected {
    color: #e74c3c;
    font-weight: bold;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 管理员编辑按钮样式 */
.edit-attendance-admin {
    padding: 4px 8px;
    font-size: 12px;
}

/* 新增样式 */
.attendance-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.user-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-selector label {
    margin-bottom: 0;
    font-weight: bold;
}

.user-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.rejected {
    color: #e74c3c;
    font-weight: bold;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-nav h3 {
    margin: 0;
    min-width: 120px;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .attendance-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-selector {
        justify-content: center;
    }
    
    .month-nav {
        justify-content: center;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 50%;
    border-radius: 5px;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    margin: 1rem 0;
    justify-content: center;
}

.page-item {
    margin: 0 2px;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
}

.page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}