/* ============================================================
   客保云 · visual refinement
   Quiet enterprise surfaces, restrained motion, no decorative noise.
   ============================================================ */

:root {
  --radius-lg: 14px;
  --radius-xl: 18px;
}

html { scroll-behavior: smooth; }
.app-body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.view-enter { animation: kb-view-in .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes kb-view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Top chrome: solid, readable, no glass effect */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}
.mobile-nav {
  background: var(--surface);
  border-top: 1px solid var(--border);
  backdrop-filter: none;
}

/* Dashboard overview band: flat navy, no orbit/grid decorations */
.dash-hero {
  background: #102a43;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  box-shadow: none;
  padding: 24px 28px;
}
[data-theme="blue"] .dash-hero { background: #0a213b; }
[data-theme="black"] .dash-hero { background: #161512; border-color: #2c2820; }
.hero-orbit, .hero-grid { display: none; }
.hero-title { font-size: 28px; letter-spacing: -.02em; }
.hero-eyebrow { letter-spacing: .02em; margin-bottom: 8px; }
.hero-actions { margin-top: 16px; }
.hero-btn-primary, .hero-btn-ghost {
  border-radius: 8px;
  backdrop-filter: none;
  box-shadow: none;
}
.hero-stats { gap: 8px; }
.hero-stat {
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .11);
  backdrop-filter: none;
  padding: 12px 13px;
}
.hero-stat-label { letter-spacing: .02em; }

/* KPI cards: one surface, one icon, no colored blobs */
.kpi-card {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
.kpi-card::after { display: none; }
.kpi-card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.kpi-icon {
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.kpi-card.tone-accent .kpi-icon { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.kpi-card.tone-success .kpi-icon { background: var(--success-soft); border-color: transparent; color: var(--success); }
.kpi-card.tone-warning .kpi-icon { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.kpi-card.tone-gold .kpi-icon { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.kpi-value { font-size: 32px; }

/* Empty lower dashboard should not stretch the activity card */
.bottom-grid { align-items: start; }

/* Mobile account actions: keep edit/reset/disable/delete reachable */
.user-mobile-actions { display: none; }

/* Generic cards and controls */
.card { border-radius: 12px; box-shadow: var(--shadow-sm); }
.card, .kpi-card, .btn, .nav-item, .menu-item, .theme-toggle {
  transition-duration: .18s;
}
.btn { border-radius: 8px; box-shadow: none; }
.btn:active { transform: translateY(1px); }
.nav-section-title {
  text-transform: none;
  letter-spacing: .02em;
  font-size: 14px;
  color: var(--text-3);
}
.nav-item { border-radius: 8px; }
.nav-item:hover { transform: none; }
.data-table tbody tr { transition: background-color .16s var(--ease); }
.popover { border-radius: 10px; }
.modal, .drawer { border-radius: 14px; }

/* Theme switch: no borders anywhere inside */
.theme-switch,
.theme-switch .theme-toggle,
.theme-switch .theme-opt {
  border: 0;
}

/* Login topbar: only the theme control; brand lives inside the card */
.login-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  height: 76px;
}
.login-brand { display: none; }
.login-topbar-right { margin-left: auto; }

.login-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}
.login-card-brand .logo-mark {
  width: 56px;
  height: 56px;
}
.login-card-brand .brand-text strong { font-size: 22px; }
.login-card-brand .brand-text small { font-size: 14px; letter-spacing: .04em; }

/* Login: no floating orbs or grid */
.logo-mark { object-fit: contain; }
.login-body {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.login-background { display: none; }
.login-card {
  border-radius: 14px;
  box-shadow: 0 10px 30px -24px rgba(13, 21, 38, .28);
  padding: 32px 32px 22px;
}
.login-card::before { display: none; }
.login-card-head h1 { font-size: 28px; letter-spacing: -.02em; }
.login-form .input-shell .input,
.login-form .btn-lg { border-radius: 8px; }

/* Loading screen: keep it quiet */
.boot-loader { background-image: none; }
.boot-logo { filter: none; }
.boot-bar span { background: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .dash-hero { padding: 20px; border-radius: 14px; }
  .hero-title { font-size: 23px; }
  .login-card { border-radius: 12px; padding: 26px 22px 18px; }
  .login-topbar { height: 64px; padding: 0 18px; }
  .login-card-brand { gap: 10px; margin-bottom: 18px; }
  .login-card-brand .logo-mark { width: 48px; height: 48px; }
  .login-card-brand .brand-text strong { font-size: 18px; }
  .login-card-brand .brand-text small { font-size: 14px; letter-spacing: .03em; }
}

@media (max-height: 760px) and (min-width: 621px) {
  .login-topbar { height: 58px; }
  .login-card-brand .logo-mark { width: 48px; height: 48px; }
  .login-card-brand .brand-text strong { font-size: 19px; }
}

@media (max-width: 860px) {
  .user-mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
  }
  .user-mobile-actions .row-action {
    width: 34px;
    height: 34px;
  }
  .users-table { min-width: 0; width: 100%; }
  .users-table .col-action,
  .users-table .col-cust { display: none; }

  .logs-table { min-width: 0; width: 100%; }
  .logs-table .col-type,
  .logs-table .col-ip,
  .logs-table .col-ua,
  .logs-table .col-reason { display: none; }
  .logs-table .log-summary {
    max-width: none;
    white-space: normal;
    overflow: visible;
  }
}

@media (max-width: 1024px) {
  .view { padding-bottom: 98px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view-enter { animation: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
