:root {
  --ink: #182033;
  --muted: #7a8296;
  --line: #e8eaf1;
  --surface: #fff;
  --canvas: #f5f6fa;
  --primary: #6556e8;
  --primary-dark: #5143d4;
  --nav: #151a29;
  --success: #1fa77a;
  --danger: #dc5662;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { color: #8275ed; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.eyebrow.light { color: rgba(255,255,255,.72); }
.logo-mark {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px;
  color: #fff; font-size: 22px; font-weight: 800;
  background: linear-gradient(145deg, #7b6cf4, #5543d8);
  box-shadow: 0 14px 32px rgba(91,73,218,.32);
}
.logo-mark.small { width: 40px; height: 40px; border-radius: 13px; font-size: 17px; box-shadow: none; }
.login-shell {
  min-height: 100vh; display: grid; place-items: center; overflow: hidden; position: relative;
  background: radial-gradient(circle at 18% 20%, #ede9ff 0, transparent 34%),
    radial-gradient(circle at 84% 80%, #ffe8dc 0, transparent 30%), #f7f7fb;
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .7; }
.orb-one { width: 280px; height: 280px; top: -90px; right: 8%; background: linear-gradient(145deg,#8c7cff,#bd93ff); }
.orb-two { width: 220px; height: 220px; bottom: -90px; left: 8%; background: linear-gradient(145deg,#ffc28f,#ff8f75); }
.login-card {
  width: min(430px, calc(100% - 36px)); padding: 44px; position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: rgba(255,255,255,.9);
  box-shadow: 0 30px 90px rgba(35,29,72,.13); backdrop-filter: blur(18px);
}
.login-card .logo-mark { margin-bottom: 28px; }
.login-card h1 { margin: 8px 0 8px; font-size: 29px; }
.login-card > p { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
label { display: grid; gap: 8px; color: #4d5569; font-size: 12px; font-weight: 700; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #dfe2eb; border-radius: 11px;
  outline: none; color: var(--ink); background: #fff; transition: .2s;
}
input:focus, select:focus, textarea:focus { border-color: #8c7df1; box-shadow: 0 0 0 3px rgba(101,86,232,.1); }
textarea { resize: vertical; }
.primary, .outline-button, .ghost, .light-button, .text-button, .icon-button {
  border: 0; border-radius: 10px; text-decoration: none; transition: .18s;
}
.primary { padding: 10px 16px; color: #fff; background: linear-gradient(135deg,#6d5cf0,#5545d8); box-shadow: 0 8px 18px rgba(85,69,216,.18); }
.primary:hover { transform: translateY(-1px); background: linear-gradient(135deg,#7969f4,#5d4ade); }
.wide { width: 100%; margin-top: 18px; padding: 12px; }
.ghost { padding: 9px 14px; color: #596076; background: #f1f2f6; }
.outline-button { display: inline-flex; justify-content: center; padding: 10px 15px; color: var(--primary); border: 1px solid #d9d5fa; background: #faf9ff; }
.light-button { padding: 11px 16px; color: #5143cb; background: #fff; font-weight: 800; }
.text-button { padding: 4px; color: var(--primary); background: transparent; }
.icon-button { width: 34px; height: 34px; color: #6d7488; background: #f1f2f6; font-size: 20px; }
.form-message { min-height: 19px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.form-message.success { color: var(--success); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0,1fr); }
.sidebar {
  min-height: 100vh; max-height: 100vh; position: sticky; top: 0; align-self: start;
  padding: 24px 16px; overflow-y: auto;
  color: #fff; background: linear-gradient(180deg,#171c2b 0%,#111522 100%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { margin-top: 4px; color: #858da6; font-size: 10px; letter-spacing: .08em; }
.sidebar nav { display: grid; gap: 6px; }
.nav-section-label {
  display: block; margin: 16px 14px 3px; color: #666f89; font-size: 9px;
  font-weight: 800; letter-spacing: .16em;
}
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 0; border-radius: 11px; color: #959db3; background: transparent;
  text-align: left; text-decoration: none;
}
.nav-item i { width: 20px; color: #78819b; font-style: normal; font-size: 17px; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: linear-gradient(135deg,rgba(120,101,245,.95),rgba(85,67,215,.95)); box-shadow: 0 12px 25px rgba(47,36,141,.28); }
.nav-item.active i { color: #fff; }
.sidebar-foot {
  position: static; display: flex; gap: 10px; margin-top: 22px;
  padding: 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.035);
}
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { margin-top: 3px; color: #747d96; font-size: 9px; }
.live-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #38c799; box-shadow: 0 0 0 4px rgba(56,199,153,.12); }
main { min-width: 0; }
header {
  min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 15px 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(14px);
}
header h2 { margin: 4px 0 0; font-size: 19px; }
.operator { display: flex; align-items: center; gap: 12px; color: #555d70; font-size: 12px; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 20px; }
.page { padding: 26px 32px 42px; }
.page-head, .panel-head, .provider-title, .modal-head, .modal-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.page-head { margin-bottom: 18px; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.registration-toggle { display: flex; align-items: center; gap: 7px; color: #636b7d; font-size: 11px; }
.registration-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }
.page-head h3, .panel-head h3, .provider-title h3, .modal-head h3 { margin: 0; }
.page-head p, .panel-head p, .provider-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.hero-card {
  min-height: 174px; display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding: 32px 38px; overflow: hidden; position: relative; border-radius: 22px; color: #fff;
  background: radial-gradient(circle at 85% 25%,rgba(255,255,255,.18),transparent 23%),
    linear-gradient(120deg,#5141cf,#765ff0 58%,#8a6ff6);
  box-shadow: 0 22px 45px rgba(70,52,190,.2);
}
.hero-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: 13%; bottom: -145px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.hero-card h3 { margin: 9px 0; font-size: 27px; }
.hero-card p { margin: 0; color: rgba(255,255,255,.75); font-size: 13px; }
.hero-card button { position: relative; z-index: 1; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 18px 0; }
.metrics article, .panel { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 8px 24px rgba(35,42,66,.04); }
.metrics article { padding: 19px 21px; }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 11px; }
.metrics strong { display: block; margin: 7px 0 4px; font-size: 28px; letter-spacing: -.04em; }
.overview-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 18px; }
.panel { padding: 20px; }
.panel-head { margin-bottom: 15px; }
.filters { display: grid; grid-template-columns: 1fr 180px; gap: 12px; margin-bottom: 15px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px; color: #8a91a3; background: #f8f8fb; font-size: 10px; text-align: left; white-space: nowrap; }
td { padding: 13px 11px; border-bottom: 1px solid #f0f1f5; color: #4f576a; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.account-name strong, .account-name small { display: block; }
.account-name strong { color: var(--ink); }
.account-name small { margin-top: 4px; color: #9299aa; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #16825f; background: #e8f8f2; font-size: 10px; font-weight: 800; }
.status-pill.suspended, .status-pill.expired { color: #b84956; background: #fff0f1; }
.status-pill.pending { color: #946829; background: #fff7e6; }
.status-pill.waiting { color: #946829; background: #fff7e6; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { padding: 6px 8px; border: 0; border-radius: 7px; color: #6559c8; background: #f3f1ff; font-size: 10px; }
.row-actions button.danger { color: #c84e5a; background: #fff1f2; }
.empty { padding: 34px; color: var(--muted); text-align: center; }
.provider-overview { display: grid; gap: 10px; }
.provider-overview > div { display: flex; align-items: center; justify-content: space-between; padding: 13px; border-radius: 12px; background: #f8f8fb; }
.provider-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.provider-card { display: grid; gap: 17px; }
.provider-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: #fff; font-weight: 800; }
.provider-icon.orange { background: linear-gradient(145deg,#ff9a64,#f36b3d); }
.provider-icon.violet { background: linear-gradient(145deg,#8d77f6,#654edc); }
.provider-note { padding: 14px; border-radius: 12px; background: #f7f6fd; }
.provider-note p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.hint { color: var(--muted); font-size: 11px; }
.security-card { width: min(560px,100%); display: grid; gap: 16px; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(19,23,36,.55); backdrop-filter: blur(5px); }
.modal-card { width: min(680px,100%); max-height: calc(100vh - 44px); overflow: auto; padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 35px 90px rgba(18,21,34,.25); }
.account-modal { width: min(760px,100%); }
.modal-head { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
fieldset { margin: 18px 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; }
legend { padding: 0 7px; color: #555d70; font-size: 12px; font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.permission-grid label, .device-option { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 9px; background: #f7f7fb; }
.permission-grid input, .device-option input { width: auto; }
.developer-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-radius: 11px; background: #f7f6fd;
}
.developer-switch span, .developer-switch b, .developer-switch small { display: block; }
.developer-switch small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.developer-switch input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.feature-access { margin: 18px 0; }
.feature-access-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; border-radius: 10px; background: #f8f8fb;
}
.feature-access-option span, .feature-access-option b, .feature-access-option small { display: block; }
.feature-access-option small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.feature-access-option input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.modal-actions { justify-content: flex-end; margin-top: 20px; }
.device-list { display: grid; gap: 8px; max-height: 430px; overflow: auto; margin-top: 14px; }
.device-option { justify-content: space-between; }
.device-option > div { display: flex; align-items: center; gap: 9px; }
.device-option small { color: var(--muted); }
@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .provider-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 90; width: 238px; transform: translateX(-105%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  header { padding: 14px 17px; }
  .operator span { display: none; }
  .page { padding: 18px 14px 34px; }
  .hero-card { align-items: flex-start; flex-direction: column; padding: 25px; }
  .hero-card h3 { font-size: 22px; }
  .metrics { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .metrics article { padding: 15px; }
  .form-grid, .filters { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: repeat(2,1fr); }
  .page-head { align-items: flex-start; }
}
