/* =========================================================================
   Coffelorvia — Yönetim Paneli
   ========================================================================= */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a11;
  --surface: #12121c;
  --surface-2: #171724;
  --surface-3: #1e1e2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #e94560;
  --accent-hover: #ff5773;
  --accent-soft: rgba(233, 69, 96, 0.13);
  --text: #f2f2f7;
  --text-dim: rgba(242, 242, 247, 0.58);
  --text-mute: rgba(242, 242, 247, 0.36);
  --ok: #35c98a;
  --warn: #f0b429;
  --danger: #ff5c5c;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.85);
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(233, 69, 96, 0.10), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(88, 101, 242, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ------------------------------------------------------------------ login */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px 34px 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise 500ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
  flex: none;
}

.login-brand-mark::after {
  content: '';
  position: absolute;
  inset: 8px 14px;
  border-radius: 999px;
  background: #0a0a11;
  transform: rotate(24deg);
}

.login-brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 6px;
  margin-bottom: 26px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.input::placeholder {
  color: var(--text-mute);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 92, 92, 0.12);
}

.input-wrap .input {
  padding-right: 46px;
}

.peek {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-dim);
  transition: color 160ms, background 160ms;
}

.peek:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 500;
  transition:
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    transform 120ms var(--ease),
    opacity 180ms;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(233, 69, 96, 0.9);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

.btn-danger {
  border-color: rgba(255, 92, 92, 0.35);
  background: rgba(255, 92, 92, 0.1);
  color: #ffb3b3;
}

.btn-danger:hover {
  background: rgba(255, 92, 92, 0.2);
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.btn .spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.alert {
  display: none;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 92, 92, 0.3);
  background: rgba(255, 92, 92, 0.1);
  color: #ffb3b3;
}

.alert.is-visible {
  display: block;
}

.login-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-mute);
}

/* ------------------------------------------------------------------ kabuk */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: rgba(10, 10, 17, 0.6);
  backdrop-filter: blur(12px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
}

.sidebar-mark {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(233, 69, 96, 0.45);
  flex: none;
}

.sidebar-mark::after {
  content: '';
  position: absolute;
  inset: 6px 11px;
  border-radius: 999px;
  background: #0a0a11;
  transform: rotate(24deg);
}

.sidebar-title {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-title small {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  font-weight: 400;
  margin-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: #ffd7de;
  box-shadow: inset 0 0 0 1px rgba(233, 69, 96, 0.22);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #ffd7de;
  font-size: 0.8rem;
  font-weight: 600;
  flex: none;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-mute);
}

/* ------------------------------------------------------------------ ana içerik */
.main {
  padding: 30px clamp(20px, 3vw, 44px) 56px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.page-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 4px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: fade-up 280ms var(--ease) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* İstatistikler */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: '';
  position: absolute;
  inset: auto -30% -60% auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(30px);
}

.stat-label {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-value.small {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* Araç çubuğu */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar .grow {
  flex: 1;
}

.hint {
  font-size: 0.78rem;
  color: var(--text-mute);
}

/* Galeri ızgarası */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition:
    border-color 180ms var(--ease),
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card.is-dragging {
  opacity: 0.4;
}

.card.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-3);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms var(--ease);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(10, 10, 17, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
}

.card-badge.is-active {
  color: #b8ffe0;
  border-color: rgba(53, 201, 138, 0.4);
  background: rgba(53, 201, 138, 0.16);
}

.card-order {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(10, 10, 17, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.card-body {
  padding: 12px 13px 13px;
}

.card-name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--text-mute);
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.card-actions {
  display: flex;
  gap: 6px;
  padding: 0 13px 13px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  transition:
    color 160ms,
    background 160ms,
    border-color 160ms;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

.icon-btn.is-danger:hover {
  color: #ffb3b3;
  background: rgba(255, 92, 92, 0.14);
  border-color: rgba(255, 92, 92, 0.35);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Boş / yükleniyor */
.empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
}

.empty strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 6px;
}

.skeleton {
  height: 260px;
  border-radius: var(--radius);
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.03) 20%,
    rgba(255, 255, 255, 0.07) 45%,
    rgba(255, 255, 255, 0.03) 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 160% 0;
  }
  to {
    background-position: -60% 0;
  }
}

/* ------------------------------------------------------------------ modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 200ms var(--ease),
    visibility 200ms;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(0.98);
  transition: transform 240ms var(--ease);
}

.modal.is-open .modal-card {
  transform: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.02rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-dim);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

/* Form alanları */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.select,
.textarea {
  width: 100%;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color 180ms,
    box-shadow 180ms;
}

.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.select option {
  background: var(--surface-2);
}

.textarea {
  resize: vertical;
  min-height: 74px;
}

/* Dosya bırakma */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 18px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 180ms,
    background 180ms;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone svg {
  color: var(--text-mute);
}

.dropzone strong {
  font-size: 0.92rem;
  font-weight: 500;
}

.dropzone span {
  font-size: 0.78rem;
  color: var(--text-mute);
}

.dropzone input {
  display: none;
}

.picked {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.picked-item {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.picked-item img {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
}

.picked-item b {
  font-weight: 500;
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  margin-top: 14px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: none;
}

.upload-progress.is-visible {
  display: block;
}

.upload-progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 200ms linear;
}

/* Anahtar (switch) */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
}

.switch-text span {
  font-size: 0.8rem;
  color: var(--text-mute);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: none;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 200ms var(--ease);
  pointer-events: none;
}

.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 220ms var(--ease);
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(20px);
}

.switch input:focus-visible + i {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.panel-card {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  margin-bottom: 18px;
}

.panel-card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.panel-card > p {
  font-size: 0.84rem;
  color: var(--text-mute);
  margin-bottom: 14px;
}

/* ------------------------------------------------------------------ toast */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(23, 23, 36, 0.96);
  box-shadow: var(--shadow);
  font-size: 0.87rem;
  animation: toast-in 260ms var(--ease) both;
}

.toast.is-out {
  animation: toast-out 200ms var(--ease) both;
}

.toast::before {
  content: '';
  width: 3px;
  align-self: stretch;
  border-radius: 3px;
  background: var(--ok);
  flex: none;
}

.toast.is-error::before {
  background: var(--danger);
}

.toast.is-info::before {
  background: #6b8cff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* ------------------------------------------------------------------ uyum */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-head {
    padding: 0 12px 0 4px;
    flex: none;
  }
  .sidebar-title small {
    display: none;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    padding: 9px 12px;
  }
  .nav-item span {
    display: none;
  }
  .sidebar-foot {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .user-chip {
    margin-bottom: 0;
    padding: 0 6px;
  }
  .user-meta {
    display: none;
  }
  .main {
    padding-top: 22px;
  }
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
}

/* İnce kaydırma çubuğu */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
  background-clip: content-box;
}

/* =========================================================================
   v5 — canlı önizleme, toplu işlem, denetim, oturum
   ========================================================================= */

[hidden] {
  display: none !important;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin-bottom: 2px;
}

.panel-head > div > p {
  margin-bottom: 0;
}

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

.toolbar-tight {
  margin: 16px 0 0;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-top: 7px;
}

/* ---------------------------------------------------------- canlı önizleme */
.preview-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #06060a;
}

.preview-stage .preview-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.preview-stage .preview-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.15);
  filter: blur(30px) saturate(1.12) brightness(0.5);
  pointer-events: none;
}

.preview-stage[data-fit='contain-blur'] .preview-bg {
  opacity: 1;
}

.preview-stage[data-fit='contain-blur'] .preview-photo,
.preview-stage[data-fit='contain-black'] .preview-photo {
  object-fit: contain;
}

.preview-stage[data-fit='contain-black'] {
  background: #000;
}

.preview-stage.is-empty .preview-photo,
.preview-stage.is-empty .preview-bg {
  display: none;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--text-mute);
  font-size: 0.9rem;
}

.preview-stage.is-empty .preview-empty {
  display: grid;
}

.preview-caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 17, 0.72);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ------------------------------------------------------------- galeri arama */
.gallery-toolbar .search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 340px;
  min-width: 200px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-mute);
  pointer-events: none;
}

.search-box .input {
  padding-left: 36px;
}

.select.compact {
  width: auto;
  min-width: 128px;
  padding: 9px 12px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.check-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(233, 69, 96, 0.35);
  background: var(--accent-soft);
}

.bulkbar strong {
  font-size: 0.85rem;
}

.bulkbar .grow {
  flex: 1;
}

/* --------------------------------------------------------------- kart ekstra */
.card {
  cursor: default;
}

.card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.card-media {
  cursor: zoom-in;
}

.card-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 17, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.card-select input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.card-badge {
  left: 42px;
}

.card-meta {
  flex-wrap: wrap;
  gap: 5px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
}

.meta-key {
  color: var(--text-mute);
}

.meta-value {
  color: var(--text-dim);
}

.card-actions {
  flex-wrap: wrap;
}

.card-actions .icon-btn {
  width: 32px;
  height: 32px;
}

.icon-btn[disabled] {
  opacity: 0.32;
  pointer-events: none;
}

/* --------------------------------------------------------------- düzenleme */
.edit-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #06060a;
  overflow: hidden;
}

.edit-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.edit-preview .card-badge {
  left: 10px;
}

/* ------------------------------------------------------------------- kv */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.kv-label {
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.kv-value {
  font-size: 0.86rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.kv-value.is-ok {
  color: #8ff0c4;
}

.kv-value.is-warn {
  color: #ffd27a;
}

.kv-value.is-danger {
  color: #ff9b9b;
}

/* ------------------------------------------------------------------- tablo */
.table-wrap {
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table th {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-empty {
  padding: 26px 12px !important;
  text-align: center;
  color: var(--text-mute);
}

.cell-time,
.cell-ip {
  white-space: nowrap;
  color: var(--text-dim);
}

.cell-detail {
  max-width: 420px;
  color: var(--text-mute);
  overflow-wrap: anywhere;
}

.action-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.table-foot {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* --------------------------------------------------------------- geçmiş */
.history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.83rem;
}

.history-time {
  color: var(--text-dim);
}

.history-ip {
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.history-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-mute);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------- şifre gücü */
.strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.strength i {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 180ms;
}

.strength i.is-on {
  background: var(--warn);
}

.strength[data-score='1'] i.is-on {
  background: var(--danger);
}

.strength[data-score='3'] i.is-on {
  background: #8fd0ff;
}

.strength[data-score='4'] i.is-on {
  background: var(--ok);
}

/* --------------------------------------------------------- seçilen dosyalar */
.picked-remove {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--text-mute);
  font-size: 0.72rem;
}

.picked-remove:hover {
  background: rgba(255, 92, 92, 0.15);
  color: #ffb3b3;
}

/* ------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 28px);
  padding: clamp(14px, 3vw, 40px);
  background: rgba(4, 4, 8, 0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 200ms var(--ease),
    visibility 200ms;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(1200px, 100%);
  max-height: 100%;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px -30px #000;
}

.lightbox-figure figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-nav {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
  .lightbox-nav {
    display: none;
  }
}
