/* =========================================================
   Demo uygulama kabuğu (dashboard / panel görünümü)
   Ürün ve örnek çalışma demolarında ortak kullanılır.
   Renkler --app-brand değişkeni ile projeye göre değişir.
   ========================================================= */

:root {
  --app-bg: #f4f6fb;
  --app-surface: #ffffff;
  --app-surface-2: #f8fafc;
  --app-border: #e6eaf2;
  --app-text: #1a2237;
  --app-text-soft: #5b667f;
  --app-muted: #98a2b8;
  --app-brand: #4f6ef7;
  --app-brand-soft: #eef1fe;
  --app-success: #16a34a;
  --app-warning: #d97706;
  --app-danger: #dc2626;
  --app-radius: 14px;
  --app-shadow: 0 4px 20px -8px rgba(20, 30, 60, 0.18);
  --app-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app * { box-sizing: border-box; margin: 0; padding: 0; }
.app {
  font-family: var(--app-font);
  background: var(--app-bg);
  color: var(--app-text);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  -webkit-font-smoothing: antialiased;
}
.app img { max-width: 100%; display: block; }
.app a { color: inherit; text-decoration: none; }

/* Demo geri şeridi */
.app .demo-strip {
  grid-column: 1 / -1;
  background: #0b1020;
  color: #cfd6f0;
  font-size: 0.82rem;
  padding: 7px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.app .demo-strip a { color: #6c8cff; font-weight: 600; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px 18px;
  font-weight: 800;
  font-size: 1.08rem;
}
.sidebar-brand .mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--app-brand);
  color: #fff; font-size: 1.2rem;
}
.sidebar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  padding: 14px 12px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--app-text-soft);
  font-weight: 500;
  font-size: 0.94rem;
  transition: 0.15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--app-surface-2); color: var(--app-text); }
.nav-item.active { background: var(--app-brand-soft); color: var(--app-brand); font-weight: 600; }
.nav-item .ic { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--app-text-soft);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--app-brand-soft);
  color: var(--app-brand);
  display: grid; place-items: center;
  font-weight: 700;
}

/* ---------- Main ---------- */
/* Backdrop yalnızca mobilde görünür — masaüstünde grid hücresi kaplamasın */
.backdrop { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 68px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--app-muted);
  font-size: 0.9rem;
  min-width: 220px;
}
.search input { border: none; background: none; outline: none; font: inherit; color: var(--app-text); width: 100%; }

.content { padding: 26px; display: flex; flex-direction: column; gap: 22px; }

.mobile-nav-btn {
  display: none;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Buton ---------- */
.a-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600; font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}
.a-btn-primary { background: var(--app-brand); color: #fff; }
.a-btn-primary:hover { filter: brightness(1.08); }
.a-btn-ghost { background: var(--app-surface); border-color: var(--app-border); color: var(--app-text); }
.a-btn-ghost:hover { background: var(--app-surface-2); }
.a-btn-sm { padding: 7px 12px; font-size: 0.84rem; }

/* ---------- Stat kartları ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 20px;
  box-shadow: var(--app-shadow);
}
.stat .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat .ic {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--app-brand-soft); color: var(--app-brand);
}
.stat .val { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.stat .lbl { color: var(--app-text-soft); font-size: 0.88rem; margin-top: 2px; }
.stat .delta { font-size: 0.8rem; font-weight: 600; }
.delta.up { color: var(--app-success); }
.delta.down { color: var(--app-danger); }

/* ---------- Panel / kart ---------- */
.panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--app-border);
}
.panel-head h2 { font-size: 1.05rem; font-weight: 700; }
.panel-head p { color: var(--app-text-soft); font-size: 0.85rem; }
.panel-body { padding: 20px; }
.grid-cols { display: grid; gap: 22px; }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-2e { grid-template-columns: 1fr 1fr; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
table.data th {
  text-align: left; padding: 13px 20px;
  color: var(--app-muted); font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-2);
}
table.data td { padding: 14px 20px; border-bottom: 1px solid var(--app-border); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: 0.12s; }
table.data tbody tr:hover { background: var(--app-surface-2); }
.cell-user { display: flex; align-items: center; gap: 10px; }

/* Etiketler */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-green { background: #e7f6ec; color: var(--app-success); }
.tag-amber { background: #fdf1e0; color: var(--app-warning); }
.tag-red { background: #fdeaea; color: var(--app-danger); }
.tag-blue { background: var(--app-brand-soft); color: var(--app-brand); }
.tag-gray { background: #eef1f6; color: var(--app-text-soft); }

/* ---------- Basit çubuk grafik ---------- */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.chart .bar {
  flex: 1; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--app-brand), color-mix(in srgb, var(--app-brand) 55%, #fff));
  position: relative;
  min-height: 6px;
  transition: 0.4s;
}
.chart .bar span {
  position: absolute; bottom: -22px; left: 0; right: 0; text-align: center;
  font-size: 0.72rem; color: var(--app-muted);
}
.chart .bar b {
  position: absolute; top: -20px; left: 0; right: 0; text-align: center;
  font-size: 0.72rem; font-weight: 700; color: var(--app-text-soft);
}

/* Donut / ilerleme */
.progress { height: 8px; border-radius: 999px; background: var(--app-surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--app-brand); }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--app-border);
}
.list-item:last-child { border-bottom: none; }
.list-item .ic {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--app-surface-2); display: grid; place-items: center; font-size: 1.1rem;
  flex-shrink: 0;
}
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta b { font-weight: 600; font-size: 0.92rem; }
.list-item .meta small { display: block; color: var(--app-muted); font-size: 0.8rem; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 20, 40, 0.5);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--app-surface); border-radius: 18px;
  width: 100%; max-width: 460px; box-shadow: 0 30px 70px -20px rgba(0,0,0,0.4);
  overflow: hidden; animation: pop 0.2s ease;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 20px; border-bottom: 1px solid var(--app-border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 1.1rem; font-weight: 700; }
.modal-head .x { cursor: pointer; color: var(--app-muted); font-size: 1.3rem; background: none; border: none; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 6px; color: var(--app-text-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--app-border); background: var(--app-surface-2);
  font: inherit; color: var(--app-text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--app-brand); }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--app-border); display: flex; justify-content: flex-end; gap: 10px; }

.section-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.muted { color: var(--app-text-soft); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } .cols-2, .cols-2e { grid-template-columns: 1fr; } }
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 60; width: 264px; left: 0; top: 0;
    transform: translateX(-100%); transition: 0.25s; box-shadow: var(--app-shadow);
  }
  .app.nav-open .sidebar { transform: none; }
  .mobile-nav-btn { display: grid; place-items: center; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; display: none; }
  .app.nav-open .backdrop { display: block; }
  .search { display: none; }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } .content { padding: 18px; } }
