:root {
  --yw-ink: #071018;
  --yw-ink-soft: #0d1a22;
  --yw-cyan: #16cfe2;
  --yw-cyan-soft: #dff8fb;
  --yw-teal: #087f8c;
  --yw-red: #ff5145;
  --yw-paper: #f3f7f8;
  --yw-panel: #ffffff;
  --yw-line: #d9e4e8;
  --yw-text: #172129;
  --yw-muted: #687984;
  --yw-success: #16866e;
  --yw-warning: #b56a13;
  --yw-danger: #cf4c44;
}

html,
body,
#app {
  min-height: 100%;
}

html,
body,
button,
input,
select,
textarea {
  font-family: Inter, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif !important;
  letter-spacing: 0 !important;
}

body.yiwang-brand {
  background: var(--yw-paper) !important;
  color: var(--yw-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.yiwang-brand ::selection {
  background: rgba(22, 207, 226, 0.24);
  color: var(--yw-ink);
}

body.yiwang-brand * {
  scrollbar-color: #9fb2bb transparent;
  scrollbar-width: thin;
}

body.yiwang-brand *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.yiwang-brand *::-webkit-scrollbar-thumb {
  background: #9fb2bb;
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}

body.yiwang-brand *::-webkit-scrollbar-track {
  background: transparent;
}

/* Brand shell */
body.yiwang-brand aside.sidebar {
  width: 16rem !important;
  background: var(--yw-ink) !important;
  border-right: 1px solid #17313b !important;
  box-shadow: 10px 0 28px rgba(7, 16, 24, 0.08) !important;
}

body.yiwang-brand .sidebar-header {
  height: 4.5rem !important;
  gap: 0.75rem !important;
  padding: 0 1rem !important;
  border-color: #17313b !important;
}

body.yiwang-brand .sidebar-logo {
  width: 2.625rem !important;
  height: 2.625rem !important;
  flex: 0 0 2.625rem !important;
  border: 1px solid #1c3a45 !important;
  border-radius: 10px !important;
  background: #08131b !important;
  box-shadow: none !important;
}

body.yiwang-brand .sidebar-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.yiwang-brand .sidebar-header > a:not(.sidebar-logo) {
  min-width: 0;
  color: #f5fafc !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

body.yiwang-brand .sidebar-header > button {
  min-height: 1.5rem !important;
  padding: 0.25rem 0.45rem !important;
  border: 1px solid #23414b !important;
  border-radius: 6px !important;
  background: #0e2029 !important;
  color: #8fa7b2 !important;
  box-shadow: none !important;
  font-size: 0.625rem !important;
}

body.yiwang-brand .sidebar-nav {
  padding: 0.875rem 0.625rem !important;
}

body.yiwang-brand .sidebar-section {
  margin-bottom: 1.1rem !important;
}

body.yiwang-brand .yiwang-section-label,
body.yiwang-brand .sidebar-section-title {
  display: block;
  margin: 0 0 0.4rem;
  padding: 0 0.75rem;
  color: #647c87 !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  line-height: 1.25rem !important;
  text-transform: uppercase;
}

body.yiwang-brand .sidebar-link {
  position: relative;
  min-height: 2.55rem;
  gap: 0.7rem !important;
  margin-bottom: 0.2rem !important;
  padding: 0.58rem 0.75rem !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #a7b8c0 !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease !important;
}

body.yiwang-brand .sidebar-link svg {
  width: 1.05rem !important;
  height: 1.05rem !important;
  flex: 0 0 1.05rem !important;
  color: #6d8792 !important;
  transition: color 140ms ease !important;
}

body.yiwang-brand .sidebar-link:hover {
  border-color: #17343e !important;
  background: #0d2029 !important;
  color: #effbfd !important;
}

body.yiwang-brand .sidebar-link:hover svg {
  color: #bdeff4 !important;
}

body.yiwang-brand .sidebar-link-active,
body.yiwang-brand .sidebar-link.router-link-active {
  border-color: #20505d !important;
  background: #102b34 !important;
  color: #f3fcfd !important;
  box-shadow: inset 3px 0 0 var(--yw-cyan) !important;
}

body.yiwang-brand .sidebar-link-active svg,
body.yiwang-brand .sidebar-link.router-link-active svg {
  color: var(--yw-cyan) !important;
}

body.yiwang-brand aside.sidebar > div:last-child {
  padding: 0.65rem !important;
  border-color: #17313b !important;
  background: #08131b !important;
}

body.yiwang-brand aside.sidebar > div:last-child button {
  border-radius: 8px !important;
  color: #8fa4ae !important;
}

body.yiwang-brand aside.sidebar > div:last-child button:hover {
  background: #10252e !important;
  color: #f2fbfc !important;
}

/* Top navigation */
body.yiwang-brand header.glass {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: var(--yw-line) !important;
  box-shadow: 0 1px 0 rgba(12, 33, 43, 0.03) !important;
  backdrop-filter: blur(16px) !important;
}

body.yiwang-brand header.glass::after {
  position: absolute;
  bottom: -1px;
  left: 1.5rem;
  width: 5.5rem;
  height: 2px;
  background: var(--yw-cyan);
  content: "";
}

body.yiwang-brand header.glass > div {
  height: 4.5rem !important;
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
}

body.yiwang-brand header h1 {
  color: var(--yw-text) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

body.yiwang-brand header h1 + p,
body.yiwang-brand header p {
  color: var(--yw-muted) !important;
  font-size: 0.72rem !important;
}

body.yiwang-brand header button {
  border-radius: 8px !important;
}

body.yiwang-brand header button:hover {
  background-color: #edf4f6 !important;
}

body.yiwang-brand .yiwang-mobile-brand {
  display: none;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  overflow: hidden;
  border: 1px solid #1b3944;
  border-radius: 8px;
  background: var(--yw-ink);
}

body.yiwang-brand .yiwang-mobile-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Work surface */
body.yiwang-brand #app > div,
body.yiwang-brand main {
  background: var(--yw-paper) !important;
}

body.yiwang-brand main {
  min-height: calc(100vh - 4.5rem);
  padding: 1.25rem !important;
}

body.yiwang-brand main > * {
  width: 100%;
  max-width: 1920px;
  margin-right: auto;
  margin-left: auto;
}

body.yiwang-brand .layout-section-fixed:first-child {
  padding: 0.875rem !important;
  border: 1px solid var(--yw-line) !important;
  border-radius: 8px !important;
  background: var(--yw-panel) !important;
  box-shadow: 0 1px 2px rgba(11, 34, 44, 0.03) !important;
}

body.yiwang-brand .layout-section-scrollable {
  margin-top: 0.875rem !important;
}

body.yiwang-brand .card {
  border: 1px solid var(--yw-line) !important;
  border-radius: 8px !important;
  background: var(--yw-panel) !important;
  box-shadow: 0 1px 2px rgba(11, 34, 44, 0.04) !important;
}

body.yiwang-brand .card:hover {
  box-shadow: 0 2px 8px rgba(11, 34, 44, 0.06) !important;
  transform: none !important;
}

body.yiwang-brand .table-scroll-container {
  overflow: hidden !important;
}

body.yiwang-brand .table-wrapper {
  border-radius: 0 !important;
  background: var(--yw-panel) !important;
}

body.yiwang-brand table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: var(--yw-panel) !important;
}

body.yiwang-brand table thead {
  background: #f6f9fa !important;
}

body.yiwang-brand table th {
  padding: 0.72rem 0.8rem !important;
  border-color: var(--yw-line) !important;
  background: #f6f9fa !important;
  color: #62737d !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  line-height: 1.15rem !important;
  white-space: nowrap;
}

body.yiwang-brand table td {
  padding: 0.72rem 0.8rem !important;
  border-color: #e7eef1 !important;
  color: #34424b !important;
  font-size: 0.78rem !important;
  line-height: 1.25rem !important;
  vertical-align: middle !important;
}

body.yiwang-brand table tbody tr {
  background: var(--yw-panel) !important;
  transition: background-color 120ms ease !important;
}

body.yiwang-brand table tbody tr:hover {
  background: #f0fafb !important;
}

body.yiwang-brand table a {
  color: #087a87 !important;
  font-weight: 600 !important;
}

body.yiwang-brand table a:hover {
  color: #055f69 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Controls */
body.yiwang-brand .btn {
  min-height: 2.25rem !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
}

body.yiwang-brand .btn-primary {
  border: 1px solid #087580 !important;
  background: #087f8c !important;
  background-image: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.yiwang-brand .btn-primary:hover {
  border-color: #066974 !important;
  background: #066f7a !important;
  background-image: none !important;
  transform: none !important;
}

body.yiwang-brand .btn-secondary {
  border-color: #cddadf !important;
  background: #ffffff !important;
  color: #42525c !important;
  box-shadow: none !important;
}

body.yiwang-brand .btn-secondary:hover {
  border-color: #aebfc6 !important;
  background: #f5f8f9 !important;
  color: #172129 !important;
  transform: none !important;
}

body.yiwang-brand .btn-ghost:hover {
  background: #e9f1f3 !important;
}

body.yiwang-brand .btn-danger {
  background-image: none !important;
  background-color: var(--yw-danger) !important;
  box-shadow: none !important;
}

body.yiwang-brand input:not([type="checkbox"]):not([type="radio"]),
body.yiwang-brand textarea,
body.yiwang-brand select,
body.yiwang-brand [role="combobox"] {
  border-color: #cbd9df !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  color: var(--yw-text) !important;
  box-shadow: none !important;
}

body.yiwang-brand input:not([type="checkbox"]):not([type="radio"]):focus,
body.yiwang-brand textarea:focus,
body.yiwang-brand select:focus,
body.yiwang-brand [role="combobox"]:focus {
  border-color: var(--yw-teal) !important;
  box-shadow: 0 0 0 3px rgba(22, 207, 226, 0.14) !important;
  outline: none !important;
}

body.yiwang-brand input::placeholder,
body.yiwang-brand textarea::placeholder {
  color: #97a7af !important;
}

body.yiwang-brand input[type="checkbox"],
body.yiwang-brand input[type="radio"] {
  accent-color: var(--yw-teal);
}

body.yiwang-brand .badge {
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
}

body.yiwang-brand .badge-primary {
  border-color: #b7e8ed !important;
  background: #e7f8fa !important;
  color: #08717c !important;
}

body.yiwang-brand .badge-success {
  border-color: #bce6d9 !important;
  background: #eaf8f3 !important;
  color: #11735e !important;
}

body.yiwang-brand .badge-warning {
  border-color: #ecd5ae !important;
  background: #fff8e9 !important;
  color: #98601b !important;
}

body.yiwang-brand .badge-danger {
  border-color: #efc4c0 !important;
  background: #fff0ef !important;
  color: #b7433d !important;
}

body.yiwang-brand .modal-overlay,
body.yiwang-brand [data-headlessui-state][role="dialog"]::before {
  backdrop-filter: blur(4px) !important;
}

body.yiwang-brand .modal-content,
body.yiwang-brand [role="dialog"] {
  border: 1px solid #cfdde2 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 60px rgba(7, 16, 24, 0.2) !important;
}

body.yiwang-brand .modal-header,
body.yiwang-brand .modal-footer {
  border-color: var(--yw-line) !important;
}

body.yiwang-brand .modal-title,
body.yiwang-brand [role="dialog"] h2,
body.yiwang-brand [role="dialog"] h3 {
  color: var(--yw-text) !important;
  font-weight: 700 !important;
}

body.yiwang-brand [role="listbox"],
body.yiwang-brand [role="menu"] {
  border: 1px solid #cfdde2 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 12px 28px rgba(7, 16, 24, 0.14) !important;
}

body.yiwang-brand [role="option"] {
  border-radius: 6px !important;
}

body.yiwang-brand [role="option"]:hover,
body.yiwang-brand [role="option"][aria-selected="true"] {
  background: #e9f8fa !important;
  color: #086d78 !important;
}

/* Pagination and operational strips */
body.yiwang-brand .table-scroll-container > .mb-4 {
  margin: 0 !important;
  border-bottom: 1px solid var(--yw-line) !important;
  border-radius: 0 !important;
  background: #edf8fa !important;
}

body.yiwang-brand .table-page-layout > .layout-section-fixed:last-child > div {
  border-color: var(--yw-line) !important;
  background: #ffffff !important;
}

body.yiwang-brand nav[aria-label="Pagination"] button,
body.yiwang-brand nav[aria-label="pagination"] button {
  border-color: #cbd9df !important;
  background: #ffffff !important;
  color: #43535d !important;
  box-shadow: none !important;
}

body.yiwang-brand nav[aria-label="Pagination"] button[aria-current="page"],
body.yiwang-brand nav[aria-label="pagination"] button[aria-current="page"] {
  border-color: var(--yw-teal) !important;
  background: var(--yw-teal) !important;
  color: #ffffff !important;
}

/* Login and public pages */
body.yiwang-brand:not(:has(aside.sidebar)) #app > div {
  background: #eef4f5 !important;
}

body.yiwang-brand:not(:has(aside.sidebar)) .card,
body.yiwang-brand:not(:has(aside.sidebar)) form {
  border-radius: 8px !important;
}

/* Dark mode stays graphite instead of blue-gray. */
html.dark body.yiwang-brand,
html.dark body.yiwang-brand #app > div,
html.dark body.yiwang-brand main {
  background: #090e12 !important;
  color: #e7eef1 !important;
}

html.dark body.yiwang-brand header.glass {
  background: rgba(13, 20, 25, 0.96) !important;
  border-color: #25343b !important;
}

html.dark body.yiwang-brand header h1,
html.dark body.yiwang-brand .modal-title,
html.dark body.yiwang-brand [role="dialog"] h2,
html.dark body.yiwang-brand [role="dialog"] h3 {
  color: #f2f7f8 !important;
}

html.dark body.yiwang-brand header button:hover {
  background: #17242b !important;
}

html.dark body.yiwang-brand .layout-section-fixed:first-child,
html.dark body.yiwang-brand .card,
html.dark body.yiwang-brand table,
html.dark body.yiwang-brand table tbody tr,
html.dark body.yiwang-brand .table-wrapper,
html.dark body.yiwang-brand .table-page-layout > .layout-section-fixed:last-child > div {
  border-color: #26373e !important;
  background: #10171c !important;
}

html.dark body.yiwang-brand table thead,
html.dark body.yiwang-brand table th {
  border-color: #2b3b42 !important;
  background: #151f24 !important;
  color: #9cb0b9 !important;
}

html.dark body.yiwang-brand table td {
  border-color: #202e34 !important;
  color: #cbd6da !important;
}

html.dark body.yiwang-brand table tbody tr:hover {
  background: #11262c !important;
}

html.dark body.yiwang-brand .btn-secondary,
html.dark body.yiwang-brand input:not([type="checkbox"]):not([type="radio"]),
html.dark body.yiwang-brand textarea,
html.dark body.yiwang-brand select,
html.dark body.yiwang-brand [role="combobox"],
html.dark body.yiwang-brand [role="listbox"],
html.dark body.yiwang-brand [role="menu"],
html.dark body.yiwang-brand .modal-content,
html.dark body.yiwang-brand [role="dialog"] {
  border-color: #2a3a41 !important;
  background: #111a1f !important;
  color: #dce5e8 !important;
}

html.dark body.yiwang-brand .btn-secondary:hover {
  background: #18252b !important;
  color: #ffffff !important;
}

@media (max-width: 1023px) {
  body.yiwang-brand .yiwang-mobile-brand {
    display: flex;
  }

  body.yiwang-brand header.glass > div {
    height: 4rem !important;
    padding-right: 0.75rem !important;
    padding-left: 0.75rem !important;
  }

  body.yiwang-brand header.glass::after {
    left: 0.75rem;
    width: 3.5rem;
  }

  body.yiwang-brand main {
    min-height: calc(100vh - 4rem);
    padding: 0.875rem !important;
  }

  body.yiwang-brand .layout-section-fixed:first-child {
    padding: 0.75rem !important;
  }
}

@media (max-width: 639px) {
  body.yiwang-brand header h1 {
    font-size: 0.9rem !important;
  }

  body.yiwang-brand header h1 + p {
    display: none;
  }

  body.yiwang-brand main {
    padding: 0.625rem !important;
  }

  body.yiwang-brand .card,
  body.yiwang-brand .layout-section-fixed:first-child {
    border-radius: 6px !important;
  }

  body.yiwang-brand table th,
  body.yiwang-brand table td {
    padding: 0.62rem 0.68rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.yiwang-brand *,
  body.yiwang-brand *::before,
  body.yiwang-brand *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
