/* Tek, sabit ve yüksek kontrastlı açık tema.
   Telefon karanlık modda olsa bile select/input gibi yerel form elemanlarının
   karanlık-üstüne-karanlık render olup okunmaz hale gelmesini engellemek için
   color-scheme kasıtlı olarak "light" ile sabitlendi. */

:root {
  color-scheme: light;

  --color-primary: #0f6b47;
  --color-primary-dark: #0a4d33;
  --color-primary-light: #e6f4ec;

  --color-danger: #c0281c;
  --color-danger-bg: #fdeceb;
  --color-danger-border: #f3b8b2;

  --color-warning: #92640a;
  --color-warning-bg: #fff3d9;
  --color-warning-border: #f2d489;

  --color-success: #0f6b47;
  --color-success-bg: #e6f4ec;
  --color-success-border: #a9d8bf;

  --color-bg: #eef1f0;
  --color-card: #ffffff;
  --color-border: #d4d9d7;

  --color-text: #16191b;
  --color-text-muted: #51595a;

  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.topbar {
  background: var(--color-primary);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}

.topbar a { color: #ffffff; text-decoration: underline; }
.topbar .brand { font-weight: 800; font-size: 1.05rem; color: #ffffff; }
.topbar .user-info { font-size: 0.9rem; color: #ffffff; opacity: 0.95; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.container.wide { max-width: 1150px; }

nav.mainmenu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

nav.mainmenu a {
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--color-bg);
}

nav.mainmenu a.active { background: var(--color-primary); color: #ffffff; }

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 4px 0 18px;
  color: var(--color-text);
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--color-text);
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: var(--color-text);
}

input[type=text],
input[type=password],
input[type=date],
input[type=search],
input[type=number],
input[type=datetime-local],
select,
textarea {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  margin-bottom: 16px;
  background-color: #ffffff;
  color: #16191b;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 71, 0.15);
}

/* Yerel select/option renklerini garanti altına al (bazı tarayıcılar
   sistem karanlık temasını yerel kontrollere zorla uygular). */
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5 7l5 5 5-5' stroke='%2351595a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
select, select option {
  background-color: #ffffff;
  color: #16191b;
}

input::placeholder, textarea::placeholder { color: #8a9190; }

textarea { min-height: 90px; resize: vertical; }

input:disabled, select:disabled, textarea:disabled {
  background-color: #f0f2f1;
  color: #6b7170;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 16px;
  font-size: 1.08rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  font-family: inherit;
}

.btn-primary { background: var(--color-primary); color: #ffffff; }
.btn-primary:active { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #9bb8ac; cursor: not-allowed; }

.btn-secondary { background: #e3e7e5; color: var(--color-text); }
.btn-secondary:active { background: #d3d8d5; }

.btn-danger { background: var(--color-danger); color: #ffffff; }

.btn-small { width: auto; padding: 9px 16px; font-size: 0.9rem; }

.alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid transparent;
}

.alert-error { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-border); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success-border); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: var(--color-warning-border); }

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge-basildi { background: #e3e7e5; color: #33393a; }
.badge-depoda { background: #dbeafe; color: #1447a3; }
.badge-sevk { background: #fef0c7; color: #8a5a06; }
.badge-iade { background: var(--color-danger-bg); color: var(--color-danger); }

#reader { width: 100%; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }

.confirm-box {
  background: #ffffff;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.confirm-box .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.confirm-box .row:last-child { border-bottom: none; }
.confirm-box .label { color: var(--color-text-muted); font-weight: 600; }
.confirm-box .value { font-weight: 800; text-align: right; color: var(--color-text); }

table.report {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
  color: var(--color-text);
}
table.report th, table.report td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}
table.report th {
  background: #f2f4f3;
  color: var(--color-text);
  font-weight: 800;
  position: sticky;
  top: 0;
}
table.report tbody tr:nth-child(even) { background: #fafbfa; }

.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border); box-shadow: var(--shadow); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: end; }
.filters .field { min-width: 160px; flex: 1; }
.filters label { margin-bottom: 6px; }
.filters input, .filters select { margin-bottom: 0; }

.muted { color: var(--color-text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
