/* Act Rush — ortak bileşenler */

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text);
  font: 600 14px/1 var(--font-ui); letter-spacing: .01em; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-3); color: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn.primary {
  background: linear-gradient(180deg, #f1cf77, #d6a846);
  border-color: #f3d484; color: var(--gold-ink);
  box-shadow: 0 1px 0 rgb(255 255 255 / .35) inset, 0 10px 22px -12px rgb(229 195 107 / .75);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f7db8c, #dfb354); border-color: #f7de98; color: var(--gold-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn.danger { background: rgb(226 100 79 / .12); border-color: rgb(226 100 79 / .45); color: #ffb4a6; }
.btn.danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost.danger { background: transparent; border-color: transparent; color: #f29c8c; }
.btn.ghost.danger:hover:not(:disabled) { background: rgb(226 100 79 / .14); border-color: rgb(226 100 79 / .4); color: #ffc2b7; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }
.btn kbd { margin-left: 2px; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0;
  border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--gold-2);
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-3); color: #fff; }
.icon-btn:disabled { opacity: .4; }
.icon-btn.danger { color: #f29c8c; }
.icon-btn.danger:hover:not(:disabled) { background: rgb(226 100 79 / .16); border-color: rgb(226 100 79 / .45); color: #ffc2b7; }

.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--gold-2); font: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Segmented ---------- */
.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg);
}
.segmented button {
  min-height: 32px; padding: 0 14px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--text-2); font: 600 13.5px/1 var(--font-ui);
  transition: background .15s, color .15s;
}
.segmented button:hover { color: #fff; }
.segmented button[aria-pressed="true"],
.segmented button[aria-selected="true"] {
  background: var(--surface-3); color: var(--gold-3);
  box-shadow: 0 0 0 1px var(--line-3) inset;
}
.segmented.block { display: flex; }
.segmented.block button { flex: 1; }
.segmented.sm button { min-height: 28px; padding: 0 10px; font-size: 12.5px; }

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track {
  position: relative; flex: none; width: 38px; height: 22px;
  border-radius: 999px; border: 1px solid var(--line-3); background: var(--surface-3);
  transition: background .18s, border-color .18s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-2);
  transition: transform .22s var(--ease-out), background .18s;
}
.switch input:checked + .switch-track { background: rgb(229 195 107 / .28); border-color: var(--gold); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--gold-2); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch input:disabled + .switch-track { opacity: .45; }
.switch.sm { font-size: 12.5px; gap: 8px; }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-label .ico { color: var(--gold-2); }
.field-unit { color: var(--text-3); font-weight: 500; }
.field-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.45; color: var(--text-3); }
.field-hint b { color: var(--text-2); }

input:not([type]), input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%; min-width: 0;
  padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text);
  font: 500 14.5px/1.4 var(--font-ui);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #7d6f53; }
input:focus-visible, textarea:focus-visible, input:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgb(229 195 107 / .16);
}
input[readonly], textarea[readonly] { background: var(--bg-raise); color: var(--text-2); }
input:disabled { opacity: .55; }

.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.check b { color: var(--text); font-weight: 600; }

.form-error { min-height: 1.3em; color: #ff9d8c; font-size: 13.5px; font-weight: 600; }

/* ---------- Stepper ---------- */
.stepper {
  display: inline-flex; align-items: stretch;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg);
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.stepper .icon-btn { width: 38px; height: 42px; border: 0; border-radius: 0; background: transparent; }
.stepper .icon-btn:hover:not(:disabled) { background: rgb(229 195 107 / .1); }
.stepper input[type="number"] {
  width: 64px; padding: 0; border: 0; border-radius: 0; background: transparent;
  text-align: center; color: #fff;
  font: 700 18px/1 var(--font-ui); font-variant-numeric: tabular-nums;
}
.stepper input[type="number"]:focus { box-shadow: none; }
.stepper:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(229 195 107 / .16); }
.stepper.is-locked { opacity: .55; }

/* ---------- Kart ---------- */
.card {
  min-width: 0;
  padding: 20px;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 0%, #120e0a 100%);
  box-shadow: 0 1px 0 rgb(255 255 255 / .03) inset;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 9px; color: #fff; font: 700 15px/1.3 var(--font-ui); letter-spacing: .01em; }
.card-title .ico { color: var(--gold-2); width: 18px; height: 18px; }
.card-sub { margin-top: 4px; color: var(--text-3); font-size: 13px; }

.notice { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.notice-lock { color: var(--amber); background: rgb(240 184 64 / .09); border: 1px solid rgb(240 184 64 / .35); }
.notice[hidden] { display: none; }

.empty {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-2);
  color: var(--text-2); font-size: 13.5px;
}
.empty > .ico { color: var(--gold-2); width: 20px; height: 20px; }
.empty p { flex: 1; min-width: 200px; }

/* ---------- Rozetler ---------- */
.role-badge, .team-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  color: var(--blue); background: rgb(120 184 224 / .1); border: 1px solid rgb(120 184 224 / .38);
}
.role-badge.is-leader, .team-chip.is-leader { color: var(--gold-2); background: rgb(229 195 107 / .1); border-color: rgb(229 195 107 / .42); }
.team-chip.is-locked { color: var(--amber); background: rgb(240 184 64 / .1); border-color: rgb(240 184 64 / .38); }
.team-chip.is-free { color: var(--green); background: rgb(140 199 96 / .1); border-color: rgb(140 199 96 / .38); }
.team-chip.is-muted { color: var(--text-3); background: transparent; border-color: var(--line); font-weight: 500; }
.role-badge.sm { padding: 2px 8px; font-size: 11.5px; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.sync.is-ok { color: var(--green); }
.sync.is-error { color: #ff9d8c; }

/* ---------- Popover ---------- */
.popover {
  position: absolute; z-index: 60; top: calc(100% + 8px); left: 0;
  padding: 14px; border-radius: 14px; border: 1px solid var(--line-3);
  background: #17120c; box-shadow: var(--shadow-pop);
  animation: popIn .18s var(--ease-out);
}
.popover[hidden] { display: none; }
.popover-title { margin-bottom: 10px; color: var(--text-3); font-size: 12px; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Hızlı mesaj listesi ---------- */
.msg-list { display: grid; gap: 8px; }
.msg-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  width: 100%; padding: 11px 12px; text-align: left;
  border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.msg-item:hover { border-color: var(--gold); background: rgb(229 195 107 / .07); }
.msg-icon, .msg-copy { margin-top: 2px; color: var(--gold-2); }
.msg-copy { color: var(--text-3); }
.msg-label { display: block; color: var(--gold-3); font-size: 13.5px; font-weight: 700; }
.msg-text { display: block; margin-top: 2px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.msg-item.is-copied { border-color: var(--green); }
.msg-item.is-copied .msg-copy { color: var(--green); }

/* ---------- Toast ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  display: grid; justify-items: end; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line-3);
  background: #1d170f; color: var(--text); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .28s var(--ease-out);
}
.toast.in { opacity: 1; transform: none; }
.toast .ico { color: var(--green); }
.toast-info .ico { color: var(--gold-2); }
.toast-error { border-color: rgb(226 100 79 / .55); }
.toast-error .ico { color: var(--red); }

/* ---------- Dialog ---------- */
.dialog {
  width: min(440px, calc(100vw - 32px)); padding: 0;
  border-radius: 16px; border: 1px solid var(--line-3);
  background: linear-gradient(180deg, #1d160e, #120e09); color: var(--text);
  box-shadow: var(--shadow-pop);
}
.dialog[open] { animation: dialogIn .22s var(--ease-out); }
.dialog::backdrop { background: rgb(5 4 2 / .72); backdrop-filter: blur(4px); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.dialog-body { display: grid; justify-items: center; gap: 10px; padding: 26px 24px 20px; text-align: center; }
.dialog-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  color: var(--gold-2); background: rgb(229 195 107 / .12); border: 1px solid rgb(229 195 107 / .35);
}
.dialog-icon .ico { width: 22px; height: 22px; }
.dialog-icon.is-danger { color: #ff9d8c; background: rgb(226 100 79 / .12); border-color: rgb(226 100 79 / .45); }
.dialog-title { color: #fff; font: 700 18px/1.3 var(--font-ui); }
.dialog-msg { color: var(--text-2); font-size: 14px; white-space: pre-line; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.dialog-actions .btn { min-width: 124px; }
