/* ─── Panel Layout — Sidebar + Main ─────────────────────────────────────── */

/* Panel sayfaları body class'ı: page-panel */
body.page-panel {
  background: var(--bg-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Panel wrapper ───────────────────────────────────────────────────────── */

.panel-layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */

.panel-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 2px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 2px solid #1a1a1a;
  text-decoration: none;
}

.sidebar-logo img {
  width: 100%;
  max-width: 216px;
  height: auto;
}

.sidebar-user {
  padding: 14px 20px;
  border-bottom: 2px solid rgba(26,26,26,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
  background: #b8f0ef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #1a1a1a;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: 0.75rem;
  color: var(--text-secondary, #555);
  display: flex;
  align-items: center;
  gap: 4px;
}

.plan-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #b8f0ef;
  border: 1.5px solid #1a1a1a;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* ─── Nav grupları ────────────────────────────────────────────────────────── */

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-label {
  padding: 8px 20px 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary, #888);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #1a1a1a);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  flex-shrink: 0;
}

.nav-link:hover {
  background: #f5f5f5;
}

.nav-link.active {
  background: #e6fafa;
  border-left-color: #1a9ea4;
  font-weight: 600;
}

.nav-link.active i {
  color: #1a9ea4;
}

/* Genişleyebilir grup */
.nav-collapsible .nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
  user-select: none;
  list-style: none;
  border-left: 3px solid transparent;
}

.nav-collapsible .nav-group-header i.nav-icon {
  width: 18px;
  text-align: center;
  color: var(--text-secondary, #666);
}

.nav-collapsible .nav-group-header .chevron {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.nav-collapsible.open .nav-group-header .chevron {
  transform: rotate(180deg);
}

.nav-collapsible .nav-sub {
  display: none;
  padding-left: 12px;
}

.nav-collapsible.open .nav-sub {
  display: block;
}

.nav-sub .nav-link {
  padding: 7px 20px 7px 28px;
  font-size: 0.8125rem;
}

/* ─── Nav ayraç ──────────────────────────────────────────────────────────── */

.nav-divider {
  margin: 8px 20px;
  border-top: 2px dashed rgba(26,26,26,0.15);
}

@media (prefers-color-scheme: dark) {
  .nav-divider {
    border-top-color: rgba(240,237,232,0.15);
  }
}

/* ─── Sidebar alt kısım ───────────────────────────────────────────────────── */

.sidebar-footer {
  padding: 12px 20px;
  border-top: 2px solid rgba(26,26,26,0.1);
}

.sidebar-footer .nav-link {
  padding: 8px 0;
  border-left: none;
  font-size: 0.8125rem;
  color: var(--text-secondary, #666);
}

.sidebar-footer .nav-link:hover {
  background: none;
  color: #e53e3e;
}

/* ─── Panel içerik alanı ──────────────────────────────────────────────────── */

.panel-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel-topbar {
  background: var(--surface);
  border-bottom: 2px solid #1a1a1a;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.panel-topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  flex: 1;
}

.panel-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobil menu toggle */
.sidebar-toggle {
  display: none;
  background: none;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
  border-radius: 3px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  color: #1a1a1a;
}

/* Sidebar backdrop overlay (mobil) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.panel-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ─── Özet kartlar (ana dashboard) ──────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 2px solid #1a1a1a;
  box-shadow: 4px 4px 0 #1a1a1a;
  border-radius: 4px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.12s;
}

.stat-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a1a1a;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border: 2px solid #1a1a1a;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary, #1a1a1a);
  line-height: 1;
}

.stat-card-label {
  font-size: 0.8125rem;
  color: var(--text-secondary, #666);
}

/* Renk varyantları */
.stat-card.mint  { background: #e6fafa; }
.stat-card.mint .stat-card-icon { background: #b8f0ef; }

.stat-card.lavender { background: #f3f0fe; }
.stat-card.lavender .stat-card-icon { background: #e0d4fc; }

.stat-card.peach { background: #fff3ea; }
.stat-card.peach .stat-card-icon { background: #ffd6b8; }

.stat-card.lemon { background: #fdfbe8; }
.stat-card.lemon .stat-card-icon { background: #f8f0b8; }

.stat-card.blue { background: #eaf4ff; }
.stat-card.blue .stat-card-icon { background: #c8e4fc; }

.stat-card.pink { background: #fff0f6; }
.stat-card.pink .stat-card-icon { background: #ffd4e8; }

/* ─── Dashboard iki kolon grid ───────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 32px; /* tek kolon olunca bölümler arası boşluk — box-shadow taşmasını telafi eder */
  }

  /* İkinci bölüm başlığı üstteki kartın gölgesinden net ayrılsın */
  .dashboard-grid > div + div {
    padding-top: 4px;
  }
}

/* ─── Panel bölüm başlığı ─────────────────────────────────────────────────── */

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.panel-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0;
}

/* ─── Kayıt tablosu ───────────────────────────────────────────────────────── */

.records-table-wrapper {
  background: var(--surface);
  border: 2px solid #1a1a1a;
  box-shadow: 4px 4px 0 #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.records-table thead {
  background: #f5f5f5;
  border-bottom: 2px solid #1a1a1a;
}

.records-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--text-secondary, #555);
  white-space: nowrap;
}

.records-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(26,26,26,0.08);
  color: var(--text-primary, #1a1a1a);
  vertical-align: middle;
}

.records-table tr:last-child td {
  border-bottom: none;
}

.records-table tr:hover td {
  background: #fafaf8;
}

/* ─── Skor badge ──────────────────────────────────────────────────────────── */

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 2px 8px;
  border: 1.5px solid #1a1a1a;
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.score-badge.good    { background: #c6f6d5; }
.score-badge.average { background: #fefcbf; }
.score-badge.poor    { background: #fed7d7; }

/* ─── Aksiyon butonları (tablo satırında) ────────────────────────────────── */

.row-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.8125rem;
  color: #1a1a1a;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-icon:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #1a1a1a;
}

.btn-icon.danger:hover {
  background: #fff0f0;
  border-color: #e53e3e;
  color: #e53e3e;
  box-shadow: 1px 1px 0 #e53e3e;
}

/* ─── Boş durum ───────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary, #666);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
  display: block;
}

.empty-state p {
  margin: 0 0 16px;
  font-size: 0.9375rem;
}

/* ─── Yükleniyor skeleton ─────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 3px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Panel butonları ─────────────────────────────────────────────────────── */

.panel-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 2px solid #1a1a1a;
  box-shadow: 3px 3px 0 #1a1a1a;
  border-radius: 3px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
  background: var(--surface);
  color: #1a1a1a;
}

.panel-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1a1a1a;
}

.panel-btn.primary {
  background: #b8f0ef;
}

.panel-btn.danger {
  background: #ffd6b8;
}

/* ─── Modal ───────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 2px solid #1a1a1a;
  box-shadow: 6px 6px 0 #1a1a1a;
  border-radius: 4px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform 0.15s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 2px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  color: var(--text-secondary, #666);
  line-height: 1;
}

.modal-body {
  padding: 20px 24px;
}

/* ─── Aktivite listesi ────────────────────────────────────────────────────── */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26,26,26,0.08);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border: 2px solid #1a1a1a;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  margin-top: 2px;
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 16px 0 4px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: #1a1a1a;
  transition: transform 0.1s, box-shadow 0.1s;
}

.page-btn:hover:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #1a1a1a;
}

.page-btn.active {
  background: #b8f0ef;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ─── Domain expiry uyarısı ─────────────────────────────────────────────── */

.expiry-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1.5px solid;
}

.expiry-warning.critical { background: #fed7d7; border-color: #e53e3e; color: #c53030; }
.expiry-warning.soon     { background: #fefcbf; border-color: #d69e2e; color: #975a16; }
.expiry-warning.ok       { background: #c6f6d5; border-color: #38a169; color: #276749; }

/* ─── Dark mode ───────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  .panel-sidebar {
    border-right-color: #f0ede8;
  }

  .sidebar-logo {
    border-bottom-color: #f0ede8;
  }

  .nav-link:hover {
    background: #2a2a2a;
  }

  .nav-link.active {
    background: #1a2e2e;
    border-left-color: #1a9ea4;
  }

  .stat-card,
  .records-table-wrapper,
  .modal {
    border-color: #f0ede8;
    box-shadow: 4px 4px 0 #f0ede8;
  }

  .stat-card:hover {
    box-shadow: 2px 2px 0 #f0ede8;
  }

  .records-table thead {
    background: #2a2a2a;
    border-bottom-color: #f0ede8;
  }

  .records-table tr:hover td {
    background: #242424;
  }

  .panel-topbar {
    border-bottom-color: #f0ede8;
  }

  .sidebar-user {
    border-bottom-color: rgba(240,237,232,0.1);
  }

  .sidebar-footer {
    border-top-color: rgba(240,237,232,0.1);
  }

  .modal-header {
    border-bottom-color: #f0ede8;
  }

  .activity-item {
    border-bottom-color: rgba(240,237,232,0.08);
  }

  .records-table td {
    border-bottom-color: rgba(240,237,232,0.08);
  }

  .panel-btn {
    border-color: #f0ede8;
    box-shadow: 3px 3px 0 #f0ede8;
    color: #f0ede8;
  }

  .panel-btn:hover {
    box-shadow: 1px 1px 0 #f0ede8;
  }

  .btn-icon {
    border-color: #f0ede8;
    box-shadow: 2px 2px 0 #f0ede8;
    color: #f0ede8;
  }

  .btn-icon:hover {
    box-shadow: 1px 1px 0 #f0ede8;
  }
}

/* ─── Mobil ───────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .panel-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    transition: left 0.2s;
    z-index: 200;
  }

  .panel-sidebar.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .panel-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal {
    max-width: 100%;
    margin: 0;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 -4px 0 #1a1a1a;
  }

  .modal-overlay {
    align-items: flex-end;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .records-table th:nth-child(n+4),
  .records-table td:nth-child(n+4) {
    display: none;
  }
}

@media (max-width: 900px) and (prefers-color-scheme: dark) {
  .modal {
    box-shadow: 0 -4px 0 #f0ede8;
  }
}