/* Components: buttons, cards, forms, tables, toasts, modals */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: 0.2s ease;
  white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(180deg, #f3dd84, #d4af37 45%, #a07c1a);
  color: #1a1404;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-gold:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-gold:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--gold-200);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: rgba(212,175,55,0.08); }
.btn-danger {
  background: linear-gradient(180deg, #f07a7a, #b93a3a);
  color: white;
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-icon {
  width: 42px; height: 42px; padding: 0; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--gold-300);
}

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.glass-strong {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(22px);
}

.card {
  background: linear-gradient(180deg, rgba(16,26,51,0.9), rgba(7,11,24,0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(248,231,161,0.5), transparent);
}
.card-gold { box-shadow: inset 0 0 0 1px rgba(212,175,55,0.35), var(--glow); }

.stat-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  min-height: 96px;
}
.stat-card .icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(248,231,161,0.25), rgba(212,175,55,0.08));
  border: 1px solid var(--line);
  color: var(--gold-300);
  flex-shrink: 0;
}
.stat-card .label { font-size: 12px; color: var(--white-mute); text-transform: uppercase; letter-spacing: 0.12em; }
.stat-card .value { font-size: 20px; font-weight: 700; color: var(--gold-200); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.badge-ok { background: rgba(61,206,138,0.15); color: #7cf0b5; }
.badge-gold { background: rgba(212,175,55,0.15); color: var(--gold-200); }
.badge-warn { background: rgba(224,177,93,0.15); color: #f0d08a; }
.badge-danger { background: rgba(224,93,93,0.15); color: #ff9b9b; }
.badge-info { background: rgba(90,168,255,0.15); color: #9cc9ff; }
.badge-mute { background: rgba(255,255,255,0.06); color: var(--white-dim); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-300); }
.field input, .field select, .field textarea {
  background: rgba(5,8,22,0.7);
  border: 1px solid var(--line);
  color: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: 0.15s border, 0.15s box-shadow;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}
.field .hint { font-size: 12px; color: var(--white-mute); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); max-width: 100%; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-300);
  padding: 12px;
  background: rgba(212,175,55,0.06);
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid rgba(212,175,55,0.1);
  color: var(--white-dim);
}
table.data tr:hover td { background: rgba(212,175,55,0.04); }

.toast-stack {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 260px; max-width: 360px;
  background: var(--navy-800);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease;
}
.toast strong { display: block; color: var(--gold-200); font-size: 13px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,0.62);
  display: grid; place-items: center; z-index: 70; padding: 16px;
}
.modal {
  width: min(520px, 100%);
  background: var(--navy-800);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--glow), var(--shadow);
}
.modal.wide { width: min(860px, 100%); }

.skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(212,175,55,0.12), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 10px;
  min-height: 16px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.progress {
  height: 8px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #8a6a1f, #f8e7a1, #d4af37);
}

.logo-lockup {
  display: flex; align-items: center; gap: 12px;
}
.logo-lockup img, .logo-lockup svg { width: 48px; height: 48px; }
.logo-lockup .brand-name {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--gold-300);
}
.logo-lockup .brand-tag {
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--gold-500);
}

.demo-banner {
  border: 1px dashed var(--line-strong);
  background: rgba(212,175,55,0.07);
  color: var(--gold-200);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.empty {
  text-align: center; padding: 36px 16px; color: var(--white-mute);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--white-dim);
  background: transparent;
}
.chip.active {
  background: rgba(212,175,55,0.15);
  color: var(--gold-200);
  border-color: var(--gold-400);
}
#wa-fab {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 42;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #25d366;
  color: #fff;
  box-shadow: var(--shadow);
}
@media (max-width: 960px) {
  #wa-fab { bottom: 88px; }
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

@media (max-width: 1100px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .input-row { flex-wrap: wrap; }
  .toast { min-width: 0; max-width: calc(100vw - 32px); }
  .notif-drop { width: min(340px, calc(100vw - 24px)); right: 0; }
  .field input, .field select, .field textarea { font-size: 16px; max-width: 100%; }
  .btn { max-width: 100%; }
}
@media (max-width: 760px) {
  table.data { min-width: 480px; }
}
