/* 星禾悦动 · 内部管理系统 — Light Glassmorphism */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

/* ===== Design Tokens ===== */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --primary-light: #a29bfe;
  --primary-bg: #f4f2ff;
  --primary-glow: rgba(108, 92, 231, 0.12);
  --green: #00b894;
  --green-bg: #e6faf4;
  --bg: #f8f7fc;
  --card: #ffffff;
  --card-alt: #faf9fe;
  --text: #2d2b3d;
  --text2: #6e6b7b;
  --text3: #b0adba;
  --border: #e8e5f0;
  --border-light: #f2f0f7;
  --danger: #ff6b6b;
  --danger-bg: #fff0f0;
  --success: #00b894;
  --warning: #fdcb6e;
  --warning-bg: #fffbf0;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Glass tokens */
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-bg-light: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-border-strong: rgba(255, 255, 255, 0.65);
  --glass-blur: 16px;
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 1px 4px rgba(0, 0, 0, 0.03);
  --glass-shadow-hover:
    0 8px 32px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ===== Glass Utility Mixins ===== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

.glass-card-light {
  background: var(--glass-bg-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.glass-card-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-strong);
}

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

body {
  font-family:
    "Inter",
    "Noto Sans SC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, #f4f2ff 0%, transparent 50%),
    radial-gradient(ellipse 60% 70% at 80% 60%, #f8f7fc 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 80%, #faf9fe 0%, transparent 50%),
    linear-gradient(180deg, #faf9fe 0%, #f4f2ff 50%, #f8f7fc 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Login Page ===== */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, #f4f2ff 0%, transparent 50%),
    radial-gradient(ellipse 60% 60% at 80% 70%, #f8f7fc 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, #f4f2ff 0%, transparent 50%);
  padding: 24px;
}

.login-container {
  display: flex;
  width: 960px;
  max-width: 95vw;
  min-height: 540px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.login-illustration {
  flex: 1;
  background: rgba(244, 242, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.login-illustration::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(108, 92, 231, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
  top: -60px;
  right: -60px;
}

.login-illustration::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(162, 155, 254, 0.06) 0%,
    transparent 70%
  );
  border-radius: 50%;
  bottom: -40px;
  left: -40px;
}

.login-illustration svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  position: relative;
  z-index: 1;
}

.login-form-side {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 52px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-logo {
  display: block;
  width: 52px;
  height: auto;
  margin: 0 0 16px 0;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.login-form-side h1 {
  font-size: 26px;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.3px;
}

.login-form-side .sub {
  color: var(--text2);
  margin-bottom: 36px;
  font-size: 14px;
  line-height: 1.5;
}

.input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
  background: rgba(248, 250, 252, 0.7);
}

.input-wrap input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-wrap input::placeholder {
  color: var(--text3);
}

.login-form-side button {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
  letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.25);
}

.login-form-side button:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.35);
  transform: translateY(-1px);
}

.login-form-side button:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  margin-top: 28px;
}

.error-msg {
  color: var(--danger);
  text-align: center;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

.btn-dingtalk {
  width: 100%;
  padding: 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-light);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-dingtalk:hover {
  background: var(--glass-bg-strong);
  border-color: var(--primary-light);
}

/* ===== Layout ===== */
#main-page {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar — Glass ===== */
.sidebar {
  width: 240px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  border-right: 1px solid var(--glass-border);
  box-shadow: 1px 0 20px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 4px;
}

.sidebar-logo {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-header h2 {
  font-size: 15px;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.nav-menu {
  list-style: none;
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

/* 菜单分组标签 */
.nav-group-label {
  padding: 16px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text3);
  pointer-events: none;
  user-select: none;
}

.nav-group-label:first-child {
  padding-top: 4px;
}

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
  margin-left: auto; line-height: 1;
}
.nav-badge-warn { background: var(--warning); color: #92400e; }
.nav-group-label .nav-badge { margin-left: 6px; }

.nav-menu li a {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  gap: 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  position: relative;
}

.nav-menu li a:hover {
  background: rgba(108, 92, 231, 0.06);
  color: var(--text);
}

.nav-menu li a.active {
  background: rgba(108, 92, 231, 0.1);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(108, 92, 231, 0.06);
}

.nav-menu li a .icon {
  font-size: 17px;
  width: 22px;
  height: 22px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-menu li a .icon svg {
  display: block;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.nav-menu li a:hover .icon svg {
  opacity: 0.8;
}
.nav-menu li a.active .icon svg {
  opacity: 1;
  color: var(--primary);
}

.nav-group .nav-parent .arrow {
  font-size: 7px;
  margin-left: auto;
  transition: transform var(--transition);
  opacity: 0.35;
}

.nav-group.expanded .nav-parent .arrow {
  transform: rotate(90deg);
  opacity: 0.6;
}

.nav-sub {
  list-style: none;
  display: none;
}
.nav-group.expanded .nav-sub {
  display: block;
}

.nav-sub li a {
  padding: 9px 14px 9px 48px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text2);
}

.nav-sub li a:hover {
  color: var(--text);
  background: rgba(108, 92, 231, 0.05);
}
.nav-sub li a.active {
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  font-weight: 500;
}

.menu-logo {
  width: 20px;
  height: auto;
  border-radius: 4px;
  vertical-align: middle;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text2);
  background: var(--glass-bg-light);
}

/* 侧边栏用户卡片 */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-avatar-default {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  user-select: none;
}

.sidebar-user-detail {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: var(--text2);
  font-size: 11px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-logout {
  cursor: pointer;
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  margin-top: 3px;
  display: inline-block;
}

.sidebar-user-logout:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ===== Content Area ===== */
.content {
  margin-left: 240px;
  flex: 1;
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 80% 100%, var(--primary-bg) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 0%, rgba(162, 155, 254, 0.04) 0%, transparent 40%);
}

.content > * {
  position: relative;
  z-index: 1;
  animation: pageIn 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#watermark {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background-repeat: repeat;
  opacity: 1;
}

/* ===== Welcome Bar ===== */
.welcome-bar {
  padding: 14px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(108,92,231,0.08) 0%, rgba(162,155,254,0.04) 100%);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.welcome-greeting {
  font-size: 15px;
  color: var(--text);
}

.welcome-greeting strong {
  color: var(--primary);
}

.welcome-date {
  font-size: 13px;
  color: var(--text2);
}

.welcome-entry {
  font-size: 12px;
  color: var(--text3);
  margin-left: auto;
}

/* ===== Empty State Guide ===== */
.empty-guide {
  text-align: center;
  padding: 48px 24px;
  color: var(--text2);
}

.empty-guide p {
  font-size: 15px;
  margin-bottom: 6px;
  font-weight: 600;
}

.empty-guide-hint {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--text3);
  margin-bottom: 16px !important;
}

.empty-guide-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Notice Bar — Glass ===== */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-strong);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.notice-bar::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--primary-bg);
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
}

.notice-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.notice-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#notice-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text2);
  animation: notice-marquee 20s linear infinite;
}

#notice-text:hover {
  animation-play-state: paused;
}

@keyframes notice-marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-180%);
  }
}

/* ===== Cards & Tables ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  position: relative;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  font-family: "Noto Sans SC", sans-serif;
  margin-bottom: 2px;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-header h2::after {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  flex-shrink: 0;
}

.page-header p {
  color: var(--text2);
  font-size: 14px;
  font-weight: 400;
}

/* ===== Stats Cards — Glass ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: all var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:hover {
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
  background: var(--glass-bg-strong);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: "Inter", "SF Mono", monospace;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-card .stat-hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.stat-card.accent-green::before {
  background: linear-gradient(90deg, var(--success), #34d399);
}
.stat-card.accent-warning::before {
  background: linear-gradient(90deg, var(--warning), #fcd34d);
}
.stat-card.accent-danger::before {
  background: linear-gradient(90deg, var(--danger), #fca5a5);
}
.stat-card.accent-green .stat-value {
  color: var(--success);
}
.stat-card.accent-warning .stat-value {
  color: #e17055;
}
.stat-card.accent-danger .stat-value {
  color: var(--danger);
}

/* ===== Card — Glass ===== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--glass-shadow-hover);
  background: var(--glass-bg-strong);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: rgba(248, 250, 252, 0.7);
  font-weight: 600;
  color: var(--text2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--border);
}

tr {
  transition: background var(--transition);
}

tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.4);
}
tbody tr:hover td {
  background: rgba(108, 92, 231, 0.04) !important;
}
tbody tr:last-child td {
  border-bottom: none;
}

#store-table-wrap,
#employee-table-wrap,
#plan-table-wrap,
#profit-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Buttons ===== */
.btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  filter: brightness(1.05);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  filter: brightness(1.05);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(108, 92, 231, 0.06);
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: rgba(248, 250, 252, 0.7);
  transition: all var(--transition);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group input::placeholder {
  color: var(--text3);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

/* ===== Badges ===== */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-success {
  background: var(--green-bg);
  color: #065f46;
}
.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
}
.badge-danger {
  background: var(--danger-bg);
  color: #991b1b;
}
.badge-info {
  background: var(--primary-bg);
  color: #4a3db8;
}
.badge-muted {
  background: #f1f5f9;
  color: #64748b;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-active {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.status-inactive {
  background: var(--text3);
}

/* ===== Modal — Glass ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 32px;
  width: 580px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--glass-border-strong);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.06);
  animation: modalIn 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h3 {
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 700;
  font-family: "Noto Sans SC", sans-serif;
}

.modal-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ===== Multi-Select Dropdown ===== */
.multi-select-btn:hover {
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text2);
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
  user-select: none;
  font-family: inherit;
}

.filter-tab:hover {
  background: var(--glass-bg);
  color: var(--text);
}
.filter-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

/* ===== Tags / Permissions ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  user-select: none;
  font-weight: 500;
  font-family: inherit;
  background: rgba(248, 250, 252, 0.8);
}

.tag:hover {
  border-color: var(--primary-light);
  background: var(--glass-bg);
}
.tag.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

/* ===== Drive ===== */
.drive-breadcrumb {
  padding: 8px 0 0 0;
  font-size: 13px;
  color: var(--text2);
}

.drive-breadcrumb-item {
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
  transition: color var(--transition);
}

.drive-breadcrumb-item:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.drive-breadcrumb-item.current {
  color: var(--text);
  cursor: default;
  font-weight: 600;
}
.drive-breadcrumb-item.current:hover {
  text-decoration: none;
}
.drive-breadcrumb-sep {
  color: var(--text3);
  margin: 0 6px;
}

.drive-folder-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
}

.drive-folder-tag {
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
  font-weight: 500;
}

.drive-folder-tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

.drive-folder-del {
  display: inline-block;
  margin-left: 6px;
  width: 18px;
  height: 18px;
  line-height: 17px;
  text-align: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  transition: all var(--transition);
  vertical-align: middle;
}

.drive-folder-del:hover {
  background: var(--danger);
  color: #fff;
}
.drive-folder-tag:hover .drive-folder-del {
  color: rgba(255, 255, 255, 0.7);
}
.drive-folder-tag:hover .drive-folder-del:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
}

/* ===== Misc ===== */
.empty-state {
  text-align: center;
  padding: 64px 40px;
  color: var(--text2);
}

.empty-state .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--primary-light);
  font-size: 28px;
  border: 1px solid var(--glass-border);
}

.empty-state p {
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

.empty-illustration {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto 16px;
  opacity: 0.25;
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
  overflow: hidden;
  min-width: 60px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

/* ===== Tab Buttons (commissions/kpi) ===== */
.comm-tab,
.kpi-tab {
  font-family: inherit;
  font-weight: 500;
  transition: all var(--transition);
}

.comm-tab.active,
.kpi-tab.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

/* ===== Pending Items ===== */
.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.pending-item:hover {
  background: var(--glass-bg);
}

.pending-item .pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
}

/* ===== Profit Detail Modal ===== */
.profit-cost-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.profit-cost-row:last-child {
  border-bottom: none;
}

.profit-total-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-weight: 700;
  font-size: 16px;
  border-top: 2px solid var(--border);
  margin-top: 4px;
}

/* ===== Section Divider ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 28px 0;
  border: none;
}

/* ===== Detail Label ===== */
.meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text3);
}

.number {
  font-family: "Inter", "SF Mono", monospace;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.text-right {
  text-align: right;
}
.text-success {
  color: var(--success);
  font-weight: 500;
}
.text-danger {
  color: var(--danger);
  font-weight: 500;
}
.mt-16 {
  margin-top: 16px;
}
.mb-16 {
  margin-bottom: 16px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text2);
}

/* ===== AI Chat Float Button — Glass ===== */
#ai-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(108, 92, 231, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.08);
  transition: all var(--transition);
}

#ai-float-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(108, 92, 231, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.1);
  background: var(--primary-dark);
}

#ai-float-btn:active {
  transform: translateY(0);
}

/* ===== AI Chat Panel — Glass ===== */
.ai-chat-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--glass-border-strong);
  display: flex;
  flex-direction: column;
  z-index: 998;
  animation: aiSlideIn 250ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ai-chat-panel:not(.open) {
  display: none;
}

@keyframes aiSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  background: var(--glass-bg-light);
  flex-shrink: 0;
}

.ai-chat-header span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-header .btn {
  font-size: 18px;
  padding: 2px 10px;
  line-height: 1;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.65;
  max-width: 88%;
  word-break: break-word;
}

.ai-msg-bot {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-msg-user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-msg-err {
  background: var(--danger-bg);
  color: var(--danger);
}

.ai-quick-qs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.ai-quick-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border-strong);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.ai-quick-btn:hover {
  background: var(--glass-bg-strong);
  border-color: var(--primary-light);
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-bg-light);
  flex-shrink: 0;
}

.ai-chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--glass-border-strong);
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--glass-bg);
  transition: all var(--transition);
}

.ai-chat-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ===== AI Loading Dot Pulse ===== */
.ai-dot-pulse {
  display: inline-block;
  width: 40px;
  height: 8px;
  position: relative;
}

.ai-dot-pulse::after {
  content: "•••";
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text3);
  animation: dotPulse 1.4s infinite;
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* ===== AI Chat Embedded ===== */
.ai-chat-embedded {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
  padding: 0;
  overflow: hidden;
}

.ai-chat-embedded .ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.ai-chat-embedded .ai-chat-input-row {
  padding: 14px 20px;
}
.ai-chat-embedded .ai-chat-input-row input {
  padding: 12px 16px;
  font-size: 14px;
}

/* ===== Employee Photo Cell ===== */
.emp-photo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-photo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  transition: all var(--transition);
}

.emp-photo-thumb:hover {
  transform: scale(1.15);
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.15);
}

.emp-photo-default {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  user-select: none;
  flex-shrink: 0;
}

.emp-photo-large {
  width: 72px;
  height: 72px;
  font-size: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  user-select: none;
}

/* 照片上传区域 */
.photo-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--glass-bg-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.photo-preview {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-hint {
  font-size: 11px;
  color: var(--text3);
  display: block;
  width: 100%;
  margin-top: 2px;
}

/* ===== Crop Modal ===== */
.crop-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 150ms ease;
}

.crop-modal {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  width: 520px;
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  animation: modalIn 250ms cubic-bezier(0.4,0,0.2,1);
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.crop-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  font-family: "Noto Sans SC", sans-serif;
}

.crop-ratio-toggle {
  display: flex;
  gap: 4px;
}

.crop-ratio-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--glass-bg-light);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all var(--transition);
}

.crop-ratio-btn:hover {
  background: var(--glass-bg);
  color: var(--text);
}
.crop-ratio-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.crop-container-wrap {
  width: 100%;
  max-height: 50vh;
  min-height: 260px;
  background: #f0f0f0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.crop-container-wrap img {
  display: block;
  max-width: 100%;
}

.crop-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-shrink: 0;
}

/* 移动端裁剪弹窗 */
@media (max-width: 768px) {
  .crop-modal {
    padding: 16px;
    border-radius: 16px;
    max-height: 95vh;
  }

  .crop-container-wrap {
    min-height: 220px;
    max-height: 40vh;
  }

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

  .crop-ratio-btn {
    padding: 3px 8px;
    font-size: 11px;
  }
}

/* ===== 树状通讯录 ===== */
.contacts-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}

.view-tabs {
  display: flex; gap: 4px; background: var(--glass-bg);
  border-radius: var(--radius-sm); padding: 3px; border: 1px solid var(--glass-border);
}

.view-tab {
  padding: 7px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none; background: transparent;
  color: var(--text2); transition: all var(--transition);
}
.view-tab:hover { color: var(--text); background: rgba(108,92,231,0.05); }
.view-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(108,92,231,0.2); }

.contacts-search-row { display: flex; gap: 8px; align-items: center; }
.contacts-search-input {
  width: 240px; padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 20px; font-size: 13px; font-family: inherit; outline: none;
  background: var(--glass-bg); transition: all var(--transition);
}
.contacts-search-input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
.contacts-filter-select {
  padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 12px; font-family: inherit; background: var(--glass-bg);
  color: var(--text2); cursor: pointer; outline: none;
}

/* 组织架构布局 */
.org-layout { display: flex; gap: 20px; min-height: 400px; }
.org-sidebar { width: 220px; flex-shrink: 0; }
.dept-tree {
  background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius); border: 1px solid var(--glass-border);
  padding: 8px 0; overflow-y: auto; max-height: 60vh;
}
.dept-tree-header {
  padding: 8px 16px 10px; font-size: 12px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-light); margin-bottom: 4px;
}

/* 真正的树节点 */
.dept-tree-node {
  display: flex; align-items: center; padding: 7px 12px; cursor: pointer;
  transition: all var(--transition); gap: 4px; font-size: 13px;
  border-left: 3px solid transparent; user-select: none;
}
.dept-tree-node:hover { background: rgba(108,92,231,0.05); }
.dept-tree-node.selected {
  background: rgba(108,92,231,0.1); color: var(--primary);
  font-weight: 600; border-left-color: var(--primary);
}
.dept-tree-arrow {
  width: 16px; font-size: 10px; color: var(--text3); flex-shrink: 0;
  transition: transform var(--transition); text-align: center; line-height: 1;
}
.dept-tree-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dept-tree-count {
  font-size: 11px; color: var(--text3); background: var(--glass-bg-light);
  border-radius: 10px; padding: 1px 8px; flex-shrink: 0;
}
.org-main { flex: 1; min-width: 0; }

/* 员工卡片网格 */
.emp-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px;
}
.emp-card {
  background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  padding: 16px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer;
  transition: all var(--transition);
}
.emp-card:hover {
  background: var(--glass-bg-strong); box-shadow: var(--glass-shadow-hover);
  transform: translateY(-1px); border-color: var(--primary-light);
}
.emp-card-inactive { opacity: 0.55; }
.emp-card-inactive:hover { opacity: 0.8; }
.emp-card-photo { flex-shrink: 0; width: 64px; height: 80px; position: relative; }
.emp-card-photo-img { width: 64px; height: 80px; border-radius: 8px; object-fit: cover; display: block; }
.emp-photo-placeholder {
  width: 64px; height: 80px; border-radius: 8px; background: #eef0f5;
  display: none; align-items: center; justify-content: center;
}
.emp-card-photo .emp-photo-placeholder:only-child { display: flex; }
.emp-photo-cell .emp-photo-placeholder { display: flex !important; }
.emp-card-body { flex: 1; min-width: 0; }
.emp-card-name {
  font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.emp-card-row {
  font-size: 12px; color: var(--text2); line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-card-meta {
  font-size: 11px; color: var(--text3); margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

/* 员工详情弹窗 */
.emp-detail-modal { max-width: 480px !important; }
.emp-detail-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.emp-detail-avatar { flex-shrink: 0; text-align: center; }
.emp-detail-photo { width: 80px; height: 100px; border-radius: 8px; object-fit: cover; }
.emp-detail-placeholder { width: 80px; height: 100px; border-radius: 8px; background: #eef0f5; display: flex; align-items: center; justify-content: center; }
.emp-detail-info { flex: 1; min-width: 200px; }
.emp-detail-name { font-size: 18px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.emp-detail-row { font-size: 13px; padding: 5px 0; display: flex; align-items: center; }
.emp-detail-label { display: inline-block; width: 48px; color: var(--text3); font-size: 12px; flex-shrink: 0; }
.emp-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ===== 驾驶舱 ===== */
.dash-welcome {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding: 20px 24px;
  background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius); border: 1px solid var(--glass-border);
  flex-wrap: wrap; gap: 12px;
}
.dash-welcome-greet { font-size: 20px; font-weight: 400; color: var(--text); }
.dash-welcome-greet strong { font-weight: 700; color: var(--primary); }
.dash-welcome-sub { font-size: 13px; color: var(--text2); margin-top: 2px; }
.dash-welcome-meta { font-size: 12px; color: var(--text3); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dash-welcome-sep { color: var(--border); }
.dash-month-input {
  padding: 8px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: #fff; cursor: pointer;
}
.dash-grid { display: flex; gap: 20px; }
.dash-main { flex: 1; min-width: 0; }
.dash-side { width: 300px; flex-shrink: 0; }
.dash-links { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.todo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.todo-link { margin-left: auto; cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 500; }
.todo-link:hover { text-decoration: underline; }
.todo-count { margin-left: auto; margin-right: 4px; font-weight: 700; font-size: 13px; color: var(--text); }
.dash-announcement { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.dash-ann-title { font-size: 13px; font-weight: 500; color: var(--text); }
.dash-ann-date { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* 移动端 */
@media (max-width: 768px) {
  .dash-grid { flex-direction: column; }
  .dash-side { width: 100%; }
  .dash-welcome { padding: 14px 16px; }
  .dash-welcome-greet { font-size: 17px; }
}

/* ===== 发票预览 ===== */
.ocr-preview { background: var(--glass-bg-light); border-radius: var(--radius-sm); padding: 8px; }

/* ===== 审批筛选 ===== */
.approval-filter-card {
  margin-bottom: 12px;
  padding: 14px 16px;
}
.approval-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.approval-search-input {
  min-width: 260px;
  flex: 1;
}
.approval-filter-count {
  margin-left: auto;
  color: var(--text3);
  font-size: 12px;
  white-space: nowrap;
}
.approval-person-list {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.approval-person-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.approval-person-chip span {
  margin-left: 4px;
  color: var(--text3);
}
.approval-person-chip.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}
.approval-person-chip.active span {
  color: var(--primary);
}

/* ===== 发票卡片 ===== */
.inv-month-group { margin-bottom: 20px; }
.inv-month-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-light); }
.inv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.inv-card {
  background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-sm); border: 1px solid var(--glass-border); padding: 14px 16px;
  transition: all var(--transition);
}
.inv-card:hover { background: var(--glass-bg-strong); box-shadow: var(--glass-shadow-hover); }
.inv-card-row { font-size: 13px; line-height: 1.6; }
@media (max-width: 768px) { .inv-cards { grid-template-columns: 1fr; } }

/* ===== OA 快捷卡片 ===== */
.oa-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.oa-shortcut-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.oa-shortcut-card:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-1px);
  border-color: var(--primary-light);
}
.oa-shortcut-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.oa-shortcut-text { flex: 1; min-width: 0; }
.oa-shortcut-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.oa-shortcut-desc { font-size: 12px; color: var(--text3); }
.oa-shortcut-count {
  font-size: 24px; font-weight: 700; color: var(--primary);
  font-family: "Inter", monospace;
}
.oa-shortcut-detail {
  font-size: 11px; color: var(--text3);
  grid-column: 2 / -1;
}

/* OA 表格优化 */
.oa-table th { font-size: 12px; letter-spacing: 0.4px; }
.oa-table td { padding: 10px 14px; }

/* 移动端 */
@media (max-width: 768px) {
  .oa-shortcut-grid { grid-template-columns: 1fr; gap: 10px; }
  .oa-shortcut-card { padding: 14px 16px; }
  .oa-shortcut-count { font-size: 20px; }
}

/* ===== 批量发票 ===== */
.batch-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; background: var(--glass-bg); }
.batch-item-header { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.batch-status { font-size: 12px; white-space: nowrap; }
.batch-ocr-info { font-size: 11px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.batch-item-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.batch-item-fields select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit; }
.batch-item-fields input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit; }
.batch-submitted { opacity: 0.5; pointer-events: none; }

/* ===== 消息中心 ===== */
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background var(--transition); }
.notif-item:hover { background: rgba(108,92,231,0.04); }
.notif-unread { background: rgba(108,92,231,0.03); }
.notif-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.notif-content { font-size: 12px; color: var(--text2); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 4px; display: flex; gap: 8px; }
.notif-mark-read { color: var(--primary); cursor: pointer; font-size: 11px; }
.notif-mark-read:hover { text-decoration: underline; }

/* ===== Mobile Menu Toggle ===== */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 110;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all var(--transition);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  #main-page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100vh;
    overflow-y: auto;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
  }

  .sidebar.open {
    transform: translateY(0);
  }

  .sidebar-header {
    padding: 18px 16px 14px;
    flex-shrink: 0;
  }
  .sidebar-header h2 {
    font-size: 15px;
  }
  .sidebar-logo {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
  }

  .nav-menu {
    padding: 6px 12px;
    flex: 1;
  }
  .nav-menu li a {
    padding: 10px 12px;
    font-size: 13px;
  }

  .sidebar-footer {
    padding: 12px 16px;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* 移动端菜单分组标签 */
  .nav-group-label {
    padding: 14px 14px 4px;
    font-size: 10px;
  }

  .content {
    margin-left: 0;
    padding: 56px 12px 24px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .page-header h2 {
    font-size: 18px;
  }
  .page-header h2::after {
    display: none;
  }

  .card {
    padding: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 表格移动端横向滚动 */
  #employee-table-wrap,
  #store-table-wrap,
  #plan-table-wrap,
  #profit-table-wrap,
  #salary-table-wrap,
  #dept-table-wrap,
  #comm-table-wrap,
  #kpi-table-wrap,
  #log-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 12px;
    min-width: 650px;
  }
  th,
  td {
    padding: 8px 6px;
  }
  th {
    font-size: 10px;
    letter-spacing: 0.3px;
  }

  .btn-group {
    flex-wrap: wrap;
  }
  .btn {
    font-size: 12px;
    padding: 6px 12px;
  }
  .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
  }

  .modal {
    width: 95vw;
    padding: 20px 16px;
    max-height: 90vh;
    border-radius: 18px;
  }
  .modal h3 {
    font-size: 16px;
    margin-bottom: 14px;
  }
  .modal-btns {
    flex-wrap: wrap;
  }

  /* 移动端照片上传区域 */
  .photo-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
  }

  .photo-actions {
    width: 100%;
  }

  /* 移动端侧边栏用户卡片 */
  .sidebar-user-card {
    gap: 10px;
  }

  .sidebar-user-avatar {
    width: 36px;
    height: 36px;
  }

  .sidebar-user-avatar-default {
    font-size: 15px;
  }

  /* 移动端员工照片缩略图 */
  .emp-photo-cell {
    width: 32px;
    height: 32px;
  }

  .emp-photo-thumb {
    width: 30px;
    height: 30px;
  }

  .emp-photo-default {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .login-container {
    flex-direction: column;
    min-height: auto;
    max-width: 100vw;
    border-radius: 20px;
  }
  .login-illustration {
    flex: 0 0 auto;
    padding: 24px 20px;
    max-height: 160px;
  }
  .login-illustration svg {
    max-width: 260px;
  }
  .login-form-side {
    flex: 0 0 auto;
    padding: 24px 24px 32px;
  }
  .login-form-side h1 {
    font-size: 22px;
  }
  .login-form-side .sub {
    margin-bottom: 24px;
    font-size: 13px;
  }
  .login-logo {
    width: 44px;
    margin-bottom: 12px;
  }
  .input-wrap input {
    padding: 12px 12px 12px 38px;
    font-size: 13px;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .tab {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card {
    padding: 14px 16px;
  }
  .stat-card .stat-value {
    font-size: 22px;
  }
  .progress-bar {
    min-width: 40px;
  }
  .comm-tab,
  .kpi-tab {
    font-size: 12px;
    padding: 4px 10px;
  }
  .profit-cost-row {
    font-size: 12px;
  }
  .profit-total-row {
    font-size: 14px;
  }

  /* AI 悬浮按钮移动端：不遮挡底部操作 */
  #ai-float-btn {
    width: 44px;
    height: 44px;
    bottom: 16px;
    right: 16px;
    z-index: 990;
  }

  .ai-chat-panel {
    width: calc(100vw - 16px);
    max-width: 100vw;
    height: 80vh;
    max-height: 80vh;
    bottom: 72px;
    right: 8px;
    left: 8px;
  }

  .ai-msg {
    max-width: 92%;
    font-size: 13px;
  }

  .ai-chat-embedded {
    height: calc(100vh - 160px);
    min-height: 300px;
  }
}

/* 小屏手机适配 (390px 宽度) */
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .btn-group { flex-wrap: wrap; gap: 4px; }
  .content {
    padding: 52px 10px 20px;
  }

  .card {
    padding: 12px;
    border-radius: var(--radius-sm);
  }

  table {
    font-size: 11px;
    min-width: 580px;
  }
  th,
  td {
    padding: 6px 4px;
  }

  .page-header h2 {
    font-size: 16px;
  }

  .btn {
    font-size: 11px;
    padding: 5px 10px;
  }
  .btn-sm {
    padding: 3px 6px;
    font-size: 10px;
  }

  .badge {
    font-size: 10px;
    padding: 3px 6px;
  }

  /* 欢迎栏移动端 */
  .welcome-bar {
    padding: 10px 12px;
    gap: 8px;
    margin-bottom: 10px;
    flex-direction: column;
    align-items: flex-start;
  }
  .welcome-greeting { font-size: 14px; }
  .welcome-date { font-size: 12px; }
  .welcome-entry { font-size: 11px; margin-left: 0; }

  /* 空状态引导移动端 */
  .empty-guide { padding: 32px 14px; }
  .empty-guide p { font-size: 14px; }
  .empty-guide-hint { font-size: 12px !important; }
  .empty-guide-actions { flex-direction: column; align-items: center; }

  .notice-bar {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .notice-label {
    font-size: 12px;
  }

  #notice-text {
    font-size: 11px;
    animation: none;
    white-space: normal;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }
  .stat-card .stat-value {
    font-size: 18px;
  }
  .stat-card .stat-label {
    font-size: 10px;
  }

  .sidebar {
    width: 100%;
  }

  /* 侧边栏用户卡片移动端 */
  .sidebar-user-card {
    gap: 8px;
  }
  .sidebar-user-avatar {
    width: 32px;
    height: 32px;
  }
  .sidebar-user-name {
    font-size: 13px;
  }

  /* 通讯录移动端：部门树 → 横向标签滚动 */
  .org-layout { flex-direction: column; }
  .org-sidebar { width: 100%; }
  .dept-tree {
    max-height: none; display: flex; flex-wrap: nowrap; overflow-x: auto;
    overflow-y: hidden; white-space: nowrap; gap: 0; flex-direction: row;
    padding: 4px 8px; border-radius: var(--radius-sm);
  }
  .dept-tree-header { display: none; }
  .dept-tree-node {
    flex-shrink: 0; font-size: 12px; padding: 6px 12px;
    border-left: none; border-bottom: 2px solid transparent;
  }
  .dept-tree-node.selected { border-left: none; border-bottom-color: var(--primary); }
  .dept-tree-count { display: none; }
  .dept-tree-arrow { display: none; }
  .emp-cards-grid { grid-template-columns: 1fr; gap: 8px; }
  .emp-card { padding: 12px; gap: 10px; }
  .emp-card-photo { width: 48px; height: 60px; }
  .emp-card-photo-img { width: 48px; height: 60px; }
  .emp-photo-placeholder { width: 48px; height: 60px; }
  .contacts-toolbar { flex-direction: column; align-items: stretch; }
  .contacts-search-input { flex: 1; width: auto; }
  .contacts-search-row { flex: 1; }
  .emp-detail-modal { padding: 20px 16px !important; max-height: 90vh; }
  .emp-detail-layout { gap: 12px; }
  .emp-detail-actions { width: 100%; }
}

/* ===== 工资条卡片 ===== */
.payslip-card {
  padding: 20px;
}
.payslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.payslip-memo {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 12px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.025);
  border-radius: 6px;
}
.payslip-section {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0,0,0,0.012);
}
.payslip-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.payslip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 13px;
}
.payslip-subtotal {
  border-top: 1px solid var(--border-light);
  margin-top: 3px;
  padding-top: 6px;
  font-weight: 600;
}
.payslip-na {
  color: var(--text3);
  font-size: 12px;
}

.salary-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.salary-status-tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.salary-status-tab span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--card-alt);
  color: var(--text3);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.salary-status-tab:hover,
.salary-status-tab.active {
  color: var(--primary);
  border-color: rgba(108, 92, 231, 0.28);
  background: var(--primary-bg);
}

.salary-status-tab.active span {
  background: var(--primary);
  color: #fff;
}

.salary-dispute-box {
  margin: 8px 0 4px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 107, 107, 0.24);
  border-radius: 8px;
  background: var(--danger-bg);
  color: #b42318;
  font-size: 12px;
  line-height: 1.6;
}
