/* 兼职记账 · 管理后台样式（青色现代风） */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2ac0cb;
  --primary-dark: #1ea6b2;
  --primary-light: #e4f6f8;
  --bg: #f4f6fa;
  --sidebar-bg: #333a4d;
  --sidebar-text: #b8c0d0;
  --sidebar-active: #2ac0cb;
  --text: #2b2f3a;
  --muted: #8a94a6;
  --border: #e8ecf2;
  --card: #ffffff;
  --danger: #fa5151;
  --success: #2bb673;
  --warning: #f59e0b;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  transition: width .22s ease;
}
.sidebar .logo { padding: 20px; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .5px; border-bottom: 1px solid rgba(255,255,255,.06); position: relative; white-space: nowrap; transition: padding .22s ease; }
.sidebar .logo::before {
  content: ''; display: inline-block; width: 8px; height: 18px; margin-right: 10px; vertical-align: -3px;
  border-radius: 4px; background: linear-gradient(180deg, #5bd6de, #2ac0cb);
  box-shadow: 0 0 8px rgba(42,192,203,.55);
}
.sidebar .menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar .menu a {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--sidebar-text); font-size: 14px;
  border-left: 3px solid transparent; transition: all .15s;
}
.sidebar .menu .menu-icon {
  width: 18px; height: 18px; flex: 0 0 18px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  opacity: .85; transition: all .15s;
}
.sidebar .menu a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; padding-left: 24px; }
.sidebar .menu a:hover .menu-icon { opacity: 1; }
.sidebar .menu a.active { background: rgba(42,192,203,.14); color: #fff; border-left-color: var(--sidebar-active); }
.sidebar .menu a.active .menu-icon { opacity: 1; stroke-width: 1.9; filter: drop-shadow(0 0 4px rgba(42,192,203,.6)); }
.sidebar .foot { padding: 16px 20px; font-size: 12px; color: #767f92; border-top: 1px solid rgba(255,255,255,.06); white-space: nowrap; transition: padding .22s ease; }

/* 折叠按钮 */
.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: #4a5262; cursor: pointer; transition: all .15s; flex: 0 0 34px;
}
.sidebar-toggle:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px rgba(42,192,203,.12); }

/* 折叠态：只显示图标 */
html.sb-collapsed .sidebar { width: 64px; }
html.sb-collapsed .sidebar .logo { padding: 20px 0; font-size: 0; text-align: center; }
html.sb-collapsed .sidebar .logo::before { margin-right: 0; }
html.sb-collapsed .sidebar .menu a { justify-content: center; padding: 12px 0; gap: 0; }
html.sb-collapsed .sidebar .menu a:hover { padding-left: 0; }
html.sb-collapsed .sidebar .menu-text { display: none; }
html.sb-collapsed .sidebar .foot { padding: 16px 0; font-size: 0; text-align: center; }
html.sb-collapsed .main { margin-left: 64px; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .22s ease; }
.header {
  background: #fff; padding: 0 24px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.header .title { font-size: 16px; font-weight: 600; }
.header .user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.header .user a { color: var(--primary); }
.content { padding: 24px; flex: 1; }

/* 卡片 */
.card { background: var(--card); border-radius: 12px; box-shadow: 0 2px 8px rgba(43,54,74,.05); margin-bottom: 20px; }
.card .card-hd { padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.card .card-bd { padding: 20px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 2px 8px rgba(43,54,74,.05); }
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -.5px; }
.stat-card .value.red { color: var(--danger); }
.stat-card .value.green { color: var(--success); }
.stat-card .value.blue { color: var(--primary); }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart-box { height: 320px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.tbl th {
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,.06);
  border-right: 1px solid rgba(255,255,255,.28);
}
table.tbl th:last-child { border-right: none; }
table.tbl tr:hover td { background: #f0fafb; }

/* 徽标 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge.green { background: #e8f7f0; color: #1f9e60; }
.badge.gray { background: #f0f2f6; color: #8a94a6; }
.badge.red { background: #fef0f0; color: #e04343; }
.badge.blue { background: var(--primary-light); color: var(--primary-dark); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #4a5262; font-size: 13px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; color: var(--text);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42,192,203,.12); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 20px; border-radius: 999px; border: 1px solid transparent; font-size: 14px; cursor: pointer; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(42,192,203,.35); }
.btn-outline { background: #fff; border-color: var(--border); color: #4a5262; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e04343; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 分页 */
.pagination { display: flex; gap: 6px; list-style: none; margin-top: 16px; flex-wrap: wrap; }
.pagination li a, .pagination li span { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: #4a5262; font-size: 13px; }
.pagination li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li.active span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination li.disabled span { color: #c3cad6; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(24,30,42,.5); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; width: 440px; max-width: 92vw; padding: 24px; box-shadow: 0 20px 60px rgba(24,30,42,.2); }
.modal .modal-hd { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; }

/* 提示 */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: rgba(24,30,42,.92); color: #fff; padding: 10px 20px; border-radius: 999px; z-index: 200; display: none; font-size: 13px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #333a4d 0%, #2ac0cb 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 40px; width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.login-box .sub { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.login-box .btn { width: 100%; padding: 11px; font-size: 15px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row img { height: 38px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Flatpickr 日历主题（青色，匹配整站风格） */
.js-datepicker, .js-monthpicker { cursor: pointer; background: #fff; }
.flatpickr-calendar {
  border-radius: 12px; box-shadow: 0 12px 40px rgba(24,30,42,.18);
  font-family: inherit; padding: 0; border: 1px solid var(--border);
}
.flatpickr-calendar.arrowTop:before { border-bottom-color: var(--border); }
.flatpickr-calendar.arrowTop:after { border-bottom-color: #fff; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month { padding-top: 8px; }
.flatpickr-weekday { color: var(--muted); font-weight: 600; }
.flatpickr-day { border-radius: 8px; font-size: 13.5px; }
.flatpickr-day:hover { background: var(--primary-light); border-color: var(--primary-light); }
.flatpickr-day.today { border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.flatpickr-day.today:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.inRange {
  background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(42,192,203,.4);
}
.flatpickr-day.inRange { color: var(--primary-dark); }
.flatpickr-monthSelect-month { border-radius: 8px; font-size: 13.5px; }
.flatpickr-monthSelect-month:hover { background: var(--primary-light); }
.flatpickr-monthSelect-month.selected { background: var(--primary); color: #fff; }
/* 日历头部：月份下拉 + 年份，统一 13.5px、不加粗、无错位 */
.flatpickr-current-month {
  font-size: 13.5px !important;
  height: 36px;
  padding-top: 6px !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-size: 13.5px !important;
  font-weight: 400 !important;
  height: 20px;
  line-height: 20px;
  padding: 0 12px 0 6px;
  margin: 0;
  vertical-align: middle;
}
.flatpickr-current-month .numInputWrapper {
  font-size: 13.5px !important;
  width: auto;
  vertical-align: middle;
}
.flatpickr-current-month .numInputWrapper span { display: none; }
.flatpickr-current-month .fp-year-select {
  font-size: 13.5px; font-weight: 400; font-family: inherit;
  color: inherit; background: transparent; border: none;
  height: 20px; line-height: 20px; padding: 0 2px; margin-left: 6px;
  vertical-align: middle; cursor: pointer; outline: none;
}
.flatpickr-current-month input.cur-year {
  font-size: 13.5px !important;
  font-weight: 400 !important;
  height: 20px;
  line-height: 20px;
  width: 4.2ch;
  padding: 0;
  vertical-align: middle;
  cursor: pointer;
  -moz-appearance: textfield;
  appearance: textfield;
}
.flatpickr-monthDropdown-month { font-size: 13px !important; padding: 4px 8px !important; max-height: none; }
