/* KuponMatik — kimlik doğrulama arayüzü */

body:not(.auth-ready) .app { display: none !important; }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(163, 255, 46, 0.10), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(0, 245, 196, 0.08), transparent 60%),
    var(--bg);
}
.auth-overlay[hidden] { display: none !important; }

.auth-card {
  width: min(430px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-brand strong {
  font-family: var(--display);
  letter-spacing: -0.02em;
  font-size: 17px;
}
.auth-brand strong span { color: var(--accent); }
.auth-brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-title {
  font-family: var(--display);
  font-size: 19px;
  margin: 0 0 6px;
}
.auth-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.5;
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.pad { padding: 18px 20px 22px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
}
.auth-form label small { color: var(--muted); font-weight: 500; }
.auth-form input,
.uc-grid input,
.uc-grid select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--txt);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}
.auth-form input:focus,
.uc-grid input:focus,
.uc-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 255, 46, 0.14);
}

.auth-error {
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.4);
  color: #ffb3c1;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.auth-foot {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.8px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* hesap rozeti */
.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  font-size: 12px;
}
.ac-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #00f5c4);
  color: #06110a;
  font-weight: 800;
  font-size: 12px;
}
.ac-name { font-weight: 700; }
.ac-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-left: 1px solid var(--line-strong);
  padding-left: 8px;
}
.ac-role.admin { color: var(--accent); }
.account-chip .linkbtn { font-size: 11.5px; }

/* kullanıcı yönetimi */
.auth-modal .modal-card.wide { width: min(1080px, 96vw); max-height: 88vh; }
.users-body { padding: 16px 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.uc-grid { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: 9px; align-items: center; }
.uc-grid .switch.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
}
.users-table { width: 100%; border-collapse: collapse; font-size: 12.3px; }
.users-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-strong);
}
.users-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users-table .u-actions { text-align: right; white-space: nowrap; }
.users-table .u-actions .linkbtn { font-size: 11px; margin-left: 7px; }
.linkbtn.danger { color: var(--danger); }

.audit-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 190px;
  overflow-y: auto;
  font-size: 11px;
}
.audit-row {
  display: grid;
  grid-template-columns: 132px 96px 1fr 1fr 1.4fr;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
}
.audit-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.audit-row.bad { color: #ffb3c1; }
.audit-row .ar-ev { font-weight: 700; }
.audit-row .ar-ip,
.audit-row .ar-ts,
.audit-row .ar-user { color: var(--muted); }

.auth-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 12.5px;
  z-index: 9500;
  box-shadow: var(--shadow);
}
.auth-toast.ok { border-color: rgba(56, 239, 125, 0.5); }
.auth-toast.err { border-color: rgba(255, 77, 109, 0.55); }

@media (max-width: 760px) {
  .uc-grid { grid-template-columns: 1fr 1fr; }
  .users-table .u-actions .linkbtn { display: inline-block; margin: 2px 4px 2px 0; }
  .account-chip .ac-role { display: none; }
}

/* yönetim sekmeleri */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* IP erişimi */
.ip-head { display: flex; flex-direction: column; gap: 8px; }
.ip-mode-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ip-mode-row select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--txt);
  font-size: 12.5px;
  font-family: var(--font);
  min-width: 260px;
}
.ip-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  background: rgba(255, 183, 3, 0.07);
  border: 1px solid rgba(255, 183, 3, 0.25);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.ip-grid { display: grid; grid-template-columns: 1.5fr 140px 1fr auto; gap: 9px; align-items: center; }
.ip-grid input, .ip-grid select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--txt);
  font-size: 12.5px;
  font-family: var(--font);
  outline: none;
}
.ip-grid input:focus, .ip-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 255, 46, 0.14);
}
.ip-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
.ip-list { max-height: 300px; overflow-y: auto; }
.ip-table { font-size: 11.6px; }
.ip-table td { padding: 7px 6px; }
.ip-table .pill { font-size: 9.5px; }

@media (max-width: 900px) {
  .ip-cols { grid-template-columns: 1fr; }
  .ip-grid { grid-template-columns: 1fr 120px; }
}
