:root {
  --bg: #f4f7f2;
  --panel: #ffffff;
  --text: #172018;
  --muted: #657064;
  --line: #d9e2d5;
  --brand: #2f6b3f;
  --brand-dark: #255733;
  --accent: #e8b84b;
  --danger: #b73535;
  --ok: #27724b;
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost {
  background: #e7eee4;
  color: var(--brand-dark);
}

.danger {
  background: var(--danger);
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.forgot-card,
.register-card {
  display: none;
  margin-top: 12px;
}

.forgot-card.show,
.register-card.show {
  display: block;
}

.register-card {
  display: none;
}

.register-card .field {
  margin-bottom: 10px;
}

.login-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.login-links .ghost {
  flex: 1;
}

.home-link {
  display: inline-block;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 2px;
}

.home-link:hover {
  color: var(--brand);
}

/* --- Fotoğraflar --- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.photo-grid:empty {
  display: none;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f0f3ee;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0;
  background: rgba(183, 53, 53, 0.92);
  color: #fff;
  line-height: 1;
  font-size: 18px;
}

.photo-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 8px;
  border: 1px dashed var(--brand);
  border-radius: var(--radius);
  background: #eef4ea;
  color: var(--brand-dark);
  font-weight: 700;
  cursor: pointer;
  padding: 0 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

.role {
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 12px;
}

.cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary {
  min-height: 78px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.summary strong {
  font-size: 26px;
}

.summary span {
  color: var(--muted);
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px;
}

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

.customer-picker {
  display: grid;
  gap: 6px;
}

.customer-search {
  min-height: 40px;
}

.checks {
  display: grid;
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  font-weight: 700;
}

.check input {
  width: 24px;
  min-height: 24px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips .check {
  position: relative;
  justify-content: center;
  width: auto;
  min-height: 32px;
  padding: 6px 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.15;
  cursor: pointer;
  border-radius: 999px;
}

.chips .check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chips .check:has(input:checked) {
  border-color: #2474c9;
  background: #2474c9;
  color: #fff;
}

.hourly-field {
  display: none;
}

.hourly-field.show {
  display: grid;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  min-height: 42px;
  white-space: nowrap;
  background: #e7eee4;
  color: var(--brand-dark);
  padding: 0 14px;
}

.tab.active {
  background: var(--brand);
  color: #fff;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef1ed;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.badge.sent {
  background: #dff0e6;
  color: var(--ok);
}

.badge.wait {
  background: #fff3ce;
  color: #7b5a08;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f5;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-form button {
  min-height: 46px;
}

.job-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f5;
  color: var(--muted);
  padding: 5px 6px 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.job-list button {
  width: 22px;
  min-height: 22px;
  border-radius: 999px;
  padding: 0;
  background: #e5ece2;
  color: var(--danger);
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button,
.actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 700;
}

.actions a,
.whatsapp-btn {
  background: #25d366;
  color: #fff;
}

.notice {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 10px;
  display: none;
}

.notice.show {
  display: block;
}

.notice.ok {
  background: #dff0e6;
  color: #145533;
}

.notice.err {
  background: #f7dcdc;
  color: #7f1d1d;
}

.desktop-only {
  display: block;
}

@media (max-width: 760px) {
  .wrap {
    padding: 10px;
  }

  .cols {
    grid-template-columns: 1fr;
  }

  .admin-quick,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .desktop-only {
    display: none;
  }

  .topbar-inner {
    padding: 10px;
  }

  .panel {
    padding: 12px;
  }

  button {
    width: 100%;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}

/* === Tema değiştirme düğmesi (yüzen) === */
.theme-fab {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 60;
  width: 50px;
  height: 50px;
  min-height: 50px;
  border-radius: 50%;
  padding: 0;
  background: var(--panel);
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.theme-fab svg {
  width: 22px;
  height: 22px;
}

/* === Karanlık mod === */
:root[data-theme="dark"] {
  --bg: #11160f;
  --panel: #1a221a;
  --text: #e7efe5;
  --muted: #97a594;
  --line: #2c3a2a;
  --brand: #4e9a64;
  --brand-dark: #3c8350;
  --danger: #d9605b;
  --ok: #4fae74;
}

[data-theme="dark"] .ghost,
[data-theme="dark"] .tab {
  background: #25321f;
  color: #cfe0c8;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .check,
[data-theme="dark"] .item {
  background: #141d13;
  color: var(--text);
}

[data-theme="dark"] .badge {
  background: #28331f;
  color: var(--muted);
}

[data-theme="dark"] .badge.sent {
  background: #1d3a2a;
  color: #84d8a6;
}

[data-theme="dark"] .badge.wait {
  background: #3a3318;
  color: #e6c869;
}

[data-theme="dark"] .permission-list span,
[data-theme="dark"] .job-list span {
  background: #1f2a1c;
  color: var(--muted);
}

[data-theme="dark"] .job-list button {
  background: #2a3724;
}

[data-theme="dark"] .photo-thumb {
  background: #1f2a1c;
}

[data-theme="dark"] .photo-add {
  background: #1d2a18;
  color: #cfe0c8;
}

[data-theme="dark"] .notice.ok {
  background: #173a28;
  color: #9fe4bd;
}

[data-theme="dark"] .notice.err {
  background: #43201f;
  color: #f1b3b0;
}
