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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e8eaf0;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 20px 12px;
  max-width: 1100px;
  margin: 0 auto;
}
header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #e8eaf0;
  text-decoration: none;
  letter-spacing: 0.2px;
}
header .brand-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #76b900, #3fa9f5);
  color: #0f1117;
  box-shadow: 0 4px 18px rgba(118, 185, 0, 0.3);
}
header .brand-mark svg { width: 22px; height: 22px; }
header .tagline { color: #9aa1b1; margin-top: 6px; font-size: 0.92rem; }
header h1 {
  font-size: 1.7rem;
  background: linear-gradient(90deg, #76b900, #3fa9f5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
header p { color: #9aa1b1; margin-top: 4px; font-size: 0.92rem; }

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.header-user .who { font-weight: 600; }
.header-user .who em { color: #3fa9f5; font-style: normal; font-size: 0.85rem; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
}

.panel {
  background: #171a22;
  border: 1px solid #262b38;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.panel h2 { font-size: 1.1rem; margin-bottom: 14px; color: #c9d2e3; }
.panel h3 { font-size: 0.95rem; margin: 22px 0 10px; color: #c9d2e3; }
.hint { font-size: 0.85rem; color: #9aa1b1; margin-bottom: 12px; }

.hidden { display: none !important; }

/* ---- Giriş / Kayıt ---- */
.auth-panel { max-width: 460px; margin-left: auto; margin-right: auto; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-tabs .tab {
  flex: 1;
  padding: 10px;
  border: 1px solid #2c3342;
  border-radius: 8px;
  background: #1b2029;
  color: #9aa1b1;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.auth-tabs .tab svg { width: 17px; height: 17px; }
.auth-tabs .tab:hover { color: #e8eaf0; border-color: #3fa9f5; }
.auth-tabs .tab.active {
  background: linear-gradient(135deg, rgba(118, 185, 0, 0.16), rgba(63, 169, 245, 0.16));
  color: #e8eaf0;
  border-color: #3fa9f5;
  box-shadow: 0 0 0 1px rgba(63, 169, 245, 0.25) inset;
}
.auth-form label { display: block; font-size: 0.85rem; margin: 14px 0 6px; color: #cbd5e1; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 11px 12px 11px 40px;
  background: #0f1117;
  border: 1px solid #2c3342;
  border-radius: 8px;
  color: #e8eaf0;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input:focus { outline: none; border-color: #3fa9f5; box-shadow: 0 0 0 3px rgba(63, 169, 245, 0.18); }
.auth-form .btn { margin-top: 20px; }
.form-note { font-size: 0.8rem; color: #9aa1b1; margin-top: 12px; }
.muted { color: #8b93a5; font-size: 0.85rem; font-weight: normal; }

/* Alan + ikon */
.field { position: relative; margin-bottom: 14px; }
.field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5a6172;
  display: flex;
  pointer-events: none;
}
.field-icon svg { width: 18px; height: 18px; }
.field:focus-within .field-icon { color: #3fa9f5; }

/* Spam tuzağı: ekranda görünmez */
.hp-field { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; width: 0; }

/* ---- Kota ---- */
.quota { margin-bottom: 14px; }
.quota-info { font-size: 0.85rem; color: #9aa1b1; margin-bottom: 6px; }
.quota-track { height: 8px; background: #262b38; border-radius: 99px; overflow: hidden; }
.quota-fill { height: 100%; background: linear-gradient(90deg, #76b900, #3fa9f5); border-radius: 99px; transition: width 0.4s; }

/* ---- Dropzone ---- */
.dropzone {
  border: 2px dashed #3a4152;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  margin-bottom: 14px;
  position: relative;
}
.dropzone:hover, .dropzone.dragover {
  border-color: #76b900;
  background: #1b2029;
  box-shadow: 0 0 0 4px rgba(118, 185, 0, 0.08);
}
.dropzone-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  color: #5a6172;
  transition: color 0.2s;
}
.dropzone:hover .dropzone-icon { color: #76b900; }
.dropzone img { max-width: 100%; max-height: 300px; border-radius: 8px; margin-top: 10px; }
.dropzone .hint { margin-top: 8px; margin-bottom: 0; font-size: 0.78rem; }

/* ---- Panel başlıkları ---- */
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.title-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #76b900, #3fa9f5);
  color: #0f1117;
  flex-shrink: 0;
}
.panel-sub { margin-top: 22px; font-size: 0.95rem; color: #c9d2e3; }

/* ---- Butonlar ---- */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #2c3342;
  background: #1b2029;
  color: #e8eaf0;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  text-align: center;
}
.btn:hover { border-color: #3fa9f5; }
.btn.small { padding: 5px 10px; font-size: 0.8rem; }
.btn.primary {
  background: linear-gradient(135deg, #76b900, #57a400);
  border-color: transparent;
  color: #0f1117;
  font-weight: 700;
  width: 100%;
  margin-top: 16px;
  box-shadow: 0 6px 24px rgba(118, 185, 0, 0.25);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn.primary:hover { background: linear-gradient(135deg, #8ad10a, #64b400); box-shadow: 0 8px 30px rgba(118, 185, 0, 0.4); transform: translateY(-1px); }
.btn.primary:disabled { background: #4a5d2b; border-color: #4a5d2b; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ok { border-color: #2e7d32; color: #81c784; }
.btn.danger { border-color: #7a2e33; color: #ff8a90; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.row .btn { flex: 1; }

#model-box { width: 100%; height: 440px; border-radius: 8px; overflow: hidden; background: #0b0d12; }
#btn-download { background: #3fa9f5; border-color: #3fa9f5; color: #08121c; }
#btn-download:hover { background: #6bc0ff; }

/* ---- Benim modellerim ---- */
.my-models { display: flex; flex-direction: column; gap: 8px; }
.model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #1b2029;
  border: 1px solid #262b38;
  border-radius: 8px;
  font-size: 0.9rem;
}
.model-item a { color: #3fa9f5; text-decoration: none; word-break: break-all; }
.model-item a:hover { text-decoration: underline; }

/* ---- Spinner ---- */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 17, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid #2c3342;
  border-top-color: #76b900;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.spinner-overlay p { margin-top: 14px; color: #c9d2e3; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Mesajlar ---- */
.error {
  background: #3a1618;
  border: 1px solid #7a2e33;
  color: #ffb3b8;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 16px 0;
  white-space: pre-wrap;
}
.notice {
  background: #10314f;
  border: 1px solid #1d5a8f;
  color: #a8d5f5;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 16px 0;
}

/* ---- Yönetim Paneli ---- */
.admin-body main { max-width: 1200px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: #171a22;
  border: 1px solid #262b38;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.stat .num { font-size: 1.8rem; font-weight: 700; background: linear-gradient(90deg, #76b900, #3fa9f5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat div:last-child { font-size: 0.8rem; color: #9aa1b1; margin-top: 4px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  background: #0f1117;
  border: 1px solid #2c3342;
  border-radius: 8px;
  color: #e8eaf0;
}
.toolbar select {
  padding: 9px 10px;
  background: #0f1117;
  border: 1px solid #2c3342;
  border-radius: 8px;
  color: #e8eaf0;
}
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  text-align: left;
  padding: 10px 12px;
  color: #9aa1b1;
  font-weight: 600;
  border-bottom: 1px solid #262b38;
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #1e2430; vertical-align: middle; }
.table tr:hover td { background: #1a1f2a; }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin-right: 4px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.75rem;
  background: #262e3d;
  color: #cbd5e1;
}
.badge.ok { background: #14532d; color: #86efac; }
.badge.warn { background: #713f12; color: #fcd34d; }
.badge.bad { background: #7f1d1d; color: #fca5a5; }
.badge.admin { background: #1e3a8a; color: #93c5fd; }

@media (max-width: 640px) {
  header { flex-direction: column; align-items: flex-start; }
  .table th, .table td { padding: 8px 8px; }
}