* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: #f4f5f3;
  color: #24231f;
}
a { color: #185fa5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Giriş ekranı */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card {
  background: #fff;
  border: 1px solid #e2e0d8;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.muted { color: #767466; font-size: 13px; margin: 0 0 20px; }

.card form > div { min-width: 150px; }
label { display: block; font-size: 13px; color: #55534a; margin: 14px 0 4px; }
input, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d3d1c7;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid #85b7eb; border-color: #378ADD; }
button, .btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid #d3d1c7;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  color: #24231f;
}
button.primary, .btn.primary { background: #185fa5; color: #fff; border-color: #185fa5; }
button:hover { background: #f1efe8; }
button.primary:hover { background: #0c447c; }

.auth-card form button[type="submit"] { width: 100%; margin-top: 20px; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-ok { background: #eaf3de; color: #27500a; }
.alert-err { background: #fcebeb; color: #791f1f; }

/* Uygulama kabuğu */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e0d8;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.topbar .brand { font-weight: 600; font-size: 15px; }
.topbar nav a {
  color: #55534a;
  font-size: 14px;
  margin-right: 18px;
  padding: 6px 0;
}
.topbar nav a.active { color: #185fa5; font-weight: 600; }
.topbar .user { font-size: 13px; color: #767466; display: flex; align-items: center; gap: 12px; }

.page { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.page h1 { font-size: 19px; font-weight: 600; margin: 0 0 18px; }

.card {
  background: #fff;
  border: 1px solid #e2e0d8;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 160px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e2e0d8; border-radius: 10px; padding: 14px 16px; }
.stat-card .label { font-size: 12px; color: #767466; margin-bottom: 4px; }
.stat-card .value { font-size: 22px; font-weight: 600; }
.stat-card .value.danger { color: #a32d2d; }

table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #ece9df; }
th { color: #767466; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
td.num, th.num { text-align: right; }
tr.fark-var { background: #fcebeb; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.badge.ok { background: #eaf3de; color: #27500a; }
.badge.warn { background: #fcebeb; color: #791f1f; }

.row-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.empty-state { text-align: center; padding: 40px 20px; color: #767466; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 8px; }
  .topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; width: 100%; order: 3; }
  .topbar nav a { margin-right: 0; }
  .page { padding: 16px 14px 60px; }
  .card { padding: 14px; }
  .card form { flex-direction: column; align-items: stretch; }
  .card form > div { width: 100%; min-width: 0; }
  .card form label { margin-top: 12px; }
  .card form label:first-of-type { margin-top: 0; }
  .card form input, .card form select { width: 100%; box-sizing: border-box; }
  .card form button { width: 100%; margin-top: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 12px; }
  th, td { padding: 7px 6px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters select, .filters input { width: 100%; }
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
