/* Hasat — light, warm, agricultural */
:root {
  --bg: #fafaf5;
  --surface: #ffffff;
  --border: #e8e3d9;
  --text: #2d2a26;
  --muted: #8a8577;
  --accent: #7fb069;
  --accent-dark: #5a8c47;
  --accent2: #e07a5f;
  --highlight: #f4f1de;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); font-size: .85em; }

/* NAV */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.nav-brand a { font-size: 1.3em; font-weight: 700; color: var(--accent-dark); }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-link { color: var(--text); padding: 4px 6px; border-radius: 6px; font-size: .95em; }
.nav-link:hover { background: var(--highlight); text-decoration: none; }
.nav-logout { color: var(--accent2); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5em; cursor: pointer; color: var(--text); }

@media (max-width: 700px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px; align-items: stretch; }
  .nav-links.open { display: flex; box-shadow: var(--shadow); }
  .nav-toggle { display: block; }
}

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-header h2 { color: var(--text); }
h3 { margin: 24px 0 10px; color: var(--accent-dark); font-weight: 600; }

/* CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.form-card { max-width: 600px; }

/* STAT GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: .85em; margin-bottom: 6px; }
.stat-value { font-size: 1.8em; font-weight: 700; color: var(--accent-dark); }
.stat-sub { color: var(--muted); font-size: .85em; }

/* TABLES */
.tbl {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 16px; font-size: .92em;
}
.tbl th { background: var(--highlight); text-align: left; padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--border); font-size: .88em; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fbfaf3; }
.tbl-scroll { display: block; overflow-x: auto; }
.row-notes td { background: #fffbf0; font-size: .88em; color: var(--muted); }
.row-inactive { opacity: .55; }
.tbl-actions { white-space: nowrap; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 1.1em; padding: 4px 6px; border-radius: 6px; }
.btn-icon:hover { background: var(--highlight); }

/* FORM */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .9em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px;
  font: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127,176,105,.15); }
textarea { resize: vertical; }
.filter-form {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: end;
  background: var(--surface); padding: 12px; border-radius: var(--radius); border: 1px solid var(--border);
}
.filter-form label { font-size: .85em; color: var(--muted); }
.filter-form select, .filter-form input { width: auto; min-width: 130px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* BUTTONS */
.btn {
  display: inline-block; padding: 9px 18px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: .92em;
  transition: all .15s;
}
.btn:hover { background: var(--highlight); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 500; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-sm { padding: 6px 12px; font-size: .88em; }
.btn-ghost { background: transparent; }
.btn-full { width: 100%; }

/* BADGES */
.badge { display: inline-block; padding: 3px 9px; border-radius: 14px; font-size: .78em; font-weight: 500; }
.badge-ödendi { background: #d8f3dc; color: #2d6a4f; }
.badge-bekliyor { background: #fff3cd; color: #856404; }
.badge-veresiye { background: #f8d7da; color: #842029; }
.badge-aktif { background: #d8f3dc; color: #2d6a4f; }
.badge-pasif { background: #e2e3e5; color: #555; }
.badge-admin { background: #e07a5f; color: white; }
.badge-staff { background: #d8e2dc; color: #2d6a4f; }
.badge-type { background: #f4f1de; color: #6b705c; }
.badge-none { background: #f0efeb; color: #8a8577; }

/* FLASH */
.flash-box { margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: 7px; margin-bottom: 8px; font-size: .92em; }
.flash-success { background: #d8f3dc; color: #2d6a4f; border-left: 4px solid #2d6a4f; }
.flash-error { background: #f8d7da; color: #842029; border-left: 4px solid #842029; }
.flash-info { background: #daeafc; color: #1c4b7a; border-left: 4px solid #1c4b7a; }

/* LOGIN */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.login-card { background: var(--surface); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 360px; border: 1px solid var(--border); }
.login-card h2 { text-align: center; color: var(--accent-dark); margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: .9em; }

/* DIALOG */
.form-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 90%; max-width: 480px; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.form-dialog::backdrop { background: rgba(0,0,0,.3); }
.form-dialog h3 { margin-bottom: 18px; color: var(--accent-dark); }

/* CHARTS */
.chart-wrap { position: relative; height: 260px; background: var(--surface); padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 18px; }

/* MISC */
.total-preview { padding: 12px; background: var(--highlight); border-radius: 7px; font-weight: 600; color: var(--accent-dark); min-height: 20px; margin-bottom: 10px; }
.total-preview:empty { display: none; }
.empty { color: var(--muted); font-style: italic; padding: 24px; text-align: center; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border); }
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 4em; color: var(--accent2); margin-bottom: 10px; }
.footer { text-align: center; padding: 30px 20px; color: var(--muted); font-size: .85em; border-top: 1px solid var(--border); margin-top: 40px; }

/* Push banner */
#push-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  padding: 14px 18px;
  z-index: 9999;
  animation: slideUp .35s ease-out;
}
#push-banner .push-banner-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#push-banner .push-banner-content span { font-weight: 500; }
#push-banner button { white-space: nowrap; }
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 500px) {
  #push-banner .push-banner-content { flex-direction: column; align-items: stretch; text-align: center; }
  #push-banner .push-banner-content > div { display: flex; gap: 8px; justify-content: center; }
}
