/* 
 * 员工打卡小程序后台管理系统 - 自定义样式
 * 基于 AdminLTE 3 框架
 */

/* 全局样式 */
.main-header {
    background-color: #007bff !important;
}

.main-sidebar {
    background-color: #343a40 !important;
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 450px;
    margin: 2% auto;
}

.login-card-body {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.login-logo {
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.login-logo i {
    margin-right: 10px;
    font-size: 2rem;
}

/* 可点击卡片样式 */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.clickable-card:active {
    transform: translateY(-2px);
}

/* 测试账号卡片样式 */
.test-account-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 120px;
}

.test-account-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.test-account-card:active {
    transform: translateY(-4px);
}

.test-account-card .card-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-right: 20px;
    flex-shrink: 0;
}

.admin-card .card-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.supervisor-card .card-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.employee-card .card-icon {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.test-account-card .card-content {
    flex: 1;
    color: white;
}

.test-account-card .card-content h5 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.test-account-card .card-content p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.test-account-card .card-content .phone {
    font-weight: 500;
    font-size: 1rem;
    color: white;
}

.test-account-card .card-content .password {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 测试账号容器 */
.card.mt-3 {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border-radius: 15px;
}

.card.mt-3 .card-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 15px 15px 0 0;
}

.card.mt-3 .card-body {
    background: transparent;
    padding: 25px;
}

.card.mt-3 .card-title {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.card.mt-3 .card-title i {
    margin-right: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .test-account-card {
        flex-direction: column;
        text-align: center;
        min-height: 140px;
        padding: 20px;
    }
    
    .test-account-card .card-icon {
        margin-right: 0;
        margin-bottom: 15px;
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .test-account-card .card-content h5 {
        font-size: 1.1rem;
    }
    
    .test-account-card .card-content .phone {
        font-size: 0.9rem;
    }
}

/* 输入框样式改进 */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-left: none;
    color: #666;
}

.input-group .form-control:first-child {
    border-radius: 8px 0 0 8px;
}

.input-group .input-group-append .input-group-text {
    border-radius: 0 8px 8px 0;
}

/* 按钮样式改进 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .login-box {
        width: 95%;
        margin: 10px auto;
    }
    
    .login-card-body {
        padding: 20px;
    }
    
    .login-logo {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .info-box {
        margin-bottom: 15px;
    }
}

/* 数据表格样式 */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* 状态标签样式 */
.badge-pending {
    background-color: #ffc107;
    color: #212529;
}

.badge-approved {
    background-color: #28a745;
    color: #fff;
}

.badge-rejected {
    background-color: #dc3545;
    color: #fff;
}

.badge-submitted {
    background-color: #17a2b8;
    color: #fff;
}

/* 角色标签样式 */
.role-admin {
    background-color: #dc3545;
    color: #fff;
}

.role-foreman {
    background-color: #fd7e14;
    color: #fff;
}

.role-employee {
    background-color: #6c757d;
    color: #fff;
}

/* 项目状态样式 */
.status-active {
    background-color: #28a745;
    color: #fff;
}

.status-completed {
    background-color: #6c757d;
    color: #fff;
}

.status-suspended {
    background-color: #ffc107;
    color: #212529;
}

/* 按钮样式 */
.btn-action {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-box {
        width: 90%;
        margin: 5% auto;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .btn-action {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* 仪表板卡片样式 */
.info-box {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.info-box:hover {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* 表单样式 */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 导出按钮样式 */
.export-buttons {
    margin-bottom: 20px;
}

.export-buttons .btn {
    margin-right: 10px;
    margin-bottom: 5px;
}

/* 筛选器样式 */
.filter-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-section h6 {
    margin-bottom: 15px;
    color: #495057;
    font-weight: 600;
}

/* 统计卡片样式 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-card p {
    margin-bottom: 0;
    opacity: 0.9;
}

/* 修复Bootstrap 5下拉菜单样式 */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    position: absolute;
    z-index: 1050;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.25rem;
}

.dropdown-menu.show {
    display: block;
}

/* 确保导航栏下拉菜单正确显示 */
.navbar .dropdown-menu {
    margin-top: 0.125rem;
}

/* 修复AdminLTE和Bootstrap 5的兼容性问题 */
.navbar-nav .dropdown-menu {
    position: absolute !important;
}

/* 退出登录按钮样式 */
#logout-btn {
    cursor: pointer;
    transition: background-color 0.2s;
}

#logout-btn:hover {
    background-color: #f8f9fa;
}

/* 修复select下拉框显示不完整的问题 */
select.form-control {
    height: auto !important;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    overflow: visible !important;
}

/* 确保select选项文字完整显示 */
select.form-control option {
    padding: 5px 10px;
    line-height: 1.5;
    height: auto;
    white-space: normal;
}

/* 修复AdminLTE中select样式冲突 */
.form-group select.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* 多选框样式修复 */
select.form-control[multiple] {
    height: auto !important;
    min-height: 150px;
}

/* 响应式下拉框 */
@media (max-width: 768px) {
    select.form-control {
        font-size: 16px; /* 防止移动端缩放 */
    }
}

/* 强制修复下拉框文字截断问题 */
.content-wrapper select.form-control,
.modal select.form-control,
.card select.form-control {
    height: calc(2.25rem + 2px) !important;
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
}

/* 特定页面下拉框修复 */
#exportForm select.form-control,
#filterForm select.form-control,
#statisticsExportForm select.form-control {
    height: 38px !important;
    padding: 6px 12px !important;
    line-height: normal !important;
}

/* 确保下拉箭头正确显示 */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Bootstrap 5 间距类兼容性修复 */
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }

.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-5 { margin-left: 3rem !important; }

/* 统一按钮样式 - 不覆盖背景色 */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* 确保按钮颜色正确显示 */
.btn-primary {
    color: #fff !important;
    background-color: #007bff !important;
    border-color: #007bff !important;
}

.btn-secondary {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.btn-success {
    color: #fff !important;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-danger {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-warning {
    color: #212529 !important;
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.btn-info {
    color: #fff !important;
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
}

.btn-light {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-color: #f8f9fa !important;
}

.btn-dark {
    color: #fff !important;
    background-color: #343a40 !important;
    border-color: #343a40 !important;
}

/* 按钮间距修复 */
.btn + .btn {
    margin-left: 0.5rem;
}

/* 按钮组中的按钮 */
.btn-group .btn,
.btn-group-vertical .btn {
    margin-left: 0;
    margin-right: 0;
}

/* 修复按钮在不同容器中的间距 */
.card-header .btn,
.card-footer .btn,
.modal-header .btn,
.modal-footer .btn {
    margin-bottom: 0;
}

/* 操作按钮统一样式 */
.btn-action {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 小尺寸按钮 */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* 强制修复按钮显示问题 */
.content-wrapper .btn,
.card .btn,
.modal .btn {
    display: inline-block !important;
    white-space: nowrap;
    vertical-align: middle;
}

/* 确保按钮图标和文字对齐 */
.btn i {
    margin-right: 0.25rem;
    vertical-align: middle;
}

/* 修复d-flex容器中的按钮 */
.d-flex .btn {
    flex-shrink: 0;
}

/* 按钮悬停效果 */
.btn-primary:hover {
    background-color: #0056b3 !important;
    border-color: #004085 !important;
}

.btn-secondary:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.btn-warning:hover {
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
}

.btn-info:hover {
    background-color: #138496 !important;
    border-color: #117a8b !important;
}

.btn-light:hover {
    background-color: #e2e6ea !important;
    border-color: #dae0e5 !important;
}

.btn-dark:hover {
    background-color: #23272b !important;
    border-color: #1d2124 !important;
}

/* 响应式按钮 */
@media (max-width: 576px) {
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn i {
        margin-right: 0.125rem;
    }
}

/* ===== 通用列表页面美化样式 ===== */

/* 表格样式美化 */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f5f6fa;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 状态标签美化 */
.badge {
    padding: 0.4em 0.8em;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge-pending_foreman {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.badge-pending_admin {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.badge-approved {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    color: white;
}

.badge-rejected {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #495057;
}

/* 表格单元格样式 */
.table td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* 时间列样式 */
.table td:nth-child(7),
.table td:nth-child(8),
.table td:nth-child(12),
.table td:nth-child(14) {
    font-size: 0.875rem;
    color: #6c757d;
}

/* 工时列突出显示 */
.table td:nth-child(9) {
    font-weight: 600;
    color: #007bff;
    font-size: 1.1rem;
}

/* 操作按钮样式 */
.table .btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.2rem;
    margin: 0 0.1rem;
}

/* 复选框美化 */
input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
}

/* 筛选表单美化 */
.filter-section {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-section .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* 空数据提示 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 3rem;
}

.loading-state .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* 响应式表格优化 */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    /* 保持横向滚动，不隐藏列 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 批量操作提示 */
.batch-action-info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.batch-action-info i {
    color: #2196f3;
    margin-right: 0.5rem;
}

/* 表格行选中效果 - 通用 */
.table tbody tr.selected {
    background-color: #e3f2fd !important;
}

/* 美化滚动条 */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 操作按钮动画 */
.table .btn {
    transition: all 0.2s ease;
}

.table .btn:active {
    transform: scale(0.95);
}

/* 标签动画 */
.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
} 