:root {
  --admin-bg: #f4f7fb;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f8fafc;
  --admin-ink: #172033;
  --admin-muted: #697489;
  --admin-line: #dfe6ef;
  --admin-sidebar: #101522;
  --admin-sidebar-2: #171f31;
  --admin-primary: #1665d8;
  --admin-primary-dark: #0b4ba8;
  --admin-teal: #00a58e;
  --admin-coral: #e55353;
  --admin-amber: #d99000;
  --admin-violet: #7357d9;
  --admin-radius: 8px;
  --admin-shadow: 0 14px 36px rgba(20, 31, 54, 0.10);
}

html,
body {
  background: var(--admin-bg) !important;
  color: var(--admin-ink);
  letter-spacing: 0;
}

body {
  font-family: "Inter", "Pretendard", "Noto Sans KR", "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--admin-primary);
}

a:hover {
  color: var(--admin-primary-dark);
}

.app {
  background:
    linear-gradient(180deg, rgba(22, 101, 216, 0.07), rgba(22, 101, 216, 0) 260px),
    var(--admin-bg) !important;
}

.app-header {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid var(--admin-line);
  box-shadow: 0 4px 22px rgba(25, 36, 59, 0.07);
  min-height: 58px;
}

.navbar-header {
  background: var(--admin-sidebar) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
  color: #fff !important;
  font-weight: 800;
  letter-spacing: 0;
}

.navbar-logo,
.login .logo {
  background: linear-gradient(135deg, var(--admin-teal), var(--admin-primary)) !important;
  border-radius: 6px !important;
  box-shadow: 0 0 0 5px rgba(22, 101, 216, 0.14);
}

.navbar-mobile-toggler .icon-bar {
  background: #fff !important;
}

.navbar-nav {
  align-items: center;
  gap: 8px;
  padding-right: 14px;
}

.navbar-item .btn,
.navbar-item button.btn {
  border-radius: 999px;
  box-shadow: none;
  font-weight: 700;
  min-height: 34px;
  padding: 7px 13px;
}

.navbar-item.dropdown > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 12px !important;
}

.app-sidebar {
  background: linear-gradient(180deg, var(--admin-sidebar), var(--admin-sidebar-2)) !important;
  border-right: 0;
  box-shadow: 12px 0 34px rgba(10, 15, 25, 0.22);
}

.app-sidebar .app-sidebar-content {
  padding: 14px 10px;
}

.menu-profile {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--admin-radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.menu-profile-cover {
  background:
    linear-gradient(135deg, rgba(0, 165, 142, 0.85), rgba(22, 101, 216, 0.72)),
    url("../img/transparent/white-0.1.png") !important;
}

.menu-profile-image img {
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

.menu-header {
  color: #7f8da8 !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 16px 8px 8px;
  text-transform: uppercase;
}

.menu .menu-item .menu-link {
  border-radius: var(--admin-radius);
  color: #b7c1d6 !important;
  margin: 2px 0;
  min-height: 38px;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.menu .menu-item .menu-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  transform: translateX(2px);
}

.menu .menu-item.active > .menu-link,
.menu .menu-item.expand > .menu-link,
.menu .menu-item.has-sub.active > .menu-link {
  background: #fff !important;
  color: var(--admin-sidebar) !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.menu .menu-icon {
  color: var(--admin-teal) !important;
}

.menu .active > .menu-link .menu-icon,
.menu .expand > .menu-link .menu-icon {
  color: var(--admin-primary) !important;
}

.menu-submenu {
  background: rgba(0, 0, 0, 0.14);
  border-radius: var(--admin-radius);
  margin: 4px 0 8px 14px;
  padding: 5px;
}

.app-content {
  background: transparent !important;
  padding: 82px 24px 30px !important;
}

.breadcrumb {
  background: transparent;
  border: 0;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  padding: 0;
}

.page-header {
  color: var(--admin-ink);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 22px;
}

.page-header small {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 600;
}

.row {
  row-gap: 18px;
}

.widget.widget-stats {
  background: var(--admin-surface) !important;
  border: 1px solid var(--admin-line);
  border-left: 5px solid var(--admin-primary);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  color: var(--admin-ink);
  min-height: 138px;
  overflow: hidden;
  padding: 18px 18px 42px;
}

.widget.widget-stats.bg-info,
.widget.widget-stats.bg-blue {
  border-left-color: var(--admin-primary);
}

.widget.widget-stats.bg-orange,
.widget.widget-stats.bg-warning {
  border-left-color: var(--admin-amber);
}

.widget.widget-stats.bg-red,
.widget.widget-stats.bg-danger {
  border-left-color: var(--admin-coral);
}

.widget.widget-stats.bg-green,
.widget.widget-stats.bg-success {
  border-left-color: var(--admin-teal);
}

.widget.widget-stats .stats-icon {
  color: rgba(23, 32, 51, 0.08);
  font-size: 52px;
  right: 16px;
  top: 16px;
}

.widget.widget-stats .stats-info h4 {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.35;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.widget.widget-stats .stats-info p {
  color: var(--admin-ink);
  font-size: 28px;
  font-weight: 850;
  line-height: 1.1;
  margin-bottom: 0;
}

.widget.widget-stats .stats-link {
  background: var(--admin-surface-soft) !important;
  border-top: 1px solid var(--admin-line);
  bottom: 0;
}

.widget.widget-stats .stats-link a {
  color: var(--admin-primary) !important;
  font-weight: 800;
}

.panel,
.card,
.modal-content,
.theme-panel-content {
  background: var(--admin-surface) !important;
  border: 1px solid var(--admin-line) !important;
  border-radius: var(--admin-radius) !important;
  box-shadow: var(--admin-shadow);
  color: var(--admin-ink);
}

.panel-heading,
.card-header,
.modal-header {
  background: var(--admin-surface-soft) !important;
  border-bottom: 1px solid var(--admin-line) !important;
  color: var(--admin-ink) !important;
  font-weight: 800;
}

.panel-title,
.card-title,
.modal-title {
  color: var(--admin-ink) !important;
  font-weight: 850;
}

.table {
  --bs-table-bg: #fff;
  --bs-table-striped-bg: #f8fafc;
  --bs-table-hover-bg: #eef6ff;
  border-color: var(--admin-line) !important;
  color: var(--admin-ink);
}

.table thead th,
.table > :not(caption) > * > th {
  background: #eef3f8 !important;
  border-bottom: 1px solid var(--admin-line) !important;
  color: #344154 !important;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table td,
.table th {
  border-color: var(--admin-line) !important;
  vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.form-control,
.form-select,
.select2-container .select2-selection {
  background-color: #fff !important;
  border: 1px solid #cfd8e5 !important;
  border-radius: var(--admin-radius) !important;
  color: var(--admin-ink) !important;
  min-height: 36px;
}

.form-control:focus,
.form-select:focus,
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
  border-color: var(--admin-primary) !important;
  box-shadow: 0 0 0 4px rgba(22, 101, 216, 0.12) !important;
}

.btn {
  border-radius: var(--admin-radius);
  font-weight: 800;
  letter-spacing: 0;
}

.btn-primary,
.btn-theme,
.page-item.active .page-link {
  background: var(--admin-primary) !important;
  border-color: var(--admin-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-theme:hover {
  background: var(--admin-primary-dark) !important;
  border-color: var(--admin-primary-dark) !important;
}

.btn-success {
  background: var(--admin-teal) !important;
  border-color: var(--admin-teal) !important;
}

.btn-danger {
  background: var(--admin-coral) !important;
  border-color: var(--admin-coral) !important;
}

.btn-warning {
  background: var(--admin-amber) !important;
  border-color: var(--admin-amber) !important;
  color: #182033 !important;
}

.badge,
.label {
  border-radius: 999px;
  font-weight: 850;
  padding: 5px 8px;
}

.dropdown-menu {
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.dropdown-item {
  border-radius: 6px;
  color: var(--admin-ink);
  font-weight: 650;
}

.dropdown-item:hover {
  background: #eef6ff;
  color: var(--admin-primary);
}

.app-loader {
  background: rgba(244, 247, 251, 0.9) !important;
}

.spinner {
  border-color: rgba(22, 101, 216, 0.18) !important;
  border-top-color: var(--admin-primary) !important;
}

.login.login-v2 {
  min-height: 100vh;
}

.login-cover-bg {
  background:
    linear-gradient(135deg, rgba(16, 21, 34, 0.92), rgba(22, 101, 216, 0.68)) !important;
}

.login-container {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--admin-radius);
  box-shadow: 0 28px 70px rgba(7, 13, 24, 0.34);
  color: var(--admin-ink);
  padding: 26px;
}

.login .brand,
.login .brand b,
.login .icon {
  color: var(--admin-ink) !important;
}

.login .brand small {
  color: var(--admin-muted) !important;
}

.dashboard-overview {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-hero,
.dashboard-section {
  background: var(--admin-surface);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.dashboard-hero {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.95fr);
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.dashboard-hero::before {
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-teal));
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 5px;
}

.dashboard-kicker {
  color: var(--admin-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.dashboard-hero h2 {
  color: var(--admin-ink);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 8px;
}

.dashboard-hero p {
  color: var(--admin-muted);
  font-size: 14px;
  font-weight: 650;
  margin: 0;
}

.dashboard-hero-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-hero-metrics > div,
.dashboard-card,
.dashboard-metric,
.dashboard-profit > div {
  background: var(--admin-surface-soft);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
}

.dashboard-hero-metrics > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 96px;
  padding: 16px;
}

.dashboard-hero-metrics span,
.dashboard-card span,
.dashboard-metric span,
.dashboard-profit span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-hero-metrics strong {
  color: var(--admin-ink);
  font-size: 24px;
  font-weight: 900;
  margin-top: 7px;
}

.dashboard-section {
  padding: 18px;
}

.dashboard-section-row {
  row-gap: 18px;
}

.dashboard-section-row .dashboard-section {
  height: 100%;
}

.dashboard-section-title {
  align-items: flex-end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-section-title h3 {
  color: var(--admin-ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
}

.dashboard-section-title span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.dashboard-card-grid {
  display: grid;
  gap: 12px;
}

.dashboard-card-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-card {
  color: var(--admin-ink);
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  position: relative;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dashboard-card:hover,
.dashboard-metric:hover {
  border-color: rgba(22, 101, 216, 0.45);
  box-shadow: 0 14px 26px rgba(22, 101, 216, 0.12);
  color: var(--admin-ink);
  transform: translateY(-2px);
}

.dashboard-card i {
  align-items: center;
  background: #fff;
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.dashboard-card strong {
  color: var(--admin-ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.dashboard-card small {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-card-danger {
  border-left: 5px solid var(--admin-coral);
}

.dashboard-card-warning {
  border-left: 5px solid var(--admin-amber);
}

.dashboard-card-primary {
  border-left: 5px solid var(--admin-primary);
}

.dashboard-card-info {
  border-left: 5px solid var(--admin-teal);
}

.dashboard-metric-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metric {
  color: var(--admin-ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dashboard-metric strong {
  color: var(--admin-ink);
  font-size: 24px;
  font-weight: 900;
}

.dashboard-profit {
  display: grid;
  gap: 10px;
}

.dashboard-profit > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 14px;
}

.dashboard-profit strong {
  color: var(--admin-ink);
  font-size: 18px;
  font-weight: 900;
}

.dashboard-profit a {
  align-items: center;
  background: var(--admin-primary);
  border-radius: var(--admin-radius);
  color: #fff;
  display: flex;
  font-weight: 850;
  justify-content: space-between;
  min-height: 44px;
  padding: 12px 14px;
  text-decoration: none;
}

.dashboard-profit a:hover {
  background: var(--admin-primary-dark);
  color: #fff;
}

.member-drill-cell {
  color: var(--admin-primary);
  cursor: pointer;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.member-drill-cell:hover {
  background: #eef6ff;
  color: var(--admin-primary-dark);
}

.member-drill-empty {
  color: var(--admin-muted);
  cursor: default;
  text-decoration: none;
}

.member-child-badge {
  background: rgba(22, 101, 216, 0.10);
  border: 1px solid rgba(22, 101, 216, 0.20);
  border-radius: 999px;
  color: var(--admin-primary);
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  margin-left: 6px;
  padding: 4px 7px;
  white-space: nowrap;
}

.member-child-badge-empty {
  background: #f1f4f8;
  border-color: var(--admin-line);
  color: var(--admin-muted);
}

.member-row-open > td {
  background: #f7fbff !important;
}

.calc-drill-row {
  cursor: pointer;
}

.calc-drill-row:hover > td {
  background: #eef6ff !important;
}

.notice-editor-toolbar {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--admin-line);
  border-bottom: 0;
  border-radius: var(--admin-radius) var(--admin-radius) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
}

.notice-editor-toolbar .btn {
  min-height: 30px;
  padding: 4px 9px;
}

.notice-editor-divider {
  background: var(--admin-line);
  display: inline-block;
  height: 24px;
  margin: 0 3px;
  width: 1px;
}

.notice-web-editor {
  background: #fff;
  border: 1px solid var(--admin-line);
  border-radius: 0 0 var(--admin-radius) var(--admin-radius);
  color: var(--admin-ink);
  line-height: 1.6;
  min-height: 320px;
  outline: none;
  overflow-y: auto;
  padding: 14px;
}

.notice-web-editor:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 4px rgba(22, 101, 216, 0.12);
}

.note-editor.note-frame {
  border-color: var(--admin-line);
  border-radius: var(--admin-radius);
}

.note-editor .note-toolbar {
  background: #f8fafc;
  border-bottom-color: var(--admin-line);
  border-radius: var(--admin-radius) var(--admin-radius) 0 0;
}

.note-editor .note-editable {
  color: var(--admin-ink);
  line-height: 1.6;
}

.dashboard-live-section,
.app-content > .row:last-of-type {
  background: var(--admin-surface);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  margin-top: 20px;
  padding: 18px;
}

.app-content > .row:last-of-type .page-header {
  font-size: 17px;
  margin-bottom: 12px;
}

.app-content > .row:last-of-type .panel-body {
  overflow-x: auto;
  padding: 0;
}

.app-content > .row:last-of-type .table {
  margin-bottom: 0;
  min-width: 980px;
}

.theme-panel,
.theme-panel .theme-collapse-btn {
  display: none !important;
}

@media (max-width: 991.98px) {
  .app-content {
    padding: 74px 14px 24px !important;
  }

  .navbar-item.dropdown > div {
    display: none;
  }

  .page-header {
    font-size: 21px;
  }

  .widget.widget-stats {
    min-height: 126px;
  }

  .dashboard-hero,
  .dashboard-hero-metrics,
  .dashboard-card-grid-4,
  .dashboard-metric-list {
    grid-template-columns: 1fr;
  }
}
