:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20201e;
  background: #f7f7f4;
  font-synthesis: none;
  --ink: #20201e;
  --muted: #72716c;
  --line: #e7e6df;
  --card: #ffffff;
  --violet: #6556d8;
  --violet-dark: #5144be;
  --violet-soft: #f0edff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(101, 86, 216, .24);
  outline-offset: 2px;
}

.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; background: #191918; color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 27px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand__mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: linear-gradient(145deg, #897af2, #5545bc); box-shadow: inset 0 1px rgba(255,255,255,.32); }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 9px; color: #aaa9a4; text-decoration: none; font-size: 14px; font-weight: 540; }
.sidebar nav a span { width: 19px; text-align: center; font-size: 17px; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.sidebar nav a.is-active { color: #fff; background: rgba(255,255,255,.105); }
.workspace-switcher { margin-top: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px 10px; border: 1px solid #363633; border-radius: 11px; color: #d3d2cd; font-size: 12px; }
.workspace-switcher strong, .workspace-switcher small { display: block; }
.workspace-switcher strong { color: #fff; font-size: 13px; margin-bottom: 2px; }
.workspace-switcher small { color: #85847e; }

main { width: min(1120px, 100%); margin: 0 auto; padding: 55px 62px 80px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--violet); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: 35px; line-height: 1.16; letter-spacing: -.042em; }
.page-intro { margin: 9px 0 0; color: var(--muted); font-size: 15px; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 680; }
.button--primary { color: #fff; background: var(--violet); box-shadow: 0 1px 2px rgba(33, 28, 78, .22); }
.button--primary:hover { background: var(--violet-dark); }
.button--primary:disabled { cursor: not-allowed; opacity: .48; }
.button--quiet { color: #575651; border-color: var(--line); background: #fff; }
.button--quiet:hover { background: #f6f5f2; }

.usage-card { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(230px, 1.3fr) auto; align-items: center; gap: 35px; padding: 25px 27px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: 0 1px 2px rgba(30,30,25,.025); }
.usage-card__copy { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px 10px; }
.usage-card__copy h2 { grid-column: 1 / -1; margin-top: 4px; }
.usage-card__copy p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.usage-card__copy p strong { color: var(--ink); }
.plan-badge { width: max-content; padding: 3px 7px; border-radius: 5px; color: #5145aa; background: var(--violet-soft); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.usage-card__meter { height: 7px; overflow: hidden; border-radius: 99px; background: #ecebe7; }
.usage-card__meter span { display: block; height: 100%; width: 62.5%; border-radius: inherit; background: linear-gradient(90deg, #7666e8, #9b8ef5); transition: width .25s ease; }
.usage-card > a { color: var(--violet); text-decoration: none; white-space: nowrap; font-size: 12px; font-weight: 680; }

.members-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: 0 1px 2px rgba(30,30,25,.025); }
.members-card__header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 23px 27px 20px; }
.members-card__header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.search { display: flex; align-items: center; gap: 7px; width: 220px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: #999790; background: #fbfbf9; }
.search input { width: 100%; min-height: 35px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search:focus-within { border-color: #8f84e1; box-shadow: 0 0 0 3px rgba(101, 86, 216, .12); }
.table-wrap { border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 27px; color: #8c8a84; background: #fafaf8; font-size: 10px; font-weight: 720; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
th:last-child, td:last-child { width: 65px; text-align: right; }
td { padding: 14px 27px; border-top: 1px solid #efeee9; font-size: 12px; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: #fcfcfa; }
.member { display: flex; align-items: center; gap: 11px; }
.member strong, .member small { display: block; }
.member strong { margin-bottom: 3px; font-size: 13px; }
.member small { color: var(--muted); }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 11px; font-weight: 750; }
.avatar--workspace { width: 30px; height: 30px; color: #ddd8ff; background: #4f457f; }
.avatar--violet { color: #5547a7; background: #ece8ff; }
.avatar--blue { color: #376a93; background: #e2f1fb; }
.avatar--amber { color: #8b6423; background: #faedce; }
.avatar--rose { color: #985466; background: #f9e5ea; }
.avatar--green { color: #3d755c; background: #e0f1e8; }
.role { display: inline-block; padding: 4px 8px; border: 1px solid #e8e7e2; border-radius: 6px; color: #65635e; background: #fafaf8; font-size: 11px; font-weight: 650; }
.role--owner { color: #594cac; border-color: #ded8ff; background: #f3f0ff; }
.last-active { color: var(--muted); }
.icon-button { border: 0; color: #8b8983; background: transparent; cursor: pointer; font-weight: 750; }
.empty-state { padding: 60px 24px; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 13px; border-radius: 12px; color: var(--violet); background: var(--violet-soft); font-size: 21px; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid #deddd7; border-radius: 16px; color: var(--ink); box-shadow: 0 24px 80px rgba(25, 22, 45, .24); }
dialog::backdrop { background: rgba(28, 27, 31, .48); backdrop-filter: blur(2px); }
dialog form { padding: 25px 28px 27px; }
.dialog__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dialog__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--violet); background: var(--violet-soft); font-size: 20px; font-weight: 700; }
.dialog__header .icon-button { font-size: 22px; font-weight: 400; }
.step-indicator { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; width: 90px; margin-bottom: 25px; }
.step-indicator span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #deddd8; border-radius: 50%; color: #96948e; font-size: 10px; font-weight: 750; }
.step-indicator span.is-current { color: #fff; border-color: var(--violet); background: var(--violet); }
.step-indicator span.is-complete { color: var(--violet); border-color: #d8d1ff; background: var(--violet-soft); }
.step-indicator i { height: 1px; background: #deddd8; }
dialog h2 { margin-bottom: 7px; font-size: 24px; }
dialog section > p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.field { display: grid; gap: 7px; margin-top: 17px; color: #4e4d49; font-size: 12px; font-weight: 680; }
.field span small { color: #999790; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dcdad4; border-radius: 8px; color: var(--ink); background: #fff; font-size: 13px; }
.field input, .field select { height: 42px; padding: 0 12px; }
.field textarea { padding: 11px 12px; resize: vertical; }
.field__error { min-height: 16px; color: #b44351; font-weight: 550; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid #eeede8; }
.dialog__actions--split { justify-content: space-between; }
.toast { position: fixed; right: 25px; bottom: 25px; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 10px; color: #fff; background: #242421; box-shadow: 0 12px 32px rgba(0,0,0,.2); font-size: 13px; }
.toast[hidden] { display: none; }
.toast > span:first-child { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #1f503a; background: #a8e0c2; font-size: 11px; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 17px 18px; }
  .brand { padding: 0; }
  .sidebar nav, .workspace-switcher { display: none; }
  main { padding: 35px 22px 60px; }
  .usage-card { grid-template-columns: 1fr; gap: 18px; }
  .members-card__header, .page-header { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  th, td { padding-left: 16px; padding-right: 16px; }
}
