:root {
  --navy: #1F3864;
  --blue: #2E5597;
  --light-blue: #D9E2F3;
  --grey: #F2F2F2;
  --border: #D8DEE9;
  --green: #C6E0B4;
  --green-text: #375623;
  --red: #F8CBAD;
  --red-text: #7A1E00;
  --yellow: #FFE699;
  --yellow-text: #7A5C00;
  --orange: #F4B183;
  --text: #1B1F27;
  --muted: #667085;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #F5F6FA;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #fff;
  color: var(--text);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(16, 24, 40, 0.06);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
}
.brand {
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: bold;
  min-width: 0;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.header-logo {
  display: block;
  max-width: min(260px, 48vw);
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-title {
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding: 18px 24px;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-logo {
  display: block;
  max-width: min(280px, 52vw);
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.footer-copy {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  line-height: 1.4;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-secondary:hover { background: var(--navy); }
.btn-danger { background: #C0392B; color: #fff; }
.btn-danger:hover { background: #922B21; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-outline:hover { background: var(--light-blue); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  background: var(--blue);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 16px 0;
}

h1 { font-size: 22px; margin: 0 0 4px 0; }
h2 { font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; }

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
th {
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { background: var(--blue); }
tbody tr:hover { background: #F8F9FC; }
tbody tr.clickable { cursor: pointer; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}
.badge-green { background: var(--green); color: var(--green-text); }
.badge-red { background: var(--red); color: var(--red-text); }
.badge-yellow { background: var(--yellow); color: var(--yellow-text); }
.badge-grey { background: var(--grey); color: var(--muted); }
.badge-orange { background: var(--orange); color: #7A3300; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab:hover { color: var(--blue); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: var(--muted);
  margin-bottom: 4px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.field input:disabled, .field.readonly-field input, .field.readonly-field div.readonly-value {
  background: var(--light-blue);
  font-style: italic;
  color: var(--navy);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.summary-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.summary-chip {
  background: var(--grey);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  min-width: 90px;
  text-align: center;
}
.summary-chip b { display: block; font-size: 18px; }

.genel-durum-banner {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: bold;
  margin-bottom: 18px;
}

.category-header {
  font-weight: bold;
  color: var(--navy);
  background: var(--light-blue);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 18px 0 10px 0;
  font-size: 13px;
}
.category-header:first-child { margin-top: 0; }

.checklist-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
}
.checklist-item .q-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.checklist-item .q-text { font-size: 14px; line-height: 1.4; flex: 1; }
.checklist-item .q-no { color: var(--muted); font-size: 12px; margin-right: 6px; }
.checklist-item select.status-select { min-width: 220px; font-weight: bold; }
.status-select.st-evet { background: var(--green); color: var(--green-text); }
.status-select.st-hayir { background: var(--red); color: var(--red-text); }
.status-select.st-kismen { background: var(--yellow); color: var(--yellow-text); }
.status-select.st-kapsam { background: var(--grey); }
.checklist-item .extra-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.checklist-item .note-highlight textarea {
  border-color: #C0392B;
  background: #FFF6F4;
}
.hint-box {
  background: var(--light-blue);
  border-left: 4px solid var(--blue);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: #fff; border-radius: 10px; padding: 24px;
  width: 420px; max-width: 92vw;
}
.modal-box h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.error-text { color: #C0392B; font-size: 13px; margin-top: 8px; }

.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.history-list li:hover { background: #F8F9FC; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

.save-indicator {
  font-size: 12px; color: #2E7D32; margin-left: 8px; opacity: 0; transition: opacity .3s;
}
.save-indicator.show { opacity: 1; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2E7D32;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

.breadcrumb { margin-bottom: 14px; font-size: 13px; }

.confirm-box p { line-height: 1.5; }

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }

  .topbar-inner {
    min-height: 68px;
  }

  .header-logo {
    max-width: 180px;
    max-height: 44px;
  }

  .brand-title {
    font-size: 15px;
    white-space: normal;
  }

  .btn {
    padding: 8px 12px;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-logo {
    max-width: 220px;
    max-height: 42px;
  }

  .footer-copy {
    text-align: left;
  }
}
