@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Literata:ital,wght@0,500;0,600;0,700;1,500&display=swap');

:root {
  --ink: #1e3425;
  --ink-soft: #5b685c;
  --forest: #173f2a;
  --forest-2: #2f7050;
  --gold: #c99b40;
  --paper: #fbf7e8;
  --paper-2: #f3ead0;
  --line: rgba(71, 79, 46, 0.2);
  --warning: #a95a35;
  --success: #3c7a54;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  color: var(--ink);
  background: #e9ecd9;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 80% 5%, rgba(226, 202, 123, 0.24), transparent 26%),
    linear-gradient(180deg, #f6f2df, #dde5cc);
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(201, 155, 64, 0.72); outline-offset: 2px; }

.data-app { min-width: 1120px; min-height: 100vh; }
.data-header {
  min-height: 94px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 13px 30px;
  border-bottom: 4px solid rgba(47, 112, 80, 0.32);
  background: linear-gradient(180deg, #fffdf4, #f1e8cc);
  box-shadow: 0 8px 24px rgba(31, 57, 35, 0.12);
}
.back-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--forest);
  background: rgba(255,255,248,.75);
  font-weight: 700;
  text-decoration: none;
}
.identity { display: flex; align-items: center; gap: 14px; }
.data-seal {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f7dd9a;
  font-family: 'Literata', serif;
  font-size: 27px;
  background: radial-gradient(circle, #3c805d 0 47%, #17422d 48% 67%, #d1a74f 68% 74%, #173f2a 75%);
  box-shadow: inset 0 0 0 2px #efd179, 0 5px 14px rgba(24, 58, 34, .24);
}
.identity small, .identity strong, .identity em { display: block; }
.identity small { color: #8c6b2e; font-weight: 700; letter-spacing: 1px; }
.identity strong { margin-top: 2px; font-family: 'Literata', serif; font-size: 28px; color: var(--forest); }
.identity em { margin-top: 3px; color: #686149; font-family: 'Literata', serif; font-size: 11px; }
.period-box {
  min-width: 205px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,248,.74);
}
.period-box small, .period-box strong, .period-box em { display: block; }
.period-box small { color: var(--ink-soft); font-size: 9px; }
.period-box strong { margin-top: 2px; font-family: 'Literata', serif; color: var(--forest); }
.period-box em { margin-top: 2px; color: #8a6b31; font-size: 9px; }

.data-main { max-width: 1500px; margin: 0 auto; padding: 24px 30px 42px; }
.quality-banner {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(169, 90, 53, .28);
  border-radius: 15px;
  background: rgba(255, 243, 231, .88);
  box-shadow: 0 10px 26px rgba(70, 57, 29, .09);
}
.quality-banner > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--warning); font-size: 24px; }
.quality-banner strong, .quality-banner p { display: block; margin: 0; }
.quality-banner strong { font-family: 'Literata', serif; color: #783f2a; }
.quality-banner p { margin-top: 3px; color: #765b4f; font-size: 10px; }
.quality-banner button, .source-panel button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(120, 72, 36, .24);
  border-radius: 9px;
  color: #783f2a;
  background: #fff7e9;
  cursor: pointer;
  font-weight: 700;
  font-size: 9px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.metric-card {
  min-height: 112px;
  display: grid;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(251,247,232,.94);
  box-shadow: 0 11px 26px rgba(27, 54, 32, .12);
}
.metric-card small, .metric-card strong, .metric-card em { display: block; }
.metric-card small { color: #8a6b31; font-weight: 700; font-size: 8px; text-transform: uppercase; letter-spacing: .5px; }
.metric-card strong { margin-top: 6px; font-family: 'Literata', serif; color: var(--forest); font-size: 24px; }
.metric-card em { margin-top: 4px; color: var(--ink-soft); font-size: 8px; line-height: 1.4; }
.metric-card.warning strong { color: var(--warning); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 16px; margin-top: 16px; }
.lower-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.panel {
  border: 1px solid rgba(82, 80, 43, .25);
  border-radius: 17px;
  background: rgba(251,247,232,.96);
  box-shadow: 0 15px 36px rgba(27, 54, 32, .13);
  overflow: hidden;
}
.panel-heading {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  color: white;
  background: linear-gradient(180deg, #347451, #17422d);
  border-bottom: 1px solid rgba(224,190,88,.58);
}
.panel-heading small, .panel-heading strong { display: block; }
.panel-heading small { font-size: 8px; opacity: .82; }
.panel-heading strong { margin-top: 2px; font-family: 'Literata', serif; font-size: 15px; }
.panel-heading b { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 10px; }
.panel-heading a { color: #f7e3a3; font-size: 9px; font-weight: 700; text-decoration: none; }

.target-list { padding: 10px 13px 14px; }
.target-row { padding: 9px 0; border-bottom: 1px solid rgba(76,82,49,.11); }
.target-row:last-child { border-bottom: 0; }
.target-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.target-row strong { font-size: 9px; }
.target-row b { color: var(--forest); font-size: 9px; }
.progress-track { height: 8px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: #dedac2; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f7050, #80a25e); }
.target-row.pending .progress-track span { background: linear-gradient(90deg, #bd7a3f, #d7b066); }
.target-row small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 8px; }

.branch-table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid rgba(75,82,48,.12); text-align: right; font-size: 9px; }
th:first-child, td:first-child { text-align: left; }
th { color: #6f664e; background: rgba(237,228,194,.58); font-size: 8px; text-transform: uppercase; }
tbody tr:hover { background: rgba(221,230,197,.48); }
tfoot td { font-weight: 700; color: var(--forest); background: rgba(229,223,190,.5); }
.branch-name strong, .branch-name small { display: block; }
.branch-name strong { font-family: 'Literata', serif; font-size: 10px; }
.branch-name small { margin-top: 2px; color: var(--ink-soft); font-size: 7px; }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 13px; }
.result-card { min-height: 93px; padding: 12px; border: 1px solid rgba(76,82,48,.13); border-radius: 12px; background: rgba(255,255,249,.7); }
.result-card span { font-size: 20px; }
.result-card strong, .result-card small { display: block; }
.result-card strong { margin-top: 5px; font-family: 'Literata', serif; color: var(--forest); font-size: 13px; }
.result-card small { margin-top: 3px; color: var(--ink-soft); font-size: 8px; line-height: 1.4; }

.priority-panel ol { margin: 0; padding: 12px 17px 15px 45px; }
.priority-panel li { padding: 8px 4px; border-bottom: 1px solid rgba(76,82,48,.12); color: #435044; font-size: 9px; line-height: 1.55; }
.priority-panel li::marker { color: #8d6b2e; font-family: 'Literata', serif; font-weight: 700; }
.priority-panel li:last-child { border-bottom: 0; }

.source-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(247,242,221,.92);
}
.source-panel small, .source-panel strong, .source-panel p { display: block; margin: 0; }
.source-panel small { color: #8a6b31; font-weight: 700; font-size: 8px; }
.source-panel strong { margin-top: 3px; font-family: 'Literata', serif; color: var(--forest); }
.source-panel p { margin-top: 4px; color: var(--ink-soft); font-size: 8px; }
.source-panel button { color: var(--forest); border-color: rgba(46,101,72,.24); background: #eef1dc; }

.data-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 37, 22, .5);
  backdrop-filter: blur(5px);
}
.data-modal-backdrop[hidden] { display: none !important; }
.data-modal {
  width: min(720px, 92vw);
  max-height: 84vh;
  overflow: auto;
  position: relative;
  padding: 28px;
  border: 1px solid rgba(111,86,28,.38);
  border-radius: 20px;
  background: linear-gradient(145deg, #fffdf1, #efe5c2);
  box-shadow: 0 30px 95px rgba(14, 36, 22, .38);
}
.modal-close { position: absolute; top: 12px; right: 13px; width: 36px; height: 36px; border: 1px solid rgba(92,72,31,.3); border-radius: 50%; background: #f4e8b9; cursor: pointer; font-size: 22px; }
.data-modal > span { color: #92702f; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.data-modal h2 { margin: 7px 0 12px; font-family: 'Literata', serif; color: var(--forest); font-size: 27px; }
.modal-note { padding: 11px 12px; border: 1px solid rgba(80,82,48,.14); border-radius: 11px; background: rgba(255,255,249,.68); }
.modal-note + .modal-note { margin-top: 8px; }
.modal-note strong, .modal-note p { display: block; margin: 0; }
.modal-note strong { color: var(--forest); font-size: 10px; }
.modal-note p { margin-top: 4px; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }

@media (max-width: 1250px) {
  .data-app { min-width: 1024px; }
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
  .data-header { grid-template-columns: auto 1fr; }
  .period-box { grid-column: 1 / -1; justify-self: end; margin-top: -8px; }
}

@media (max-height: 760px) {
  .data-header { min-height: 82px; padding-block: 8px; }
  .identity strong { font-size: 24px; }
  .data-main { padding-top: 16px; }
  .metric-card { min-height: 92px; }
}
