:root {
  --navy: #17232d;
  --blue: #0099b8;
  --cyan: #08a7c6;
  --bg: #f4f7f9;
  --line: #dfe6ea;
  --text: #17232d;
  --muted: #687681;
  --ok: #0b7a53;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
}
h1,
h2,
p {
  margin-top: 0;
}
button,
.secondary {
  border: 0;
  border-radius: 9px;
  padding: 11px 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  color: var(--text);
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  color: var(--blue);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 12px;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--blue), var(--cyan));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}
.brand-mark.small {
  width: 39px;
  height: 39px;
  border-radius: 10px;
  font-size: 20px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 80% 15%, #d8effa, transparent 30%),
    linear-gradient(135deg, #eef3f9, #fff);
}
.login-card {
  width: min(420px, calc(100% - 32px));
  background: #fff;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px #20385a18;
}
.login-card > .login-logo {
  display: block;
  width: 220px !important;
  max-width: 100% !important;
  height: auto;
  object-fit: contain;
  margin: 0 auto 28px;
}
.login-card form {
  display: grid;
  gap: 16px;
  margin: 28px 0;
}
.login-card button {
  width: 100%;
  padding: 13px;
}
.login-card small {
  display: block;
  text-align: center;
  color: var(--muted);
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--navy);
  color: #fff;
  padding: 25px 18px;
  display: flex;
  flex-direction: column;
}
.logo-row {
  display: grid;
  gap: 10px;
  padding: 0 6px 28px;
}
.logo-row img {
  display: block;
  width: 185px;
  max-width: 100%;
  height: auto;
}
.logo-row span {
  display: block;
}
.logo-row span {
  font-size: 12px;
  color: #9eb2ca;
  margin-top: 2px;
}
nav {
  display: grid;
  gap: 5px;
}
nav a {
  padding: 12px;
  border-radius: 8px;
  color: #adbed1;
  text-decoration: none;
  font-size: 14px;
}
nav a:hover,
nav a.active {
  background: #ffffff12;
  color: #fff;
}
.user {
  margin-top: auto;
  padding: 16px 8px 2px;
  border-top: 1px solid #ffffff18;
}
.user b,
.user span {
  display: block;
}
.user span {
  font-size: 12px;
  color: #9eb2ca;
  margin: 4px 0 12px;
  text-transform: capitalize;
}
.user a {
  font-size: 13px;
  color: #fff;
}
.content {
  margin-left: 238px;
  padding: 30px;
  max-width: 1600px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
header h1 {
  font-size: 29px;
  margin-bottom: 5px;
}
.period { position: relative; min-width: 320px; }
.period-title { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
.period-control { display: flex; align-items: center; overflow: hidden; min-height: 43px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 2px 8px #17232d0a; }
.period-arrow { display: grid; place-items: center; align-self: stretch; width: 43px; flex: 0 0 43px; color: var(--blue); font-size: 27px; line-height: 1; text-decoration: none; transition: background .15s ease, color .15s ease; }
.period-arrow:hover { background: #e8f7fa; color: #087d94; }
.period-label { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 150px; flex: 1; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: center; font-size: 14px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.period-label:hover { background: #f5fbfc; }
.period-picker { display: grid; place-items: center; align-self: stretch; width: 45px; flex: 0 0 45px; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--blue); cursor: pointer; }
.period-picker:hover { background: #e8f7fa; }
.calendar-icon { font-size: 20px; line-height: 1; }
.period-menu { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; width: 310px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 16px 38px #17232d24; }
.period-menu[hidden] { display: none; }
.period-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.period-menu-head label { margin: 0; font-size: 13px; font-weight: 750; color: var(--muted); }
.period-menu-head select { width: 120px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font-weight: 700; }
.period-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.period-months button { min-height: 38px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font-weight: 700; cursor: pointer; }
.period-months button:hover { border-color: var(--blue); background: #e8f7fa; color: var(--blue); }
.period-months button.selected { border-color: var(--blue); background: var(--blue); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.kpis article,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.kpis article {
  padding: 19px;
}
.kpis span,
.kpis small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.kpis strong {
  display: block;
  font-size: 25px;
  margin: 9px 0 6px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(290px, 0.8fr);
  gap: 18px;
  align-items: start;
}
.panel {
  padding: 20px;
}
.panel h2 {
  font-size: 17px;
  margin-bottom: 5px;
}
.panel p {
  font-size: 13px;
  color: var(--muted);
}
.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.secondary {
  background: #eff5fd;
  color: var(--blue);
  font-size: 12px;
  white-space: nowrap;
}
.table-wrap {
  overflow: auto;
  margin: 12px -20px -20px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  padding: 13px 14px;
  text-align: left;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
th {
  background: #f9fbfd;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.num {
  text-align: right;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.status {
  background: #e7f7f0;
  color: var(--ok);
  padding: 5px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
}
.doc-type {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 20px;
  background: #e8f7fa;
  color: #087d94;
  font-size: 10px;
  font-weight: 800;
}
.type-04 { background: #fff0f0; color: #a42b2b; }
.type-05 { background: #fff5dd; color: #8a5b00; }
.type-07 { background: #f1edff; color: #6946b8; }
.effect { font-weight: 800; color: var(--ok); }
.effect.negative { color: #b42318; }
.supported-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
.supported-types span { padding: 6px 9px; border-radius: 20px; background: #e8f7fa; color: #087d94; font-size: 11px; font-weight: 750; }
.right {
  position: static;
  width: auto;
  background: transparent;
  color: inherit;
  padding: 0;
  display: grid;
  gap: 18px;
}
.upload {
  display: grid;
  gap: 12px;
}
.drop {
  border: 1.5px dashed #b7c6d8;
  padding: 18px;
  text-align: center;
  border-radius: 10px;
  background: #f8fbff;
}
.drop span {
  color: var(--muted);
  font-weight: 400;
}
.drop input {
  margin-top: 10px;
  font-size: 12px;
}
.supplier {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.supplier small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.supplier strong {
  white-space: nowrap;
}
.alert {
  padding: 12px 14px;
  border-radius: 9px;
  margin-bottom: 14px;
  font-size: 13px;
}
.alert.error {
  background: #fff0f0;
  color: #a42b2b;
}
.alert.success {
  background: #eaf8f1;
  color: var(--ok);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px !important;
}
.detail-panel { margin-bottom: 18px; border-color: #a9dfe9; box-shadow: 0 10px 28px #17232d0d; }
.detail-table { margin-bottom: -20px; }
.description-cell { min-width: 260px; max-width: 460px; white-space: normal; line-height: 1.4; }
.detail-link,.xml-download { display: inline-block; white-space: nowrap; text-decoration: none; font-size: 11px; font-weight: 800; color: var(--blue); }
.detail-link { margin-right: 10px; padding-right: 10px; border-right: 1px solid var(--line); }
@media (max-width: 1050px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .right {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  aside {
    position: static;
    width: 100%;
    padding: 14px;
  }
  .logo-row {
    padding-bottom: 10px;
  }
  nav {
    display: none;
  }
  .user {
    display: none;
  }
  .content {
    margin: 0;
    padding: 18px;
  }
  header {
    display: block;
  }
  .period {
    width: 100%;
    margin-top: 16px;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .right {
    grid-template-columns: 1fr;
  }
  .panel-title {
    display: block;
  }
  .secondary {
    display: inline-block;
    margin-bottom: 10px;
  }
}
