:root {
  color-scheme: light;
  --ink: #14231e;
  --ink-soft: #52615a;
  --muted: #89948f;
  --line: #e6ebe8;
  --surface: #ffffff;
  --canvas: #f3f5f2;
  --dark: #0b1713;
  --green: #2f9b68;
  --green-soft: #e5f5ec;
  --orange: #ff6b35;
  --orange-soft: #fff0e8;
  --gold: #d7a84e;
  --shadow: 0 18px 54px rgba(20, 35, 30, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 32px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--dark);
  background-size: 56px 56px;
}

.login-screen::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(58, 178, 117, 0.16), transparent 38%);
  content: "";
  pointer-events: none;
}

.login-atmosphere {
  position: absolute;
  border: 1px solid rgba(104, 222, 159, 0.14);
  border-radius: 50%;
}

.atmosphere-one {
  top: -320px;
  right: -210px;
  width: 720px;
  height: 720px;
}

.atmosphere-two {
  bottom: -270px;
  left: -170px;
  width: 560px;
  height: 560px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  background: rgba(18, 35, 28, 0.86);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.34);
  color: #fff;
  backdrop-filter: blur(22px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--orange);
  color: white;
  font-size: 23px;
  font-style: italic;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(255, 107, 53, 0.24);
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 17px;
  font-style: italic;
  letter-spacing: 0.1em;
}

.brand-lockup small {
  margin-top: 4px;
  color: #759083;
  font-size: 9px;
  letter-spacing: 0.19em;
}

.login-copy {
  margin: 56px 0 38px;
}

.login-copy h1 {
  margin: 17px 0 16px;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.22;
  letter-spacing: -0.05em;
}

.login-copy > p:last-child {
  margin: 0;
  color: #90a39a;
  line-height: 1.7;
}

.login-form label {
  display: block;
  margin-bottom: 10px;
  color: #bdc9c3;
  font-size: 13px;
  font-weight: 650;
}

.password-field {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 12px 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
  transition: border-color 0.2s, background 0.2s;
}

.password-field:focus-within {
  border-color: rgba(90, 218, 150, 0.7);
  background: rgba(255, 255, 255, 0.075);
}

.password-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
}

.password-field input::placeholder {
  color: #64776e;
}

.text-button {
  border: 0;
  background: transparent;
  color: #6ed79e;
  font-size: 12px;
}

.login-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  margin-top: 18px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  background: var(--orange);
  color: white;
  font-weight: 750;
  box-shadow: 0 14px 30px rgba(255, 107, 53, 0.19);
}

.login-button span:last-child {
  font-size: 22px;
}

.login-hint {
  margin: 15px 0 0;
  color: #60746b;
  font-size: 11px;
  text-align: center;
}

.login-footer {
  position: absolute;
  z-index: 1;
  bottom: 22px;
  color: #476056;
  font-size: 9px;
  letter-spacing: 0.25em;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 20px 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 10% 5%, rgba(74, 189, 128, 0.11), transparent 24%),
    var(--dark);
  color: white;
}

.sidebar-brand {
  padding: 0 8px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-groups {
  flex: 1;
  padding-top: 18px;
}

.nav-group {
  margin-bottom: 22px;
}

.nav-group > p {
  margin: 0 0 9px;
  padding: 0 11px;
  color: #53695f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 43px;
  margin: 3px 0;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8ea198;
  text-align: left;
  transition: background 0.18s, color 0.18s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: white;
}

.nav-item.active {
  background: rgba(76, 203, 138, 0.12);
  color: #6fe0a4;
  font-weight: 700;
}

.nav-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin-right: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 11px;
  font-weight: 750;
}

.nav-item.active .nav-symbol {
  background: rgba(83, 216, 148, 0.13);
}

.sidebar-footer {
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.server-status {
  display: flex;
  align-items: center;
  padding: 11px 9px;
}

.server-status > span {
  width: 9px;
  height: 9px;
  margin-right: 11px;
  border-radius: 50%;
  background: #4ed58d;
  box-shadow: 0 0 13px rgba(78, 213, 141, 0.7);
}

.server-status strong,
.server-status small {
  display: block;
}

.server-status strong {
  color: #b7c7bf;
  font-size: 11px;
}

.server-status small {
  margin-top: 3px;
  color: #53685f;
  font-size: 9px;
}

.logout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 37px;
  margin-top: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: transparent;
  color: #71877d;
  font-size: 11px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 102px;
  padding: 20px 38px;
  border-bottom: 1px solid rgba(222, 229, 225, 0.88);
  background: rgba(243, 245, 242, 0.92);
  backdrop-filter: blur(18px);
}

.topbar h2 {
  margin: 8px 0 0;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.today {
  margin-right: 7px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 12px;
}

.icon-button {
  width: 40px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-soft);
  font-size: 20px;
}

.primary-action {
  gap: 6px;
  padding: 0 17px;
  border: 0;
  background: var(--orange);
  color: white;
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 9px 24px rgba(255, 107, 53, 0.16);
}

.secondary-action {
  padding: 0 17px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-soft);
}

.content {
  padding: 28px 38px 54px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.metric-card {
  position: relative;
  min-height: 142px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(220, 227, 223, 0.85);
  border-radius: 20px;
  background: white;
  box-shadow: 0 12px 40px rgba(20, 35, 30, 0.035);
}

.metric-card.dark {
  border-color: transparent;
  background:
    radial-gradient(circle at 90% 12%, rgba(76, 217, 144, 0.18), transparent 32%),
    var(--dark);
  color: white;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.dark .metric-head {
  color: #81958c;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 780;
}

.dark .metric-icon {
  background: rgba(92, 221, 153, 0.11);
  color: #64dc9a;
}

.metric-value {
  margin-top: 20px;
  font-size: 34px;
  font-weight: 820;
  letter-spacing: -0.045em;
}

.metric-foot {
  margin-top: 7px;
  color: #9aa49f;
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 1px solid rgba(220, 227, 223, 0.9);
  border-radius: 22px;
  background: white;
  box-shadow: 0 12px 40px rgba(20, 35, 30, 0.035);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 23px 17px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-head span {
  color: var(--muted);
  font-size: 11px;
}

.activity-list {
  padding: 0 22px 13px;
}

.activity-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #edf0ee;
}

.activity-type {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 760;
}

.activity-copy strong,
.activity-copy small {
  display: block;
}

.activity-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.activity-time {
  color: #9ba49f;
  font-size: 10px;
}

.operations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px 20px;
}

.operation-tile {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafbfa;
}

.operation-tile strong,
.operation-tile small {
  display: block;
}

.operation-tile strong {
  font-size: 23px;
}

.operation-tile small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.resource-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.resource-summary {
  color: var(--muted);
  font-size: 12px;
}

.search-field {
  display: flex;
  align-items: center;
  width: min(100%, 280px);
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.table-shell {
  overflow: hidden;
  border: 1px solid rgba(220, 227, 223, 0.9);
  border-radius: 20px;
  background: white;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 15px 17px;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #fafbfa;
  color: #829089;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.data-table td {
  max-width: 260px;
  color: #536159;
  font-size: 12px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfcfb;
}

.primary-cell {
  color: var(--ink) !important;
  font-weight: 720;
}

.cell-muted {
  color: #929c97;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #287a56;
  font-size: 10px;
  font-weight: 700;
}

.status-badge.off {
  background: #eef1ef;
  color: #7a8780;
}

.color-dot {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 7px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d9dfdc;
  vertical-align: middle;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink-soft);
  font-size: 10px;
}

.row-button.danger {
  border-color: #f2d8d2;
  background: #fff8f6;
  color: #d55b45;
}

.empty-state {
  padding: 76px 30px;
  text-align: center;
}

.empty-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 17px;
  border-radius: 19px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 22px;
  font-weight: 820;
}

.empty-state h3 {
  margin: 0;
  font-size: 16px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.client-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
  transition: transform 0.18s, box-shadow 0.18s;
}

.client-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.client-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff9362, #ee5c2c);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.client-head strong,
.client-head small {
  display: block;
}

.client-head strong {
  font-size: 13px;
}

.client-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.client-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 18px;
}

.client-stats div {
  padding: 11px 7px;
  border-radius: 11px;
  background: #f6f8f7;
  text-align: center;
}

.client-stats strong,
.client-stats small {
  display: block;
}

.client-stats strong {
  font-size: 16px;
}

.client-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.client-card > button {
  width: 100%;
  height: 34px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink-soft);
  font-size: 10px;
}

.edit-dialog {
  width: min(94vw, 720px);
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: white;
  box-shadow: 0 30px 100px rgba(13, 28, 22, 0.24);
}

.edit-dialog::backdrop {
  background: rgba(6, 16, 12, 0.62);
  backdrop-filter: blur(6px);
}

.dialog-panel {
  margin: 0;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 27px 19px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h3 {
  margin: 8px 0 0;
  font-size: 20px;
}

.dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: #75817b;
  font-size: 21px;
}

.dialog-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
  max-height: 62vh;
  padding: 24px 27px;
  overflow-y: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #536159;
  font-size: 11px;
  font-weight: 680;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #dce3df;
  border-radius: 11px;
  outline: 0;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 12px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field input,
.field select {
  height: 42px;
  padding: 0 13px;
}

.field textarea {
  min-height: 94px;
  padding: 11px 13px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #69bd91;
  box-shadow: 0 0 0 3px rgba(64, 166, 112, 0.1);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  min-height: 42px;
  padding-top: 21px;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 27px 23px;
  border-top: 1px solid var(--line);
  background: #fafbfa;
}

.client-panel .dialog-body {
  display: block;
}

.client-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.client-summary div {
  padding: 15px;
  border-radius: 13px;
  background: #f5f8f6;
  text-align: center;
}

.client-summary strong,
.client-summary span {
  display: block;
}

.client-summary strong {
  font-size: 20px;
}

.client-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.detail-section {
  margin-top: 21px;
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.detail-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.detail-record strong,
.detail-record small {
  display: block;
}

.detail-record strong {
  font-size: 11px;
}

.detail-record small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.detail-record > span {
  color: var(--green);
  font-size: 10px;
  font-weight: 680;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  min-width: 220px;
  padding: 14px 17px;
  border-radius: 13px;
  background: #13271f;
  box-shadow: 0 18px 50px rgba(9, 24, 17, 0.24);
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #9f3e31;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .nav-groups {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 14px;
  }

  .nav-group:nth-child(2) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-group > p {
    grid-column: 1 / -1;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    position: static;
    padding: 20px 24px;
  }

  .content {
    padding: 24px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-screen {
    padding: 18px;
  }

  .login-card {
    padding: 28px 23px;
  }

  .login-copy {
    margin: 40px 0 30px;
  }

  .nav-groups {
    display: block;
  }

  .nav-group:nth-child(2) {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
  }

  .today {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .metric-grid,
  .client-grid {
    grid-template-columns: 1fr;
  }

  .resource-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .search-field {
    width: 100%;
  }

  .table-shell {
    overflow-x: auto;
  }

  .data-table {
    min-width: 700px;
  }

  .dialog-body {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .client-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
