/* ── Değişkenler ────────────────────────────────────────── */
:root {
  --pk:       #e91e8c;
  --pk-light: #fce4ec;
  --pk-dark:  #c2185b;
  --bg:       #f0f2f5;
  --white:    #ffffff;
  --border:   #e2e8f0;
  --text:     #2d3748;
  --muted:    #718096;
  --sidebar:  260px;
  --radius:   10px;
  --shadow:   0 1px 4px rgba(0,0,0,.08);
  --shadow-md:0 4px 12px rgba(0,0,0,.1);
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
       background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font: inherit; }

/* ── LOGIN ──────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center;
              justify-content: center; background: linear-gradient(135deg, #f8f9fa 0%, #fce4ec 100%); }
.login-box  { background: var(--white); border-radius: 16px; padding: 48px 40px;
              width: 380px; box-shadow: var(--shadow-md); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--pk); }
.login-logo p  { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-logo .book-icon { font-size: 48px; display: block; margin-bottom: 12px; }

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

/* ── SİDEBAR ────────────────────────────────────────────── */
.sidebar { width: var(--sidebar); background: var(--white); border-right: 1px solid var(--border);
           display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
           height: 100vh; overflow-y: auto; z-index: 100; }
.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-brand h2 { font-size: 14px; font-weight: 700; color: var(--pk); line-height: 1.3; }
.sidebar-brand span { font-size: 11px; color: var(--muted); }
.sidebar-section { padding: 12px 12px 4px; font-size: 10px; font-weight: 700;
                   text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.sidebar-nav { flex: 1; padding-bottom: 12px; }
.sidebar-link { display: flex; align-items: center; gap: 10px;
                padding: 8px 16px; border-radius: 8px; margin: 1px 8px;
                color: var(--text); font-size: 13px; transition: all .15s; cursor: pointer; }
.sidebar-link:hover { background: var(--bg); }
.sidebar-link.aktif { background: var(--pk-light); color: var(--pk); font-weight: 600; }
.sidebar-link .badge { margin-left: auto; background: var(--bg); color: var(--muted);
                       font-size: 11px; padding: 1px 7px; border-radius: 20px; min-width: 24px;
                       text-align: center; }
.sidebar-link.aktif .badge { background: var(--pk); color: #fff; }
.sidebar-unite-no { width: 22px; height: 22px; border-radius: 50%; background: var(--bg);
                    color: var(--muted); font-size: 11px; font-weight: 700;
                    display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-link.aktif .sidebar-unite-no { background: var(--pk); color: #fff; }
.sidebar-link .sidebar-link-text { flex: 1; overflow: hidden;
                                   white-space: nowrap; text-overflow: ellipsis; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 12px; flex-shrink: 0; }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
                    border-radius: 8px; color: var(--muted); font-size: 13px; transition: .15s; }
.sidebar-footer a:hover { background: var(--bg); color: var(--text); }

/* ── ANA ALAN ───────────────────────────────────────────── */
.main { margin-left: var(--sidebar); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border);
          padding: 0 28px; height: 60px; display: flex; align-items: center;
          justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.topbar-breadcrumb a { color: var(--muted); }
.topbar-breadcrumb a:hover { color: var(--pk); }
.topbar-breadcrumb .sep { color: var(--border); }
.topbar-breadcrumb .cur { font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.content { padding: 28px; flex: 1; }

/* ── KARTLAR ────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius);
        box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border);
               display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 22px; }

/* ── DASHBOARD KARTLARı ─────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card  { background: var(--white); border-radius: var(--radius); padding: 20px 22px;
              box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.stat-icon  { width: 48px; height: 48px; border-radius: 12px; display: flex;
              align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.pink   { background: var(--pk-light); }
.stat-icon.purple { background: #ede7f6; }
.stat-icon.green  { background: #e8f5e9; }
.stat-info h4 { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-info p  { font-size: 12px; color: var(--muted); margin-top: 3px; }

.unite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.unite-card { background: var(--white); border-radius: var(--radius); padding: 18px;
              box-shadow: var(--shadow); transition: all .2s; display: flex;
              flex-direction: column; gap: 10px; border-left: 4px solid var(--pk); }
.unite-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.unite-card-top { display: flex; align-items: center; gap: 10px; }
.unite-num  { width: 32px; height: 32px; border-radius: 8px; display: flex;
              align-items: center; justify-content: center; font-size: 13px;
              font-weight: 700; color: #fff; flex-shrink: 0; }
.unite-card h4 { font-size: 13px; font-weight: 600; line-height: 1.3; }
.unite-card-meta { font-size: 12px; color: var(--muted); }
.unite-card-meta span { background: var(--bg); padding: 2px 8px; border-radius: 20px; }

/* ── KONULAR LİSTESİ ────────────────────────────────────── */
.konu-list { display: flex; flex-direction: column; gap: 6px; }
.konu-item { background: var(--white); border: 1px solid var(--border);
             border-radius: var(--radius); padding: 14px 16px;
             display: flex; align-items: center; gap: 12px; transition: .15s; }
.konu-item:hover { border-color: var(--pk); box-shadow: 0 0 0 3px var(--pk-light); }
.konu-item-drag { color: var(--border); font-size: 16px; cursor: grab; flex-shrink: 0; }
.konu-item-text { flex: 1; font-size: 14px; font-weight: 500; }
.konu-item-meta { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.konu-item-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── İÇERİK MADDELERİ ───────────────────────────────────── */
.icerik-list { display: flex; flex-direction: column; gap: 6px; }
.icerik-item { background: var(--white); border: 1px solid var(--border);
               border-radius: var(--radius); overflow: hidden; transition: .15s; }
.icerik-item:hover { border-color: #d0d5de; }
.icerik-item-inner { display: flex; align-items: flex-start; gap: 0; }
.icerik-type-bar { width: 4px; flex-shrink: 0; align-self: stretch; }
.icerik-type-bar.metin  { background: #94a3b8; }
.icerik-type-bar.madde  { background: #3b82f6; }
.icerik-type-bar.onemli { background: #ef4444; }
.icerik-type-bar.ipucu  { background: #10b981; }
.icerik-body  { flex: 1; padding: 12px 14px; }
.icerik-badge { display: inline-flex; align-items: center; gap: 4px;
                font-size: 11px; font-weight: 600; padding: 2px 8px;
                border-radius: 20px; margin-bottom: 5px; }
.badge-metin  { background: #f1f5f9; color: #64748b; }
.badge-madde  { background: #eff6ff; color: #2563eb; }
.badge-onemli { background: #fef2f2; color: #dc2626; }
.badge-ipucu  { background: #ecfdf5; color: #059669; }
.icerik-text { font-size: 14px; color: var(--text); line-height: 1.55;
               white-space: pre-wrap; word-break: break-word; }
.icerik-actions { display: flex; flex-direction: column; gap: 2px;
                  padding: 8px 10px; flex-shrink: 0; justify-content: center; }

/* ── FORM ALANLARI ──────────────────────────────────────── */
.add-form { background: var(--white); border: 2px dashed var(--border);
            border-radius: var(--radius); padding: 20px; }
.add-form:focus-within { border-color: var(--pk); }
.add-form-title { font-size: 13px; font-weight: 700; color: var(--muted);
                  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600;
              color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-control { width: 100%; border: 1px solid var(--border); border-radius: 8px;
                padding: 9px 12px; font-size: 14px; transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--pk); box-shadow: 0 0 0 3px var(--pk-light); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Tip seçici */
.tip-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.tip-label { display: flex; align-items: center; gap: 6px; padding: 7px 14px;
             border: 2px solid var(--border); border-radius: 8px; cursor: pointer;
             font-size: 13px; font-weight: 500; transition: all .15s; user-select: none; }
.tip-label:hover { border-color: #94a3b8; }
.tip-label input { position: absolute; opacity: 0; pointer-events: none; }
.tip-label.checked-metin  { border-color: #94a3b8; background: #f1f5f9; color: #64748b; }
.tip-label.checked-madde  { border-color: #3b82f6; background: #eff6ff; color: #2563eb; }
.tip-label.checked-onemli { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.tip-label.checked-ipucu  { border-color: #10b981; background: #ecfdf5; color: #059669; }

/* ── BUTONLAR ───────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
       border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
       border: none; transition: all .15s; white-space: nowrap; }
.btn-primary { background: var(--pk); color: #fff; }
.btn-primary:hover { background: var(--pk-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e8eaed; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 5px 7px; background: var(--bg); border: 1px solid var(--border);
            color: var(--muted); border-radius: 6px; cursor: pointer;
            font-size: 13px; transition: .15s; display: inline-flex; }
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-icon.danger:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4);
                 display: flex; align-items: center; justify-content: center;
                 z-index: 999; opacity: 0; pointer-events: none; transition: .2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--white); border-radius: 14px; padding: 28px;
             width: 480px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.2);
             transform: scale(.95); transition: .2s; }
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between;
                margin-bottom: 20px; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer;
               color: var(--muted); padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── FLASH MESAJLARI ────────────────────────────────────── */
.flash-bar { padding: 11px 20px; border-radius: 8px; font-size: 13px;
             font-weight: 500; display: flex; align-items: center; gap: 8px;
             margin-bottom: 20px; }
.flash-bar.success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-bar.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── YARDIMCI ───────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── SAYFA BAŞLIĞI ──────────────────────────────────────── */
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start;
               justify-content: space-between; gap: 16px; }
.page-header-left h2 { font-size: 20px; font-weight: 700; }
.page-header-left p  { font-size: 13px; color: var(--muted); margin-top: 3px; }
.unite-renk-dot { display: inline-block; width: 10px; height: 10px;
                  border-radius: 50%; margin-right: 8px; }

/* ── AYARLAR ────────────────────────────────────────────── */
.settings-card { max-width: 480px; }
