:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --sidebar-width: 250px;
  --header-height: 46px;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.4;
  font-size: 13.5px;
}

/* Fullscreen Light-Style SSO Redirect Mask */
.sso-redirect-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sso-redirect-card.light-theme {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 48px 56px;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 10px 15px -3px rgba(15, 23, 42, 0.04);
  text-align: center;
  max-width: 560px;
  width: 90%;
  color: #0f172a;
  transform: translateY(-8vh);
}

.sso-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background-color: #eff6ff;
  color: #2563eb;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid #bfdbfe;
}

.sso-redirect-card.light-theme h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.sso-notice-text {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 32px !important;
  line-height: 1.5 !important;
}

.sso-redirect-btn-box {
  display: flex;
  justify-content: center;
}

.btn-center-xl {
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  padding: 13px 38px !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.btn-center-xl:hover {
  background-color: var(--primary-hover) !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.4) !important;
}

/* App Header */
.app-header {
  height: var(--header-height);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

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

.brand-icon {
  font-size: 1.15rem;
  color: var(--primary-color);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-top-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sso-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background-color: #f1f5f9;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.sso-select {
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.75rem;
  color: var(--text-main);
  outline: none;
}

/* App Wrapper for Main Layout */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Workspace Layout */
.workspace {
  display: flex;
  margin-top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Sidebar Styling - Micro-fitted with auto scrollbar for future 100+ units */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px 8px 6px;
}

.nav-section {
  margin-bottom: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  font-size: 0.72rem;
}

.btn-icon:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  margin-bottom: 0px;
  border-radius: 4px;
  cursor: pointer;
  color: #334155;
  font-weight: 500;
  font-size: 0.8rem;
  line-height: 1.35;
  transition: all 0.12s ease;
  user-select: none;
}

.sidebar-item:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.sidebar-item.active {
  background-color: #eff6ff;
  color: var(--primary-color);
  font-weight: 600;
}

/* Main Content Area */
.content-area {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background-color: var(--bg-color);
}

.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.content-card {
  padding: 16px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.table-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.table-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.record-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Data Table */
.table-responsive {
  flex: 1;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, 
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

/* Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-primary { background-color: #dbeafe; color: #1e40af; }
.badge-nextweek { background-color: #fef3c7; color: #92400e; font-weight: 600; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: 0.7rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  text-decoration: none;
}

.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: #fff; border-color: #cbd5e1; color: #334155; }
.btn-secondary:hover { background-color: #f8fafc; border-color: #94a3b8; }
.btn-sm { padding: 2px 6px; font-size: 0.72rem; }

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.modal-large {
  max-width: 840px;
  width: 92%;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title { font-size: 0.98rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; }

.modal-body { padding: 18px; overflow-y: auto; max-height: 75vh; }
.modal-footer { padding: 10px 18px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 8px; background: #f8fafc; }

.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; }
.form-input { width: 100%; padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 5px; outline: none; font-size: 0.85rem; }
.form-textarea { width: 100%; min-height: 180px; padding: 9px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 0.85rem; outline: none; resize: vertical; line-height: 1.5; }

.form-textarea-large {
  min-height: 360px !important;
  font-size: 0.95rem !important;
  line-height: 1.7 !important;
  padding: 14px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  color: #0f172a !important;
  background-color: #f8fafc !important;
}

.form-textarea-large:focus {
  background-color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

/* Detail View Box */
.detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 16px;
  background-color: #f1f5f9;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.detail-content-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 22px;
  min-height: 300px;
  max-height: 52vh;
  overflow-y: auto;
  font-size: 0.96rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

/* Interactive WorkWeek Date Link */
.workweek-link {
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.workweek-link:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
  text-decoration: underline;
}

/* Toast System */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 6px; background: #334155; color: #fff; font-size: 0.85rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.toast-success { background: #065f46; }
.toast-warning { background: #92400e; }
.toast-error { background: #991b1b; }

/* Summary Paper View */
.summary-modal-card { max-width: 800px; width: 95%; }
.summary-document-paper { background: #fff; padding: 30px 40px; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); font-family: "Songti SC", "SimSun", serif; color: #000; line-height: 1.8; }
.summary-title { font-size: 1.4rem; font-weight: bold; text-align: center; margin-bottom: 20px; }
.summary-meta { font-size: 0.95rem; margin-bottom: 20px; }
.summary-sec-title { font-size: 1.1rem; font-weight: bold; margin-top: 20px; margin-bottom: 8px; }
.summary-unit-title { font-weight: bold; font-size: 1rem; margin-top: 10px; }
.summary-unit-reporter { font-size: 0.9rem; color: #333; margin-bottom: 4px; }
.summary-sep { border: none; border-top: 1px dashed #94a3b8; margin: 12px 0; }
.summary-content-block { font-size: 0.95rem; white-space: pre-wrap; word-break: break-all; }

/* 企业后台视觉优化：保持原有布局，仅提升层次、间距和可读性 */
:root {
  --primary-color: #1f5fae;
  --primary-hover: #174b8a;
  --bg-color: #f4f7fb;
  --header-height: 54px;
}

.app-header {
  padding: 0 20px;
  box-shadow: 0 1px 8px rgba(15, 42, 74, 0.06);
}

.header-brand { gap: 9px; }
.brand-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf5ff;
  border-radius: 8px;
  font-size: 1.1rem;
}
.brand-title { font-size: 1.08rem; }
.sso-badge { padding: 5px 10px; background: #f7f9fc; }

.sidebar {
  box-shadow: 2px 0 10px rgba(15, 42, 74, 0.025);
}
.sidebar-scroll { padding: 12px 10px 16px; }
.nav-section { margin-bottom: 12px; }
.section-header { padding: 5px 8px; font-size: 0.69rem; }
.sidebar-item {
  gap: 8px;
  padding: 6px 9px;
  margin-bottom: 2px;
  border-radius: 6px;
  font-size: 0.81rem;
  line-height: 1.4;
}
.sidebar-item:hover { background: #f3f7fc; }
.sidebar-item.active {
  background: #eaf3ff;
  box-shadow: inset 3px 0 0 var(--primary-color);
}

.content-area { padding: 16px; }
.card {
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(15, 42, 74, 0.055);
}
.content-card { padding: 18px 20px; }
.table-header { margin-bottom: 14px; padding-bottom: 13px; }
.table-title h2 { font-size: 1.12rem; color: #173453; }
.record-counter {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 2px 8px;
}

.table-responsive {
  border: 1px solid #e5ebf3;
  border-radius: 8px;
}
.data-table th, .data-table td { padding: 10px 12px; }
.data-table th {
  background: #f6f8fb;
  color: #52677e;
  letter-spacing: 0.01em;
  text-transform: none;
}
.data-table tr:hover { background: #f7faff; }

.badge-primary { background: #e5f0ff; color: #1e5595; }
.badge-nextweek {
  background: #e8f2ff;
  color: #1f5fae;
  border: 1px solid #cfe2fb;
  border-radius: 10px;
  padding: 1px 6px;
}
.btn { border-radius: 6px; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn-primary { box-shadow: 0 2px 5px rgba(31, 95, 174, 0.18); }
.btn-primary:hover { box-shadow: 0 3px 8px rgba(31, 95, 174, 0.24); }

.modal-card { border-radius: 12px; box-shadow: 0 24px 55px -15px rgba(15, 42, 74, 0.3); }
.modal-header { padding: 15px 20px; background: #f8fafc; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; }
.form-input:focus, .form-textarea:focus {
  border-color: #6da2dc;
  box-shadow: 0 0 0 3px rgba(31, 95, 174, 0.1);
}
.workweek-link:hover { text-decoration: none; }

.sidebar-scroll::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar { width: 7px; height: 7px; }
.sidebar-scroll::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb { background: #cbd6e3; border-radius: 10px; }

@media (max-width: 900px) {
  :root { --sidebar-width: 210px; }
  .content-area { padding: 10px; }
  .content-card { padding: 14px; }
  .data-table th, .data-table td { padding: 9px 8px; }
}

/* 左侧单位菜单紧凑模式：保证常见桌面高度下尽量一屏展示全部分公司 */
.sidebar-scroll {
  padding: 6px 9px 8px;
}
.nav-section {
  margin-bottom: 4px;
}
.section-header {
  padding: 2px 7px;
  font-size: 0.66rem;
  line-height: 1.25;
}
.sidebar-item {
  gap: 7px;
  min-height: 22px;
  padding: 2px 8px;
  margin-bottom: 0;
  font-size: 0.76rem;
  line-height: 1.25;
}
.sidebar-item > i:first-child {
  width: 13px;
  text-align: center;
  font-size: 0.72rem;
}
