:root {
  --green-dark: #3f5147;
  --green-deep: #225a3a;
  --green-soft: #9ab0a4;
  --green-panel: #cef3de;
  --peach: #ffedd8;
  --card-text: #1a3525;
  --black: #000000;
  --white: #ffffff;
  --border-soft: rgba(0,0,0,0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--black);
  background: var(--white);
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, select, input { font-family: inherit; }

/* ---------- HEADER ---------- */
header {
  width: 100%;
  height: 64px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 38px;
  object-fit: contain;
}

.brand-text {
  max-width: 220px;
  color: var(--green-dark);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 400;
}

.brand-text strong {
  display: block;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--black);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--green-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--black);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- MAIN ---------- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 40px 50px;
}

.page-title {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 26px;
}

/* ---------- STAT CARDS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--peach);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding-bottom: 11px;
}

.stat-value {
  font-size: 32px;
  font-weight: 500;
  color: var(--card-text);
  margin-top: 8px;
}

/* ---------- HISTORY PANEL ---------- */
.history-panel {
  position: relative;
  background: var(--green-panel);
  border-radius: 18px;
  padding: 24px 28px 28px;
}

.panel-icon {
  position: absolute;
  width: 15px;
  height: 15px;
  color: var(--peach);
  top: -12px;
}

.panel-icon-left { left: 14px; }
.panel-icon-right { right: 14px; }

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-wrap {
  flex: 1;
  min-width: 160px;
  max-width: 226px;
}

.search-input {
  width: 100%;
  height: 30px;
  background: var(--green-deep);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0 14px;
  color: rgba(255,237,216,0.73);
  font-size: 13px;
}

.search-input::placeholder {
  color: rgba(255,237,216,0.73);
}

.search-input:focus {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--peach);
  border-bottom: 2px solid var(--peach);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.status-select {
  appearance: none;
  -webkit-appearance: none;
  height: 30px;
  min-width: 118px;
  background: var(--green-deep);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0 26px 0 14px;
  color: var(--peach);
  font-size: 13px;
  cursor: pointer;
}

.more-filter-btn {
  height: 30px;
  min-width: 108px;
  background: var(--green-deep);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--peach);
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.more-filter-btn:hover,
.more-filter-btn:focus-visible {
  opacity: 0.85;
}

/* ---------- TABLE ---------- */
.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table thead th {
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--black);
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(0,0,0,0.4);
}

.history-table thead th:first-child {
  text-align: left;
}

.history-table tbody td {
  text-align: center;
  padding: 16px 6px;
  font-size: 13px;
  color: #555;
}

.empty-row td {
  text-align: center;
}

/* ---------- FOOTER ---------- */
footer {
  width: 100%;
  background: var(--green-soft);
  padding: 40px 40px 22px;
  margin-top: 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  padding-bottom: 22px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.footer-logo {
  width: 78px;
  height: 95px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-brand h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--green-dark);
  line-height: 1.15;
  max-width: 280px;
}

.footer-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--black);
  margin-bottom: 10px;
  max-width: 340px;
}

.footer-info-row .ico {
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-social h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.social-icons {
  display: flex;
  gap: 8px;
}

.social-icons a {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: opacity 0.2s ease;
}

.social-icons a:hover {
  opacity: 0.8;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 300;
}

.footer-links li a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.25);
  padding-top: 14px;
  font-size: 13px;
  color: var(--black);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  header { flex-wrap: wrap; height: auto; padding: 12px 18px; gap: 12px; }
  .main-nav { order: 3; width: 100%; justify-content: space-between; gap: 14px; }
  .nav-link { font-size: 13px; }
  main { padding: 22px 18px 40px; }
  .page-title { font-size: 18px; }
  .history-panel { padding: 20px 16px; }
  .panel-toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; }
  .toolbar-right { flex-direction: column; align-items: stretch; }
  .status-select, .more-filter-btn { width: 100%; }
  .history-table { display: block; overflow-x: auto; }
  footer { padding: 28px 18px 18px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-brand { flex-direction: column; align-items: center; text-align: center; }
  .footer-info-row { justify-content: center; }
}