/* ===================================================
   武汉市远辰智联游戏科技有限公司 人员管理系统
   全局样式 — 现代深色不对称设计
=================================================== */

:root {
  /* 主色 */
  --primary:        #1a6fc4;
  --primary-dark:   #0f5099;
  --primary-light:  #3b8fd8;
  --accent:         #e85d26;
  --accent2:        #18a87e;

  /* 背景层次 */
  --bg-dark:        #0d1b2a;
  --bg-panel:       #132338;
  --bg-card:        #1a2f46;
  --bg-sidebar:     #0f1e2f;
  --bg-page:        #0d1b2a;

  /* 文字 */
  --text:           #e8edf3;
  --text-main:      #e8edf3;
  --text-sub:       #8fa8c0;
  --text-muted:     #5a7a94;

  /* 边框 */
  --border:         #1e3550;
  --border-light:   #264460;

  /* 语义色 */
  --success:        #18a87e;
  --warning:        #e8a020;
  --danger:         #d63b3b;
  --info:           #1a6fc4;

  /* 阴影 */
  --shadow-sm:  0 2px 8px  rgba(0,0,0,.28);
  --shadow-md:  0 4px 20px rgba(0,0,0,.38);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.48);

  /* 结构 */
  --radius:     0px;
  --sidebar-w:  240px;
  --header-h:   56px;
  --font:       'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { color: #fff; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: var(--bg-panel); }
::-webkit-scrollbar-thumb    { background: var(--border-light); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ======================================================
   LOGIN PAGE
====================================================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0d1b2a 0%, #0f2540 45%, #102038 100%);
  position: relative;
  overflow: hidden;
}
.login-bg-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.login-bg-shapes::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 520px; height: 520px;
  background: linear-gradient(135deg, rgba(26,111,196,.18), rgba(232,93,38,.08));
  clip-path: polygon(20% 0%, 100% 0%, 100% 80%, 60% 100%, 0% 70%);
}
.login-bg-shapes::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -40px;
  width: 340px; height: 340px;
  background: linear-gradient(225deg, rgba(24,168,126,.12), rgba(26,111,196,.10));
  clip-path: polygon(0 30%, 70% 0%, 100% 60%, 40% 100%);
}
/* 装饰线条 */
.login-bg-shapes .line1,
.login-bg-shapes .line2 {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(26,111,196,.15), transparent);
  height: 1px; width: 100%;
}
.login-bg-shapes .line1 { top: 35%; }
.login-bg-shapes .line2 { top: 65%; }

.login-left {
  width: 54%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 72px;
  position: relative; z-index: 1;
}
.login-right {
  width: 46%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  position: relative; z-index: 1;
  background: rgba(15,30,47,.35);
  border-left: 1px solid rgba(38,68,96,.6);
}

/* 品牌区 */
.login-brand { margin-bottom: 52px; }
.login-brand .brand-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-brand .brand-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: #fff;
  clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 100%, 15% 100%, 0 85%);
}
.login-brand .brand-name         { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.3; }
.login-brand .brand-name span    { display: block; font-size: 12px; font-weight: 400; color: var(--text-sub); margin-top: 2px; }
.login-headline                  { font-size: 40px; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 16px; letter-spacing: -.5px; }
.login-headline em               { font-style: normal; color: var(--primary-light); }
.login-desc                      { color: var(--text-sub); font-size: 14px; line-height: 1.85; max-width: 400px; }
.login-features                  { margin-top: 44px; display: flex; flex-direction: column; gap: 14px; }
.login-feature-item              { display: flex; align-items: center; gap: 10px; color: var(--text-sub); font-size: 13px; }
.login-feature-item .dot         { width: 6px; height: 6px; background: var(--primary-light); flex-shrink: 0; }
.login-feature-item .feat-label  { color: var(--text-main); font-weight: 500; }

/* 装饰统计 */
.login-stat-row { display: flex; gap: 28px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.login-stat-item { text-align: center; }
.login-stat-num  { font-size: 22px; font-weight: 800; color: var(--primary-light); line-height: 1; margin-bottom: 4px; }
.login-stat-lbl  { font-size: 11px; color: var(--text-muted); }

/* 登录卡片 */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 44px 42px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent2));
}
.login-card-header { margin-bottom: 30px; }
.login-card-title  { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.login-card-sub    { color: var(--text-sub); font-size: 13px; }

.login-divider { display: flex; align-items: center; gap: 10px; margin: 24px 0; }
.login-divider-line { flex: 1; height: 1px; background: var(--border); }
.login-divider-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.login-footer { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-muted); }
.login-footer a { color: var(--primary-light); }

/* 系统版权行 */
.login-copyright {
  position: fixed; bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(13,27,42,.8);
  border-top: 1px solid rgba(30,53,80,.6);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.login-copyright a { color: var(--primary-light); font-weight: 500; }
.login-copyright a:hover { color: #fff; }

/* ======================================================
   FORM CONTROLS
====================================================== */
.form-group  { margin-bottom: 18px; }
.form-label  {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-sub); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .5px;
}
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 14px; font-family: var(--font);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  border-radius: 0 !important;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus          { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,111,196,.18); }
.form-control::placeholder   { color: var(--text-muted); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238fa8c0' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
select.form-control option { background: var(--bg-panel); color: var(--text-main); }
textarea.form-control { resize: vertical; min-height: 90px; }
input[type="date"].form-control,
input[type="month"].form-control { color-scheme: dark; }

/* 输入框图标前缀 */
.input-wrap          { position: relative; }
.input-wrap .form-control { padding-left: 38px; }
.input-icon          {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ======================================================
   BUTTONS
====================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  border: 1px solid transparent; outline: none;
  transition: all .18s; white-space: nowrap;
  border-radius: 0 !important; text-decoration: none;
  user-select: none;
}
.btn:active           { transform: translateY(1px); }
.btn-primary          { background: var(--primary);   border-color: var(--primary);   color: #fff; }
.btn-primary:hover    { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-accent           { background: var(--accent);    border-color: var(--accent);    color: #fff; }
.btn-accent:hover     { background: #c94d1c;          border-color: #c94d1c;          color: #fff; }
.btn-success          { background: var(--success);   border-color: var(--success);   color: #fff; }
.btn-success:hover    { background: #138a67;          border-color: #138a67;          color: #fff; }
.btn-warning          { background: var(--warning);   border-color: var(--warning);   color: #fff; }
.btn-warning:hover    { background: #c47d10;          color: #fff; }
.btn-danger           { background: var(--danger);    border-color: var(--danger);    color: #fff; }
.btn-danger:hover     { background: #b02020;          border-color: #b02020;          color: #fff; }
.btn-outline          { background: transparent;      border-color: var(--border-light); color: var(--text-sub); }
.btn-outline:hover    { border-color: var(--primary); color: var(--primary-light); }
.btn-sm               { padding: 5px 12px; font-size: 12px; }
.btn-lg               { padding: 12px 28px; font-size: 15px; }
.btn-full             { width: 100%; justify-content: center; }
.btn-icon             { padding: 7px 10px; }

/* ======================================================
   LAYOUT
====================================================== */
.app-layout { display: flex; min-height: 100vh; }

/* ======================================================
   SIDEBAR
====================================================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto; overflow-x: hidden;
  transition: width .2s;
}
.sidebar-header {
  padding: 0 16px; height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 10px;
}
.sidebar-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff; flex-shrink: 0;
  clip-path: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 18% 100%, 0 82%);
}
.sidebar-title          { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }
.sidebar-title span     { display: block; font-size: 10px; font-weight: 400; color: var(--text-muted); }
.sidebar-nav            { flex: 1; padding: 12px 0; }
.nav-group              { margin-bottom: 4px; }
.nav-group-label        { padding: 10px 20px 4px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 20px; color: var(--text-sub); font-size: 13px;
  cursor: pointer; transition: all .15s; position: relative;
  border-left: 3px solid transparent; text-decoration: none;
}
.nav-item:hover           { background: rgba(26,111,196,.10); color: var(--text-main); border-left-color: var(--primary-light); }
.nav-item.active          { background: rgba(26,111,196,.15); color: var(--primary-light); border-left-color: var(--primary); font-weight: 600; }
.nav-item .nav-icon       { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-badge      { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; min-width: 18px; text-align: center; }
.nav-parent-arrow         { margin-left: auto; font-size: 10px; transition: transform .2s; color: var(--text-muted); }
.nav-parent.open .nav-parent-arrow { transform: rotate(90deg); }

/* ======================================================
   HEADER
====================================================== */
.main-header {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  background: rgba(13,27,42,.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30,53,80,.65);
  z-index: 90; display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
}
.header-title       { font-size: 15px; font-weight: 700; color: #fff; }
.header-breadcrumb  { font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.header-spacer      { flex: 1; }
.header-actions     { display: flex; align-items: center; gap: 12px; }
.header-notif {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sub); cursor: pointer; transition: color .15s;
}
.header-notif:hover          { color: #fff; }
.header-notif .badge         { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--accent); border-radius: 0; }
.header-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 10px; transition: background .15s;
}
.header-user:hover       { background: rgba(255,255,255,.05); }
.header-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 20% 100%, 0 80%);
}
.header-user-name  { font-size: 13px; font-weight: 600; color: var(--text-main); }
.header-user-role  { font-size: 11px; color: var(--text-muted); }

/* ======================================================
   MAIN CONTENT
====================================================== */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column;
}
.page-body { flex: 1; padding: 24px; }

/* ======================================================
   PAGE HEADER
====================================================== */
.page-header         { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-header-left    {}
.page-title          { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.page-subtitle       { font-size: 12px; color: var(--text-muted); }
.page-header-right   { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ======================================================
   CARDS
====================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 14px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before { content: ''; width: 3px; height: 14px; background: var(--primary); display: block; }

/* ======================================================
   STAT CARDS
====================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 22px 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--stat-color, var(--primary));
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 60px; height: 60px;
  background: var(--stat-color, var(--primary));
  opacity: .07;
  clip-path: polygon(30% 0%, 100% 0%, 100% 70%);
}
.stat-card-label  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.stat-card-value  { font-size: 32px; font-weight: 800; color: var(--stat-color, var(--primary-light)); line-height: 1; margin-bottom: 10px; }
.stat-card-trend  { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* Mini stat cards (工具栏内统计) */
.stat-cards-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-card-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-width: 90px;
  position: relative;
  overflow: hidden;
}
.stat-card-mini::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
}
.stat-card-mini.warning::before  { background: var(--warning, #f59e0b); }
.stat-card-mini.success::before  { background: var(--success, #10b981); }
.stat-card-mini.danger::before   { background: var(--danger,  #ef4444); }
.stat-card-mini.primary::before  { background: var(--primary, #3b82f6); }
.scm-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.stat-card-mini.warning .scm-num { color: var(--warning, #f59e0b); }
.stat-card-mini.success .scm-num { color: var(--success, #10b981); }
.stat-card-mini.danger  .scm-num { color: var(--danger,  #ef4444); }
.stat-card-mini.primary .scm-num { color: var(--primary, #3b82f6); }
.scm-label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ======================================================
   QUICK ACTION GRID (首页)
====================================================== */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 18px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-sub); font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: all .18s;
}
.quick-item:hover {
  background: rgba(26,111,196,.14);
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.quick-item-icon {
  width: 36px; height: 36px;
  background: rgba(26,111,196,.12);
  border: 1px solid rgba(26,111,196,.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-light);
}

/* ======================================================
   TABLE
====================================================== */
.table-wrap   { width: 100%; overflow-x: auto; }
.data-table   { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { background: var(--bg-panel); }
.data-table th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-main); vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(26,111,196,.06); }
.data-table .actions       { display: flex; gap: 5px; flex-wrap: nowrap; }

/* ======================================================
   BADGES
====================================================== */
.badge         { display: inline-block; padding: 3px 10px; font-size: 11px; font-weight: 600; border-radius: 0 !important; }
.badge-success { background: rgba(24,168,126,.15);  color: var(--success);       border: 1px solid rgba(24,168,126,.3); }
.badge-warning { background: rgba(232,160,32,.15);  color: var(--warning);       border: 1px solid rgba(232,160,32,.3); }
.badge-danger  { background: rgba(214,59,59,.15);   color: var(--danger);        border: 1px solid rgba(214,59,59,.3); }
.badge-info    { background: rgba(26,111,196,.15);  color: var(--primary-light); border: 1px solid rgba(26,111,196,.3); }
.badge-default { background: rgba(90,122,148,.15);  color: var(--text-sub);      border: 1px solid var(--border); }
.badge-accent  { background: rgba(232,93,38,.15);   color: var(--accent);        border: 1px solid rgba(232,93,38,.3); }

/* ======================================================
   FILTER BAR
====================================================== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 14px 18px;
}
.filter-bar .form-control { width: auto; min-width: 160px; padding: 7px 12px; font-size: 13px; }

/* ======================================================
   PAGINATION
====================================================== */
.pagination       { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 14px 0 2px; flex-wrap: wrap; }
.pagination-info  { font-size: 12px; color: var(--text-muted); margin-right: 8px; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-sub); cursor: pointer; font-size: 12px;
  transition: all .15s; border-radius: 0 !important;
}
.page-btn:hover       { border-color: var(--primary); color: var(--primary-light); }
.page-btn.active      { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled    { opacity: .4; cursor: default; }

/* ======================================================
   MODAL
====================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.68);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); position: relative;
  transform: translateY(20px); transition: transform .2s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-box.modal-lg { max-width: 860px; }
.modal-box.modal-sm { max-width: 440px; }
.modal-box.modal-xl { max-width: 1100px; }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-title  { font-size: 15px; font-weight: 700; color: #fff; }
.modal-close  {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-sub); cursor: pointer; transition: all .15s;
  font-size: 16px; border-radius: 0 !important;
}
.modal-close:hover  { border-color: var(--danger); color: var(--danger); }
.modal-body         { padding: 24px; }
.modal-footer       { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ======================================================
   FORM LAYOUT
====================================================== */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full  { grid-column: 1/-1; }

/* ======================================================
   TABS
====================================================== */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-sub); cursor: pointer; border: none;
  background: transparent; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s; font-family: var(--font);
}
.tab-btn:hover         { color: var(--text-main); }
.tab-btn.active        { color: var(--primary-light); border-bottom-color: var(--primary); }
.tab-panel             { display: none; }
.tab-panel.active      { display: block; }

/* ======================================================
   ALERTS
====================================================== */
.alert {
  padding: 12px 16px; border-left: 3px solid; margin-bottom: 14px;
  font-size: 13px; display: flex; align-items: center; gap: 10px;
  border-radius: 0 !important;
}
.alert-success { background: rgba(24,168,126,.10);  border-color: var(--success); color: #5ecba5; }
.alert-warning { background: rgba(232,160,32,.10);  border-color: var(--warning); color: #f0b93a; }
.alert-danger  { background: rgba(214,59,59,.10);   border-color: var(--danger);  color: #e87474; }
.alert-info    { background: rgba(26,111,196,.10);  border-color: var(--primary); color: #6ab0e8; }

/* ======================================================
   DROPDOWN
====================================================== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0;
  min-width: 160px; background: var(--bg-panel);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md); z-index: 300;
  display: none; animation: slideDown .15s ease;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; color: var(--text-sub); font-size: 13px;
  background: transparent; border: none; cursor: pointer;
  width: 100%; text-align: left; font-family: var(--font);
  transition: all .12s; text-decoration: none; border-radius: 0 !important;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: rgba(26,111,196,.12); color: var(--text-main); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ======================================================
   FOOTER — 现代化增强
====================================================== */
.main-footer {
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  padding: 0;
}
.footer-inner {
  display: flex; align-items: stretch;
  flex-wrap: wrap;
}
.footer-main {
  flex: 1; padding: 16px 24px;
  border-right: 1px solid var(--border);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px; margin-right: 8px;
}
.footer-brand-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  clip-path: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 18% 100%, 0 82%);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.footer-brand-name { font-size: 12px; font-weight: 700; color: var(--text-sub); }
.footer-sep        { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.footer-copy       { font-size: 11px; color: var(--text-muted); line-height: 1.7; }
.footer-copy a     { color: var(--primary-light); font-weight: 600; transition: color .15s; }
.footer-copy a:hover { color: #fff; }
.footer-right {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; flex-shrink: 0;
}
.footer-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.footer-status-dot { width: 6px; height: 6px; background: var(--success); flex-shrink: 0; }
.footer-version {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 3px 10px;
}

/* ======================================================
   PRINT
====================================================== */
@media print {
  .sidebar, .main-header, .main-footer, .no-print { display: none !important; }
  .main-content { margin: 0 !important; }
  .page-body { padding: 0 !important; }
}

/* ======================================================
   TOAST
====================================================== */
.toast-wrap {
  position: fixed; top: 68px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  padding: 12px 18px; min-width: 260px; max-width: 360px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: flex-start; gap: 10px;
  pointer-events: auto;
  animation: toastIn .2s ease;
  font-size: 13px; color: var(--text-main);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-error   { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ======================================================
   LOADING
====================================================== */
.loading-spin {
  width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================
   EMPTY STATE
====================================================== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 12px; opacity: .4; }
.empty-state p   { font-size: 13px; }

/* ======================================================
   UTILITIES
====================================================== */
.section-divider { height: 1px; background: linear-gradient(90deg, var(--primary), transparent); margin: 20px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px;  } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px;   } .mt-12 { margin-top: 12px;  } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px;} .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.text-center  { text-align: center; } .text-right { text-align: right; }
.text-muted   { color: var(--text-muted); } .text-sub { color: var(--text-sub); } .text-white { color: #fff; }
.text-primary { color: var(--primary-light); } .text-success { color: var(--success); }
.text-warning { color: var(--warning); } .text-danger { color: var(--danger); } .text-accent { color: var(--accent); }
.font-bold { font-weight: 700; } .font-sm { font-size: 12px; }
.w-full { width: 100%; } .hidden { display: none !important; }

/* ======================================================
   CHECKBOX / RADIO
====================================================== */
.custom-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-sub); }
.custom-check input[type="checkbox"],
.custom-check input[type="radio"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; border-radius: 0 !important; }

/* ======================================================
   PROGRESS
====================================================== */
.progress-bar  { height: 6px; background: var(--bg-panel); border: 1px solid var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width .4s; }

/* ======================================================
   DETAIL INFO
====================================================== */
.detail-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 0; }
.detail-item  { padding: 12px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.detail-item:last-child { border-right: none; }
.detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.detail-value { font-size: 14px; color: var(--text-main); font-weight: 500; }

/* ======================================================
   STEP INDICATOR
====================================================== */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }
.step  { flex: 1; text-align: center; position: relative; }
.step::after { content: ''; position: absolute; top: 14px; left: 50%; width: 100%; height: 1px; background: var(--border); }
.step:last-child::after { display: none; }
.step-circle {
  width: 28px; height: 28px; background: var(--bg-panel); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin: 0 auto 6px; position: relative; z-index: 1;
}
.step.done .step-circle   { background: var(--success); border-color: var(--success); color: #fff; }
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-label               { font-size: 11px; color: var(--text-muted); }
.step.active .step-label  { color: var(--primary-light); }

/* ======================================================
   SIDEBAR BOTTOM STAT
====================================================== */
.sidebar-stat      { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-stat-dot  { width: 8px; height: 8px; background: var(--success); flex-shrink: 0; }
.sidebar-stat-text { font-size: 11px; color: var(--text-muted); }

/* ======================================================
   NOTICE BANNER
====================================================== */
.notice-bar {
  background: rgba(26,111,196,.12); border: 1px solid rgba(26,111,196,.25);
  border-left: 3px solid var(--primary); padding: 10px 16px;
  font-size: 12px; color: var(--text-sub); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ======================================================
   ORG TREE
====================================================== */
.org-tree { overflow-x: auto; padding-bottom: 12px; }
.org-node { display: inline-block; text-align: center; padding: 4px 8px; }
.org-node-box {
  display: inline-block; background: var(--bg-panel);
  border: 1px solid var(--border-light); padding: 10px 18px;
  font-size: 13px; color: var(--text-main); position: relative;
  cursor: pointer; transition: all .15s; min-width: 100px;
}
.org-node-box:hover  { border-color: var(--primary); color: var(--primary-light); }
.org-node-box.root   { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ======================================================
   CALENDAR GRID
====================================================== */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; border: 1px solid transparent;
  transition: all .12s; color: var(--text-sub);
}
.cal-cell:hover   { border-color: var(--primary); color: var(--primary-light); }
.cal-cell.today   { background: var(--primary); color: #fff; }
.cal-cell.marked  { border-color: var(--accent); color: var(--accent); }
.cal-cell.off     { color: var(--text-muted); }

/* ======================================================
   ICON HELPERS
====================================================== */
.icon-sm { width: 14px; height: 14px; display: inline-block; vertical-align: middle; }
.icon-md { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }

/* ======================================================
   STATUS DOT
====================================================== */
.status-dot         { width: 7px; height: 7px; display: inline-block; margin-right: 5px; }
.status-dot.online  { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.warning { background: var(--warning); }

/* ======================================================
   UPLOAD AREA
====================================================== */
.upload-area {
  border: 2px dashed var(--border-light); padding: 32px;
  text-align: center; cursor: pointer; color: var(--text-muted);
  font-size: 13px; transition: border-color .15s;
}
.upload-area:hover { border-color: var(--primary); color: var(--primary-light); }

/* ======================================================
   CHART AREA
====================================================== */
.chart-area {
  width: 100%; height: 280px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px;
}

/* ======================================================
   RESPONSIVE
====================================================== */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar        { transform: translateX(-240px); }
  .sidebar.open   { transform: translateX(0); width: 240px; }
  .main-header    { left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .login-left     { display: none; }
  .login-right    { width: 100%; }
  .footer-sep     { display: none; }
}
