/* ===== ???????? - ?????? ===== */
:root {
    --topbar-h: 54px;
    --sidebar-w: 192px;
    --sidebar-collapsed: 64px;
    --primary: #2c4a6e;
    --primary-color: #2c4a6e;
    --primary-light: #3a5f8a;
    --accent: #6b7280;
    --accent-hover: #4b5563;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f4f6f9;
    --sidebar-active: #eef2f7;
    --content-bg: #f0f2f5;
    --text: #2c4a6e;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --card-bg: #ffffff;
    --shadow: none;
    --shadow-md: none;
    --shadow-lg: 0 4px 16px rgba(0,0,0,.08);
    --radius: 4px;
    --transition: 0.15s ease;
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "STHeiti", "WenQuanYi Micro Hei", sans-serif;
    background: var(--content-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ??? ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
    height: var(--topbar-h);
    background: #2c4a6e;
    display: flex; align-items: center;
    padding: 0 20px;
    box-shadow: none;
    border-bottom: 1px solid rgba(0,0,0,.12);
}
.topbar-brand {
    width: auto;
    min-width: var(--sidebar-w);
    height: 100%;
    display: flex; align-items: center; gap: 8px;
    padding: 0 14px;
    background: transparent;
    color: #fff; text-decoration: none; font-size: 16px; font-weight: 700;
    letter-spacing: 0;
    transition: var(--transition);
}
.topbar-brand .brand-logo,
.topbar-brand img {
    height: 33px;
    width: 33px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}
.topbar-brand .brand-text {
    white-space: nowrap;
    font-size: 17px;
    line-height: 1.2;
    color: #fff;
    font-weight: 700;
}
.sidebar-collapsed .topbar-brand { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); justify-content: center; padding: 0 6px; }
.sidebar-collapsed .topbar-brand .brand-text { display: none; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-right .btn { color: #cbd5e1; border: none; padding: 7px 14px; font-size: 14px; border-radius: 8px; transition: var(--transition); }
.topbar-right .btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.topbar-right .btn .fa-crown { color: #e2e8f0; }
.topbar-user { color: #e2e8f0; font-size: 14px; }
.topbar-user i { margin-right: 6px; }
.topbar-divider { width: 1px; height: 24px; background: rgba(255,255,255,.15); margin: 0 6px; }

/* ===== ??? ===== */
.sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 1020;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto; overflow-x: hidden;
    transition: var(--transition);
    padding: 8px 0;
    box-shadow: none;
}
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }

.sidebar-section { padding: 16px 20px 6px; font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1.2px; white-space: nowrap; }
.sidebar-collapsed .sidebar-section { display: none; }

.sidebar-nav { list-style: none; margin: 0; padding: 0 10px; }
.sidebar-nav li { margin: 1px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 4px;
    color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: var(--transition); white-space: nowrap;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: var(--primary); }
.sidebar-nav a.active { background: var(--sidebar-active); color: var(--primary); font-weight: 600; }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; color: var(--text-muted); transition: var(--transition); }
.sidebar-nav a:hover i, .sidebar-nav a.active i { color: var(--primary); }
.sidebar-nav a .nav-label { transition: var(--transition); }
.sidebar-collapsed .sidebar-nav a { gap: 0; padding: 10px 0; justify-content: center; border-radius: 4px; margin: 2px 8px; }
.sidebar-collapsed .sidebar-nav a .nav-label { display: none; }

.sidebar-toggle {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    width: 36px; height: 36px; border-radius: 4px; cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--sidebar-hover); color: var(--text); }

/* ===== ??? ===== */
.main-content {
    margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
    padding: 24px 28px; min-height: calc(100vh - var(--topbar-h));
    transition: var(--transition);
}
.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }

/* ===== ???? ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    transition: none;
}
.card:hover { box-shadow: none; }
.card-header {
    background: #f7f8fa;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 12px 16px;
    font-size: 14px;
    letter-spacing: 0;
}
.card-body { padding: 16px 18px; }

/* ===== ?? ===== */
.table { margin-bottom: 0; }
.table th { font-weight: 600; font-size: 13px; color: var(--text-muted); border-bottom-width: 1px; }
.table-hover tbody tr { transition: background .15s; }
.table-hover tbody tr:hover { background: #f8f9fb; }

/* ===== ???? ===== */
.stats-card {
    border-radius: var(--radius);
    box-shadow: none;
    transition: none;
    border: 1px solid var(--border);
    background: #fff;
}
.stats-card:hover { box-shadow: none; transform: none; }
.stats-value { font-size: 1.8rem; font-weight: 700; }
.stats-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ===== ?? ===== */
.btn {
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    letter-spacing: 0;
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); transform: none; box-shadow: none; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-success:hover { transform: none; box-shadow: none; }
.btn-outline-secondary:hover { transform: none; }
.btn-sm { border-radius: 4px; }

/* ===== ?? ===== */
.form-control, .form-select {
    border-radius: 4px;
    border-color: var(--border);
    font-size: 14px;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(44,74,110,.12);
}
.form-control-lg { border-radius: 4px; }

/* ===== ?? ===== */
.badge { font-weight: 500; letter-spacing: 0; border-radius: 3px; }

/* ===== ?? ===== */
.pagination .page-link { border-radius: 4px; margin: 0 2px; border-color: var(--border); color: var(--text); transition: var(--transition); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-link:hover { background: var(--sidebar-hover); }

/* ===== ?? ===== */
.alert { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: none; }

/* ===== ???? ===== */
.dropdown-menu { border-radius: 4px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 2px; padding: 8px 14px; font-size: 14px; transition: var(--transition); }
.dropdown-item:hover { background: var(--sidebar-hover); }

/* ===== ??? ===== */
.modal-content { border-radius: 4px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

/* ===== ??? ===== */
.breadcrumb { background: transparent; padding: 0; margin-bottom: 12px; }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item.active { color: var(--text); font-weight: 500; }

/* ===== ?? ===== */
footer { padding: 16px 0; text-align: center; color: var(--text-light); font-size: 12px; }

/* ===== ?? ===== */
.fade-in { animation: none; }

/* ===== ????????? ===== */
body.no-sidebar .sidebar, body.no-sidebar .topbar { display: none; }
body.no-sidebar .main-content { margin-left: 0; margin-top: 0; }

/* ===== ????? ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== ??????? ===== */
.text-primary-color { color: var(--primary) !important; }

/* ===== Surface Kit: unified page chrome ===== */
.sf-page { max-width: 1100px; }
.sf-page-wide { max-width: 1200px; }

.sf-hero {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #1f2937;
  padding: 1rem 1.15rem;
  box-shadow: none;
  margin-bottom: 1rem;
}
.sf-hero::before,
.sf-hero::after { display: none; }
.sf-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.sf-hero h1,
.sf-hero .sf-hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  color: #2c4a6e;
  line-height: 1.3;
}
.sf-hero p,
.sf-hero .sf-hero-desc {
  margin: 0;
  color: #6b7280;
  font-size: .875rem;
}
.sf-hero-icon { display: none; }
.sf-back {
  border-radius: 4px;
  background: #fff;
  border: 1px solid #d7dee8;
  color: #2c4a6e;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
  padding: .3rem .75rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: var(--transition);
}
.sf-back:hover {
  background: #eef1f5;
  border-color: #2c4a6e;
  color: #2c4a6e;
}

.sf-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  box-shadow: none;
  overflow: hidden;
  margin-bottom: 1rem;
}
.sf-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .75rem 1rem;
  background: #f7f8fa;
  border-bottom: 1px solid #e5e7eb;
}
.sf-panel-head h2,
.sf-panel-head .sf-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}
.sf-panel-body { padding: 1rem; }
.sf-panel-body.p-0 { padding: 0; }

.sf-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 .75rem;
}
.sf-section-title i { display: none; }

.sf-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .2rem;
  padding: .15rem;
  background: #f1f4f8;
  border-radius: 4px;
}
.sf-filters a,
.sf-filters .sf-filter {
  text-decoration: none;
  color: #6b7280;
  font-size: .82rem;
  font-weight: 500;
  padding: .28rem .65rem;
  border-radius: 3px;
  white-space: nowrap;
  border: none;
  background: transparent;
  transition: background .15s, color .15s;
}
.sf-filters a:hover,
.sf-filters .sf-filter:hover {
  color: var(--primary);
  background: rgba(255,255,255,.7);
}
.sf-filters a.active,
.sf-filters .sf-filter.active {
  background: var(--primary);
  color: #fff;
}

.sf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.sf-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
.sf-search-row .form-control,
.sf-search-row .form-select { border-radius: 4px; }

.sf-empty {
  text-align: center;
  padding: 2rem 1.25rem;
  color: #94a3b8;
}
.sf-empty i {
  font-size: 1.5rem;
  color: #9ca3af;
  display: block;
  margin-bottom: .5rem;
}

.sf-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.sf-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: .85rem 1rem;
  box-shadow: none;
}
.sf-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.sf-stat-label {
  font-size: .82rem;
  color: #6b7280;
  margin-top: .2rem;
}

.sf-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  padding: .15rem .45rem;
  border-radius: 3px;
  border: 1px solid #e5e7eb;
  background: #f7f8fa;
  color: #4b5563;
}
.sf-badge-primary { background: #eef1f5; color: #2c4a6e; border-color: #d7dee8; }
.sf-badge-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.sf-badge-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.sf-badge-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.sf-badge-muted { background: #f7f8fa; color: #64748b; border-color: #e5e7eb; }

.sf-table thead th {
  background: #f7f9fb;
  color: #64748b;
  font-weight: 600;
  font-size: .8rem;
  border-bottom: 1px solid #e8ecf1;
  white-space: nowrap;
}
.sf-table tbody td {
  vertical-align: middle;
  border-color: #f0f3f7;
}
.sf-table tbody tr:hover { background: #f8fafc; }

.section-title h2,
.section-title .h4,
.dashboard-section > h1,
.dashboard-section > h2 {
  color: var(--primary);
  font-weight: 600;
}
.section-title i { display: none; }

.card-header.bg-primary {
  background: #2c4a6e !important;
  border-bottom: none;
  color: #fff;
  font-weight: 600;
}
.card-header.bg-primary .text-white,
.card-header.bg-primary h5,
.card-header.bg-primary h6 { color: #fff !important; }

.main-content > .container > h1:first-child,
.main-content > .container-fluid > h1:first-child,
.main-content > .fade-in > h1:first-child,
.main-content > h1:first-child {
  color: var(--primary);
  font-weight: 700;
}
.main-content h1 > .fas,
.main-content h1 > .far,
.main-content h2 > .fas,
.main-content h3 > .fas {
  display: none;
}

@media (max-width: 576px) {
  .sf-hero { padding: .9rem 1rem; }
  .sf-hero h1, .sf-hero .sf-hero-title { font-size: 1.15rem; }
}
