.sales-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sales-head {
  align-items: flex-start;
}

.sales-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sales-history-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d6c8b6;
  background: linear-gradient(180deg, #f7f1e7 0%, #eee5d6 100%);
  color: #4c3d2b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sales-history-btn:hover {
  filter: brightness(1.02);
}

.sales-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sales-main-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(400px, 1fr);
  gap: 14px;
  align-items: start;
}

/* KART — border kaldırıldı, hafif arka plan tonu */
.sales-card {
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
  padding: 16px 18px;
}

.sales-card-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e7a60;
  margin-bottom: 14px;
}

.sales-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.sales-field:last-child {
  margin-bottom: 0;
}

.sales-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a6d58;
}

.sales-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sales-autocomplete-wrap {
  position: relative;
}

.sales-input,
.sales-textarea {
  width: 100%;
  border: 1px solid #d6c8b4;
  border-radius: 10px;
  background: linear-gradient(180deg, #fdf9f3 0%, #f6efe3 100%);
  color: #20180c;
  font-family: inherit;
  font-size: 14px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sales-input {
  height: 44px;
}

.sales-input::placeholder,
.sales-textarea::placeholder {
  color: #b0a08a;
  font-size: 13px;
}

.sales-textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.sales-input:focus,
.sales-textarea:focus {
  border-color: #c8943c;
  box-shadow: 0 0 0 2px rgba(200, 148, 60, 0.1);
}

.sales-readonly {
  background: linear-gradient(180deg, #f0e8da 0%, #e8dece 100%);
  color: #7a6e5c;
  border-color: #cec0ab;
}

.sales-kalan-input {
  font-weight: 800;
  font-size: 15px;
  color: #7a2413;
}

/* AUTOCOMPLETE */
.sales-autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 500;
  border: 1px solid #d8ccba;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #fdf8f0 0%, #f4ecdf 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.sales-autocomplete-item {
  padding: 11px 13px;
  border-bottom: 1px solid #ede3d4;
  cursor: pointer;
}

.sales-autocomplete-item:last-child {
  border-bottom: none;
}

.sales-autocomplete-item:hover,
.sales-autocomplete-item.is-active {
  background: rgba(255, 255, 255, 0.5);
}

.sales-autocomplete-title {
  font-size: 13px;
  font-weight: 700;
  color: #20180c;
}

.sales-autocomplete-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #9e8e76;
}

.sales-new-option {
  background: linear-gradient(180deg, #e9f1d8 0%, #dde9c4 100%);
}

.sales-new-option .sales-autocomplete-title {
  color: #23410a;
}

/* ALT BAR */
.sales-actions-bar {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.sales-clear-btn,
.sales-save-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.sales-clear-btn {
  background: linear-gradient(180deg, #efe6d9 0%, #e3d7c7 100%);
  border-color: #d6c8b6;
  color: #564938;
}

.sales-save-btn {
  background: linear-gradient(180deg, #d5e9ae 0%, #bdd885 100%);
  border-color: #8fb35a;
  color: #25420a;
}

.sales-clear-btn:hover,
.sales-save-btn:hover {
  filter: brightness(1.03);
}

@media (max-width: 1100px) {
  .sales-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sales-two-col {
    grid-template-columns: 1fr;
  }

  .sales-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sales-clear-btn,
  .sales-save-btn,
  .sales-history-btn {
    width: 100%;
  }

  .module-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* GEÇMİŞ MODAL */
.gecmis-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 20, 10, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gecmis-panel {
  width: 520px;
  max-width: calc(100vw - 32px);
  border-radius: 16px;
  background: linear-gradient(180deg, #faf5ed 0%, #f2e9da 100%);
  border: 1px solid #d8ccb8;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.gecmis-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e4d9c8;
}

.gecmis-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: #20180c;
}

.gecmis-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #8e7a60;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gecmis-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.gecmis-form {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gecmis-row {
  display: flex;
  gap: 10px;
}

.gecmis-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.gecmis-field-sm {
  flex: 0 0 auto;
  min-width: 0;
}

.gecmis-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a6d58;
}

.gecmis-actions {
  padding-top: 4px;
  display: flex;
  justify-content: flex-end;
}

.gecmis-save-btn {
  min-width: 100px;
}

/* ===== KOYU TEMA ===== */
body.dark .sales-history-btn {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #c0b0a0;
}
body.dark .sales-card { background: rgba(255,255,255,0.04); }
body.dark .sales-card-title { color: #6a5a48; }
body.dark .sales-field label { color: #7a6a58; }
body.dark .sales-input, body.dark .sales-textarea {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #e0d4c0;
}
body.dark .sales-input::placeholder, body.dark .sales-textarea::placeholder { color: #5a4a38; }
body.dark .sales-input:focus, body.dark .sales-textarea:focus { border-color: #c8943c; }
body.dark .sales-readonly {
  background: linear-gradient(180deg, #221c14 0%, #1a1610 100%);
  color: #7a6a58;
  border-color: #3a3028;
}
body.dark .sales-kalan-input { color: #e8725a; }
body.dark .sales-autocomplete-list {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
}
body.dark .sales-autocomplete-item { border-color: #3a3028; }
body.dark .sales-autocomplete-item:hover, body.dark .sales-autocomplete-item.is-active { background: rgba(255,255,255,0.05); }
body.dark .sales-autocomplete-title { color: #e0d4c0; }
body.dark .sales-autocomplete-sub { color: #6a5a48; }
body.dark .sales-new-option { background: linear-gradient(180deg, #1e2a10 0%, #182208 100%); }
body.dark .sales-new-option .sales-autocomplete-title { color: #7ecf5a; }
body.dark .sales-clear-btn {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #a09080;
}
body.dark .sales-save-btn {
  background: linear-gradient(180deg, #2a4010 0%, #1e3008 100%);
  border-color: #4a8020;
  color: #a0d870;
}
body.dark .gecmis-panel {
  background: linear-gradient(180deg, #252018 0%, #1e1810 100%);
  border-color: #3a3028;
}
body.dark .gecmis-panel-head { border-color: #3a3028; }
body.dark .gecmis-panel-title { color: #e0d4c0; }
body.dark .gecmis-close-btn { color: #8a7a68; }
body.dark .gecmis-close-btn:hover { background: rgba(255,255,255,0.06); }
body.dark .gecmis-field label { color: #7a6a58; }
