* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f2933;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f7f1 url("../images/index_sayfa_zemin.jpg") repeat;
  --brand: #d31212;
  --brand-dark: #891010;
  --ink: #171212;
  --ink-soft: #655858;
  --line: rgba(23, 18, 18, 0.12);
  --shadow-md: 0 18px 40px rgba(34, 10, 10, 0.16);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.login-panel {
  width: min(900px, calc(100vw - 32px));
  min-height: 320px;
  background: url("../images/index_giris_zemin1.jpg") center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 42px 54px;
}

.login-form {
  display: grid;
  grid-template-columns: auto 140px auto 140px 92px;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  transform: translate(18px, 85px);
}

.topbar {
  height: 75px;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  align-items: stretch;
  background: url("../images/ust_zemin.png") repeat-x;
}

.topbar img {
  width: 277px;
  height: 75px;
  object-fit: cover;
}

.nav {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 0 16px 14px;
}

.nav a,
.nav button {
  border: 0;
  background: transparent;
  color: #c90000;
  cursor: pointer;
  font: 14px Arial, Helvetica, sans-serif;
}

.userbox {
  display: flex;
  gap: 18px;
  align-items: start;
  padding: 8px 20px 0 0;
  color: #99cc33;
  white-space: nowrap;
}

.userbox a {
  color: #fff;
  font-weight: 700;
}

.page {
  width: min(1260px, calc(100vw - 32px));
  margin: 24px auto;
}

.menu-grid {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.menu-list {
  display: grid;
  gap: 22px;
  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d7dfcb;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
}

.order-lower-card {
  width: min(90vw, calc(100vw - 32px));
  margin: 16px 0 0 50%;
  transform: translateX(-50%);
}

.order-entry-card {
  min-width: 0;
  overflow: hidden;
  padding: 20px 14px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.order-entry-action-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.order-entry-action-strip__spacer {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  margin-left: auto;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid rgba(23, 18, 18, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand);
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-button--danger {
  color: #b42318;
}

.order-entry-action-icon {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.order-entry-action-icon svg {
  width: 18px;
  height: 18px;
}

.order-entry-action-icon--labeled {
  width: auto;
  min-width: 92px;
  gap: 8px;
  padding: 0 14px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

.order-entry-action-icon--labeled span {
  white-space: nowrap;
}

.order-entry-action-icon--nav {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.order-entry-action-icon--nav:hover {
  background: var(--brand-dark);
}

.order-entry-action-divider {
  width: 100%;
  height: 1px;
  margin: 16px 0 18px;
  background: rgba(23, 18, 18, 0.08);
}

.order-entry-header-layout {
  display: grid;
  grid-template-columns: 180px 220px minmax(220px, 1fr);
  gap: 12px 16px;
  align-items: start;
  justify-content: stretch;
}

.order-entry-header-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.header-row-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.header-row-field__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(23, 18, 18, 0.84);
}

.header-row-field__control {
  display: grid;
  align-items: center;
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid #cfd6df;
  background: #ffffff;
  min-width: 0;
}

.header-row-field__control input,
.header-row-field__control select,
.header-row-field__control textarea {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.header-row-field__control textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.45;
  padding-top: 4px;
}

.header-row-field--textarea .header-row-field__control {
  align-items: start;
  min-height: 130px;
  padding: 7px;
}

.order-entry-customer-field {
  grid-column: span 1;
}

.order-entry-description-field {
  min-width: 0;
}

.order-entry-description-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: end;
}

.order-entry-file-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  margin-bottom: 0;
  color: var(--brand);
}

.order-entry-file-button svg {
  width: 22px;
  height: 22px;
}

.row-action-cell {
  width: 82px;
  white-space: nowrap;
}

.row-icon-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 9px;
  margin-right: 4px;
}

.row-icon-button svg {
  width: 16px;
  height: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 641px) {
  .order-entry-action-icon {
    height: 44px;
    min-height: 44px;
    border-radius: 14px;
  }

  .order-entry-action-icon svg {
    width: 22px;
    height: 22px;
  }

  .order-entry-action-icon--labeled {
    min-width: 112px;
    padding: 0 16px;
  }
}

.toolbar,
.form-grid,
.row-form {
  display: grid;
  gap: 10px;
}

.form-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
}

.row-form {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}

.row-dialog {
  width: min(848px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 24px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(34, 10, 10, 0.24);
}

.row-dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.row-dialog__header,
.row-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-dialog__header {
  min-height: 75px;
  padding: 0 14px 0 0;
  border-bottom: 1px solid rgba(23, 18, 18, 0.1);
  background: url("../images/ust_zemin.png") repeat-x;
}

.row-dialog__brand {
  display: flex;
  align-items: center;
  min-height: 75px;
  padding-left: 0;
}

.row-dialog__logo {
  width: 277px;
  height: 75px;
  object-fit: contain;
  object-position: left center;
}

.row-dialog__close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
}

.row-dialog__close svg {
  width: 18px;
  height: 18px;
}

.row-dialog .row-form {
  grid-template-columns: 1fr;
  padding: 16px;
}

.row-dialog .row-form label {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(23, 18, 18, 0.1);
}

.row-dialog .row-form label:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row-dialog__footer {
  padding: 14px 16px;
  justify-content: flex-end;
  border-top: 1px solid rgba(23, 18, 18, 0.1);
}

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

label {
  display: grid;
  gap: 4px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid #b9c3ad;
  border-radius: 4px;
  padding: 6px 8px;
  font: 14px Arial, Helvetica, sans-serif;
  background: #fff;
}

textarea {
  resize: vertical;
}

button,
.button {
  min-height: 32px;
  border: 1px solid #6f861b;
  border-radius: 4px;
  background: #99bb1b;
  color: #fff;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
}

button.secondary,
.button.secondary {
  border-color: #9aa4b2;
  background: #fff;
  color: #344054;
}

button.danger {
  border-color: #a61b1b;
  background: #c62828;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border: 1px solid #d6ddca;
  padding: 7px;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef4e4;
  color: #394820;
}

tbody tr.is-selected td {
  background: #c62828;
  color: #fff;
}

.table-wrap {
  overflow: auto;
  max-height: 58vh;
  border: 1px solid #d6ddca;
}

.notice {
  margin: 10px 0;
  min-height: 22px;
  color: #8a1f11;
  font-weight: 700;
}

.muted {
  color: #667085;
  font-weight: 400;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
  }

  .userbox,
  .nav {
    padding: 10px 16px;
    align-items: center;
  }

  .form-grid,
  .row-form,
  .login-form,
  .order-entry-header-layout {
    grid-template-columns: 1fr;
  }

  .order-entry-description-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

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

  .row-dialog .row-form label {
    grid-template-columns: 1fr;
  }

  .order-entry-card {
    border-radius: 18px;
    padding: 14px;
  }

  .order-entry-action-strip {
    flex-wrap: wrap;
  }

  .order-entry-action-strip__spacer {
    display: none;
  }
}
