.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-strong); font-weight: 700; letter-spacing: -0.02em; }
.brand img { width: 118px; height: auto; }
.brand-mark { width: 29px; height: 29px; object-fit: contain; }
.button {
  min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  text-decoration: none; font-weight: 650; font-size: 14px; line-height: 1; transition: 160ms var(--ease);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled, .button[aria-disabled="true"] { opacity: .48; cursor: not-allowed; transform: none; }
.button--primary { color: white; background: linear-gradient(135deg, #6575f5, #5266e9); box-shadow: 0 10px 28px rgba(83, 102, 232, .24); }
.button--primary:hover { background: linear-gradient(135deg, #7483ff, #5c70f4); }
.button--secondary { background: var(--ink-3); border-color: var(--line); color: var(--text-strong); }
.button--secondary:hover { border-color: var(--line-strong); background: var(--ink-4); }
.button--quiet { background: transparent; border-color: transparent; color: var(--text-muted); }
.button--quiet:hover { color: var(--text-strong); background: rgba(255,255,255,.045); }
.button--danger { background: var(--coral-soft); border-color: rgba(242,118,114,.25); color: #ffaaa7; }
.button--danger:hover { background: rgba(242,118,114,.18); }
.button--sm { min-height: 34px; padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.button--lg { min-height: 48px; padding: 12px 20px; font-size: 15px; }
.button--icon { width: 38px; min-height: 38px; padding: 0; }
.button svg { width: 16px; height: 16px; flex: none; }
.button-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: linear-gradient(180deg, rgba(19,26,37,.96), rgba(13,18,27,.96)); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card--flat { box-shadow: none; }
.card--interactive { transition: border-color 160ms var(--ease), transform 160ms var(--ease), background 160ms var(--ease); }
.card--interactive:hover { border-color: rgba(108,124,255,.38); transform: translateY(-2px); }
.card__header { padding: 18px 20px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card__body { padding: 0 20px 20px; }
.card__footer { padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.card__title { font-size: 14px; font-weight: 700; color: var(--text-strong); }
.card__description { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text-muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { color: var(--teal); border-color: rgba(57,212,188,.2); background: var(--teal-soft); }
.badge--info { color: var(--cobalt-strong); border-color: rgba(108,124,255,.22); background: var(--cobalt-soft); }
.badge--warning { color: var(--amber); border-color: rgba(242,184,75,.22); background: var(--amber-soft); }
.badge--danger { color: var(--coral); border-color: rgba(242,118,114,.22); background: var(--coral-soft); }
.badge--neutral { color: var(--text-muted); }

.field { display: grid; gap: 7px; }
.field + .field { margin-top: 16px; }
.field__label { color: var(--text); font-weight: 600; font-size: 13px; }
.field__hint { color: var(--text-faint); font-size: 12px; }
.field__error { min-height: 18px; color: #ff9c98; font-size: 12px; }
.control { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text-strong); background: rgba(7,10,15,.66); border: 1px solid var(--line); border-radius: var(--radius-sm); outline: 0; transition: 150ms var(--ease); }
.control::placeholder { color: #5f6b7c; }
.control:hover { border-color: var(--line-strong); }
.control:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(108,124,255,.13); }
textarea.control { min-height: 98px; resize: vertical; line-height: 1.55; }
select.control { appearance: none; background-image: linear-gradient(45deg,transparent 50%,var(--text-muted) 50%),linear-gradient(135deg,var(--text-muted) 50%,transparent 50%); background-position: calc(100% - 17px) 19px,calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; color: var(--text-muted); font-size: 13px; cursor: pointer; }
.checkbox input { margin-top: 3px; accent-color: var(--cobalt); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(3,5,8,.76); backdrop-filter: blur(12px); animation: fade-in 150ms ease both; }
.dialog { width: min(100%, 560px); max-height: min(860px, calc(100vh - 40px)); overflow: auto; background: #101620; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: dialog-in 180ms var(--ease) both; }
.dialog--wide { width: min(100%, 760px); }
.dialog__header { padding: 22px 24px 18px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; }
.dialog__title { font-size: 18px; }
.dialog__description { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.dialog__body { padding: 22px 24px; }
.dialog__footer { padding: 16px 24px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; padding: 13px 14px; background: #151d29; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); animation: toast-in 200ms var(--ease) both; }
.toast__title { color: var(--text-strong); font-weight: 650; font-size: 13px; }
.toast__message { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.toast__close { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.state { min-height: 240px; display: grid; place-items: center; text-align: center; padding: 36px; border: 1px dashed var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.015); }
.state__icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 12px; color: var(--cobalt-strong); background: var(--cobalt-soft); }
.state__icon svg { width: 20px; }
.state__title { font-size: 16px; }
.state__description { max-width: 430px; margin: 7px auto 18px; color: var(--text-muted); font-size: 13px; }
.skeleton { border-radius: 7px; background: linear-gradient(100deg, rgba(255,255,255,.035) 20%, rgba(255,255,255,.075) 40%, rgba(255,255,255,.035) 60%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; min-width: 680px; }
.table th { padding: 11px 14px; background: rgba(255,255,255,.025); color: var(--text-faint); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
.table td { padding: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.table tbody tr { transition: background 140ms ease; }
.table tbody tr:hover { background: rgba(255,255,255,.018); }

.code-panel { position: relative; padding: 17px 88px 17px 17px; overflow: auto; color: #b9c6d8; background: #070a0f; border: 1px solid var(--line); border-radius: var(--radius-sm); font: 12px/1.65 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.code-panel .button { position: absolute; top: 10px; right: 10px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ink-1); }
.segmented button { border: 0; padding: 7px 11px; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; font-weight: 600; }
.segmented button[aria-selected="true"], .segmented button.is-active { color: var(--text-strong); background: var(--ink-3); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.form-grid { display: grid; gap: 16px; }
.form-grid--two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid--three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid .field + .field { margin-top: 0; }
.notice { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.022); color: var(--text-muted); font-size: 12.5px; line-height: 1.55; }
.notice--success { color: var(--teal); border-color: rgba(57,212,188,.2); background: var(--teal-soft); }
.notice--warning { color: #f5ca75; border-color: rgba(242,184,75,.22); background: var(--amber-soft); }
.notice--error { color: #ffaaa7; border-color: rgba(242,118,114,.22); background: var(--coral-soft); }
