@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', -apple-system, sans-serif;
  color: #1e293b;
  background: #f8f9ff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}
h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; letter-spacing: -0.01em; margin: 0; color: #1e293b; font-weight: 600; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 16px; margin-bottom: 16px; font-weight: 600; }
h3 { font-size: 22px; font-weight: 700; }
p { margin: 4px 0; }
a { color: #6366f1; text-decoration: none; transition: color .15s; }
a:hover { color: #4f46e5; }
small { color: #64748b; font-size: 12px; font-weight: 400; }
code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; background: #f1f5ff; padding: 2px 7px; border-radius: 5px; font-size: 12px; color: #4338ca; }

.muted { color: #94a3b8; }
.small { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 13px; }

/* ===== PASTEL GRADIENTS ===== */
.grad-text { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.grad-primary { background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); color: #fff; }
.grad-secondary { background: linear-gradient(135deg, #60a5fa 0%, #6366f1 100%); color: #fff; }
.grad-success { background: linear-gradient(135deg, #6ee7b7 0%, #10b981 100%); color: #fff; }
.grad-danger { background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%); color: #fff; }
.pos { color: #10b981; }
.neg { color: #ef4444; }

/* ===== LOGIN ===== */
.login-body { background: #f8f9ff; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-form { padding: 60px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; margin: 0 auto; width: 100%; }
.login-form .logo { font-size: 28px; font-weight: 700; font-family: 'Poppins', sans-serif; letter-spacing: -0.02em; }
.login-visual {
  background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 50%, #fce7f3 100%);
  color: #312e81;
  padding: 60px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.login-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 15% 20%, rgba(139,92,246,0.12) 2px, transparent 3px),
                    radial-gradient(circle at 85% 70%, rgba(99,102,241,0.08) 1px, transparent 2px);
  background-size: 80px 80px, 50px 50px;
}
.login-visual .visual-inner { max-width: 460px; position: relative; z-index: 1; }
.login-visual h3 { color: #312e81; font-size: 34px; line-height: 1.2; margin-bottom: 20px; font-weight: 700; }
.login-visual p { color: #4338ca; opacity: 0.8; font-size: 15px; margin-bottom: 32px; }
.pill-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pill { background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); border: 1px solid rgba(139,92,246,0.15); border-radius: 16px; padding: 14px; }
.pill span { font-size: 11px; color: #6366f1; display: block; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.pill strong { font-family: 'Poppins', sans-serif; display: block; margin-top: 4px; font-size: 14px; font-weight: 700; color: #312e81; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form { padding: 40px 24px; }
}

/* ===== APP LAYOUT ===== */
.app { display: flex; min-height: 100vh; background: #fff; }
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #eef0f7;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
}
.sidebar .brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #1e293b;
  padding: 4px 12px 0;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s ease;
}
.nav-link:hover { background: #f1f5ff; color: #6366f1; }
.nav-link.active {
  background: #eef2ff;
  color: #6366f1;
  font-weight: 600;
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar-foot { border-top: 1px solid #eef0f7; padding-top: 14px; margin-top: 8px; }
.user { padding: 6px 14px 12px; }
.user strong { color: #1e293b; display: block; font-size: 13px; font-weight: 600; }
.user span { font-size: 11px; color: #94a3b8; }

.main { flex: 1; margin-left: 260px; min-width: 0; background: #f8f9ff; }
.topbar {
  display: none;
  background: #fff;
  border-bottom: 1px solid #eef0f7;
  padding: 14px 20px;
  position: sticky; top: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; }
.menu-btn {
  background: #f1f5ff;
  border: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  color: #6366f1;
}
.menu-btn:hover { background: #e0e7ff; }
.content { padding: 32px 36px; max-width: 1400px; margin: 0 auto; }

.page-head { margin-bottom: 24px; }
.page-head.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head p { color: #94a3b8; margin-top: 4px; font-size: 13px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,0.08); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .content { padding: 20px; }
  h1 { font-size: 22px; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all .15s ease;
  background: #1e293b;
  color: #fff;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35); }
.btn-ghost {
  background: #fff;
  color: #64748b;
  border: 1px solid #eef0f7;
}
.btn-ghost:hover { background: #f8f9ff; border-color: #c7d2fe; color: #6366f1; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }

/* ===== CARDS ===== */
.card {
  background: #fff;
  border: 1px solid #eef0f7;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.card.no-pad { padding: 0; overflow: hidden; }

.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
}
.info-box strong { color: #1e3a8a; }

/* ===== GRID ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}

/* ===== PASTEL STAT CARDS ===== */
.stat {
  background: #fff;
  border: 1px solid #eef0f7;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  transition: all .2s;
}
.stat:hover { transform: translateY(-2px); }
.stat small {
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.stat h3 { font-size: 26px; margin-top: 10px; font-variant-numeric: tabular-nums; font-weight: 700; color: #1e293b; }
.stat .sub { font-size: 11px; color: #94a3b8; margin-top: 4px; display: block; }
.stat .icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* Referans tasarımdaki renkli kartlar */
.stat.pastel-pink { background: #fff1f2; border-color: #fecdd3; }
.stat.pastel-pink small { color: #e11d48; }
.stat.pastel-blue { background: #eff6ff; border-color: #bfdbfe; }
.stat.pastel-blue small { color: #2563eb; }
.stat.pastel-purple { background: #faf5ff; border-color: #e9d5ff; }
.stat.pastel-purple small { color: #9333ea; }
.stat.pastel-green { background: #f0fdf4; border-color: #bbf7d0; }
.stat.pastel-green small { color: #16a34a; }
.stat.pastel-yellow { background: #fefce8; border-color: #fde68a; }
.stat.pastel-yellow small { color: #ca8a04; }
.stat.pastel-teal { background: #f0fdfa; border-color: #99f6e4; }
.stat.pastel-teal small { color: #0d9488; }

.mini {
  background: #fff;
  border: 1px solid #eef0f7;
  border-radius: 12px;
  padding: 16px;
}
.mini small { color: #64748b; font-weight: 500; font-size: 11.5px; }
.mini h3 { font-size: 22px; margin-top: 4px; font-weight: 700; }

/* ===== FORMS ===== */
.form { margin-top: 24px; }
label {
  display: block;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
}
label input, label select, label textarea, input, select, textarea {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  background: #fff;
  color: #1e293b;
  transition: all .15s;
  font-weight: 400;
}
label input:focus, select:focus, textarea:focus, input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
}
select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; appearance: none; }
textarea { resize: vertical; min-height: 70px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-danger  { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }

.row { display: flex; gap: 12px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* ===== TABLE (lavanta başlıklı) ===== */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead {
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
}
.tbl th {
  text-align: left;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #4338ca;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: none;
}
.tbl td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  font-weight: 400;
}
.tbl tbody tr { transition: background-color .15s; }
.tbl tbody tr:hover { background: #f8f9ff; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .empty { text-align: center; color: #cbd5e1; padding: 60px 20px; font-style: italic; }
.tbl td strong { color: #1e293b; font-weight: 600; }
.act {
  display: inline-flex;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  margin-left: 2px;
  transition: all .15s;
  font-size: 14px;
}
.act:hover { background: #eef2ff; }
.act.del:hover { background: #fff1f2; }

/* ===== BADGES (pastel) ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}
.b-ok   { background: #f0fdf4; color: #16a34a; }
.b-err  { background: #fff1f2; color: #e11d48; }
.b-warn { background: #fefce8; color: #ca8a04; }
.b-info { background: #eff6ff; color: #2563eb; }
.b-mut  { background: #f1f5f9; color: #64748b; }

/* ===== FILTERS ===== */
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #eef0f7;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  transition: all .15s;
}
.chip:hover { border-color: #c7d2fe; color: #6366f1; }
.chip.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  border-color: transparent;
}

/* ===== INVOICE ITEMS ===== */
.item-row { display: grid; grid-template-columns: 3fr 1fr 1.3fr auto; gap: 8px; margin-bottom: 8px; }
.item-row input { margin-top: 0; }

/* ===== BAR CHART ===== */
.bar-chart { display: flex; justify-content: space-around; align-items: flex-end; height: 200px; padding: 16px 0 10px; gap: 10px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bars { display: flex; gap: 5px; align-items: flex-end; height: 160px; }
.bar { width: 16px; min-height: 2px; border-radius: 6px 6px 0 0; transition: all .2s; }
.bar.bar-gelir { background: linear-gradient(180deg, #a78bfa 0%, #8b5cf6 100%); }
.bar.bar-gider { background: linear-gradient(180deg, #93c5fd 0%, #6366f1 100%); }
.bar:hover { opacity: 0.8; }
.bar-group span { font-size: 11px; color: #94a3b8; font-weight: 500; }
.legend { display: flex; gap: 18px; justify-content: center; font-size: 12px; color: #64748b; padding-top: 12px; border-top: 1px solid #f1f5f9; margin-top: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.dot.grad-primary { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.dot.grad-secondary { background: linear-gradient(135deg, #93c5fd, #6366f1); }

/* ===== RANK LIST ===== */
.rank { list-style: none; padding: 0; margin: 0; }
.rank li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.rank li:last-child { border-bottom: none; }
.rank .num {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.rank li div { flex: 1; min-width: 0; }
.rank strong { display: block; font-size: 13.5px; color: #1e293b; font-weight: 600; }
.rank small { display: block; color: #94a3b8; margin-top: 2px; }

/* ===== INVOICE PRINT ===== */
.print-body { background: #e2e8f0; padding: 40px 20px; }
.print-wrap { max-width: 820px; margin: 0 auto; }
.invoice-doc { background: #fff; padding: 48px; border-radius: 14px; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08); }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 24px; border-bottom: 2px solid #1e293b; margin-bottom: 24px; }
.inv-head .logo { font-size: 28px; font-weight: 700; font-family: 'Poppins', sans-serif; }
.inv-head h2 { font-size: 22px; margin-top: 4px; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; font-size: 13px; }
.inv-meta small { display: block; color: #64748b; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; margin-bottom: 4px; font-weight: 600; }
.inv-tbl thead { background: #eef2ff; }
.inv-totals { display: flex; flex-direction: column; gap: 6px; max-width: 320px; margin-left: auto; margin-top: 24px; font-size: 14px; }
.inv-totals .big { font-size: 18px; font-weight: 700; padding-top: 8px; border-top: 2px solid #1e293b; font-family: 'Poppins', sans-serif; }
.inv-notes { margin-top: 32px; padding-top: 16px; border-top: 1px solid #eef0f7; font-size: 14px; }
.inv-notes small { display: block; color: #64748b; text-transform: uppercase; font-size: 11px; margin-bottom: 4px; font-weight: 600; }

/* ===== CLIENT 2-COLUMN CARD TABLE ===== */
.tbl-2col { table-layout: fixed; }
.tbl-2col th { width: 50%; }
.tbl-2col td.client-cell { padding: 16px; vertical-align: top; border-right: 1px solid #f1f5f9; }
.tbl-2col td.client-cell:last-child { border-right: none; }
.client-card { display: flex; flex-direction: column; gap: 12px; }
.client-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.client-title { flex: 1; min-width: 0; }
.client-title strong { display: block; font-size: 14px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.client-title small { display: block; font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.client-actions { display: flex; gap: 4px; }
.client-info { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; margin: 0; padding: 12px; background: #f8f9ff; border-radius: 10px; font-size: 12.5px; }
.client-info dt { font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.client-info dd { margin: 0; color: #475569; word-break: break-word; white-space: normal; font-weight: 500; }
@media (max-width: 900px) {
  .tbl-2col td.client-cell { display: block; width: 100%; border-right: none; border-bottom: 1px solid #f1f5f9; }
  .tbl-2col thead { display: none; }
}

/* ===== CHECKBOX ===== */
input[type="checkbox"] { width: 16px; height: 16px; accent-color: #8b5cf6; cursor: pointer; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f8f9ff; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }
