/* Bileşenler — TailAdmin benzeri açık tema (Jinja + Tailwind kabuğu ile uyumlu) */
:root {
  --pm-brand: #465fff;
  --pm-brand-hover: #3641f5;
  --pm-border: #e2e8f0;
  --pm-muted: #64748b;
  --pm-text: #0f172a;
}

* { box-sizing: border-box; }

.pm-auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pm-text);
}

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pm-muted);
}

input, select, textarea {
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--pm-border);
  background: #fff;
  color: var(--pm-text);
  font-size: 0.9375rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pm-brand);
  box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--pm-border);
  background: #fff;
  color: var(--pm-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: #f8fafc;
}
.btn.primary {
  background: var(--pm-brand);
  color: #fff;
  border-color: transparent;
}
.btn.primary:hover {
  background: var(--pm-brand-hover);
}

.btn.sm { padding: 0.25rem 0.5rem; font-size: 0.8125rem; }

.muted { color: var(--pm-muted); font-size: 0.875rem; }
.muted a { color: var(--pm-brand); font-weight: 500; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pm-muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--pm-border);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th, .table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--pm-border);
  text-align: left;
}
.table th {
  background: #f8fafc;
  color: var(--pm-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tr:last-child td { border-bottom: none; }

.card {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card h2 { margin-top: 0; color: var(--pm-text); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.kpi {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.15s;
}
.kpi:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.kpi span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pm-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kpi strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pm-text);
  letter-spacing: -0.02em;
}
.kpi--accent { border-color: #c7d7ff; background: linear-gradient(180deg, #fff 0%, #f5f7ff 100%); }
.kpi--profit { border-color: #bbf7d0; background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%); }

.row-inline {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
}
.row-inline input[type="checkbox"] { width: auto; }

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card-link:hover {
  border-color: var(--pm-brand);
  box-shadow: 0 4px 16px rgba(70, 95, 255, 0.12);
}

.list { padding-left: 1.2rem; color: var(--pm-text); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-inner {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  min-width: 300px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.error { color: #dc2626; font-size: 0.875rem; }

/* Kâr marjı satır renkleri (açık tema) */
.margin-band td:first-child { border-left: 3px solid transparent; }
.margin-band--severe_loss td:first-child { border-left-color: #be123c; background: rgba(190, 18, 60, 0.06); }
.margin-band--loss_2 td:first-child { border-left-color: #ea580c; background: rgba(234, 88, 12, 0.06); }
.margin-band--loss_1 td:first-child { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.06); }
.margin-band--breakeven td:first-child { border-left-color: #94a3b8; background: rgba(148, 163, 184, 0.08); }
.margin-band--low_profit td:first-child { border-left-color: #86efac; background: rgba(134, 239, 172, 0.12); }
.margin-band--mid_profit td:first-child { border-left-color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.margin-band--good_profit td:first-child { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.margin-band--high_profit td:first-child { border-left-color: #15803d; background: rgba(21, 128, 61, 0.12); }
.margin-band--unknown td:first-child { border-left-color: #94a3b8; }
