* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 196, 35, 0.18), transparent 32rem),
    linear-gradient(180deg, #fffaf0 0, #f5f0e8 18rem, #f6f7fb 18rem);
  color: #2f241d;
}

.container {
  width: min(1120px, 95%);
  margin: 24px auto 40px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid #eadfcf;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(68, 34, 14, 0.08);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-title img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-title p {
  margin: 0 0 4px;
  color: #6c3a1e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  color: #2d170c;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #3c2112;
}

.card {
  background: #fff;
  border: 1px solid #eadfcf;
  border-top: 4px solid #f5bd21;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(68, 34, 14, 0.06);
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #4a260f;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  background: #321708;
}

.btn-secondary {
  background: #7a6b5f;
}

.btn-secondary:hover {
  background: #5d5047;
}

.btn-print {
  background: #d99312;
  color: #2d170c;
}

.btn-print:hover {
  background: #c67d08;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.grid-3,
.grid-4 {
  display: grid;
  gap: 12px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8c7b2;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #2f241d;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #d99312;
  box-shadow: 0 0 0 3px rgba(217, 147, 18, 0.18);
  outline: 0;
}

textarea {
  resize: vertical;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border: 1px solid #eadfcf;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #fff4d4;
  color: #3c2112;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.flash {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.flash.success {
  background: #eef9ef;
  color: #156f3a;
  border: 1px solid #98ddb1;
}

.flash.error {
  background: #fdecec;
  color: #9b1c1c;
  border: 1px solid #f5b4b4;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.search-form input {
  max-width: 380px;
}

.link-clear {
  color: #6c3a1e;
  text-decoration: none;
}

.link-clear:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-title img {
    width: 64px;
    height: 64px;
  }

  .header-actions,
  .actions,
  .search-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search-form input {
    max-width: none;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .container {
    width: 100%;
    margin: 0;
  }

  .no-print,
  .btn,
  .actions,
  .add-row,
  .flash,
  .search-form {
    display: none !important;
  }

  .header,
  .card {
    box-shadow: none;
    border-color: #333;
    break-inside: avoid;
  }

  .header {
    padding: 0 0 10px;
    margin-bottom: 10px;
    border: 0;
    border-bottom: 2px solid #3c2112;
    border-radius: 0;
  }

  .brand-title img {
    width: 72px;
    height: 72px;
  }

  .brand-title p,
  h1,
  h2 {
    color: #000;
  }

  .card {
    padding: 10px 0 8px;
    margin-bottom: 8px;
    border: 0;
    border-top: 1px solid #333;
    border-radius: 0;
  }

  input,
  select,
  textarea {
    border: 0;
    border-bottom: 1px solid #555;
    border-radius: 0;
    padding: 2px 0;
    min-height: 22px;
    box-shadow: none;
  }

  textarea {
    min-height: 42px;
  }

  th {
    background: #eee !important;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    border-color: #555;
    padding: 5px;
  }
}
