/* admin.css — Ekip, Hareketler, Bağlantı merkezi ve Güvenlik sayfaları.
   Yalnız bu sayfalara özgü sınıflar; ortak bileşenler (.btn, .mini, .stats, .fbtn, .seg, .panel-box …) style.css'ten gelir. */

/* =========================================================
   EKİP
   ========================================================= */
.team-layout { display: block; }
.team-layout.form-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr); gap: 20px; align-items: start; }
.team-members { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.team-filters { align-self: flex-start; display: inline-flex; gap: 2px; margin: 0; padding: 3px; max-width: 100%; background: var(--surface-2); border-radius: var(--radius-sm); }

.team-list { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.team-list > .empty { min-height: 160px; }
.team-person {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 0; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background var(--dur-fast) ease;
}
.team-person:last-child { border-bottom: 0; }
@media (hover: hover) { .team-person:hover { background: var(--surface-2); } }
.person-avatar {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%;
  color: var(--green-text); background: var(--green-soft); font-size: var(--text-13); font-weight: 700; line-height: 1;
}
.team-person > .person-avatar { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
.person-main { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; }
.person-main b { overflow-wrap: anywhere; font-size: var(--text-15); font-weight: 600; line-height: 1.35; color: var(--ink); }
.person-main small { overflow-wrap: anywhere; font-size: var(--text-13); line-height: 1.45; color: var(--muted); }
.person-meta { grid-column: 2; grid-row: 2; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.wp-state, .member-import-state { font-size: var(--text-13); line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.wp-state.connected { color: var(--green-text); }
.wp-state { display: inline-flex; align-items: center; gap: 6px; }
.wp-state::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--line-2); }
.wp-state.connected::before { background: var(--green); }
.person-manage { grid-column: 3; grid-row: 1 / span 2; align-self: center; }

/* Yeni çalışan paneli */
.team-add { gap: 12px; min-width: 0; }
.team-add .section-title { margin: 0; font-size: var(--text-16); }
.team-add .hint { font-size: var(--text-14); color: var(--ink-2); }
.team-add #modeHint { font-size: var(--text-13); color: var(--muted); }
.team-add .lbl { margin-bottom: -6px; }
.team-add .seg-btn { white-space: normal; line-height: 1.3; padding-block: 6px; }
#linkBox { display: flex; flex-direction: column; gap: 6px; }
#linkBox[hidden] { display: none; }
.team-add .transfer-box { gap: 8px; padding: 14px; background: var(--surface-2); border: 0; border-radius: var(--radius-sm); box-shadow: none; }
.transfer-box > b { font-size: var(--text-14); font-weight: 600; color: var(--ink); }
.transfer-box > small { font-size: var(--text-13); line-height: 1.5; color: var(--muted); }
.transfer-box .btn { align-self: flex-start; }
.member-permission {
  min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 2px; cursor: pointer;
  font-size: var(--text-14); font-weight: 500; color: var(--ink);
}
.member-permission input { cursor: pointer; }

/* Çalışan çekmecesi */
.workspace-overlay > .card > .team-member-drawer,
.team-member-drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 60; width: min(440px, 100%); margin: 0;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 0 24px 32px; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-modal);
}
.team-member-drawer > .row-between {
  position: sticky; top: 0; z-index: 2; min-height: 64px; margin: 0 -24px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.team-member-drawer > .row-between > div { min-width: 0; }
.team-member-drawer .brand { overflow-wrap: anywhere; font-size: var(--text-18); font-weight: 600; line-height: 1.3; letter-spacing: 0; color: var(--ink); }
#drawerMemberBody { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
#drawerMemberBody .panel-box { gap: 10px; padding: 16px 0 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
#drawerMemberBody .panel-box > h3 { margin-bottom: 0; font-size: var(--text-15); font-weight: 600; }
#drawerMemberBody .panel-box > small { font-size: var(--text-13); line-height: 1.5; color: var(--muted); }
#drawerMemberBody .panel-box .btn.compact { align-self: flex-start; }
.member-profile { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: var(--radius); }
.member-profile > div { min-width: 0; display: flex; flex-direction: column; }
.member-profile b { overflow-wrap: anywhere; font-size: var(--text-15); font-weight: 600; line-height: 1.35; color: var(--ink); }
.member-profile small { overflow-wrap: anywhere; font-size: var(--text-13); color: var(--muted); }
.member-action-list { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.member-action-list .btn { width: 100%; }
.member-access-form h3, .member-password-form h3 { font-size: var(--text-15); font-weight: 600; }
.member-password-form .lbl { margin-bottom: -4px; }
#drawerMemberBody .member-remove { margin-top: 8px; padding-top: 24px; gap: 8px; }
.member-remove .hint { font-size: var(--text-13); }
.team-member-drawer .btn.danger-btn { width: 100%; min-height: 40px; }
@media (prefers-reduced-motion: no-preference) {
  .team-member-drawer { animation: drawerIn var(--dur) var(--ease-out); }
  @keyframes drawerIn { from { opacity: 0; transform: translateX(12px); } }
}

/* =========================================================
   HAREKETLER
   ========================================================= */
.activity-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.activity-summary > div { min-width: 0; min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px 18px; border-right: 1px solid var(--line); }
.activity-summary > div:last-child { border-right: 0; }
.activity-summary b { font-size: var(--text-22); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.activity-summary span { font-size: var(--text-13); line-height: 1.4; color: var(--muted); }

.activity-board .activity-filters { flex-wrap: wrap; align-items: center; }
.activity-board .activity-refresh { margin-left: auto; color: var(--green-text); font-weight: 600; }

.activity-timeline { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.activity-event {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.activity-event:last-child { border-bottom: 0; }
.activity-event-icon {
  width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm);
  color: var(--green-text); background: var(--green-soft); font-size: 0; line-height: 0;
}
.activity-event-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
:is(.action-deleted, .action-user_archived, .action-suspicious_login, .action-user_disabled) > .activity-event-icon { color: var(--red); background: var(--red-bg); }
:is(.action-status, .action-rejected) > .activity-event-icon { color: var(--amber); background: var(--amber-bg); }
.activity-event-main { min-width: 0; display: flex; flex-direction: column; padding-top: 1px; }
.activity-event-main > b { overflow-wrap: anywhere; font-size: var(--text-14); font-weight: 600; line-height: 1.4; color: var(--ink); }
.activity-event-main > small { overflow-wrap: anywhere; font-size: var(--text-13); line-height: 1.45; color: var(--muted); }
.activity-event > time { align-self: start; padding-top: 2px; white-space: nowrap; font-size: var(--text-12); line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-event details { margin-top: 2px; }
.activity-event summary {
  width: fit-content; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; margin: 0 -8px;
  color: var(--green-text); border-radius: 6px; font-size: var(--text-13); font-weight: 600; cursor: pointer;
}
.activity-event summary:hover { background: var(--green-tint); }
.activity-event summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg); transition: transform var(--dur-fast) ease;
}
.activity-event details[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.activity-change-list { margin-top: 6px; padding: 4px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.change-line { display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--text-13); line-height: 1.45; }
.change-line:last-child { border-bottom: 0; }
.change-line b { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.change-line span { color: var(--muted); overflow-wrap: anywhere; }

/* =========================================================
   BAĞLANTI MERKEZİ
   ========================================================= */
.connection-overview {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.connection-orb { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); }
.connection-orb i { width: 12px; height: 12px; border-radius: 50%; background: #a3b0a8; }
.connection-orb:has(i.ok) { background: var(--green-soft); }
.connection-orb i.ok { background: var(--green); }
.connection-orb:has(i.warn) { background: var(--amber-bg); }
.connection-orb i.warn { background: #c48a12; }
.connection-orb:has(i.bad) { background: var(--red-bg); }
.connection-orb i.bad { background: var(--red); }
.connection-overview > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#connectionState { font-size: var(--text-13); font-weight: 600; line-height: 1.4; color: var(--ink-2); }
.connection-overview:has(i.ok) #connectionState { color: var(--green-text); }
.connection-overview:has(i.warn) #connectionState { color: var(--amber); }
.connection-overview:has(i.bad) #connectionState { color: var(--red); }
#connectionUrl { overflow-wrap: anywhere; font-size: var(--text-15); font-weight: 600; line-height: 1.35; color: var(--ink); }
#connectionChecked { font-size: var(--text-13); color: var(--muted); }

.service-health { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.service-health article {
  min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.service-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--ink-2); background: var(--surface-2); font-size: var(--text-13); font-weight: 700; line-height: 1; }
.service-health article > div { min-width: 0; display: flex; flex-direction: column; }
.service-health b { font-size: var(--text-14); font-weight: 600; line-height: 1.35; color: var(--ink); }
.service-health small { overflow-wrap: anywhere; font-size: var(--text-13); line-height: 1.4; color: var(--muted); }
.service-health em {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  font-style: normal; font-size: var(--text-12); font-weight: 600; line-height: 1; color: var(--grey-text); background: var(--grey-bg);
}
.service-health em.ok { color: var(--green-text); background: var(--green-soft); }
.service-health em.bad { color: var(--red); background: var(--red-bg); }

.publish-queue-panel { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.queue-head > div { min-width: 0; }
.queue-head b { display: block; font-size: var(--text-16); font-weight: 600; line-height: 1.35; color: var(--ink); }
.queue-head small { display: block; font-size: var(--text-13); color: var(--muted); font-variant-numeric: tabular-nums; }
.publish-queue-list { display: flex; flex-direction: column; }
.queue-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.queue-row:last-child { border-bottom: 0; padding-bottom: 0; }
.queue-row > i { width: 8px; height: 8px; border-radius: 50%; background: #a3b0a8; }
.queue-row > i.succeeded { background: var(--green); }
.queue-row > i:is(.pending, .processing, .retry) { background: #c48a12; }
.queue-row > i.failed { background: var(--red); }
.queue-row > div { min-width: 0; display: flex; flex-direction: column; }
.queue-row b { overflow-wrap: anywhere; font-size: var(--text-14); font-weight: 600; line-height: 1.4; color: var(--ink); }
.queue-row small { overflow-wrap: anywhere; font-size: var(--text-13); line-height: 1.45; color: var(--muted); }
.queue-empty { padding: 12px 0 0; font-size: var(--text-13); color: var(--muted); }

.connection-error { padding: 12px 14px; color: var(--red); background: var(--red-bg); border: 1px solid var(--red-line); border-radius: var(--radius-sm); font-size: var(--text-14); line-height: 1.5; overflow-wrap: anywhere; }

.connection-settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.connection-settings > summary {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px;
  font-size: var(--text-14); font-weight: 600; color: var(--ink); cursor: pointer; border-radius: var(--radius);
}
.connection-settings > summary:hover { color: var(--green-text); }
.connection-settings > summary::after {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-top: -4px; border-right: 1.8px solid var(--ink-2); border-bottom: 1.8px solid var(--ink-2);
  transform: rotate(45deg); transition: transform var(--dur-fast) ease;
}
.connection-settings[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.connection-form { display: grid; grid-template-columns: 1.2fr .8fr .8fr auto; gap: 10px; padding: 0 20px 20px; }

.connection-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--text-13); color: var(--muted); }

/* =========================================================
   GÜVENLİK
   ========================================================= */
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.security-grid > .panel-box { min-width: 0; }
.security-grid > .panel-box > h3 { font-size: var(--text-16); font-weight: 600; }
.security-grid .hint { font-size: var(--text-14); color: var(--ink-2); }
.security-grid .btn { align-self: flex-start; }
#twoFactorSetup { display: flex; flex-direction: column; gap: 10px; }
#twoFactorSetup[hidden] { display: none; }
#twoFactorSecret {
  display: block; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--text-13); line-height: 1.5; color: var(--ink); overflow-wrap: anywhere;
}
#ownSessions { display: flex; flex-direction: column; margin-top: -4px; }
.session-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.session-row:first-child { padding-top: 4px; }
.session-row:last-child { border-bottom: 0; padding-bottom: 0; }
.session-row > div { min-width: 0; display: flex; flex-direction: column; }
.session-row b { font-size: var(--text-14); font-weight: 600; line-height: 1.4; color: var(--ink); font-variant-numeric: tabular-nums; }
.session-row small { overflow-wrap: anywhere; font-size: var(--text-13); line-height: 1.45; color: var(--muted); }
.session-row .mini { align-self: start; }
#backupState, #integrityState { display: flex; flex-direction: column; gap: 0; }
#backupState:empty, #integrityState:empty { display: none; }
#backupState b, #integrityState b { font-size: var(--text-14); font-weight: 600; line-height: 1.4; color: var(--ink); }
#backupState small, #integrityState small { font-size: var(--text-13); color: var(--muted); }
.security-state { display: block; margin-top: 2px; font-size: var(--text-13); line-height: 1.45; color: var(--muted); }
#systemSecurityBox > .btn + .btn { margin-top: -4px; }
#brandingBox { gap: 10px; }
#brandingBox label.hint { margin-bottom: -4px; font-size: var(--text-13); font-weight: 500; color: var(--ink-2); }

/* =========================================================
   Tablet ≤900
   ========================================================= */
@media (max-width: 900px) {
  .team-layout.form-open { grid-template-columns: minmax(0, 1fr); }
  .team-layout.form-open > .team-add { order: -1; }
  .service-health { grid-template-columns: minmax(0, 1fr); }
  .connection-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   Telefon ≤760
   ========================================================= */
@media (max-width: 760px) {
  /* Ekip */
  .team-filters { display: flex; align-self: stretch; }
  .team-filters .fbtn { flex: 1 1 0; }
  .team-person { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; padding: 14px; }
  .team-person > .person-avatar { width: 36px; height: 36px; flex-basis: 36px; grid-row: 1 / span 2; }
  .person-manage { grid-column: 2; grid-row: 3; justify-self: start; align-self: start; min-width: 112px; margin-top: 10px; }
  .team-add .transfer-box .btn, .team-add > .btn { align-self: stretch; width: 100%; }
  .workspace-overlay > .card > .team-member-drawer,
  .team-member-drawer { inset: 0 0 var(--mobile-nav-height) 0; width: 100%; padding: 0 16px 24px; border-left: 0; box-shadow: none; }
  .team-member-drawer > .row-between { margin: 0 -16px; padding: 10px 12px 10px 68px; min-height: 68px; }
  #drawerMemberBody .panel-box .btn.compact { align-self: stretch; }

  /* Hareketler */
  .activity-summary > div { min-height: 68px; padding: 12px; }
  .activity-summary b { font-size: var(--text-18); }
  .activity-event { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; padding: 14px; }
  .activity-event > .activity-event-icon { grid-row: 1 / span 2; }
  .activity-event > time { grid-column: 2; grid-row: 2; padding-top: 0; }
  .activity-event summary { min-height: 40px; }
  .change-line { grid-template-columns: minmax(0, 1fr); gap: 0; }

  /* Bağlantı merkezi */
  .connection-overview { grid-template-columns: 44px minmax(0, 1fr); padding: 16px; }
  .connection-overview > .btn { grid-column: 1 / -1; width: 100%; }
  .service-health article { padding: 14px; }
  .publish-queue-panel { padding: 16px; }
  .queue-row { grid-template-columns: 10px minmax(0, 1fr); }
  .queue-row > i { align-self: start; margin-top: 7px; }
  .queue-retry { grid-column: 2; justify-self: start; }
  .connection-settings > summary { padding: 0 16px; }
  .connection-form { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .connection-footer { flex-direction: column; align-items: stretch; }
  .connection-footer .btn { width: 100%; }

  /* Güvenlik */
  .security-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .security-grid .btn { align-self: stretch; width: 100%; }
}
