:root {
  color: #202124;
  color-scheme: light;
  --brand: #1a73e8;
  --brand-soft: #4285f4;
  --brand-dark: #1558b0;
  --brand-wash: #e8f0fe;
  --ink: #202124;
  --muted: #5f6368;
  --subtle: #80868b;
  --line: #e8eaed;
  --surface: #fff;
  --canvas: #f8f9fa;
  --success: #188038;
  --success-soft: #34a853;
  --success-wash: #e6f4ea;
  --warning: #ea8600;
  --warning-soft: #f9ab00;
  --warning-wash: #fef7e0;
  --danger: #d93025;
  --danger-soft: #ea4335;
  --danger-wash: #fce8e6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 8% -12%, #4285f426, transparent 36%),
    radial-gradient(circle at 96% 0%, #34a8531a, transparent 30%),
    radial-gradient(circle at 78% 100%, #fbbc0414, transparent 28%),
    var(--canvas);
  font-family: "Segoe UI Variable", "Segoe UI", Inter, "Microsoft YaHei UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #fff4, transparent 42%), var(--brand-soft);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -1px;
  box-shadow: 0 8px 20px #4285f440;
}
.brand strong { color: #152034; letter-spacing: 0.8px; font-size: 15px; font-weight: 750; display: block; }
.brand span { color: #8a94a6; letter-spacing: 1.65px; font-size: 8px; font-weight: 700; display: block; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 0.94fr) minmax(480px, 1.06fr);
  background: #fff;
}
.auth-brand {
  color: #fff;
  background:
    linear-gradient(145deg, #3c58aa26, transparent 38%),
    radial-gradient(circle at 20% 90%, #5a7cda3b, transparent 35%),
    #16213b;
  padding: 43px 9%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-brand:before, .auth-brand:after {
  content: "";
  position: absolute;
  border: 1px solid #ffffff0e;
  border-radius: 50%;
}
.auth-brand:before { width: 580px; height: 580px; bottom: -180px; right: -230px; }
.auth-brand:after { width: 360px; height: 360px; bottom: -70px; right: -120px; }
.auth-brand .brand { z-index: 1; position: relative; }
.auth-brand .brand strong { color: #fff; }
.auth-brand .brand span { color: #8996b6; }
.auth-visual { z-index: 1; width: min(100%, 540px); margin: auto 0; position: relative; }
.auth-kicker, .eyebrow {
  color: #7892df;
  letter-spacing: 1.35px;
  text-transform: uppercase;
  margin-bottom: 7px;
  font-size: 9.5px;
  font-weight: 750;
}
.auth-visual h1 {
  color: #f5f7fc;
  letter-spacing: -2.3px;
  margin: 13px 0 19px;
  font-size: clamp(34px, 4.4vw, 59px);
  font-weight: 650;
  line-height: 1.14;
}
.auth-visual > p { color: #9ca8c3; max-width: 420px; margin: 0; font-size: 13px; line-height: 1.7; }
.auth-feature-list { display: flex; flex-direction: column; gap: 15px; margin-top: 38px; }
.auth-feature-list > div { color: #6f86cc; display: flex; align-items: center; gap: 12px; }
.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6f86cc;
  flex: none;
}
.auth-feature-list span { color: #8996b4; display: flex; flex-direction: column; font-size: 10px; }
.auth-feature-list strong { color: #d8dfef; margin-bottom: 2px; font-size: 11px; font-weight: 620; }
.auth-version { z-index: 1; color: #596680; letter-spacing: 1.4px; font-size: 8px; font-weight: 700; position: relative; }
.auth-form-wrap {
  background: radial-gradient(circle at 100% 0, #4285f414, transparent 32%), #fff;
  display: grid;
  place-items: center;
  padding: 48px;
}
.auth-form { width: min(100%, 350px); }
.auth-form-head { margin-bottom: 25px; }
.auth-form-head > span { color: #6b7fbd; letter-spacing: 0.8px; font-size: 9.5px; font-weight: 700; }
.auth-form-head h2 { color: #172338; letter-spacing: -0.7px; margin: 7px 0; font-size: 25px; font-weight: 680; }
.auth-form-head p { color: #838d9d; margin: 0; font-size: 10.5px; }
.field { color: #455166; display: flex; flex-direction: column; gap: 6px; font-size: 10.5px; font-weight: 630; margin-bottom: 14px; }
.field textarea {
  color: #303d53;
  background: #fff;
  border: 1px solid #d8dee7;
  border-radius: 6px;
  outline: none;
  width: 100%;
  min-height: 96px;
  padding: 10px 11px;
  font-size: 11px;
  resize: vertical;
}
.field input, .field select {
  color: #303d53;
  background: #fff;
  border: 1px solid #d8dee7;
  border-radius: 6px;
  outline: none;
  width: 100%;
  height: 37px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 450;
}
.field input:focus, .field select:focus { border-color: var(--brand-soft); box-shadow: 0 0 0 2px #1a73e81f; }
.button {
  cursor: pointer;
  color: #455268;
  background: #fff;
  border: 1px solid #dce1e9;
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  font-size: 11.5px;
  font-weight: 620;
  display: inline-flex;
  box-shadow: 0 1px 1px #0f1c3208;
}
.button.primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px #1a73e838; }
.button.primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-submit { width: 100%; min-height: 39px; }
.auth-switch { color: #7d8797; text-align: center; margin: 17px 0; font-size: 10px; }
.auth-switch button, .preview-link { cursor: pointer; color: var(--brand); background: none; border: 0; font-weight: 620; font-size: inherit; }
.auth-security { color: #9099a8; border-top: 1px solid #e9ebef; display: flex; gap: 8px; padding-top: 17px; font-size: 8.5px; line-height: 1.55; }
.error { color: var(--danger); min-height: 18px; font-size: 11px; margin: 0 0 10px; }
.home-actions { display: flex; gap: 10px; margin-top: 28px; }

.admin-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  background: linear-gradient(180deg, #e8f0fe 0%, #fff 28%);
  border-right: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
}
.sidebar > .brand { height: 74px; padding: 0 24px; }
.nav-groups { padding: 12px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow: auto; }
.nav-label {
  color: #98a1b2;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 16px 11px 7px;
  font-size: 10px;
  font-weight: 700;
}
.sidebar-footer {
  border-top: 1px solid #e6e9ef;
  padding: 14px 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-card { display: flex; align-items: center; gap: 9px; padding: 7px 9px; }
.user-card > div { min-width: 0; flex: 1; }
.user-card strong, .user-card span { display: block; }
.user-card strong { color: #263246; font-size: 11.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card span { color: #8791a2; font-size: 10.5px; }
.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-wash);
  border: 1px solid #d2e3fc;
  flex: none;
}
.avatar svg { display: block; }
.plan-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.plan-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}
.plan-card b { display: block; font-size: 22px; margin: 8px 0; color: var(--brand); }
.pay-box { text-align: center; margin-top: 18px; }
.pay-box img { width: 220px; height: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.nav-item {
  color: #5e687b;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 560;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  position: relative;
  transition: all .14s;
}
.nav-item:hover { color: #233456; background: #f0f3f8; }
.nav-item.active { color: var(--brand); background: var(--brand-wash); font-weight: 650; }
.nav-item.active:before {
  content: "";
  position: absolute;
  left: -13px;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-soft);
}
.app-main { min-height: 100vh; margin-left: 244px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffffe6;
  border-bottom: 1px solid #e5e8ee;
  backdrop-filter: blur(18px);
}
.topbar h1 { margin: 0; font-size: 18px; }
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-title > div { display: flex; align-items: center; gap: 8px; }
.topbar-title span { color: #8c96a8; font-size: 12px; }
.topbar-title span:after { color: #c6cbd5; content: "/"; padding-left: 8px; }
.topbar-title strong { color: #344057; font-size: 12px; font-weight: 650; }
.topbar-actions, .page-actions { display: flex; align-items: center; gap: 8px; }
.crumb { display: flex; align-items: center; gap: 10px; color: #8c96a8; font-size: 12px; }
.crumb strong { color: #344057; font-weight: 650; }
.ws-pill, .connection-pill {
  color: #667385;
  background: #fafcfb;
  border: 1px solid #dfe5e2;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
}
.ws-pill.connected, .connection-pill.connected { color: var(--success); background: var(--success-wash); border-color: #ceead6; }
.page { padding: 32px 34px 60px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 25px;
}
.page-header h1 {
  color: #162237;
  letter-spacing: -0.9px;
  margin: 0;
  font-size: clamp(25px, 2.4vw, 32px);
  font-weight: 690;
}
.page-header p {
  color: #737e90;
  max-width: 620px;
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.55;
}
.panel, .metric-card, .function-card {
  background: #fffffff5;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 2px 6px #1a263c06;
}
.panel { overflow: hidden; }
.panel-heading {
  border-bottom: 1px solid #e8ebf0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 0 20px;
}
.panel-heading h2 { color: #28344a; margin: 0; font-size: 13px; font-weight: 670; }
.panel-body { padding: 18px 20px 20px; }
.form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 17px;
}
.login-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 14px 15px 15px 16px;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  background: #fff;
  color: #455166;
  position: relative;
  overflow: hidden;
}
.login-fields .login-field:nth-child(1) { background: linear-gradient(180deg, #e8f0fe 0%, #fff 42%); }
.login-fields .login-field:nth-child(1):before { background: var(--brand-soft); }
.login-fields .login-field:nth-child(2) { background: linear-gradient(180deg, #e6f4ea 0%, #fff 42%); }
.login-fields .login-field:nth-child(2):before { background: var(--success-soft); }
.login-fields .login-field:nth-child(3) { background: linear-gradient(180deg, #fef7e0 0%, #fff 42%); }
.login-fields .login-field:nth-child(3):before { background: var(--warning-soft); }
.login-fields .login-field:nth-child(4) { background: linear-gradient(180deg, #fce8e6 0%, #fff 42%); }
.login-fields .login-field:nth-child(4):before { background: var(--danger-soft); }
.login-field:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.login-field:focus-within {
  background: #fff;
  border-color: var(--brand-soft);
  box-shadow: 0 0 0 3px #1a73e81a;
}
.login-field > span { color: #2a364a; font-size: 13px; font-weight: 670; }
.login-field > small { color: #8b95a5; font-size: 11px; font-weight: 500; }
.login-field input, .login-field select {
  color: #303d53;
  background: #fff;
  border: 1px solid #d8dee7;
  border-radius: 6px;
  outline: none;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  font-size: 13px;
  margin-top: 4px;
}
.login-field select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23919aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.login-field input:focus, .login-field select:focus { border-color: var(--brand-soft); box-shadow: 0 0 0 2px #1a73e81f; }
.login-options {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e8ebf0;
}
.login-options > span {
  display: block;
  color: #667286;
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 10px;
}
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  background: #fff;
  color: #3a465a;
  font-size: 12px;
}
.option-chip input { width: auto; margin: 0; }
.option-chip:has(input:checked) {
  background: var(--brand-wash);
  border-color: #aecbfa;
  color: var(--brand);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}
.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 17px 17px 17px 18px;
  position: relative;
  overflow: hidden;
}
.metric-card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.metric-grid .metric-card:nth-child(1) { background: linear-gradient(180deg, #e8f0fe 0%, #fff 52%); }
.metric-grid .metric-card:nth-child(1):before { background: var(--brand-soft); }
.metric-grid .metric-card:nth-child(1) > b { color: var(--brand); }
.metric-grid .metric-card:nth-child(2) { background: linear-gradient(180deg, #e6f4ea 0%, #fff 52%); }
.metric-grid .metric-card:nth-child(2):before { background: var(--success-soft); }
.metric-grid .metric-card:nth-child(2) > b { color: var(--success); }
.metric-grid .metric-card:nth-child(3) { background: linear-gradient(180deg, #fef7e0 0%, #fff 52%); }
.metric-grid .metric-card:nth-child(3):before { background: var(--warning-soft); }
.metric-grid .metric-card:nth-child(3) > b { color: #b06000; }
.metric-grid .metric-card:nth-child(4) { background: linear-gradient(180deg, #fce8e6 0%, #fff 52%); }
.metric-grid .metric-card:nth-child(4):before { background: var(--danger-soft); }
.metric-grid .metric-card:nth-child(4) > b { color: var(--danger); }
.metric-card > span { color: #737e8f; font-size: 10.5px; font-weight: 580; }
.metric-card > b {
  letter-spacing: -0.6px;
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 680;
}
.metric-card > p { color: #929baa; margin: 0; font-size: 11px; line-height: 1.45; }
.function-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.function-card {
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 19px;
  transition: all .16s;
  position: relative;
  overflow: hidden;
}
.function-card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
}
.function-grid .function-card:nth-child(1):before { background: var(--brand-soft); }
.function-grid .function-card:nth-child(2):before { background: var(--success-soft); }
.function-grid .function-card:nth-child(3):before { background: var(--warning-soft); }
.function-grid .function-card:nth-child(4):before { background: var(--danger-soft); }
.function-card:hover {
  border-color: #c5d4f5;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px #1a73e814;
}
.function-card h2 { color: #2a364a; margin: 0 0 6px; font-size: 13.5px; font-weight: 670; }
.function-card > p { color: #7c8798; min-height: 34px; margin: 0 0 12px; font-size: 12px; line-height: 1.55; }
.function-card .button { align-self: flex-start; margin-top: 8px; }
.function-card .muted { margin-top: auto; padding-top: 12px; font-size: 11px; }
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(285px, .72fr);
  gap: 13px;
}
.empty-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 250px;
  padding: 35px;
}
.empty-state h3 { color: #354157; margin: 13px 0 5px; font-size: 13px; }
.empty-state p { color: #8993a4; max-width: 370px; margin: 0; font-size: 12px; line-height: 1.6; }
.empty-icon {
  color: var(--brand);
  background: var(--brand-wash);
  border-radius: 12px;
  place-items: center;
  width: 49px;
  height: 49px;
  display: grid;
  font-weight: 750;
}
.plan-price { color: var(--brand); font-size: 28px; letter-spacing: -0.8px; margin: 8px 0 16px; }
.table-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #e8ebf0; flex-wrap: wrap; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #eef1f5; }
th { color: #7a8596; font-size: 11px; font-weight: 700; }
#account-list tr { cursor: pointer; }
#account-list tr:hover { background: #f7f9fc; }
#account-list tr.active { background: var(--brand-wash); }
.muted { color: var(--muted); }
.ok { color: var(--success); }
.bad { color: var(--danger); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { height: 34px; border: 1px solid #d8dee7; border-radius: 6px; padding: 0 10px; width: 88px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 8px 0 0; }
.check { display: flex; align-items: center; gap: 8px; color: #303d53; font-size: 13px; }
.check input { width: auto; margin: 0; }
table input, table select {
  height: 34px;
  border: 1px solid #d8dee7;
  border-radius: 6px;
  padding: 0 10px;
  width: 100%;
}
table input[type="datetime-local"] { min-width: 196px; }
table input[type="number"] { width: 72px; }
.function-card > .button,
.function-card > .inline { margin-top: auto; }
.function-card .muted { font-size: 11px; padding-top: 8px; }

@media (max-width: 1160px) {
  .form-grid, .metric-grid, .login-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-wrap { min-height: 100vh; padding: 30px 22px; }
  .sidebar {
    display: flex;
    transform: translateX(-110%);
    transition: transform .2s ease;
    z-index: 40;
    background: #fff;
  }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; }
  .page, .topbar { padding-left: 18px; padding-right: 18px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .form-grid, .metric-grid, .function-grid, .overview-grid, .plan-list, .login-fields { grid-template-columns: 1fr; }
  .panel-heading { flex-wrap: wrap; min-height: 48px; padding: 10px 16px; }
  .topbar-title span { display: none; }
  #menu-toggle { display: inline-flex !important; }
}
