:root {
  --dnp-gold: #f5c556;
  --dnp-brown: #4d3824;
  --dnp-blue: #a2d0d4;
  --dnp-bg: #fffaf0;
  --dnp-white: #ffffff;
  --dnp-text: #4d3824;
  --dnp-muted: rgba(77, 56, 36, 0.72);
  --dnp-border: rgba(77, 56, 36, 0.14);
  --dnp-shadow: 0 24px 70px rgba(77, 56, 36, 0.16);
  --dnp-danger: #b94b4b;
  --dnp-success: #3d8f68;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 197, 86, 0.22), transparent 30%),
    radial-gradient(circle at 90% 70%, rgba(162, 208, 212, 0.30), transparent 34%),
    var(--dnp-bg);
  color: var(--dnp-text);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.dnp-est-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.dnp-est-main {
  padding: 54px 0 80px;
}

.dnp-est-hero {
  padding: 44px;
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(77, 56, 36, 0.96), rgba(77, 56, 36, 0.86)),
    radial-gradient(circle at top right, rgba(245, 197, 86, 0.34), transparent 34%);
  color: white;
  box-shadow: var(--dnp-shadow);
}

.dnp-est-label {
  display: inline-flex;
  width: fit-content;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(245, 197, 86, 0.22);
  color: var(--dnp-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dnp-est-hero h1 {
  max-width: 760px;
  margin-top: 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 900;
}

.dnp-est-hero p {
  max-width: 720px;
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.76);
}

.dnp-est-hero-btn {
  margin-top: 26px;
}

.dnp-est-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.dnp-est-card {
  padding: 28px;
  border-radius: 28px;
  background: white;
  border: 1px solid var(--dnp-border);
  box-shadow: 0 18px 50px rgba(77, 56, 36, 0.08);
}

.dnp-est-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--dnp-muted);
  font-size: 13px;
  font-weight: 800;
}

.dnp-est-card strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.04em;
  color: var(--dnp-brown);
}

.dnp-est-card.highlight {
  background: var(--dnp-gold);
}

.dnp-est-panel {
  margin-top: 24px;
  padding: 30px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--dnp-border);
  box-shadow: var(--dnp-shadow);
}

.dnp-est-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dnp-est-panel-head h2 {
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--dnp-brown);
}

.dnp-est-panel-head p {
  margin-top: 6px;
  color: var(--dnp-muted);
  font-size: 14px;
}

.dnp-est-btn {
  min-height: 48px;
  padding: 13px 20px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.25s ease;
  white-space: nowrap;
}

.dnp-est-btn:hover {
  transform: translateY(-2px);
}

.dnp-est-btn-primary {
  background: var(--dnp-gold);
  color: var(--dnp-brown);
}

.dnp-est-btn-dark {
  background: var(--dnp-brown);
  color: white;
}

.dnp-est-btn-light {
  background: rgba(77, 56, 36, 0.08);
  color: var(--dnp-brown);
}

.dnp-est-filters {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 0.9fr 0.9fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}

.dnp-est-field {
  display: grid;
  gap: 8px;
}

.dnp-est-field label {
  font-size: 12px;
  font-weight: 900;
  color: var(--dnp-brown);
}

.dnp-est-field input,
.dnp-est-field select,
.dnp-est-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--dnp-border);
  border-radius: 16px;
  background: white;
  color: var(--dnp-brown);
  outline: none;
  font-size: 14px;
}

.dnp-est-field textarea {
  padding: 14px;
  resize: vertical;
}

.dnp-est-field input:focus,
.dnp-est-field select:focus,
.dnp-est-field textarea:focus {
  border-color: rgba(245, 197, 86, 0.9);
  box-shadow: 0 0 0 4px rgba(245, 197, 86, 0.18);
}

.dnp-est-clear {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--dnp-border);
  border-radius: 16px;
  background: white;
  color: var(--dnp-brown);
  font-weight: 900;
  cursor: pointer;
}

.dnp-est-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--dnp-border);
  border-radius: 24px;
  background: white;
}

.dnp-est-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.dnp-est-table th,
.dnp-est-table td {
  padding: 17px 18px;
  border-bottom: 1px solid rgba(77, 56, 36, 0.10);
  text-align: left;
  font-size: 14px;
}

.dnp-est-table th {
  background: rgba(245, 197, 86, 0.18);
  color: var(--dnp-brown);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dnp-est-table td {
  color: rgba(77, 56, 36, 0.82);
}

.dnp-est-table tr:last-child td {
  border-bottom: none;
}

.dnp-est-type {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.dnp-est-type.entrada {
  background: rgba(61, 143, 104, 0.14);
  color: var(--dnp-success);
}

.dnp-est-type.saida {
  background: rgba(185, 75, 75, 0.13);
  color: var(--dnp-danger);
}

.dnp-est-qtd {
  font-weight: 900;
}

.dnp-est-qtd.entrada {
  color: var(--dnp-success);
}

.dnp-est-qtd.saida {
  color: var(--dnp-danger);
}

.dnp-est-actions {
  display: flex;
  gap: 8px;
}

.dnp-est-action-btn {
  padding: 9px 12px;
  border: none;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.dnp-est-edit {
  background: rgba(162, 208, 212, 0.45);
  color: var(--dnp-brown);
}

.dnp-est-delete {
  background: rgba(185, 75, 75, 0.12);
  color: var(--dnp-danger);
}

.dnp-est-empty {
  display: none;
  padding: 28px;
  text-align: center;
  color: var(--dnp-muted);
  font-weight: 800;
}

.dnp-est-empty.active {
  display: block;
}

.dnp-est-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.dnp-est-modal.active {
  display: flex;
}

.dnp-est-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 17, 10, 0.58);
  backdrop-filter: blur(10px);
}

.dnp-est-modal-card {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 30px;
  border-radius: 34px;
  background: var(--dnp-bg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.dnp-est-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dnp-est-modal-head h3 {
  margin-top: 12px;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--dnp-brown);
}

.dnp-est-close {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: white;
  color: var(--dnp-brown);
  font-size: 28px;
  cursor: pointer;
}

.dnp-est-form {
  display: grid;
  gap: 18px;
}

.dnp-est-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.dnp-est-radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dnp-est-radio {
  cursor: pointer;
}

.dnp-est-radio input {
  display: none;
}

.dnp-est-radio span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--dnp-border);
  background: white;
  color: var(--dnp-brown);
  font-size: 13px;
  font-weight: 900;
}

.dnp-est-radio input:checked + span {
  background: var(--dnp-gold);
  border-color: var(--dnp-gold);
}

.dnp-est-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.page-content {
  margin-left: var(--sidebar-width);
  padding: 28px;
  transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .page-content {
  margin-left: var(--sidebar-collapsed);
}

@media (max-width: 1100px) {
  .dnp-est-filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .dnp-est-clear {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .page-content {
    margin-left: 0;
    padding: 16px;
  }

  .dnp-est-main {
    padding: 24px 0 60px;
  }

  .dnp-est-container {
    width: 100%;
  }

  .dnp-est-hero {
    padding: 24px;
    border-radius: 26px;
  }

  .dnp-est-hero h1 {
    font-size: 34px;
    letter-spacing: -0.04em;
  }

  .dnp-est-hero p {
    font-size: 14px;
    line-height: 1.6;
  }

  .dnp-est-hero-btn {
    width: 100%;
  }

  .dnp-est-cards {
    grid-template-columns: 1fr;
  }

  .dnp-est-card {
    padding: 22px;
    border-radius: 22px;
  }

  .dnp-est-panel {
    padding: 20px;
    border-radius: 26px;
  }

  .dnp-est-panel-head {
    flex-direction: column;
  }

  .dnp-est-panel-head .dnp-est-btn {
    width: 100%;
  }

  .dnp-est-filters {
    grid-template-columns: 1fr;
  }

  .dnp-est-clear {
    grid-column: span 1;
    width: 100%;
  }

  .dnp-est-table-wrap {
    border-radius: 22px;
    overflow-x: visible;
    background: transparent;
    border: none;
  }

  .dnp-est-table,
  .dnp-est-table thead,
  .dnp-est-table tbody,
  .dnp-est-table th,
  .dnp-est-table td,
  .dnp-est-table tr {
    display: block;
    width: 100%;
  }

  .dnp-est-table {
    min-width: 0;
  }

  .dnp-est-table thead {
    display: none;
  }

  .dnp-est-table tr {
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--dnp-border);
    box-shadow: 0 14px 34px rgba(77, 56, 36, 0.08);
  }

  .dnp-est-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(77, 56, 36, 0.08);
    font-size: 13px;
    text-align: right;
  }

  .dnp-est-table td:last-child {
    border-bottom: none;
  }

  .dnp-est-table td::before {
    content: attr(data-label);
    flex: 0 0 110px;
    text-align: left;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dnp-brown);
  }

  .dnp-est-table td strong {
    display: block;
  }

  .dnp-est-table td small {
    display: block;
    margin-top: 4px;
    line-height: 1.4;
  }

  .dnp-est-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .dnp-est-action-btn {
    flex: 1;
  }

  .dnp-est-form-grid,
  .dnp-est-radio-group {
    grid-template-columns: 1fr;
  }

  .dnp-est-modal-card {
    padding: 22px;
    border-radius: 26px;
  }

  .dnp-est-modal-actions {
    flex-direction: column-reverse;
  }

  .dnp-est-modal-actions .dnp-est-btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .page-content {
    padding: 12px;
  }

  .dnp-est-hero h1 {
    font-size: 30px;
  }

  .dnp-est-panel-head h2 {
    font-size: 24px;
  }

  .dnp-est-card strong {
    font-size: 26px;
  }

  .dnp-est-table tr {
    padding: 16px;
  }

  .dnp-est-table td {
    flex-direction: column;
    text-align: left;
    gap: 5px;
  }

  .dnp-est-table td::before {
    flex: initial;
  }

  .dnp-est-actions {
    flex-direction: column;
  }
}