/* 排班系统样式 v2.0 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
    background: #f0f2f5;
    color: #1f2937;
    font-size: 14px;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, #1e5faa 0%, #2d7dd2 100%);
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-left h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 标签导航 */
.tabs {
    background: white;
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tab-btn {
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    color: #1e5faa;
    background: #f8fafc;
}

.tab-btn.active {
    color: #1e5faa;
    border-bottom-color: #1e5faa;
    font-weight: 600;
}

/* 内容区域 */
.tab-content {
    display: none;
    flex: 1;
    padding: 16px 20px;
}

.tab-content.active {
    display: block;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: nowrap;
    gap: 4px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    min-width: 0;
}

.toolbar-left h2 {
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    white-space: nowrap;
    margin: 0;
    padding: 0 2px;
}

/* 组别选择下拉框 */
.group-select {
    width: auto;
    min-width: 60px;
    max-width: 100px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 20px 3px 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #1e5faa;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%231e5faa' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 10px;
}

.group-select:focus {
    outline: none;
    border-color: #1e5faa;
    box-shadow: 0 0 0 2px rgba(30, 95, 170, 0.1);
}

.week-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 3px;
    padding-left: 5px;
    border-left: 1px solid #e5e7eb;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
    min-width: 0;
}

.toolbar-right::-webkit-scrollbar {
    display: none;
}

/* 工具栏中的select紧凑样式 */
.toolbar-right .select-input {
    padding: 3px 6px;
    font-size: 11px;
    min-width: 70px;
    height: auto;
}

/* 按钮 */
.btn {
    padding: 4px 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: #1e5faa;
    color: white;
}

.btn-primary:hover {
    background: #1a4f8c;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-icon {
    padding: 2px 6px;
    font-size: 11px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    line-height: 1.3;
}

.btn-icon:hover {
    background: #e5e7eb;
}

.btn-sm {
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.3;
}

.btn-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: #4b5563;
}

/* 输入框 */
.form-input, .select-input, .form-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus, .select-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #1e5faa;
    box-shadow: 0 0 0 3px rgba(30, 95, 170, 0.1);
}

.input-readonly {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 55px;
}

.search-input {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 180px;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #1e5faa;
}

.color-input {
    width: 55px;
    height: 34px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

/* 表单 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group {
    flex: 1;
}

/* 徽章 */
.badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* 班次图例 */
.shift-legend {
    background: white;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-size: 12px;
}

.shift-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #4b5563;
}

.shift-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* 报表日期选择器紧凑样式 */
.toolbar-right input[type="date"].select-input {
    width: 150px;
    padding: 5px 8px;
    font-size: 13px;
    min-width: 150px;
}

/* 综合视图组分隔行 */
.schedule-group-row td {
    background: #eef2ff !important;
    padding: 5px 10px !important;
    font-weight: 600;
    color: #4338ca;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

/* 排班表格 */
.schedule-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.schedule-table-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.schedule-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    font-size: 14px;
}

.schedule-grid th {
    background: #f8fafc;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.schedule-grid th.date-type-row {
    background: #f1f5f9;
    font-size: 10px;
    padding: 4px 6px;
    top: 0;
    z-index: 11;
}

.schedule-grid th.today {
    background: #dbeafe !important;
    color: #1e40af;
}

.schedule-grid th.weekend {
    color: #dc2626;
}

.schedule-grid th.holiday {
    background: #fef2f2 !important;
    color: #dc2626;
}

.schedule-grid th.adjusted {
    background: #fef3c7 !important;
    color: #b45309;
}

.schedule-grid td {
    padding: 3px 4px;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    text-align: center;
    font-size: 13px;
    vertical-align: middle;
}

.schedule-grid .employee-cell {
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    border-right: 2px solid #e5e7eb;
    min-width: 90px;
    max-width: 90px;
}

.schedule-grid tr:hover .employee-cell {
    background: #f8fafc;
}

.schedule-grid .employee-cell .emp-name {
    font-size: 14px;
    color: #1f2937;
}

.schedule-grid .employee-cell .emp-group {
    font-size: 11px;
    color: #9ca3af;
}

.schedule-grid .employee-cell .emp-am-pm-label {
    font-size: 10px;
    margin-top: 2px;
    line-height: 1;
}

/* 上午/下午标识列 */
.ampm-header {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    font-size: 11px;
    padding: 4px 2px;
    background: #f1f5f9;
}

.ampm-label-cell {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 1px 2px;
    text-align: center;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #f3f4f6;
    background: #f8fafc;
}

.ampm-label {
    font-size: 10px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    margin: 1px 0;
}

.ampm-label.am {
    color: #2563EB;
    font-weight: 500;
}

.ampm-label.pm {
    color: #6b7280;
    font-weight: 500;
}

/* 统计列样式 */
.schedule-grid .stats-cell {
    background: #fafbfc;
    font-weight: 500;
    min-width: 70px;
    padding: 6px 8px;
    border-left: 1px solid #e5e7eb;
}

.schedule-grid .stats-header {
    background: #f0f4ff !important;
    color: #3730a3 !important;
    font-size: 11px !important;
    padding: 8px 6px !important;
    line-height: 1.3;
    border-left: 1px solid #c7d2fe !important;
}

.schedule-grid .stat-value {
    font-size: 13px;
    font-weight: 600;
}

.schedule-grid .stat-value.negative {
    color: #dc2626;
}

.schedule-grid .stat-value.positive {
    color: #059669;
}

.schedule-grid .stat-value.warning {
    color: #d97706;
}

.schedule-grid tr:hover {
    background: #f8fafc;
}

.shift-cell {
    padding: 3px 5px;
    border-radius: 4px;
    margin: 1px 0;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.1s;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shift-cell:hover {
    transform: scale(1.05);
}

.shift-cell.rest {
    background: #f3f4f6;
    color: #9ca3af;
}

.shift-cell.maternity {
    background: #fce7f3;
    color: #be185d;
}

.shift-cell.has-ot {
    position: relative;
}

.shift-cell.has-ot::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 5px;
    height: 5px;
    background: #f59e0b;
    border-radius: 50%;
}

.shift-cell.has-leave {
    position: relative;
}

.shift-cell.has-leave::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 5px;
    height: 5px;
    background: #10b981;
    border-radius: 50%;
}

.shift-am-pm {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: stretch;
}

.shift-am-pm .shift-cell {
    text-align: center;
    justify-content: center;
}

.shift-am-label, .shift-pm-label {
    font-size: 9px;
    color: #9ca3af;
    padding: 0 3px;
    flex-shrink: 0;
    font-weight: 400;
}

.shift-cell-with-label {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* 日期类型标签 */
.date-type-tag {
    display: inline-block;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 2px;
}

.date-type-tag.workday {
    background: #dbeafe;
    color: #1e40af;
}

.date-type-tag.restday {
    background: #e5e7eb;
    color: #4b5563;
}

.date-type-tag.holiday {
    background: #fecaca;
    color: #991b1b;
}

.date-type-tag.adjusted {
    background: #fde68a;
    color: #92400e;
}

/* 员工管理 */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.employee-card {
    background: white;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #1e5faa;
}

.employee-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.employee-card.inactive {
    opacity: 0.5;
    border-left-color: #9ca3af;
}

.employee-card.maternity {
    border-left-color: #ec4899;
}

.emp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.emp-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.emp-status {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
}

.emp-status.active {
    background: #dcfce7;
    color: #166534;
}

.emp-status.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.emp-status.maternity {
    background: #fce7f3;
    color: #be185d;
}

.emp-info {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.8;
}

.emp-info span {
    color: #374151;
    font-weight: 500;
}

.emp-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.emp-stat {
    text-align: center;
    flex: 1;
}

.emp-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e5faa;
}

.emp-stat-label {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* 员工卡片新样式 */
.emp-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
}

.emp-stat-item {
    text-align: center;
}

.emp-stat-num {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.emp-stat-num.warning {
    color: #d97706;
}

.emp-stat-num.positive {
    color: #059669;
}

.emp-stat-label {
    font-size: 10px;
    color: #9ca3af;
}

.emp-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #eff6ff;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.emp-total.positive {
    background: #ecfdf5;
    border-left-color: #10b981;
}

.emp-total.negative {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.emp-total-label {
    font-size: 12px;
    color: #6b7280;
}

.emp-total-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
}

.emp-total.positive .emp-total-value {
    color: #047857;
}

.emp-total.negative .emp-total-value {
    color: #b91c1c;
}

/* 员工详情弹窗样式 */
.emp-detail-header {
    text-align: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.emp-detail-name {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.emp-detail-meta {
    font-size: 13px;
    color: #6b7280;
}

.emp-detail-meta .dot {
    margin: 0 6px;
    color: #d1d5db;
}

.emp-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.period-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.period-tab {
    padding: 6px 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.period-tab:hover {
    background: #f3f4f6;
}
.period-tab.active {
    background: #3B82F6;
    color: #fff;
    border-color: #3B82F6;
}

.summary-card {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.summary-card.warn {
    background: #fffbeb;
}

.summary-card.ok {
    background: #f0fdf4;
}

.summary-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.summary-card.warn .summary-value {
    color: #d97706;
}

.summary-card.ok .summary-value {
    color: #059669;
}

.emp-detail-total {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 16px;
}

.emp-detail-total.positive {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.emp-detail-total.negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.total-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e40af;
}

.emp-detail-total.positive .total-value {
    color: #047857;
}

.emp-detail-total.negative .total-value {
    color: #b91c1c;
}

.total-sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-list {
    background: #fafafa;
    border-radius: 6px;
    padding: 4px 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 13px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item.total-row {
    font-weight: 600;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 2px solid #e5e7eb;
    border-bottom: none;
}

.detail-label {
    color: #6b7280;
}

.detail-value {
    color: #1f2937;
    font-weight: 500;
}

.detail-value.warning {
    color: #d97706;
}

.detail-value.positive {
    color: #059669;
}

/* 本周排班迷你视图 */
.week-schedule-mini {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.mini-day {
    background: #f8fafc;
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
    font-size: 11px;
}

.mini-day.rest {
    background: #f3f4f6;
}

.mini-day.holiday {
    background: #fee2e2;
}

.mini-day-date {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    font-size: 11px;
}

.mini-shift {
    padding: 2px 4px;
    border-radius: 3px;
    margin: 2px 0;
    font-size: 10px;
    background: #e5e7eb;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-ot {
    color: #d97706;
    font-size: 10px;
    margin-top: 2px;
}

.mini-lv {
    color: #059669;
    font-size: 10px;
}

.negative {
    color: #dc2626;
}

.positive {
    color: #059669;
}

.warning {
    color: #d97706;
}

/* 加班/休钟 */
.tab-sub {
    display: flex;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 2px;
}

.sub-tab-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    border-radius: 4px;
    font-family: inherit;
}

.sub-tab-btn.active {
    background: white;
    color: #1e5faa;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.overtime-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.overtime-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    max-height: calc(100vh - 200px);
}

.overtime-list::-webkit-scrollbar {
    width: 6px;
}

.overtime-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.overtime-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.overtime-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.overtime-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s;
}

.overtime-item:hover {
    background: #f8fafc;
}

.overtime-item:last-child {
    border-bottom: none;
}

.ot-type-badge {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 10px;
}

.ot-type-badge.overtime {
    background: #f59e0b;
}

.ot-type-badge.leave {
    background: #10b981;
}

.ot-info {
    flex: 1;
}

.ot-employee {
    font-weight: 500;
    color: #1f2937;
    font-size: 13px;
    margin-bottom: 2px;
}

.ot-detail {
    font-size: 11px;
    color: #6b7280;
}

.ot-hours {
    font-size: 15px;
    font-weight: 600;
    color: #1e5faa;
    margin-right: 14px;
}

.ot-date {
    font-size: 11px;
    color: #9ca3af;
    min-width: 90px;
    text-align: right;
}

/* 申请审核样式 */
.overtime-info {
    flex: 1;
}

.overtime-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.overtime-employee {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.overtime-type, .overtime-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.overtime-meta {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    gap: 14px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.overtime-note {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 4px;
}

.overtime-time {
    font-size: 11px;
    color: #9ca3af;
}

.overtime-actions {
    display: flex;
    gap: 6px;
}

.approve-detail .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.approve-detail .detail-item:last-child {
    border-bottom: none;
}

.approve-detail .detail-label {
    color: #6b7280;
    font-size: 13px;
}

.approve-detail .detail-value {
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
}

/* 节假日日历 */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-dot.workday {
    background: #dbeafe;
    border: 1px solid #93c5fd;
}

.legend-dot.restday {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
}

.legend-dot.holiday {
    background: #fecaca;
    border: 1px solid #fca5a5;
}

.legend-dot.adjusted {
    background: #fde68a;
    border: 1px solid #fcd34d;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    background: white;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    max-width: 700px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    padding: 6px;
}

.calendar-weekday.weekend {
    color: #dc2626;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

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

.calendar-day.workday {
    background: #dbeafe;
    color: #1e40af;
}

.calendar-day.restday {
    background: #e5e7eb;
    color: #4b5563;
}

.calendar-day.holiday {
    background: #fecaca;
    color: #991b1b;
}

.calendar-day.adjusted {
    background: #fde68a;
    color: #92400e;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    outline: 2px solid #1e5faa;
    outline-offset: 1px;
}

.calendar-day .day-type-label {
    font-size: 9px;
    margin-top: 2px;
    opacity: 0.8;
}

.calendar-tip {
    margin-top: 14px;
    padding: 10px 14px;
    background: #eff6ff;
    border-radius: 6px;
    font-size: 12px;
    color: #1e40af;
    max-width: 700px;
}

.section-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 28px 0 20px;
}

.special-rules-tip {
    margin-bottom: 12px;
    font-size: 12px;
    color: #6b7280;
}

.special-rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 700px;
}

.special-rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.special-rule-item .rule-name {
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.special-rule-item .rule-info {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    gap: 16px;
}

.special-rule-item .rule-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.special-rule-item .rule-days {
    font-size: 15px;
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    padding: 4px 10px;
    border-radius: 6px;
}

.special-rule-item .btn-delete {
    color: #ef4444;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}

.special-rule-item .btn-delete:hover {
    background: #fef2f2;
}

.special-rules-empty {
    padding: 30px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    max-width: 700px;
}

/* 班次管理 */
.shift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.shift-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shift-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.shift-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    flex-shrink: 0;
}

.shift-info {
    flex: 1;
}

.shift-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 13px;
}

.shift-category {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal-wide {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.modal-body {
    padding: 18px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid #f3f4f6;
}

/* 员工多选列表 */
.employee-select-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.employee-select-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.employee-select-item:hover {
    background: #f3f4f6;
}

.employee-select-item.selected {
    background: #dbeafe;
    color: #1e40af;
}

.employee-select-item input {
    cursor: pointer;
}

/* 每周应休调整列表 */
.adjust-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adjust-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.adjust-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.adjust-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.adjust-item-name {
    font-weight: 500;
    font-size: 14px;
    color: #1f2937;
}

.adjust-item-group {
    font-size: 12px;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
}

.adjust-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adjust-default-value {
    font-size: 12px;
    color: #9ca3af;
}

.adjust-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.adjust-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.adjust-input.has-value {
    border-color: #f59e0b;
    background: #fffbeb;
}

.adjust-item-has-value {
    border-color: #f59e0b;
    background: #fffbeb;
}

/* 期初累计表格 */
.balance-table-wrap {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.balance-table {
    width: 100%;
    border-collapse: collapse;
}

.balance-table th {
    background: #f8fafc;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #e5e7eb;
}

.balance-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.balance-table input {
    width: 90px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
}

.balance-table input:focus {
    outline: none;
    border-color: #1e5faa;
}

/* 历史记录区块 */
.history-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.history-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-section-header label {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.history-list {
    background: #f9fafb;
    border-radius: 6px;
    padding: 8px;
    min-height: 40px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #e5e7eb;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item .history-date {
    width: 120px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
}

.history-item .history-select {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
}

.history-item .history-note {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
}

.history-item .btn-delete-history {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item .btn-delete-history:hover {
    background: #fee2e2;
}

.history-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    padding: 12px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #1f2937;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 2000;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #059669;
}

.toast.error {
    background: #dc2626;
}

.toast.warning {
    background: #d97706;
}

.toast.info {
    background: #2563eb;
}

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px 36px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.login-logo p {
    font-size: 12px;
    color: #9ca3af;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.login-error {
    color: #dc2626;
    font-size: 12px;
    margin-bottom: 12px;
    min-height: 18px;
    text-align: center;
}

.btn-block {
    width: 100%;
    padding: 12px !important;
    font-size: 15px !important;
    margin-top: 6px;
}

.login-tip {
    margin-top: 20px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.8;
}

.login-tip p {
    margin: 0;
}

/* ========== 用户信息 ========== */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.user-role {
    font-size: 11px;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 10px;
    font-weight: 500;
}

/* ========== 用户管理页面 ========== */
.role-info-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #3b82f6;
}

.role-info-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 12px;
}

.role-info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.role-item {
    background: white;
    padding: 12px 14px;
    border-radius: 8px;
}

.role-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.role-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.user-card {
    background: white;
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.user-card:hover {
    border-color: #1e5faa;
    box-shadow: 0 4px 12px rgba(30, 95, 170, 0.1);
    transform: translateY(-1px);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.user-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.user-card-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.user-card-role.admin {
    background: #fef3c7;
    color: #92400e;
}

.user-card-role.user {
    background: #dbeafe;
    color: #1e40af;
}

.user-card-info {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.8;
}

.user-card-info span {
    color: #374151;
    font-weight: 500;
}

.user-card.disabled {
    opacity: 0.5;
}

.user-card-status {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
}

.user-card-status.active {
    background: #d1fae5;
    color: #065f46;
}

.user-card-status.disabled {
    background: #fee2e2;
    color: #991b1b;
}

/* admin-only 隐藏类：非管理员时隐藏 */
body:not(.is-admin) .admin-only {
    display: none !important;
}

/* 非管理员时排班表不可编辑的视觉提示 */
body:not(.is-admin) .shift-am-pm {
    cursor: default;
}

body:not(.is-admin) .shift-am-pm:hover {
    outline: none;
}

/* 非管理员员工页搜索隐藏 */
body:not(.is-admin) #employeeSearch {
    display: none;
}

/* ========== 岗位管理 ========== */
.position-simple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.position-simple-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
    gap: 4px;
    position: relative;
    user-select: none;
}

.position-simple-card:hover {
    border-color: #1e5faa;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30,95,170,0.1);
}

.position-simple-card:active {
    cursor: grabbing;
}

.position-simple-card.drag-ready {
    border-color: #3B82F6;
    background: #EFF6FF;
    cursor: grabbing;
}

.position-simple-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.position-simple-card.drag-over {
    border-color: #3B82F6;
    border-style: dashed;
    background: #EFF6FF;
}

.position-simple-card.ref-active {
    border-color: #4f46e5;
    background: #eef2ff;
}

.position-simple-refs {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.checkbox-group .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.position-simple-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.position-simple-cat {
    font-size: 11px;
    color: #9ca3af;
}

/* ========== 假期抵扣 ========== */
.leave-cash-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lc-summary-item {
    background: white;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-width: 120px;
}

.lc-summary-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.lc-summary-days {
    font-size: 12px;
    color: #6b7280;
}

.lc-summary-days b {
    color: #dc2626;
    font-size: 16px;
}

.leave-cash-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== 当前用户行高亮 ========== */
.schedule-grid .my-row {
    background: #fef3c7 !important;
}

.schedule-grid .my-row .employee-cell {
    background: #fde68a !important;
}

.schedule-grid .my-row .employee-cell .emp-name {
    color: #92400e;
    font-weight: 700;
}

.schedule-grid .my-row td {
    border-left: 2px solid #f59e0b;
    border-right: 2px solid #f59e0b;
}

/* ========== 值班标记 ========== */
.duty-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    background: #7C3AED;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(124,58,237,0.4);
}

.shift-am-pm {
    position: relative;
}

/* ========== 复选框标签 ========== */
.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    padding: 6px 0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    cursor: pointer;
    accent-color: #1e5faa;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        -webkit-tap-highlight-color: transparent;
    }

    /* 顶部导航 */
    .header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 11px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
        order: 3;
    }

    .header-right .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .header-right .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    .user-info .user-name {
        font-size: 12px;
    }

    .user-info .user-role {
        font-size: 10px;
    }

    /* 标签导航 - 横向滚动 */
    .tabs {
        padding: 0 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* 内容区域 */
    .tab-content {
        padding: 10px 12px;
    }

    /* 工具栏 */
    .toolbar {
        gap: 8px;
        margin-bottom: 10px;
    }

    .toolbar-left {
        flex-wrap: wrap;
        gap: 6px;
    }

    .toolbar-left h2 {
        font-size: 14px;
        min-width: auto;
    }

    .week-nav {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        justify-content: flex-start;
    }

    .toolbar-right {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        padding-bottom: 2px;
        align-items: stretch;
    }

    .toolbar-right::-webkit-scrollbar {
        display: none;
    }

    .toolbar-right .select-input {
        font-size: 13px;
        padding: 6px 12px;
        flex-shrink: 0;
        min-width: 100px;
    }

    /* 工具栏按钮 - 圆角大按钮，图标+文字横向 */
    .toolbar-right .btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 40px;
        align-items: center;
        white-space: nowrap;
        flex-shrink: 0;
        border-radius: 10px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        color: #374151;
        gap: 6px;
        display: inline-flex;
        justify-content: center;
    }

    .toolbar-right .btn.btn-primary {
        background: #1e5faa;
        color: white;
        border-color: #1e5faa;
    }

    .toolbar-right .btn.btn-sm {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 40px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .btn-icon {
        padding: 6px 10px;
        min-height: 36px;
        min-width: 36px;
    }

    /* 排班表格 */
    .schedule-container {
        border-radius: 6px;
    }

    .schedule-table-wrapper {
        max-height: calc(100vh - 320px);
        -webkit-overflow-scrolling: touch;
    }

    .schedule-grid {
        font-size: 12px;
        min-width: 700px;
    }

    .schedule-grid th {
        padding: 6px 4px;
        font-size: 12px;
    }

    .schedule-grid th.date-type-row {
        font-size: 9px;
        padding: 3px 4px;
    }

    .schedule-grid td {
        padding: 2px 3px;
        font-size: 12px;
    }

    .schedule-grid .employee-cell {
        padding: 6px 8px;
        min-width: 72px;
        max-width: 72px;
    }

    .schedule-grid .employee-cell .emp-name {
        font-size: 12px;
    }

    .schedule-grid .employee-cell .emp-group {
        font-size: 10px;
    }

    /* 上午/下午标识列 - 移动端更窄 */
    .ampm-header {
        width: 28px;
        min-width: 28px;
        max-width: 28px;
        font-size: 10px;
        padding: 4px 1px;
    }

    .ampm-label-cell {
        width: 28px;
        min-width: 28px;
        max-width: 28px;
        padding: 1px 1px;
    }

    .ampm-label {
        font-size: 9px;
        min-height: 20px;
    }

    /* 班次图例 */
    .shift-legend {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 8px;
        font-size: 11px;
    }

    .legend-item {
        font-size: 11px;
    }

    /* 弹窗 */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 12px;
    }

    .modal-wide {
        max-width: 100%;
    }

    .modal-header {
        padding: 12px 14px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-footer {
        padding: 12px 14px;
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 10;
    }

    /* 表单 */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-input, .select-input, .form-textarea {
        padding: 10px 12px;
        font-size: 15px;
        min-height: 42px;
    }

    .form-textarea {
        min-height: 120px;
    }

    /* 员工卡片网格 */
    .employee-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .employee-card {
        padding: 10px 12px;
    }

    /* 加班/休钟列表 */
    .overtime-list {
        gap: 8px;
    }

    .overtime-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .overtime-filters {
        flex-wrap: wrap;
        gap: 8px;
    }

    .overtime-filters .select-input {
        flex: 1;
        min-width: 120px;
    }

    /* 子标签页 */
    .tab-sub {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sub-tab-btn {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* 登录页 */
    .login-container {
        width: 90%;
        max-width: 360px;
    }

    .login-logo h1 {
        font-size: 20px;
    }

    .login-logo p {
        font-size: 12px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .btn-block {
        padding: 12px;
        font-size: 15px;
        min-height: 46px;
    }

    /* 报表统计 */
    .stats-summary {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .stat-card .stat-label {
        font-size: 11px;
    }

    /* 表格类页面通用 */
    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px 8px;
    }

    /* 搜索框 */
    .search-input {
        padding: 8px 12px;
        font-size: 14px;
        min-height: 38px;
    }

    /* 徽章 */
    .badge {
        font-size: 11px;
        padding: 2px 8px;
    }

    /* Toast 提示 */
    .toast {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    /* 小屏手机进一步优化 */
    .header-left h1 {
        font-size: 15px;
    }

    .subtitle {
        font-size: 10px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .toolbar-left h2 {
        font-size: 13px;
    }

    .schedule-grid {
        min-width: 600px;
        font-size: 11px;
    }

    .schedule-grid .employee-cell {
        min-width: 60px;
        max-width: 60px;
        padding: 5px 6px;
    }

    .schedule-grid .employee-cell .emp-name {
        font-size: 11px;
    }

    .schedule-grid .employee-cell .emp-group {
        font-size: 9px;
    }

    .ampm-header,
    .ampm-label-cell {
        width: 24px;
        min-width: 24px;
        max-width: 24px;
    }

    .ampm-label {
        font-size: 8px;
        min-height: 18px;
    }

    .modal-body {
        padding: 12px;
    }

    .btn {
        padding: 7px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    .stats-summary {
        grid-template-columns: 1fr !important;
    }
}

/* ========== 报表表格 ========== */
.report-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-size: 12px;
}

.report-table thead th {
    background: #1e5faa;
    color: white;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #1a4d8a;
    white-space: nowrap;
    font-size: 12px;
}

.report-table thead .th-group {
    background: #16447a;
}

.report-table tbody td {
    padding: 6px;
    text-align: center;
    border: 1px solid #e5e7eb;
    font-size: 12px;
}

.report-table tbody tr:hover {
    background: #f0f7ff;
}

.report-table .emp-name-cell {
    font-weight: 600;
    color: #1f2937;
    text-align: left;
    white-space: nowrap;
}

.report-table .num-cell {
    font-variant-numeric: tabular-nums;
}

.report-table .rest-cell {
    color: #6b7280;
}

.report-table .duty-cell {
    color: #6D28D9;
    font-weight: 600;
}

.report-table .ot-cell {
    color: #dc2626;
    font-weight: 600;
}

.report-table .lv-cell {
    color: #059669;
    font-weight: 600;
}

.report-table .total-work {
    background: #eff6ff;
    font-weight: 700;
    color: #1e40af;
}

.report-table .total-rest {
    background: #f0fdf4;
    font-weight: 700;
    color: #166534;
}

.report-table .report-total-row td {
    background: #f8fafc;
    font-weight: 700;
    color: #1f2937;
    border-top: 2px solid #1e5faa;
}

.report-table .my-row {
    background: #fef3c7 !important;
}

.report-table .my-row .emp-name-cell {
    color: #92400e;
}

/* 放大版报表表格 */
.report-table-large {
    font-size: 13px;
}

.report-table-large thead th {
    padding: 10px 12px;
    font-size: 13px;
}

.report-table-large tbody td {
    padding: 9px 12px;
    font-size: 13px;
}

/* ========== 报表摘要 ========== */
.report-summary {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.report-summary-item {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
    min-width: 120px;
}

.report-summary-item .rs-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.report-summary-item .rs-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e5faa;
}

/* ========== 值班气泡 ========== */
.duty-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    margin-bottom: 3px;
}

.duty-bubble {
    display: inline-block;
    background: #7C3AED;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    transition: all 0.15s;
}

.duty-bubble:hover {
    background: #dc2626;
    transform: scale(1.08);
}

.duty-bubble::after {
    content: ' ×';
    font-size: 9px;
    opacity: 0;
    transition: opacity 0.15s;
}

.duty-bubble:hover::after {
    opacity: 0.8;
}

.duty-bubble:empty {
    display: none;
}

/* ========== 值班选择器 ========== */
.duty-selector-cell {
    min-width: 70px;
}

.duty-add-area {
    margin: 2px 0;
}

.duty-select {
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #c4b5fd;
    border-radius: 4px;
    background: #f5f3ff;
    color: #5b21b6;
    max-width: 70px;
    cursor: pointer;
}

/* ========== 内联班次选择 ========== */
.inline-shift-select {
    width: 100%;
    font-size: 13px;
    padding: 2px 18px 2px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3l3 4 3-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px;
    direction: ltr;
}

.inline-shift-select:hover {
    border-color: #c4b5fd;
}

.inline-shift-select:focus {
    outline: none;
    border-color: #6D28D9;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}

.inline-shift-select option {
    color: #374151;
    background: white;
    font-weight: normal;
}

/* ========== 内联加班/补休输入 ========== */
.inline-ot-row {
    display: flex;
    gap: 2px;
    margin-top: 1px;
}

.inline-ot-input,
.inline-lv-input {
    width: 50%;
    font-size: 10px;
    padding: 1px 2px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    background: #fafafa;
    text-align: center;
}

.inline-ot-input {
    border-color: #fecaca;
    color: #dc2626;
}

.inline-ot-input::placeholder {
    color: #f87171;
    font-size: 9px;
}

.inline-lv-input {
    border-color: #bbf7d0;
    color: #059669;
}

.inline-lv-input::placeholder {
    color: #34d399;
    font-size: 9px;
}

/* ========== 手动输入模式 ========== */
#btnManualInput.active,
#btnShowNotes.active {
    background: #ECFDF5;
    border-color: #10B981;
    color: #047857;
}

.manual-shift-input {
    width: 100%;
    font-size: 13px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
    text-align: center !important;
    background: transparent;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.manual-shift-input:focus {
    outline: none;
    border-color: #6D28D9;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}

.manual-shift-input.valid {
    /* 有效班次不改变样式，保持原班次颜色 */
}

.manual-shift-input.error {
    border-color: #EF4444;
    background: #FEF2F2;
    color: #B91C1C;
}

.manual-shift-input.error:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.manual-shift-input.rest {
    /* 休息班次不改变样式，保持原班次颜色 */
}

.manual-input-error-tip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #FEE2E2;
    color: #B91C1C;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 100;
    border: 1px solid #FECACA;
    margin-top: 2px;
    pointer-events: none;
    line-height: 1.4;
}

.manual-input-error-tip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #FECACA;
}

/* ========== 备注列 ========== */
.note-col-header {
    background: #FEF3C7 !important;
    color: #92400E !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    min-width: 100px !important;
    width: 100px;
}

.note-cell {
    background: #FFFEF7;
    padding: 3px !important;
    min-width: 100px;
    width: 100px;
}

.note-cell-textarea {
    width: 100%;
    height: 48px;
    border: 1px dashed #FCD34D;
    border-radius: 4px;
    padding: 3px 5px;
    font-size: 11px;
    resize: none;
    background: #FFFBEB;
    color: #92400E;
    font-family: inherit;
    line-height: 1.4;
    box-sizing: border-box;
}

.note-cell-textarea:focus {
    outline: none;
    border-color: #F59E0B;
    border-style: solid;
    background: white;
}

.note-cell-textarea::placeholder {
    color: #D97706;
    opacity: 0.6;
}

.note-cell-display {
    font-size: 11px;
    color: #92400E;
    padding: 4px 6px;
    text-align: left;
    line-height: 1.4;
    min-height: 48px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ========== 值班内联标记 ========== */
.duty-inline-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: #7C3AED;
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(124,58,237,0.4);
}

.shift-cell {
    position: relative;
}
