/* ===== CSS Variables & Reset ===== */
:root {
  --primary: #2D8C87;
  --primary-light: #3AA8A2;
  --primary-dark: #23716D;
  --primary-bg: #F4FBFA;
  --primary-bg2: #E8F5F3;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--primary-bg);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== Typography ===== */
h1 { font-size: 24px; font-weight: 700; color: var(--gray-900); }
h2 { font-size: 20px; font-weight: 600; color: var(--gray-900); }
h3 { font-size: 17px; font-weight: 600; color: var(--gray-800); }
h4 { font-size: 15px; font-weight: 600; color: var(--gray-700); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition); white-space: nowrap; min-height: 36px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #DC2626; }
.btn-success { background: var(--success); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; min-height: 28px; }
.btn-lg { padding: 12px 24px; font-size: 16px; min-height: 44px; }
.btn-block { width: 100%; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--gray-700); }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 14px; color: var(--gray-800);
  background: var(--white); transition: var(--transition); min-height: 38px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,140,135,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-input-readonly { background: #F1F5F9 !important; color: #64748B; }

/* Employee form specific */
.emp-form .form-label-hint { font-size: 12px; color: var(--gray-400); font-weight: 400; margin-left: 2px; }
.btn-upload-photo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px dashed var(--gray-300);
  background: var(--gray-50); color: var(--gray-700); font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.emp-photo-row { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.emp-photo-container {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; position: relative;
  overflow: hidden; border: 2px solid var(--gray-200); background-color: var(--gray-50);
}
.emp-photo-container .emp-photo-preview {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
  position: absolute; top: 0; left: 0;
}
.emp-photo-container .emp-photo-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; color: var(--gray-400); font-size: 11px;
}
.emp-photo-container .emp-photo-placeholder svg { width: 28px; height: 28px; stroke: var(--gray-300); fill: none; }
.dept-checkbox-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 4px;
}
.dept-checkbox-item { display:flex; align-items:center; gap:4px; padding:6px 10px; border-radius:8px; background:var(--gray-50); border:1px solid var(--gray-200); cursor:pointer; font-size:13px; transition:all 0.15s; overflow:hidden; text-overflow:ellipsis; }
.dept-checkbox-item .dept-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dept-checkbox-item:hover { border-color:var(--primary); background:var(--primary-bg); }
.dept-checkbox-item.dept-taken { background:#F9FAFB; cursor:not-allowed; opacity:0.65; }
.dept-checkbox-item.dept-taken:hover { border-color:var(--gray-200); background:#F9FAFB; }
.dept-checkbox-item.dept-taken .dept-name { color:var(--gray-400); }
.dept-checkbox-item input[type="checkbox"] { accent-color:var(--primary); margin:0; }
.dept-checkbox-item span { color:var(--gray-700); }
.dept-checkbox-item .dept-manager { color:var(--gray-400); margin-left:2px; }
.dept-checkbox-item .dept-manager::before { content:'('; }
.dept-checkbox-item .dept-manager::after { content:')'; }
.dept-checkbox-item input:not(:checked) ~ .dept-manager { display:none; }
.dept-checkbox-item .dept-manager-always { color:#F59E0B; margin-left:2px; font-size:12px; }
.dept-checkbox-item .dept-manager-always::before { content:'('; }
.dept-checkbox-item .dept-manager-always::after { content:')'; }
.emp-checkbox-item {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 13px; color: var(--gray-700);
}
.emp-checkbox-item input[type="checkbox"] { accent-color: var(--primary); margin: 0; }

.form-row { display: flex; gap: 12px; min-width: 0; }
.form-row .form-group { flex: 1; min-width: 0; }

/* ===== Cards ===== */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100);
}
.card-header h3 { margin: 0; }

/* ===== Badge ===== */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 99px; font-size: 12px; font-weight: 500;
}
.badge-pending-confirm { background: #EDE9FE; color: #5B21B6; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-approved { background: #D1FAE5; color: #065F46; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-600); }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-primary { background: var(--primary-bg2); color: var(--primary-dark); }
.badge-type-leave { background: #DBEAFE; color: #1E40AF; }
.badge-type-cancel { background: #FEF3C7; color: #92400E; }
.badge-type-revoke { background: #FEE2E2; color: #991B1B; }
.badge-type-draft { background: var(--gray-100); color: var(--gray-600); }
.badge-pending-cancel { background: #E0E7FF; color: #3730A3; }
.badge-voided { background: #F3F4F6; color: #6B7280; text-decoration: line-through; }
.badge-voided-rejected { background: #FEF2F2; color: #DC2626; }
.badge-voided-withdrawn { background: #FFFBEB; color: #D97706; }
.badge-voided-transfer-rejected { background: #FFF1F2; color: #E11D48; }

.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-filing { background: #E0E7FF; color: #3730A3; }
.badge-pending_confirmation { background: #FFF7ED; color: #C2410C; }
.badge-cancelled-leave { background: #F3F4F6; color: #6B7280; }
.badge-draft { background: var(--gray-100); color: var(--gray-600); }

/* 草稿操作按钮 */
.item-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-draft-edit, .btn-draft-delete {
  padding: 4px 14px; border-radius: 6px; font-size: 13px; border: none; cursor: pointer;
}
.btn-draft-edit { background: var(--primary); color: #fff; }
.btn-draft-edit:active { background: var(--primary-dark); }
.btn-draft-delete { background: #f5f5f5; color: #999; }
.btn-draft-delete:active { background: #eee; }

/* ===== Layout ===== */
.app-container { min-height: 100vh; display: flex; flex-direction: column; }

/* Mobile Header */
.mobile-header {
  background: var(--primary); color: var(--white);
  padding: 12px 16px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.mobile-header h1 { color: var(--white); font-size: 18px; }
.mobile-header .header-actions { display: flex; gap: 8px; }
.mobile-header .icon-btn {
  background: none; border: none; color: var(--white); cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 18px; position: relative;
}
.mobile-header .icon-btn:hover { background: rgba(255,255,255,0.15); }
.notification-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--gray-200);
  display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 8px 0; font-size: 11px;
  color: var(--gray-500); cursor: pointer; transition: var(--transition);
  background: none; border: none;
}
.bottom-nav .nav-item.active { color: var(--primary); }
.bottom-nav .nav-item .nav-icon { font-size: 20px; margin-bottom: 2px; }

/* Page Content */
.page-content { flex: 1; padding: 12px; padding-bottom: 70px; }

/* ===== Admin Layout ===== */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px; background: #F5F7FA; color: #374151;
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width 0.3s ease;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  border-right: 1px solid #E5E7EB;
}
.admin-sidebar.collapsed { width: 72px; }
.admin-sidebar.collapsed .sidebar-brand-text,
.admin-sidebar.collapsed .sidebar-nav-label,
.admin-sidebar.collapsed .sidebar-user-info,
.admin-sidebar.collapsed .sidebar-user-name,
.admin-sidebar.collapsed .sidebar-user-role { display: none; }
.admin-sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }
.admin-sidebar.collapsed .sidebar-nav-item { justify-content: center; padding: 12px 0; }
.admin-sidebar.collapsed .sidebar-footer { justify-content: center; }

.sidebar-brand {
  padding: 20px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #E5E7EB;
}
.sidebar-brand-icon {
  width: 36px; height: 36px; background: #2D9990; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 20px; height: 20px; }
.sidebar-brand-text { font-size: 15px; font-weight: 600; color: #1F2937; white-space: nowrap; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; margin: 2px 8px; border-radius: 8px;
  color: #6B7280; font-size: 14px; cursor: pointer;
  transition: all 0.2s ease; text-decoration: none;
}
.sidebar-nav-item:hover { background: #E5E7EB; color: #374151; }
.sidebar-nav-item.active { background: #E6F7F9; color: #0E7C7B; font-weight: 500; }
.sidebar-nav-item.active .sidebar-nav-icon { color: #0E7C7B; }
.sidebar-nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; }
.sidebar-nav-icon svg { width: 20px; height: 20px; }
.sidebar-nav-label { white-space: nowrap; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid #E5E7EB;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 36px; height: 36px; background: #2D9990; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user-avatar svg { width: 18px; height: 18px; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: #1F2937; }
.sidebar-user-role { font-size: 11px; color: #9CA3AF; }
.sidebar-logout {
  background: none; border: none; color: #9CA3AF; cursor: pointer;
  padding: 6px; border-radius: 6px; transition: all 0.2s;
}
.sidebar-logout:hover { color: #EF4444; background: #F3F4F6; }
.sidebar-logout svg { width: 18px; height: 18px; }

.admin-main {
  flex: 1; display: flex; flex-direction: column;
  margin-left: 240px; min-height: 100vh;
  transition: margin-left 0.3s ease;
}
.admin-sidebar.collapsed ~ .admin-main { margin-left: 72px; }

.admin-topbar {
  background: #fff; padding: 0 24px; height: 56px;
  border-bottom: 1px solid #E5E7EB;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-toggle {
  background: none; border: none; cursor: pointer; color: #6B7280;
  padding: 6px; border-radius: 6px; transition: all 0.2s;
}
.topbar-toggle:hover { background: #F3F4F6; color: #374151; }
.topbar-toggle svg { width: 20px; height: 20px; }
.topbar-title { font-size: 16px; font-weight: 600; color: #111827; }

.admin-content { flex: 1; padding: 24px; background: #F9FAFB; overflow-y: auto; }

/* Dashboard */
.dashboard-welcome { margin-bottom: 24px; }
.dashboard-welcome h2 { font-size: 22px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.dashboard-welcome p { font-size: 14px; color: #6B7280; }

.dashboard-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.admin-layout .dash-card {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.admin-layout .dash-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.admin-layout .dash-card-icon svg { width: 22px; height: 22px; }
.admin-layout .dash-card-value { font-size: 28px; font-weight: 700; color: #111827; }
.admin-layout .dash-card-label { font-size: 13px; color: #6B7280; }

.admin-layout .dash-shortcuts {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-layout .dash-shortcuts h3 { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 16px; }

/* ===== 管理后台仪表盘 ===== */
.admin-dash-welcome {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: 16px; padding: 24px 28px; margin-bottom: 20px; color: #37474f;
}
.admin-dash-welcome h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.admin-dash-welcome p { font-size: 13px; opacity: 0.85; margin: 0; }
.admin-dash-welcome-badge {
  background: rgba(255,255,255,0.6); border-radius: 12px; padding: 12px 18px;
  text-align: center; backdrop-filter: blur(4px);
}
.admin-dash-welcome-badge { font-size: 28px; font-weight: 800; }
.admin-dash-welcome-badge small { display: block; font-size: 11px; font-weight: 400; opacity: 0.9; margin-top: 2px; }

.admin-dash-stats-grid { display: flex; gap: 16px; margin-bottom: 20px; }
.admin-dash-stat-card {
  flex: 1; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.admin-stat-leave { background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); border-left: 4px solid #F59E0B; }
.admin-stat-return { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); border-left: 4px solid #3B82F6; }
.admin-stat-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.admin-stat-icon { display: flex; align-items: center; }
.admin-stat-leave .admin-stat-icon { color: #D97706; }
.admin-stat-return .admin-stat-icon { color: #2563EB; }
.admin-stat-title { font-size: 15px; font-weight: 700; }
.admin-stat-leave .admin-stat-title { color: #92400E; }
.admin-stat-return .admin-stat-title { color: #1E40AF; }
.admin-stat-items { display: flex; align-items: center; gap: 0; }
.admin-stat-item { flex: 1; text-align: center; }
.admin-stat-divider { width: 1px; height: 36px; background: rgba(0,0,0,0.08); }
.admin-stat-num { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; }
.admin-num-pending { color: #F59E0B; }
.admin-num-approved { color: #059669; }
.admin-num-return { color: #3B82F6; }
.admin-stat-label { display: block; font-size: 12px; color: #6B7280; margin-top: 4px; }

.admin-dash-shortcuts {
  background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.admin-dash-sc-title { font-size: 15px; font-weight: 700; color: #1a1a1a; margin-bottom: 16px; }
.admin-dash-sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.admin-dash-sc-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 12px; border-radius: 12px;
  background: #FAFAFA; border: 1px solid #F0F0F0;
  cursor: pointer; font-size: 13px; color: #374151;
  transition: all 0.2s;
}
.admin-dash-sc-btn:hover { background: #F5F5F5; border-color: #E0E0E0; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.admin-sc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.admin-sc-icon svg { width: 22px; height: 22px; }
.admin-layout .shortcut-icon svg { width: 18px; height: 18px; }

/* Admin Panel */
.admin-panel {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #F3F4F6;
}
.panel-header h3 { font-size: 15px; font-weight: 600; color: #111827; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 0; }

/* Data Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 12px 16px; text-align: left; background: #F9FAFB;
  font-weight: 600; color: #6B7280; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid #E5E7EB;
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid #F3F4F6;
  color: #374151;
}
.data-table tr:hover td { background: #FAFBFC; }
.data-table .text-center { text-align: center; color: #9CA3AF; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: #F9FAFB; border-radius: 10px; padding: 20px; text-align: center;
  border: 1px solid #E5E7EB;
}
.stat-value { font-size: 28px; font-weight: 700; color: #111827; }
.stat-label { font-size: 13px; color: #6B7280; margin-top: 4px; }

/* Pagination */
.pagination { padding: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Form Row */
.form-row { display: flex; gap: 12px; min-width: 0; }
.form-row .form-group { flex: 1; min-width: 0; }

/* Empty State */
.empty-state { padding: 48px 20px; text-align: center; color: #9CA3AF; font-size: 14px; }

/* ===== Table ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { background: var(--gray-50); font-weight: 600; color: var(--gray-600); white-space: nowrap; }
tr:hover td { background: var(--primary-bg); }

/* ===== Login Page ===== */
/* ===== Login Page ===== */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #2D9990; padding: 20px; gap: 32px;
}
.login-brand { text-align: center; }
.login-icon {
  width: 64px; height: 64px; border-radius: 14px; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.login-title { color: #fff; font-size: 22px; font-weight: 700; margin: 0; letter-spacing: 1px; }
.login-subtitle { color: rgba(255,255,255,0.75); font-size: 13px; margin: 6px 0 0; }
.login-card {
  background: var(--white); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12); padding: 32px 24px; width: 100%; max-width: 380px;
}
.login-form-title { font-size: 18px; font-weight: 600; color: var(--gray-800); margin-bottom: 24px; }
.login-field { margin-bottom: 18px; }
.login-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.login-input-wrap {
  position: relative; display: flex; align-items: center;
  border: 1.5px solid var(--gray-200); border-radius: 10px;
  transition: border-color 0.2s;
}
.login-input-wrap:focus-within { border-color: #2D9990; }
.login-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; flex-shrink: 0;
}
.login-input {
  width: 100%; border: none; outline: none; padding: 12px 12px 12px 40px;
  font-size: 14px; color: var(--gray-800); background: transparent;
  border-radius: 10px;
}
.login-input::placeholder { color: var(--gray-400); }
.login-input-pw { padding-right: 40px; }
.login-eye-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; flex-shrink: 0;
}
.login-eye-icon:hover { opacity: 0.7; }
.login-btn {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: #2D9990; color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px; transition: background 0.2s;
}
.login-btn:hover { background: #268580; }
.login-btn:disabled { background: #7FBDB8; cursor: not-allowed; }
.login-admin-entry {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 20px; cursor: pointer; padding: 8px;
}
.login-admin-entry span { color: var(--gray-400); font-size: 13px; }
.login-admin-entry:hover span { color: var(--gray-500); }
.login-admin-entry:hover svg { stroke: var(--gray-500); }

/* ===== Dashboard ===== */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-sm); text-align: center;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ===== Quick Actions ===== */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 8px; background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: var(--transition);
  border: none; font-size: 12px; color: var(--gray-700);
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-action .action-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 6px;
}
.quick-action .action-icon.green { background: #D1FAE5; color: #065F46; }
.quick-action .action-icon.blue { background: #DBEAFE; color: #1E40AF; }
.quick-action .action-icon.orange { background: #FEF3C7; color: #92400E; }
.quick-action .action-icon.purple { background: #EDE9FE; color: #5B21B6; }

/* ===== List ===== */
.list-item {
  background: var(--white); border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: var(--transition); display: block;
}
.list-item:hover { box-shadow: var(--shadow); }
.list-item .item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.list-item .item-title { font-weight: 600; font-size: 14px; }
.list-item .item-meta { font-size: 12px; color: var(--gray-500); display: flex; gap: 12px; flex-wrap: wrap; }
.list-item .item-desc { font-size: 13px; color: var(--gray-600); margin-top: 4px; }

/* ===== Approval Timeline (Detail Page) ===== */
.detail-timeline { position: relative; padding-left: 28px; }

.dt-item { position: relative; padding-bottom: 20px; }
.dt-item:last-child { padding-bottom: 0; }
.dt-item .dt-dot {
  position: absolute; left: -24px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 2px solid var(--gray-300);
  z-index: 1; transition: all .2s;
}
.dt-item .dt-dot svg { width: 10px; height: 10px; }

/* Done: solid green + white check */
.dt-item.dt-done .dt-dot {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(45,140,135,0.2);
}
.dt-item.dt-done .dt-dot::after {
  content: ''; display: block;
  width: 6px; height: 4px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* Current: ring + glow + green core dot */
.dt-item.dt-current .dt-dot {
  background: var(--white); border-color: var(--primary); border-width: 2px;
  box-shadow: 0 0 0 3px rgba(45,140,135,0.1);
}
.dt-item.dt-current .dt-dot::after {
  content: ''; display: block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  animation: dt-pulse 2s ease-in-out infinite;
}
@keyframes dt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.8); }
}

/* Rejected: red + white X */
.dt-item.dt-rejected .dt-dot {
  background: var(--danger); border-color: var(--danger);
  box-shadow: 0 1px 4px rgba(211,47,47,0.2);
}
.dt-item.dt-rejected .dt-dot::after {
  content: ''; display: block;
  width: 6px; height: 6px;
  background:
    linear-gradient(var(--white),var(--white)) center/1.5px 6px no-repeat,
    linear-gradient(var(--white),var(--white)) center/6px 1.5px no-repeat;
}

/* Pending: gray ring + small gray dot */
.dt-item.dt-pending .dt-dot {
  background: var(--white); border-color: var(--gray-300); border-width: 1.5px;
}
.dt-item.dt-pending .dt-dot::after {
  content: ''; display: block;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gray-300);
}

/* Connect line for each segment - colored per state */
.dt-item .dt-line {
  position: absolute; left: -15px; top: 24px; bottom: 0;
  width: 2px; background: var(--gray-200); border-radius: 1px;
}
.dt-item:last-child .dt-line { display: none; }
.dt-item.dt-done .dt-line { background: var(--primary); }
.dt-item.dt-rejected .dt-line { background: var(--danger); }


.dt-title { font-size: 14px; font-weight: 600; color: var(--gray-800); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 20px; min-height: 20px; }
.dt-title .dt-status-tag {
  display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 10px; font-size: 11px; font-weight: 500;
  line-height: 18px; vertical-align: middle; white-space: nowrap;
}
.dt-status-tag.tag-done { background: #E8F5F3; color: var(--primary); }
.dt-status-tag.tag-current { background: #FFF8E1; color: #E65100; }
.dt-status-tag.tag-rejected { background: #FFEBEE; color: #C62828; }
.dt-status-tag.tag-pending { background: var(--gray-100); color: var(--gray-500); }
.dt-status-tag.tag-filed { background: #E8F5E9; color: #2E7D32; }
.dt-status-tag.tag-unfiled { background: #FFF3E0; color: #E65100; }

.dt-person { font-size: 13px; color: var(--gray-600); margin-top: 4px; }
.dt-comment { font-size: 12px; color: var(--gray-500); margin-top: 4px; padding: 6px 10px; background: var(--gray-50); border-radius: 6px; }
.dt-time { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* Detail status bar at top */
.detail-status-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.detail-type-tag {
  padding: 4px 14px; border-radius: 14px; font-size: 13px; font-weight: 500;
  background: var(--gray-100); color: var(--gray-600);
}
.detail-flow-tag {
  padding: 4px 14px; border-radius: 14px; font-size: 13px; font-weight: 500;
  background: var(--primary-bg); color: var(--primary); border: 1px solid rgba(45,140,135,0.2);
}
.detail-main-status {
  padding: 4px 14px; border-radius: 14px; font-size: 13px; font-weight: 600;
  background: var(--primary); color: var(--white);
}
.detail-main-status.status-rejected { background: var(--danger); }
.detail-main-status.status-cancelled { background: var(--gray-500); }
.detail-main-status.status-draft { background: var(--warning); }
.detail-main-status.status-pending_confirmation { background: #F57C00; }

/* Legacy timeline (keep for other pages) */
.timeline { padding-left: 24px; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--gray-200);
}
.timeline-item { position: relative; padding-bottom: 16px; padding-left: 16px; }
.timeline-item::before {
  content: ''; position: absolute; left: -20px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gray-300); border: 2px solid var(--white);
}
.timeline-item.done::before { background: var(--success); }
.timeline-item.current::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(45,140,135,0.2); }
.timeline-item.rejected::before { background: var(--danger); }
.timeline-item .tl-title { font-weight: 500; font-size: 13px; }
.timeline-item .tl-time { font-size: 12px; color: var(--gray-500); }
.timeline-item .tl-opinion { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px);
  padding: 10px 20px; border-radius: var(--radius); font-size: 14px;
  z-index: 10000; opacity: 0; transition: all 0.3s ease;
  box-shadow: var(--shadow-lg); max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-info { background: var(--primary); color: var(--white); }
.toast-success { background: var(--success); color: var(--white); }
.toast-error { background: var(--danger); color: var(--white); }
.toast-warning { background: var(--warning); color: var(--white); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal, .modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 620px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-100); flex-shrink: 0;
}
.modal-header h3 { margin: 0; }
.modal-close {
  background: none; border: none; font-size: 24px; color: var(--gray-500);
  cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; border-radius: 50%;
}
.modal-close:hover { background: var(--gray-100); }
.modal-body { padding: 20px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--gray-100); flex-shrink: 0; }

/* ===== Tabs ===== */
.tabs { display: flex; border-bottom: 2px solid var(--gray-100); margin-bottom: 16px; gap: 0; }
.tab {
  padding: 8px 16px; font-size: 14px; color: var(--gray-500);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  background: none; border-top: none; border-left: none; border-right: none;
  font-weight: 500;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge {
  display: inline-block; background: #E74C3C; color: #fff; font-size: 10px;
  padding: 1px 5px; border-radius: 8px; margin-left: 4px; vertical-align: middle; font-weight: 600;
}

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-400); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== Search/Filter Bar ===== */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;
}
.filter-bar .form-select, .filter-bar .form-input { width: auto; min-width: 120px; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination .page-btn {
  padding: 4px 10px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  background: var(--white); cursor: pointer; font-size: 13px;
}
.pagination .page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination .page-info { font-size: 13px; color: var(--gray-500); }

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .page-content { padding: 20px; padding-bottom: 20px; }
  .form-row { gap: 16px; }
}

@media (max-width: 767px) {
  .admin-sidebar { transform: translateX(-100%); position: fixed; z-index: 200; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0 !important; }
  .admin-content { padding: 12px; }
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .shortcut-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  th, td { padding: 8px 6px; }
  .login-card { padding: 24px 18px; }
  .login-title { font-size: 19px; }
}

/* ===== Toolbar ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.toolbar-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; }

/* ===== Detail Section ===== */
.detail-section { margin-bottom: 20px; }
.detail-section .section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #374151; padding-bottom: 8px; border-bottom: 1px solid #F3F4F6; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-item { font-size: 13px; }
.detail-item .label { color: #6B7280; margin-bottom: 2px; font-size: 11px; }
.detail-item .value { color: #374151; font-weight: 500; }
.detail-item .text-primary { color: #1e40af; }
.detail-item .emp-no { color: #94a3b8; font-weight: 400; font-size: 12px; }
.detail-item .pos-tag { background: #ede9fe; color: #7c3aed; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 4px; font-weight: 500; }
.detail-item .text-days { color: #dc2626; font-weight: 700; font-size: 15px; }
.period-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.period-start { background: #dbeafe; color: #2563eb; }
.period-end { background: #fef3c7; color: #d97706; }
.info-group { padding: 0; }
.info-group-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 10px; }
.info-divider { height: 1px; background: linear-gradient(90deg, transparent, #e2e8f0, transparent); margin: 12px 0; }
.detail-reason-box { margin-top: 14px; background: #F8FAFC; border-radius: 10px; padding: 14px 16px; }
.detail-reason-label { font-size: 12px; color: #6B7280; margin-bottom: 6px; }
.detail-reason-text { font-size: 14px; color: #1F2937; line-height: 1.6; }

/* ===== Settings Page ===== */
.settings-profile-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  border-radius: 16px; padding: 24px 20px; margin-bottom: 16px;
  color: #fff;
}
.settings-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.25); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
  backdrop-filter: blur(4px); border: 2px solid rgba(255,255,255,0.4);
}
.settings-profile-info h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #fff; }
.settings-profile-info .settings-dept { font-size: 13px; color: rgba(255,255,255,0.85); margin: 0 0 2px; }
.settings-profile-info .settings-empno { font-size: 12px; color: rgba(255,255,255,0.65); margin: 0; }

.settings-section { margin-bottom: 16px; }
.settings-section-title { font-size: 13px; font-weight: 600; color: var(--gray-400); padding: 0 4px 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.settings-menu-card { padding: 0 !important; overflow: hidden; }

.settings-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--gray-100);
}
.settings-menu-item:last-child { border-bottom: none; }
.settings-menu-item:active { background: var(--gray-50); }

.settings-menu-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.settings-icon-leave { background: #E0F2FE; color: #0284C7; }
.settings-icon-notify { background: #FEF3C7; color: #D97706; }
.settings-icon-approval { background: #D1FAE5; color: #059669; }
.settings-icon-password { background: #EDE9FE; color: #7C3AED; }

.settings-menu-text { flex: 1; min-width: 0; }
.settings-menu-label { display: block; font-size: 15px; font-weight: 500; color: var(--gray-700); }
.settings-menu-desc { display: block; font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.settings-menu-arrow { flex-shrink: 0; }

.settings-logout-btn { margin-top: 24px; margin-bottom: 32px; border-radius: 12px; font-weight: 600; }

/* ===== Notification Settings ===== */
.notify-hint { background: #F0F4F8; border-radius: 8px; padding: 14px 18px; margin: 0 0 16px; font-size: 13px; color: #4B5563; line-height: 1.6; }
.notify-hint code { background: #E0E7EF; padding: 1px 6px; border-radius: 4px; font-size: 12px; color: #374151; font-family: Menlo, Consolas, monospace; }
.notify-group { margin-bottom: 20px; }
.notify-group-title { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 10px; padding-left: 2px; }
.notify-table th { font-size: 13px; }
.notify-table td { font-size: 13px; vertical-align: middle; }
.notify-event-tag { display: inline-block; background: #E8EDF3; color: #4B5563; padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.notify-template-cell { color: #6B7280; font-size: 12.5px; max-width: 360px; }
.notify-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.notify-switch input { opacity: 0; width: 0; height: 0; }
.notify-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #CBD5E1; border-radius: 22px; transition: .3s; }
.notify-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
.notify-switch input:checked + .notify-slider { background: #34D399; }
.notify-switch input:checked + .notify-slider:before { transform: translateX(18px); }
.notify-edit-btn { background: none; border: none; color: #3B82F6; font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.notify-edit-btn:hover { background: #EFF6FF; }

/* Admin tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.tag-super-admin { background: #F97316; color: white; }
.tag-super-admin svg { width: 12px; height: 12px; }
.tag-admin { background: #F1F5F9; color: #475569; }

/* Admin status toggle */
.status-text { font-size: 13px; color: #64748B; margin-left: 8px; vertical-align: middle; }

/* ===== Notification Cards ===== */
.notification-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}
.notification-card:active { transform: scale(0.985); }
.notification-card.notification-unread {
  border-left: 3px solid #3b82f6;
  background: #f8faff;
}
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.notification-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.6;
}
.notification-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.5;
}
.notification-unread .notification-title { color: #0f172a; }
.notification-content {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 6px;
}
.notification-time {
  font-size: 11px;
  color: #94a3b8;
}
.notification-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}

/* Admin icon buttons */
.icon-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; vertical-align: middle; }
.icon-btn:hover { background: #F1F5F9; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #CBD5E1; border-radius: 22px; transition: .3s; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: white; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .toggle-slider { background-color: #2D9990; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* Icon button variants */
.icon-btn-success { background: transparent; }
.icon-btn-success:hover { background: #E0F2F1; }
.icon-btn-danger { background: transparent; }
.icon-btn-danger:hover { background: #FEE2E2; }

/* ===== Employee Dashboard ===== */
.emp-dashboard { padding: 0; padding-bottom: 80px; background: #F0FAF9; min-height: 100vh; }
.emp-dashboard .mobile-header {
  background: var(--primary);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.dash-header-info { flex: 1; }
.dash-welcome { font-size: 13px; opacity: 0.85; color: #fff; }
.dash-name { font-size: 16px; font-weight: 600; margin-top: 2px; color: #fff; }

.dash-shortcuts { display: flex; justify-content: space-between; gap: 0; margin: 16px; padding: 20px 8px; background: #fff; border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.shortcut-item { display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; flex: 1; transition: transform 0.15s; }
.shortcut-item:active { transform: scale(0.93); }
.shortcut-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; transition: transform 0.2s, box-shadow 0.2s; }
.shortcut-item:active .shortcut-icon { transform: scale(0.95); }
.shortcut-label { font-size: 12px; color: #4B5563; font-weight: 500; white-space: nowrap; text-align: center; }

.dash-card { background: #fff; border-radius: 14px; padding: 18px; margin: 0 16px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.dash-card-title { font-size: 16px; font-weight: 700; color: #1a1a1a; }

/* 待我审批卡片 */
.dash-approval-cards { display: flex; gap: 12px; margin-top: 14px; }
.approval-card { flex: 1; border-radius: 12px; padding: 18px 14px; text-align: center; cursor: pointer; transition: transform 0.15s; display: flex; flex-direction: column; align-items: center; }
.approval-card:active { transform: scale(0.97); }
.approval-card-leave { background: #FFF8EE; }
.approval-card-cancel { background: #FFF0EE; }
.approval-card-revoke { background: #FFF3E0; }
.approval-card-icon-wrap { position: relative; display: inline-block; margin: 0 auto 10px; }
.approval-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.approval-badge { position: absolute; top: -6px; right: -8px; background: #E74C3C; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.dash-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dash-link { font-size: 13px; color: #2D9990; text-decoration: none; }

.dash-stats { display: flex; gap: 10px; margin-top: 14px; }
.stat-block { border-radius: 12px; padding: 14px 10px; text-align: center; }
.stat-total { background: #E8F8F5; }
.stat-leave { background: #FFF8EB; flex: 0.7; }
.stat-cancel { background: #FFF1F2; flex: 1.3; }
.stat-revoke { background: #FFF7ED; }
.stat-num { font-size: 28px; font-weight: 700; color: #2D9990; }
.stat-label { font-size: 12px; color: #666; margin-top: 2px; }
.stat-sub-title { font-size: 12px; color: #E53E3E; font-weight: 600; margin-bottom: 8px; }
.stat-row { display: flex; justify-content: center; gap: 12px; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-pending { font-size: 18px; font-weight: 700; color: #F59E0B; }
.stat-passed { font-size: 18px; font-weight: 700; color: #2D9990; }
.stat-voided { font-size: 18px; font-weight: 700; color: #9CA3AF; }
.stat-desc { font-size: 11px; color: #888; }

.recent-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #F3F4F6; cursor: pointer; }
.recent-item:last-child { border-bottom: none; }
.recent-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0; }
.recent-icon.status-passed { background: #D1FAE5; }
.recent-icon.status-pending { background: #FEF3C7; }
.recent-icon.status-other { background: #F3F4F6; }
.recent-info { flex: 1; }
.recent-type { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.recent-date { font-size: 12px; color: #999; margin-top: 2px; }
.recent-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.recent-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.recent-status.status-passed { background: #D1FAE5; color: #059669; }
.recent-status.status-pending { background: #FEF3C7; color: #D97706; }
.recent-status.status-other { background: #F3F4F6; color: #6B7280; }

.empty-tip { text-align: center; color: #999; padding: 30px 0; font-size: 14px; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: #fff; display: flex; border-top: 1px solid #E5E7EB; z-index: 100; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; text-decoration: none; font-size: 11px; gap: 2px; }
.nav-item.active { color: #2D9990; }

/* ===== 请假申请页面 ===== */
/* 卡片模块 */
.leave-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.leave-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 10px;
}
.leave-card-label .required { color: var(--danger); margin-left: 2px; }

/* 请假类型标签按钮组 */
.leave-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.leave-type-tag {
  padding: 6px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.leave-type-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.leave-type-tag.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* 时间选择行 */
.leave-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.leave-date-input {
  flex: 0 1 auto;
  max-width: 55%;
  position: relative;
  display: flex;
  align-items: center;
}
.leave-date-picker {
  width: 100%;
  min-width: 0;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  min-height: 38px;
  -webkit-appearance: none;
  appearance: none;
}
.leave-date-picker:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,140,135,0.1);
}
.leave-date-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  flex-shrink: 0;
  display: none;
}
.leave-date-picker {
  padding-left: 12px !important;
}

/* 时段选择按钮组 */
.leave-period-group {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  overflow: hidden;
}
.leave-period-btn {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.leave-period-btn:first-child {
  border-right: 1px solid var(--gray-300);
}
.leave-period-btn.active {
  background: var(--primary);
  color: var(--white);
}
.leave-period-btn:hover:not(.active) {
  background: var(--gray-50);
}

/* 请假天数展示 */
.leave-days-display {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--gray-500);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.leave-overlap-warning {
  margin-top: 8px;
  padding: 8px 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  font-size: 13px;
  color: #DC2626;
  line-height: 1.4;
}

/* 附件区域 */
.leave-attachment-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 10px;
  margin-top: -4px;
}
.leave-upload-area {
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--gray-600);
  font-size: 13px;
}
.leave-upload-area:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.leave-attachment-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--primary-bg);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}
.leave-attachment-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gray-500);
}
.leave-attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary-dark);
}
.leave-attachment-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.leave-attachment-remove:hover { color: var(--danger); }

/* 底部操作栏 */
.has-bottom-bar {
  padding-bottom: 80px !important;
}
.leave-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--gray-200);
  z-index: 100;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.leave-draft-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  color: var(--gray-700);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.leave-draft-btn:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
}
.leave-draft-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.leave-danger-outline-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  background: var(--white);
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #dc2626;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.leave-danger-outline-btn:hover {
  border-color: #f87171;
  background: #fef2f2;
}
.leave-danger-outline-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.leave-submit-btn {
  flex: 1;
  padding: 10px 24px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.leave-submit-btn:hover { background: var(--primary-dark); }
.leave-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 数据库设置 ===== */
.db-settings-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
}

.db-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 14px;
}
.db-status-bar.connected { background: #ecfdf5; }
.db-status-bar.disconnected { background: #fef2f2; }

.db-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connected .db-status-dot { background: #10b981; }
.disconnected .db-status-dot { background: #ef4444; }

.db-status-text { font-weight: 600; }
.connected .db-status-text { color: #065f46; }
.disconnected .db-status-text { color: #991b1b; }

.db-status-mode { margin-left: auto; color: var(--gray-500, #6b7280); font-size: 13px; }

.db-switch-section { margin-bottom: 24px; }

.db-switch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700, #374151);
  margin: 0 0 12px;
}

.db-switch-options { display: flex; flex-direction: column; gap: 12px; }

.db-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}
.db-option:hover { border-color: var(--gray-300, #d1d5db); }
.db-option.active { border-color: var(--primary, #2D8C87); background: #f0fdfa; }

.db-option-radio {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.db-option.active .db-option-radio { border-color: var(--primary, #2D8C87); }

.radio-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary, #2D8C87);
  transform: scale(0);
  transition: transform 0.15s;
}
.db-option.active .radio-dot { transform: scale(1); }

.db-option-info { flex: 1; }
.db-option-name { font-size: 15px; font-weight: 600; color: var(--gray-800, #1f2937); }
.db-option-desc { font-size: 12px; color: var(--gray-500, #6b7280); margin-top: 2px; }

.db-option-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.db-option-icon svg { width: 20px; height: 20px; }
.db-option-icon.local { background: #ecfdf5; color: #10b981; }
.db-option-icon.cloud { background: #eff6ff; color: #3b82f6; }

.db-info-section {
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.db-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}
.db-info-item + .db-info-item { border-top: 1px solid var(--gray-100, #f3f4f6); }
.db-info-label { color: var(--gray-500, #6b7280); }
.db-info-value { font-weight: 600; color: var(--gray-800, #1f2937); }
.text-success { color: #10b981 !important; }
.text-danger { color: #ef4444 !important; }

.db-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--primary, #2D8C87);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.db-switch-btn svg { width: 18px; height: 18px; }
.db-switch-btn:hover { background: var(--primary-dark, #1f7a75); }
.db-switch-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 数据库同步区域 */
.db-sync-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-200, #e5e7eb); }
.db-sync-header { display: flex; align-items: center; justify-content: space-between; }
.db-sync-info { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--gray-800, #1f2937); }
.db-sync-info svg { color: var(--primary, #2D8C87); }
.db-sync-desc { font-size: 12px; color: var(--gray-500, #6b7280); margin: 6px 0 0; line-height: 1.5; }
.db-sync-hint { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; margin-top: 16px; color: #92400e; font-size: 13px; line-height: 1.5; }
.db-sync-hint svg { flex-shrink: 0; color: #d97706; }
.db-sync-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
  border-radius: 8px; border: 1px solid var(--primary, #2D8C87);
  background: #fff; color: var(--primary, #2D8C87); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.db-sync-btn:hover { background: var(--primary, #2D8C87); color: #fff; }
.db-sync-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.db-sync-btn svg { transition: none; }
.db-sync-data-btn {
  border-color: #E67E22 !important;
  color: #E67E22 !important;
}
.db-sync-data-btn:hover { background: #E67E22 !important; color: #fff !important; }
.db-sync-data-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表选择 */
.db-sync-actions { display: flex; gap: 8px; align-items: center; }
.db-select-all-btn { background: #F1F5F9 !important; color: #475569 !important; border: 1px solid #CBD5E1 !important; font-size: 13px; padding: 4px 12px; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.db-select-all-btn:hover { background: #E2E8F0 !important; }
.db-table-select { margin-top: 12px; max-height: 360px; overflow-y: auto; border: 1px solid #E2E8F0; border-radius: 8px; background: #FAFBFC; }
.db-table-loading { padding: 20px; text-align: center; color: #94A3B8; font-size: 13px; }
.db-table-category { border-bottom: 1px solid #E2E8F0; }
.db-table-category:last-child { border-bottom: none; }
.db-table-category-header { padding: 8px 12px; background: #F1F5F9; font-size: 13px; font-weight: 600; color: #475569; border-bottom: 1px solid #E2E8F0; }
.db-table-items { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 12px; }
.db-table-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #334155; transition: background 0.15s; user-select: none; }
.db-table-item:hover { background: #E2E8F0; }
.db-table-check { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.db-table-check input, .db-table-check-input { width: 16px; height: 16px; accent-color: #E67E22; cursor: pointer; }
.db-table-name { font-weight: 500; }
.db-table-rows { color: #94A3B8; font-size: 12px; }
.db-table-deps { color: #E67E22; font-size: 11px; opacity: 0.8; }
.db-table-checkmark { display: none; }

/* 同步结果 */
.db-sync-result { margin-top: 12px; }
.sync-success, .sync-error { padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.sync-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.sync-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.sync-message { font-weight: 600; margin-bottom: 8px; }
.sync-group { margin-top: 8px; }
.sync-group-title { font-weight: 600; font-size: 12px; color: var(--gray-500, #6b7280); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.sync-item { padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.sync-item .sync-icon { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.sync-item.success .sync-icon { background: #dcfce7; color: #16a34a; }
.sync-item.error .sync-icon { background: #fee2e2; color: #dc2626; }
.sync-empty { color: var(--gray-500, #6b7280); font-style: italic; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== 报表样式 ===== */
.report-toolbar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.report-scope-group {
  display: flex;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.report-scope-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}
.report-scope-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.report-period-group {
  display: flex;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.report-period-tab {
  flex: 1;
  padding: 7px 0;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}
.report-period-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.report-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.report-arrow-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
}
.report-arrow-btn:active {
  background: var(--gray-100);
}
.report-date-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  min-width: 120px;
  text-align: center;
}
.report-filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.report-dept-select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  appearance: auto;
}
.report-export-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.report-export-btn:active {
  background: var(--primary-dark);
}

.report-table-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.report-table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
  text-align: center;
}
.report-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 600px;
}
.report-table thead th {
  padding: 8px 6px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-bottom: 2px solid var(--primary-dark);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.report-th-num { width: 40px; text-align: center; }
.report-th-name { text-align: left; min-width: 60px; }
.report-th-dept { text-align: left; min-width: 70px; }
.report-th-type { text-align: center; min-width: 45px; }
.report-th-total { text-align: center; min-width: 50px; background: var(--primary-color); color: var(--white); font-weight: 700; }

.report-table tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--gray-100);
}
.report-td-num { text-align: center; color: var(--gray-500); }
.report-td-name { font-weight: 500; }
.report-td-dept { color: var(--gray-500); font-size: 11px; }
.report-td-num { text-align: center; }
.report-td-total { font-weight: 700; color: var(--primary-color); background: rgba(45, 140, 135, 0.06); }

.report-row-even { background: var(--white); }
.report-row-odd { background: var(--gray-50); }

.report-table tfoot td {
  padding: 9px 6px;
  border-top: 2px solid var(--primary-color);
  border-bottom: none;
  font-weight: 700;
}
.report-row-total { background: rgba(45, 140, 135, 0.08); }
