* { box-sizing: border-box; }

html { min-height: 100%; background: var(--aaid-bg); overflow-x: hidden; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 184, 104, 0.08), transparent 32rem),
    linear-gradient(180deg, #0d0e14 0%, var(--aaid-bg) 100%);
  color: var(--aaid-text);
}

body.embed { background: transparent; }
a { color: inherit; }

.embed-page {
  width: min(1120px, calc(100vw - 24px));
  margin: 24px auto;
}

.auth-header { margin-bottom: 18px; }

.headline {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
  color: #fff;
}

.headline span,
.subtitle span { color: var(--aaid-gold); }

.subtitle {
  margin: 4px 0 0;
  color: var(--aaid-muted);
  font-size: 13px;
  line-height: 1.45;
}

.card,
.page-shell,
.panel,
.section,
.hero,
.profile-card {
  border-radius: var(--aaid-radius-lg);
  border: 1px solid var(--aaid-border);
  background: var(--aaid-surface);
  box-shadow: var(--aaid-shadow);
}

.btn,
.a,
.link-lux,
.page-btn,
.topbar-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.link-lux {
  border: 1px solid rgba(216, 184, 104, .3);
  border-radius: 999px;
  background: rgba(216, 184, 104, .06);
  color: var(--aaid-gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.link-lux:hover {
  border-color: rgba(216, 184, 104, .55);
  background: rgba(216, 184, 104, .12);
}

.input-field,
.field-input,
.field input,
.field select,
.per-page-select { min-height: 40px; }

.status-pill,
.pill,
.chip,
.badge,
.plan-pill { max-width: 100%; }

.notification-wrap { position: relative; }

.notification-wrap .notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: 430px;
  overflow: auto;
  display: none;
  z-index: 10000;
  border-radius: 14px;
  border: 1px solid var(--aaid-border);
  background: rgba(17, 17, 24, 0.98);
  box-shadow: var(--aaid-shadow);
}

.notification-wrap.open .notification-panel,
.notification-wrap:hover .notification-panel,
.notification-wrap:focus-within .notification-panel { display: block; }

.notification-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--aaid-danger);
  color: #fff;
  font-size: 10px;
}

.notification-panel-head,
.notification-page-toolbar,
.notification-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.notification-panel-head {
  padding: 12px;
  border-bottom: 1px solid var(--aaid-border);
}

.notification-panel-head button {
  border: 0;
  background: transparent;
  color: var(--aaid-gold);
  cursor: pointer;
  font-size: 12px;
}

.notification-list,
.notification-page-list { display: flex; flex-direction: column; }

.notification-item,
.notification-row {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}

.notification-item.unread,
.notification-row.unread { background: rgba(216,184,104,0.11); }

.notification-title,
.notification-row-title {
  color: #fff;
  font-weight: 650;
  font-size: 13px;
}

.notification-message,
.notification-row p {
  margin: 5px 0;
  color: rgba(245,245,245,0.78);
  font-size: 12px;
  line-height: 1.45;
}

.notification-meta,
.notification-row-meta,
.notification-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--aaid-muted);
  font-size: 11px;
}

.notification-meta { justify-content: space-between; }
.notification-meta a,
.notification-all-link { color: var(--aaid-gold); text-decoration: none; }

.notification-all-link,
.notification-empty {
  display: block;
  padding: 12px;
  font-size: 12px;
}

.notification-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.aaid-page {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.aaid-card {
  border-radius: var(--aaid-radius-lg);
  border: 1px solid var(--aaid-border);
  background: var(--aaid-surface);
  box-shadow: var(--aaid-shadow);
  padding: 18px;
}

.aaid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.aaid-toolbar-title {
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--aaid-gold);
  font-weight: 750;
}

.aaid-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.aaid-action,
.aaid-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(216,184,104,.36);
  background: rgba(216,184,104,.08);
  color: var(--aaid-gold);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.aaid-action:hover,
.aaid-button:hover {
  border-color: rgba(216,184,104,.62);
  background: rgba(216,184,104,.13);
}

.aaid-button.primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--aaid-gold), var(--aaid-gold-soft));
  color: #08090d;
}

.aaid-button.danger {
  border-color: rgba(255,92,92,.38);
  background: rgba(255,92,92,.09);
  color: #ff9a9a;
}

.aaid-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.aaid-form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aaid-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aaid-label,
.aaid-field label {
  font-size: 11px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--aaid-muted);
  font-weight: 700;
}

.aaid-input,
.aaid-field input,
.aaid-field select,
.aaid-field textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.055);
  color: var(--aaid-text);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}

.aaid-field textarea {
  min-height: 92px;
  resize: vertical;
}

.aaid-input:focus,
.aaid-field input:focus,
.aaid-field select:focus,
.aaid-field textarea:focus {
  border-color: rgba(216,184,104,.55);
  box-shadow: 0 0 0 3px rgba(216,184,104,.12);
}

.aaid-field select,
.aaid-input:is(select) {
  color-scheme: dark;
}

.aaid-field select option,
.aaid-input option {
  background: #111118;
  color: #f5f5f5;
}

.aaid-hint {
  color: var(--aaid-muted);
  font-size: 12px;
  line-height: 1.45;
}

.aaid-table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
}

.aaid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.aaid-table th {
  padding: 11px 12px;
  text-align: left;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--aaid-muted);
  border-bottom: 1px solid rgba(216,184,104,.28);
  background: rgba(216,184,104,.055);
  white-space: nowrap;
}

.aaid-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  vertical-align: top;
}

.aaid-table tbody tr:hover {
  background: rgba(255,255,255,.035);
}

.aaid-muted {
  color: var(--aaid-muted);
}

.aaid-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(216,184,104,.35);
  color: var(--aaid-gold);
  background: rgba(216,184,104,.08);
  font-size: 11px;
  font-weight: 700;
}

.aaid-chip.ok {
  border-color: rgba(74,222,128,.35);
  color: var(--aaid-ok);
  background: rgba(74,222,128,.10);
}

.aaid-chip.warn {
  border-color: rgba(251,191,36,.35);
  color: var(--aaid-warn);
  background: rgba(251,191,36,.10);
}

.aaid-chip.danger {
  border-color: rgba(255,92,92,.38);
  color: #ff9a9a;
  background: rgba(255,92,92,.10);
}

.aaid-empty {
  padding: 16px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 12px;
  color: var(--aaid-muted);
  background: rgba(255,255,255,.025);
  font-size: 13px;
}

@media (max-width: 760px) {
  .aaid-card { padding: 14px; }
  .aaid-form-grid,
  .aaid-form-grid.cols-3 { grid-template-columns: 1fr; }
  .aaid-toolbar { align-items: stretch; }
  .aaid-actions,
  .aaid-action,
  .aaid-button { width: 100%; }
}
