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

:root {
  --red:    #E02020;
  --bg:     #F4F4F6;
  --white:  #FFFFFF;
  --border: #E4E4E7;
  --text:   #0D0D0D;
  --text2:  #4B4B57;
  --text3:  #8A8A96;
  --sidebar-w: 220px;
  --font:   'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}

.login-logo {
  height: 56px;
  margin-bottom: 24px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 28px;
}

.login-field {
  display: flex;
  gap: 10px;
}

.login-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}
.login-input:focus { border-color: var(--red); }

.login-btn {
  padding: 12px 20px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background .2s;
}
.login-btn:hover { background: #b01a1a; }

.login-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--red);
  min-height: 20px;
}

/* ── LAYOUT ── */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-img {
  height: 44px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: all .15s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: rgba(224,32,32,0.08); color: var(--red); }

.nav-icon { font-size: 16px; display: inline-flex; align-items: center; }
.nav-icon svg { width: 16px; height: 16px; }

.sidebar-logout {
  margin: 16px 12px;
  padding: 10px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
}
.sidebar-logout:hover { border-color: var(--red); color: var(--red); }

/* ── MAIN ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 36px;
  max-width: 900px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.page-header { margin-bottom: 28px; }
.page-title { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.page-sub { font-size: 14px; color: var(--text2); margin-top: 4px; }

/* ── SECTION CARD ── */
.section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
}

.section-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 20px;
}

/* ── DASHBOARD CARDS ── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}

.dash-card-icon { font-size: 28px; margin-bottom: 10px; display: flex; justify-content: center; color: var(--red); }
.dash-card-icon svg { width: 28px; height: 28px; }
.dash-card-num  { font-size: 36px; font-weight: 900; letter-spacing: -1px; color: var(--red); }
.dash-card-label { font-size: 13px; color: var(--text3); font-weight: 500; margin-top: 4px; }

.dash-cat-list { display: flex; flex-direction: column; gap: 10px; }

.dash-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 14px;
}

.dash-cat-name { font-weight: 600; }
.dash-cat-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  background: rgba(224,32,32,0.08);
  padding: 3px 10px;
  border-radius: 100px;
}

/* ── FORMS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group-sm { flex: 0 0 140px; }

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

.form-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus { border-color: var(--red); }

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.btn-add {
  padding: 11px 24px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background .2s;
}
.btn-add:hover { background: #b01a1a; }

/* ── CATEGORY LIST ── */
.cat-list { display: flex; flex-direction: column; gap: 10px; }

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 14px;
}

.cat-row-left { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cat-row-icon { font-size: 20px; }
.cat-row-count { font-size: 12px; color: var(--text3); font-weight: 500; margin-left: 6px; }

.btn-delete {
  padding: 6px 14px;
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
}
.btn-delete:hover { background: #fff5f5; }

.empty-msg {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  padding: 24px 0;
}

/* ── ICON PICKER ── */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
}

.icon-option {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}

.icon-option:hover {
  border-color: #d4d4d8;
  background: #fafafa;
}

.icon-option.selected {
  border-color: var(--red);
  background: rgba(224,32,32,0.06);
}

.icon-option svg {
  width: 20px;
  height: 20px;
  stroke: var(--text2);
}

.icon-option.selected svg {
  stroke: var(--red);
}

.icon-option-label {
  font-size: 9px;
  color: var(--text3);
  font-weight: 500;
  text-align: center;
  line-height: 1.1;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

/* ── ICON RENDER (kategori listesi) ── */
.cat-icon-svg svg {
  width: 20px;
  height: 20px;
  stroke: var(--text2);
}

/* ── QUESTION LIST ── */
.q-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.filter-select { max-width: 220px; margin-bottom: 0; }

.q-list { display: flex; flex-direction: column; gap: 12px; }

.q-row {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px 18px;
}

.q-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.q-row-text { font-size: 14px; font-weight: 600; line-height: 1.5; flex: 1; }

.q-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.q-cat-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  background: rgba(224,32,32,0.08);
  color: var(--red);
  border-radius: 100px;
}

.q-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.q-answer {
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.q-answer.correct {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
  font-weight: 700;
}

.q-source {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.q-source svg { width: 12px; height: 12px; flex-shrink: 0; }

.q-note {
  margin-top: 8px;
  font-size: 12px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.q-note svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }

/* ── ÖNERİLEN SORULAR ────────────────────────────── */
.sug-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  margin-left: auto;
  line-height: 1;
}

.btn-use-sug {
  padding: 6px 12px;
  background: rgba(37,99,235,0.08);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
  white-space: nowrap;
}
.btn-use-sug:hover { background: #eff6ff; }

.sug-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.sug-sender {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}
.sug-sender svg { width: 12px; height: 12px; }

.sug-date {
  font-size: 12px;
  color: var(--text3);
}

/* ── CUSTOM MODALS ───────────────────────────────── */
.confirm-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.confirm-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  text-align: center;
  animation: slideUp 0.18s ease;
}
@keyframes slideUp { from { transform: translateY(12px); opacity:0 } to { transform: translateY(0); opacity:1 } }

.confirm-icon {
  width: 52px; height: 52px;
  background: #FEF2F2;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: #E02020;
}
.confirm-icon svg { width: 24px; height: 24px; }

.alert-icon {
  background: #EFF6FF;
  color: #2563EB;
}

.confirm-title {
  font-size: 17px; font-weight: 700;
  color: #0D0D0D;
  margin-bottom: 8px;
}
.confirm-msg {
  font-size: 14px; color: #4B4B57;
  line-height: 1.5;
  margin-bottom: 24px;
}
.confirm-actions {
  display: flex; gap: 10px;
}
.confirm-btn-cancel {
  flex: 1; padding: 10px;
  border: 1.5px solid #E4E4E7;
  border-radius: 10px;
  background: #fff;
  font-size: 14px; font-weight: 600;
  color: #4B4B57;
  cursor: pointer;
  transition: background 0.15s;
}
.confirm-btn-cancel:hover { background: #F4F4F6; }

.confirm-btn-ok {
  flex: 1; padding: 10px;
  border: none;
  border-radius: 10px;
  background: #E02020;
  font-size: 14px; font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.confirm-btn-ok:hover { background: #c41a1a; }
