:root {
  --primary: #d4d4d4;
  --primary-dark: #a3a3a3;
  --primary-soft: #111111;
  --accent: #e6e6e6;
  --accent-dark: #a3a3a3;
  --danger: #ef4444;
  --success: #a3a3a3;
  --bg: #000000;
  --text: #e6e6e6;
  --muted: #9ca3af;
  --card: #0f0f10;
  --surface: #111111;
  --surface-2: #151515;
  --border: #262626;
  --nav-grad: linear-gradient(180deg, #000000 0%, #0b0b0b 100%);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.45);
  --arrow-icon: 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 1.5 6 6.5 11 1.5' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sakura: #f9a8d4;
  --sakura-soft: rgba(249, 168, 212, 0.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  overflow-y: auto;
}
body.search-open { overflow: hidden; }

a { color: var(--accent); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; display: block; }
.icon-btn .icon { width: 18px; height: 18px; }
.btn-danger .icon { width: 14px; height: 14px; margin-right: 6px; display: inline-block; vertical-align: -2px; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-shell { display: block; min-height: 100vh; background: var(--bg); }
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 88vw);
  background: var(--surface);
  color: var(--text);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 40;
}
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 8px;
}
.drawer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-brand-title {
  font-weight: 800;
  letter-spacing: 0.8px;
  font-size: 13px;
}
.drawer-brand-sub {
  font-size: 11px;
  color: var(--muted);
}
.drawer-close {
  position: relative;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.drawer-close:hover { color: #9ca3af; }
.drawer-close-tip {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.drawer-close:hover .drawer-close-tip {
  opacity: 1;
  transform: translateY(0);
}
.drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.drawer-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: background 0.18s ease, color 0.18s ease;
  min-height: 40px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 12px;
}
.drawer-nav a:hover { background: #101010; color: var(--text); }
.drawer-nav a.active { background: #151515; color: #f3f4f6; }
.drawer-nav .nav-icon { width: 22px; height: 22px; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.drawer-nav .nav-icon .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.drawer-nav .nav-label { margin-left: 0; }
.drawer-nav .nav-badge {
  margin-left: auto;
  background: #ff6fae;
  color: #1a1a1a;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
}
.drawer-open .drawer { transform: translateX(0); opacity: 1; }
.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-open { overflow: hidden; }
.sidebar {
  width: 230px;
  background: var(--nav-grad);
  color: var(--text);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: var(--shadow-soft);
  transition: width .25s ease, padding .25s ease;
}
.sidebar-brand { padding: 12px; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.avatar-circle { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg,#141414,#1f1f1f); display: grid; place-items: center; font-weight: 800; color: #e6e6e6; letter-spacing: .4px; }
.profile-meta { display: grid; gap: 2px; }
.brand-mark, .brand-title { font-weight: 800; color: var(--text); letter-spacing: .8px; text-transform: uppercase; font-size: 11px; }
.profile-name { font-weight: 700; color: var(--text); font-size: 13px; }
.admin-mini { font-size: 11px; color: var(--muted); }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  height: 52px;
  padding: 12px 14px;
  box-sizing: border-box;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .2px;
  transition: background .18s ease, transform .18s ease, color .18s ease, box-shadow .18s ease;
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  font-size: 13px;
}
.nav-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.nav-icon .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.nav-label { flex: 1; text-align: left; margin-left: 0; display: inline-flex; align-items: center; }
.sidebar-nav a span { display: inline-flex; align-items: center; }
.sidebar-nav a:hover { background: #1f1f1f; box-shadow: 0 8px 18px rgba(0,0,0,0.24); }
.sidebar-nav a.active { background: #1f1f1f; color: #e6e6e6; box-shadow: 0 10px 24px rgba(0,0,0,0.28); border-color: #262626; }
.sidebar-nav a.active .nav-icon { color: var(--accent); }
.sidebar-footer { margin-top: auto; display: flex; gap: 10px; align-items: center; transition: padding .25s ease; }
.sidebar-footer { justify-content: space-between; width: 100%; }
.logout-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.25);
}
.logout-btn .icon { width: 18px; height: 18px; }
.logout-btn:hover { background: rgba(239, 68, 68, 0.18); }
.sidebar.collapsed { width: 86px; padding: 14px 10px; }
.sidebar.collapsed .sidebar-brand { align-items: center; text-align: center; padding: 8px; }
.sidebar.collapsed .sidebar-brand .brand-sub { display: none; }
.sidebar.collapsed .profile-meta { display: none; }
.sidebar.collapsed .sidebar-nav a { justify-content: flex-start; padding: 12px 14px; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-icon { margin: 0 auto; }
.sidebar.collapsed .sidebar-footer { flex-direction: column; gap: 8px; align-items: center; }
.sidebar.collapsed .logout-btn { justify-content: center; padding: 10px; width: 100%; }
.sidebar.collapsed .logout-text { display: none; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 10px 20px;
  background: #000000;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
  gap: 14px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-center { display: flex; justify-content: center; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-quick {
  display: none;
  justify-content: flex-start;
  padding: 6px 20px 2px;
}
.quick-filter {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  padding-bottom: 8px;
}
.quick-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 0;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: color .15s ease;
}
.quick-tab.active {
  color: #f8fafc;
}
.quick-tab:hover { color: var(--text); }
.quick-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 24px;
  border-radius: 999px;
  background: #ef4444;
  transform: translateX(0);
  transition: transform .2s ease, width .2s ease;
}
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25); color: var(--text); transition: all .15s ease; position: relative; }
.icon-btn.ghost { box-shadow: none; background: var(--surface-2); }
.icon-btn:hover { border-color: #262626; color: #e6e6e6; background: #1f1f1f; transform: translateY(-1px); }
.icon-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff4d6d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.search-fake {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0d0d0d;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  width: min(48vw, 320px);
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}
.search-fake:hover { color: var(--text); border-color: #303030; }
.search-fake .icon { width: 14px; height: 14px; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--nav-grad);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.brand-block { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.brand-title { font-weight: 900; letter-spacing: .8px; color: var(--text); text-transform: uppercase; }
.brand-sub { font-size: 11px; color: var(--muted); }
.nav-center { flex: 1; display: flex; justify-content: center; }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nav-chips a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  transition: all .15s ease;
}
.nav-chips a:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.nav-chips a.active { background: #1f1f1f; color: #e6e6e6; border-color: #262626; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dashboard-title { font-size: 16px; font-weight: 800; color: var(--text); }
.dashboard-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stat-nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  min-width: 86px;
}
.stat-nav-item:hover .stat-value,
.stat-nav-item:hover .stat-title {
  color: #f9a8d4;
}
.stat-nav-item:focus-visible {
  outline: none;
}
.stat-nav-item:focus-visible .stat-value,
.stat-nav-item:focus-visible .stat-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.stat-title { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 13px; font-weight: 800; color: var(--text); }
.admin-panel { position: relative; }
.admin-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.admin-toggle:hover { background: #1f1f1f; border-color: #262626; color: #e6e6e6; }
.admin-panel-card {
  position: fixed;
  top: 18px;
  right: 22px;
  width: min(320px, calc(100vw - 24px));
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0,0,0,0.55);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translate(14px, -12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1200;
}
.admin-panel-card.open {
  opacity: 1;
  transform: translate(0, 0);
  pointer-events: auto;
}
.admin-panel-header { display: flex; justify-content: space-between; align-items: center; }
.admin-panel-title { font-size: 14px; font-weight: 800; color: var(--text); }
.admin-panel-sub { font-size: 11px; color: var(--muted); }
.admin-panel-info { display: grid; gap: 6px; padding: 10px; border-radius: 12px; background: #121212; border: 1px solid var(--border); }
.admin-panel-name { font-size: 14px; font-weight: 700; color: var(--text); }
.admin-panel-meta { font-size: 12px; color: var(--muted); }
.admin-panel-actions { display: grid; gap: 8px; }
.admin-panel-action {
  width: 100%;
  text-align: left;
  background: #151515;
  border: 1px solid #202020;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}
.admin-panel-action:hover { background: #1f1f1f; border-color: #2a2a2a; }
.admin-panel-action.logout { color: #f87171; }
.admin-panel-action.logout:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); }
.admin-panel-edit {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #101010;
  border: 1px solid var(--border);
}
.admin-panel-edit input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.admin-panel-edit input:focus {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.25);
}
.admin-panel-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.content { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 18px 24px 32px; }

.main-wrap { padding: 0 0 14px; flex: 1; }
.container {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 0 10px rgba(0,0,0,.25);
  border: 1px solid var(--border);
}
.card .title { font-size: 14px; font-weight: 700; margin: 0 0 8px 0; }
.card .desc { font-size: 12px; color: var(--muted); margin: 0 0 12px 0; line-height: 1.6; }
.card .action { display: inline-block; padding: 8px 12px; border-radius: 10px; background: var(--primary); color: #fff; text-decoration: none; font-size: 13px; }
.card .action:hover { background: var(--primary-dark); }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.orders-shell { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 220px); }
.order-card, .order-list-card { display: flex; flex-direction: column; gap: 10px; }
.order-card { padding: 14px; }
.order-card .section-header h3 { margin: 0 0 4px; font-size: 15px; }
.order-card .section-header .sub { font-size: 12px; color: var(--muted); }
.order-card .btn-primary { padding: 8px 12px; font-size: 12px; }
.order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.order-col { display: flex; flex-direction: column; gap: 10px; }
.order-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.order-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: center; }
.order-filters input,
.order-filters select,
.order-filters button {
  min-height: 36px;
  height: auto;
}
.order-filter-hint {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: #161616;
  border: 1px dashed #262626;
  color: var(--muted);
  font-size: 13px;
}
.order-filter-hint .pill {
  background: #141414;
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.order-list-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 26px rgba(0,0,0,0.28); background: var(--card); }
.col-2 { flex: 1 1 48%; min-width: 320px; }
.col-3 { flex: 1 1 30%; min-width: 260px; }
.col-4 { flex: 1 1 24%; min-width: 220px; }

label { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); font-weight: 700; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #262626;
  box-shadow: 0 0 0 3px rgba(38, 38, 38, 0.35);
  background: #161616;
}
textarea { resize: vertical; }
select {
  appearance: none;
  background-image: var(--arrow-icon);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 42px;
  min-height: 36px;
  line-height: 1.4;
}
select option {
  padding: 8px 12px;
  line-height: 1.4;
  background: #161616;
  color: var(--text);
}
select option:checked { background: #1f1f1f; }

button {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
button:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-primary { background: #141414; color: #e6e6e6; box-shadow: 0 10px 24px rgba(0,0,0,0.35); border: 1px solid #262626; }
.btn-primary:hover { background: #1f1f1f; transform: translateY(-1px); }
#openCreateOrderBtn.btn-primary {
  background: #1f8a46;
  border-color: #1b6f3a;
  color: #f8fafc;
}
#openCreateOrderBtn.btn-primary:hover {
  background: #1b7a3e;
}
#openCreateOrderBtn.btn-primary:active {
  background: #176536;
}
.btn-danger { background: #dc2626; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,0.3); }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.btn-secondary:hover { background: #1f1f1f; color: #e6e6e6; }
.btn-small { padding: 8px 12px; font-size: 12px; border-radius: 8px; }
.btn-link { background: transparent; color: var(--primary); padding: 0; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 6px; }
.table th, .table td { border: 1px solid var(--border); padding: 12px; font-size: 12px; text-align: left; }
.table th { background: #161616; font-weight: 700; color: var(--text); position: sticky; top: 0; z-index: 1; }
.table tbody tr:hover { background: #1f1f1f; }
.table tbody tr + tr td { border-top: 1px solid var(--border); }
.table td:first-child, .table th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.table td:last-child, .table th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.table .empty-cell { text-align: center; color: var(--muted); padding: 20px; }
.table.modern th { background: #161616; text-transform: uppercase; letter-spacing: .5px; font-size: 11px; }

.tag { padding: 4px 10px; border-radius: 999px; font-size: 11px; color: #0b0b0b; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 6px 14px rgba(0,0,0,0.3); }
.tag-refunded { background: #141414; color: var(--text); }
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  border: 1px solid transparent;
}
.status-pending { background: rgba(148, 163, 184, 0.15); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.25); }
.status-running { background: rgba(59, 130, 246, 0.15); color: #e0f2fe; border-color: rgba(59, 130, 246, 0.3); }
.status-review { background: rgba(250, 204, 21, 0.15); color: #fde68a; border-color: rgba(250, 204, 21, 0.3); }
.status-finished { background: rgba(34, 197, 94, 0.15); color: #bbf7d0; border-color: rgba(34, 197, 94, 0.3); }
.status-problem { background: rgba(248, 113, 113, 0.2); color: #fecaca; border-color: rgba(248, 113, 113, 0.3); }
.status-canceled { background: rgba(148, 163, 184, 0.2); color: #e2e8f0; border-color: rgba(148, 163, 184, 0.3); }
.order-status[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  background: #141414;
  color: var(--muted);
}
.status-pending > td { background: rgba(255, 255, 255, 0.04); color: #e6e6e6; }
.status-running > td { background: rgba(255, 255, 255, 0.04); color: #e6e6e6; }
.status-review > td { background: rgba(255, 255, 255, 0.04); color: #e6e6e6; }
.status-finished > td { background: rgba(255, 255, 255, 0.04); color: #e6e6e6; }
.status-problem > td { background: rgba(255, 255, 255, 0.04); color: #e6e6e6; }
.status-refunded > td { background: #161616; color: var(--text); }

.tag-level { padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #fff; }
.lv-normal { background: #6c757d; }
.lv-vip { background: #a16207; }
.lv-svip { background: #ea580c; }

.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.link-btn:hover { text-decoration: underline; }
.pill-link {
  background: #161616;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Layout Responsive */
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 20;
  }
  .sidebar.open { transform: translateX(0); }
  .main-area { min-height: 100vh; }
  .content { padding: 14px 16px 24px; }
}

@media (max-width: 640px) {
  .topbar-right { gap: 6px; }
  .top-search { display: none; }
  .table th, .table td { padding: 8px; }
  .orders-shell { min-height: auto; }
}
.pill-link:hover {
  text-decoration: none;
  background: #1f1f1f;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.note-text {
  max-width: 320px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.helper-box {
  margin-top: 15px;
  padding: 12px;
  background: #161616;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.actions-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-stack button { margin: 0; width: auto; }

.section-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-header .sub { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-search { display: flex; align-items: center; gap: 6px; }
.search-input { min-width: 220px; }
.muted { color: var(--muted); font-size: 12px; }
.soft-hidden { display: none; }

.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.dashboard-bottom { margin-top: 16px; }
.trend-mini-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 16px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.trend-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.35);
  border-color: rgba(244, 114, 182, 0.4);
}
.trend-mini-card:focus-visible {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.25);
}
.trend-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.trend-mini-title { font-size: 14px; font-weight: 800; color: var(--text); }
.trend-mini-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.trend-mini-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.15);
  color: #f9a8d4;
  border: 1px solid rgba(244, 114, 182, 0.35);
}
.trend-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.trend-mini-item {
  background: #111111;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
}
.trend-mini-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.trend-mini-value { font-size: 20px; font-weight: 800; color: var(--text); }
.trend-mini-amount { font-size: 13px; color: #f9a8d4; font-weight: 700; }
.trend-modal-content { display: grid; gap: 12px; }
.trend-modal-content .chart-panel { margin: 0; }
.trend-table-wrap {
  max-height: 240px;
  overflow: auto;
  border-radius: 10px;
}
.trend-table { margin-top: 0; }
.trend-modal-content .trend-table-wrap { max-height: 320px; }
.dashboard-chart {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chart-thumb {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chart-thumb:hover {
  border-color: rgba(244, 114, 182, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.chart-thumb:focus-visible {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.25);
}
.chart-panel {
  position: relative;
  background: #0f0f10;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chart-header { display: flex; flex-direction: column; gap: 4px; }
.chart-title { font-weight: 700; font-size: 14px; color: var(--text); }
.chart-sub { font-size: 11px; color: var(--muted); }
#orderTrendChart,
#orderAmountChart { width: 100%; height: 220px; display: block; }
.chart-thumb #orderTrendChart,
.chart-thumb #orderAmountChart { height: 140px; }
.chart-thumb .chart-tooltip { display: none; }
.trend-modal-box .chart-panel { max-height: none; }
@media (max-width: 960px) {
  .dashboard-chart { grid-template-columns: 1fr; }
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0b0b0b;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text);
  box-shadow: 0 12px 24px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease;
  white-space: nowrap;
}
.chart-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
.platform-card .table { margin-top: 12px; }
.platform-card .sub { color: var(--muted); }
.filters-card { background: var(--card); border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); padding: 18px; display: grid; gap: 12px; }
.filters-header { display: flex; justify-content: space-between; align-items: center; }
.filters-title { font-weight: 800; font-size: 15px; color: var(--text); }
.filters-sub { color: var(--muted); font-size: 11px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 12px; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label { font-weight: 700; color: var(--text); }
.orders-panel { background: var(--card); border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); padding: 18px; display: grid; gap: 12px; }
.collab-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}
.collab-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.collab-item strong { color: var(--text); }
.collab-item.unread {
  border-color: rgba(255, 111, 174, 0.65);
  background: rgba(255, 111, 174, 0.12);
}
.pill.pill-highlight {
  background: rgba(255, 111, 174, 0.18);
  color: #ff8fbe;
  border: 1px solid rgba(255, 111, 174, 0.4);
}
.chat-messages {
  background: #0c0c0d;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
}
.chat-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.chat-message.mine { align-items: flex-end; }
.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 70%;
  font-size: 11px;
  color: var(--muted);
}
.chat-meta.mine {
  justify-content: flex-end;
  align-self: flex-end;
}
.chat-meta-time {
  font-size: 10px;
  color: rgba(203, 213, 225, 0.7);
}
.chat-bubble {
  background: #1b1b1f;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid #2a2a2f;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  max-width: 70%;
}
.chat-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent #1b1b1f transparent transparent;
}
.chat-message.mine .chat-bubble {
  background: #1a1a1d;
  border-color: #303038;
}
.chat-message.mine .chat-bubble::before {
  left: auto;
  right: -6px;
  border-width: 6px 0 6px 6px;
  border-color: transparent transparent transparent #1a1a1d;
}
.chat-bubble.file {
  display: grid;
  gap: 6px;
  background: #121215;
  border-color: #2a2a2f;
}
.chat-bubble.file::before {
  border-color: transparent #121215 transparent transparent;
}
.chat-message.mine .chat-bubble.file {
  background: #17171b;
}
.chat-message.mine .chat-bubble.file::before {
  border-color: transparent transparent transparent #17171b;
}
.chat-bubble img {
  max-width: 220px;
  border-radius: 8px;
  cursor: pointer;
}
.chat-file-status {
  font-size: 11px;
  color: var(--muted);
}
.chat-file-status.error {
  color: #f87171;
}
@media (max-width: 720px) {
  .chat-meta {
    max-width: 85%;
  }
  .chat-bubble {
    max-width: 85%;
  }
}
.chat-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chat-input textarea {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: #0f0f10;
  color: var(--text);
  resize: none;
  height: 40px;
  min-height: 40px;
  max-height: 140px;
  overflow-y: hidden;
  line-height: 20px;
  flex: 1;
}
.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
#chatFileInput { display: none; }
.chat-action-btn {
  height: 36px;
  min-height: 36px;
  min-width: 64px;
  border-radius: 10px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 13px;
  font-weight: 600;
}
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(249, 168, 212, 0.45);
  background: rgba(249, 168, 212, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 30px rgba(249, 168, 212, 0.25);
  z-index: 60;
  cursor: pointer;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab .icon,
.chat-fab .chat-icon { width: 22px; height: 22px; }
.chat-fab .icon-badge {
  position: absolute;
  top: 6px;
  right: 6px;
}
.overlay-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay-mask.hidden { display: none; }
.overlay-mask .modal-box {
  width: min(900px, calc(100vw - 24px));
  max-height: 90vh;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 40px rgba(249, 168, 212, 0.18);
  border: 1px solid rgba(249, 168, 212, 0.4);
}
.overlay-mask .modal-box.sakura-modal {
  background: var(--card);
  border: 1px solid rgba(249, 168, 212, 0.45);
  box-shadow: 0 24px 50px rgba(249, 168, 212, 0.2);
}
.chat-modal {
  width: min(92vw, 1200px);
  height: 86vh;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #101012;
  padding: 16px;
}
.chat-modal-header {
  padding-bottom: 4px;
}
.chat-modal-title {
  font-size: 14px;
  font-weight: 700;
}
.chat-modal-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.chat-split {
  flex: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}
.chat-list-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: #0f0f10;
  min-height: 0;
}
.chat-thread-pane {
  display: flex;
  min-height: 0;
  flex: 1;
}
.chat-list-header {
  display: grid;
  gap: 6px;
}
.chat-presence-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text);
  height: 18px;
}
.chat-list-search {
  height: 32px;
  padding: 6px 10px;
}
.chat-admin-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 168, 212, 0.4) transparent;
}
.chat-admin-list::-webkit-scrollbar {
  width: 6px;
}
.chat-admin-list::-webkit-scrollbar-thumb {
  background: rgba(249, 168, 212, 0.15);
  border-radius: 999px;
}
.chat-admin-list:hover::-webkit-scrollbar-thumb {
  background: rgba(249, 168, 212, 0.45);
}
.chat-admin-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #131318;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  min-height: 56px;
}
.chat-admin-item.active {
  border-color: rgba(249, 168, 212, 0.6);
  background: rgba(249, 168, 212, 0.08);
  box-shadow: inset 3px 0 0 rgba(249, 168, 212, 0.7);
}
.chat-admin-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.chat-admin-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1c1c22;
  border: 1px solid #2a2a33;
  color: #e6e6e6;
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.chat-admin-item.active .chat-admin-avatar {
  border-color: rgba(249, 168, 212, 0.8);
  box-shadow: 0 0 0 2px rgba(249, 168, 212, 0.3);
}
.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
}
.presence-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.chat-admin-info { display: grid; gap: 2px; }
.chat-admin-name { font-weight: 700; font-size: 12px; }
.chat-admin-meta { font-size: 10px; color: var(--muted); }
.chat-current-admin {
  display: grid;
  gap: 6px;
  padding: 8px 0 4px;
}
.chat-current-label {
  font-size: 11px;
  color: var(--muted);
}
.chat-current-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: #131318;
  border: 1px solid var(--border);
  min-height: 56px;
}
.chat-current-card .chat-admin-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.chat-unread-badge {
  background: #ff6fae;
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #0f0f10;
  overflow: hidden;
  flex: 1;
}
.chat-thread.empty .chat-thread-header,
.chat-thread.empty .chat-input,
.chat-thread.empty .chat-tip,
.chat-thread.empty .chat-actions {
  display: none;
}
.chat-modal .chat-thread { min-height: 0; }
.chat-modal .chat-messages { max-height: none; flex: 1; }
.chat-modal .chat-input textarea { resize: none; }
.chat-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.chat-thread-title {
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chat-thread-meta { font-size: 11px; }
.chat-messages { overscroll-behavior: contain; }
.chat-empty-state {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  background: #0c0c0d;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.notification-panel {
  width: min(420px, calc(100vw - 24px));
  max-height: 80vh;
}
.notification-panel .collab-list {
  max-height: 60vh;
}
.order-lock-status {
  font-size: 12px;
  margin-left: 6px;
  color: var(--muted);
}
.order-lock-status.locked {
  color: #ff8fbe;
}
.order-lock-status.idle {
  color: var(--muted);
}
.status-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.lock-banner {
  background: rgba(249, 168, 212, 0.18);
  border: 1px solid rgba(249, 168, 212, 0.5);
  color: #ff8fbe;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.lock-banner.readonly {
  background: rgba(255, 99, 99, 0.12);
  border-color: rgba(255, 99, 99, 0.45);
  color: #ffb3b3;
}
.collab-empty {
  font-size: 12px;
  color: var(--muted);
}
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-title { font-weight: 800; color: var(--text); font-size: 16px; }
.panel-sub { color: var(--muted); font-size: 11px; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.pagination-ui { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.order-filter-advanced { display: flex; gap: 10px; flex-wrap: wrap; }
.order-filter-advanced select, .order-filter-advanced input { flex: 1; min-width: 180px; }
.ghost { box-shadow:none; background:transparent; border:1px solid var(--border); }

.search-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }

.login-panel { max-width: 420px; margin: 60px auto; background: var(--card); border-radius: 12px; padding: 26px 24px; box-shadow: 0 8px 20px rgba(0,0,0,.35); border: 1px solid var(--border); }
.login-panel h2 { margin: 0 0 18px; text-align: center; }
.login-error { color: #f87171; margin-top: 8px; text-align: center; display:none; }
.form-item { margin-bottom: 12px; }
.form-item label { display:block; font-size:13px; margin-bottom:4px; color:var(--muted); }
.form-item input { width:100%; padding:10px; box-sizing:border-box; font-size:13px; border:1px solid var(--border); border-radius:8px; outline:none; background: var(--surface-2); color: var(--text); }
.form-item input:focus { border-color: #262626; }

.hidden { display: none !important; }

#coachList {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  gap: 12px;
  justify-content: start;
}
.user-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 220px);
  gap: 10px;
  margin-top: 12px;
  justify-content: start;
}
@media (max-width: 820px) {
  #coachList {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .user-card-list {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}
.user-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.user-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4); }
.user-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.user-card-title { display: flex; flex-direction: column; gap: 6px; }
.user-card-name { font-weight: 800; font-size: 14px; color: var(--text); letter-spacing: .3px; }
.user-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-card-actions button { padding: 6px 10px; font-size: 12px; box-shadow: none; }
.user-card-body { margin-top: 10px; display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.user-card-row { display: flex; justify-content: space-between; gap: 10px; }
.user-card-row span:last-child { color: var(--text); font-weight: 600; }
.user-card-empty {
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--muted);
  text-align: center;
}
.coach-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.coach-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4); }
.coach-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.coach-title { display: flex; flex-direction: column; gap: 4px; }
.coach-card-name { font-weight: 800; font-size: 15px; color: var(--text); letter-spacing: .3px; }
.coach-meta { color: var(--muted); font-size: 12px; }
.coach-card-body { margin-top: 10px; display: grid; gap: 8px; }
.coach-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: #141414;
  border: 1px dashed #262626;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
}
.coach-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* Modal */
#modalMask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
#modalMask .modal-box {
  width: min(900px, calc(100vw - 24px));
  max-height: 90vh;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 40px rgba(249, 168, 212, 0.18);
  border: 1px solid rgba(249, 168, 212, 0.4);
}
#modalMask .modal-box.modal-large { width: min(1100px, calc(100vw - 24px)); }
#modalMask .modal-box.modal-small { width: min(580px, calc(100vw - 18px)); }
#modalMask .modal-box.sakura-modal {
  background: var(--card);
  border: 1px solid rgba(249, 168, 212, 0.45);
  box-shadow: 0 24px 50px rgba(249, 168, 212, 0.2);
}
.global-search-results { display: grid; gap: 12px; }
.global-search-section {
  background: #161616;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.global-search-title {
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}
.global-search-list { display: grid; gap: 8px; }
.global-search-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.global-search-item-title { font-weight: 700; color: var(--text); font-size: 13px; }
.global-search-item-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.global-search-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
@media (max-width: 960px) {
  .chat-modal {
    height: 88vh;
    max-height: 88vh;
  }
  .chat-split {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .chat-modal {
    width: min(94vw, 1200px);
    height: 90vh;
    max-height: 90vh;
  }
  .chat-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat-list-pane {
    max-height: 40vh;
  }
}
@media (max-width: 640px) {
  #modalMask .modal-box {
    width: calc(100vw - 12px);
    max-height: 92vh;
    padding: 14px;
  }
  .chat-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .chat-split {
    grid-template-columns: 1fr;
  }
  .chat-fab { right: 12px; bottom: 12px; }
}
#modalMask h3 { margin: 0; font-size: 15px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.modal-close {
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}
.modal-close:hover { background: #1f1f1f; border-radius: 8px; color: #e6e6e6; }
.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 80vh;
  margin-top: 10px;
  padding-right: 6px;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}
#modalContent { font-size: 13px; color: var(--text); }
#modalInputBox { margin-top: 12px; }
#modalInput { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
#modalInput:focus { outline: none; border-color: #262626; box-shadow: 0 0 0 3px rgba(38, 38, 38, 0.35); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(22,22,22,0.9), #161616);
  border-top: 1px solid var(--border);
}
.modal-open {
  overflow: hidden;
}

.sakura-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .sakura-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { margin-top: 0; color: var(--muted); font-weight: 700; }
.form-field-full { grid-column: 1 / -1; }
.sakura-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.sakura-input:focus {
  border-color: #262626;
  box-shadow: 0 0 0 3px rgba(38, 38, 38, 0.35);
}
.field-hint { font-size: 11px; color: var(--muted); }
.form-error { color: #f87171; margin-top: 4px; font-size: 12px; }

.balance-modal { display: flex; flex-direction: column; gap: 12px; }
.balance-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #161616;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.balance-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.balance-amount { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: .4px; }
.balance-mode-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.balance-mode-pill { position: relative; display: block; }
.balance-mode-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.balance-mode-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
  min-height: 72px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all .15s ease;
}
.balance-mode-title { font-weight: 800; color: var(--text); }
.balance-mode-sub { color: var(--muted); font-size: 11px; }
.balance-mode-pill input:checked + .balance-mode-card {
  border-color: #262626;
  background: #1f1f1f;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.balance-modal-box .modal-actions { margin-top: 4px; }

.entity-orders-wrap { display: flex; flex-direction: column; gap: 12px; }
.entity-detail-container { max-width: 1100px; margin: 0 auto; }
.entity-detail-header { align-items: flex-start; }
.entity-detail-heading { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.entity-detail-back { margin-top: 2px; }
.entity-summary-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: #161616;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.entity-summary-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.entity-summary-meta { color: var(--muted); font-size: 12px; }
.entity-tabs { display: flex; gap: 8px; margin: 4px 0 6px; flex-wrap: wrap; }
.entity-tab-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.entity-tab-btn.active {
  background: #1f1f1f;
  border-color: #262626;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.entity-table { max-height: 60vh; }
.entity-table .table { margin-top: 0; }
.entity-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 12px; align-items: start; }
@media (max-width: 900px) {
  .entity-layout { grid-template-columns: 1fr; }
}
.orders-column { display: flex; flex-direction: column; gap: 10px; }
.ledger-card { background: #161616; border:1px solid var(--border); border-radius:10px; padding:12px; box-shadow:0 10px 24px rgba(0,0,0,0.35); max-height:60vh; overflow:auto; }
.ledger-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.ledger-title { font-weight:800; color:var(--text); }
.ledger-sub { color:var(--muted); font-size:11px; }
.ledger-list { display:grid; gap:8px; }
.ledger-item { background:#0b0b0b; border:1px solid var(--border); border-radius:10px; padding:8px 10px; box-shadow:0 6px 14px rgba(0,0,0,0.3); display:grid; gap:6px; }
.ledger-meta { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:11px; }
.ledger-amount { font-weight:800; font-size:16px; }
.ledger-amount.pos { color:#e6e6e6; }
.ledger-amount.neg { color:#dc2626; }
.text-pos { color:#e6e6e6; }
.text-neg { color:#dc2626; }
.ledger-remark { color:var(--text); font-size:12px; word-break: break-all; }

.revenue-tabs { display: flex; gap: 8px; margin: 10px 0 12px; }
.revenue-tab { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--text); }
.revenue-tab.active { background: #1f1f1f; border-color: #262626; color: #e6e6e6; }
.revenue-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.loading-line { padding: 10px 0; color: var(--muted); font-size: 13px; }
.revenue-table { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.revenue-table table { width: 100%; border-collapse: separate; border-spacing: 0; }
.revenue-table td, .revenue-table th { padding: 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.revenue-table th { background: #161616; position: sticky; top: 0; z-index: 2; }
.revenue-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.revenue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.revenue-title {
  font-weight: 700;
  color: var(--text);
}
.revenue-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.revenue-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.text-right { text-align: right; }
.text-muted { color: var(--muted); font-size: 12px; }
.pill { padding: 4px 10px; border-radius: 10px; background: #161616; color: var(--text); font-size: 11px; border: 1px solid var(--border); }
.rank-section { margin-top: 10px; }
.rank-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rank-item { display: grid; grid-template-columns: 40px 1fr 100px 80px; gap: 8px; padding: 8px 10px; border-bottom:1px solid var(--border); align-items:center; }
.rank-item:nth-child(-n+3) { background: #161616; font-weight: 600; }
.rank-item .name { overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .amount { text-align: right; }
.rank-item .count { text-align: right; color: var(--muted); font-size: 12px; }
.rank-header { display: grid; grid-template-columns: 40px 1fr 100px 80px; padding: 8px 10px; background:#161616; font-weight:700; }
.rank-empty { padding: 12px; color: var(--muted); text-align: center; }
.range-buttons { display:flex; gap:6px; }
.range-buttons button { padding:6px 10px; border-radius:8px; border:1px solid var(--border); background: var(--surface-2); cursor:pointer; color: var(--text); }
.range-buttons button.active { background:#1f1f1f; color:#e6e6e6; border-color:#262626; }

/* Combobox */
.order-modal-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.combo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.combo-control {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.combo-control:focus-within {
  border-color: #262626;
  box-shadow: 0 0 0 3px rgba(38, 38, 38, 0.35);
}
.combo-input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: transparent;
  color: var(--text);
}
.combo-toggle {
  width: 44px;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .12s ease;
}
.combo-toggle::after {
  content: "";
  width: 12px;
  height: 8px;
  background-image: var(--arrow-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 8px;
}
.combo-toggle:hover { background: rgba(255, 255, 255, 0.06); }
.combo-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.45);
  max-height: 260px;
  overflow: auto;
  z-index: 30;
  display: none;
}
.combo-list.open { display: block; }
.combo-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.combo-item:last-child { border-bottom: none; }
.combo-item:hover, .combo-item.active { background: #1f1f1f; }
.combo-empty {
  padding: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.combo-tip { color: var(--muted); font-size: 12px; }
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  display: none;
  z-index: 80;
  padding: 24px 16px;
}
.search-overlay.open { display: block; }
.search-panel {
  margin: 0 auto;
  width: min(980px, 100%);
  background: #0f0f10;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6);
  padding: 18px;
  transform: translateY(-8px);
  transition: transform .2s ease;
}
.search-overlay.open .search-panel { transform: translateY(0); }
.search-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.search-panel-title { font-weight: 700; font-size: 14px; }
.search-panel-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.search-panel-close:hover { color: var(--text); }
.search-panel-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: #101010;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
}
.search-panel-input input {
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 6px 8px;
}
.search-panel-input input:focus { box-shadow: none; }
.search-panel-results { margin-top: 16px; }

.suggest-anchor { position: relative; width: 100%; }
.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0b0b0b;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  z-index: 60;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}
.suggest-list.hidden { display: none; }
.suggest-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
}
.suggest-item:hover { background: #141414; }
.suggest-item.active { background: #1a1a1a; }
.suggest-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  min-width: 36px;
  text-align: center;
}
.suggest-text { display: flex; flex-direction: column; gap: 2px; }
.suggest-title { font-size: 12px; color: var(--text); }
.suggest-sub { font-size: 11px; color: var(--muted); }
.entity-summary-grid {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.entity-summary-info {
  min-width: 0;
}
.entity-summary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.entity-summary-actions .btn-small {
  box-shadow: none;
}
