/* Visual refinement: preserves the existing Dashboard content and interactions. */
:root {
  --blue-primary: #1479df;
  --blue-tint: #eaf3ff;
  --green-primary: #1da86b;
  --green-tint: #e9f9f1;
  --orange-primary: #f07f32;
  --orange-tint: #fff1e8;
  --red-primary: #ea5158;
  --red-tint: #fff0f1;
  --violet-primary: #7750e8;
  --violet-tint: #f0ebff;
  --ref-radius: 18px;
  --ref-shadow: 0 2px 5px rgba(23, 43, 77, .025), 0 12px 30px rgba(36, 62, 102, .055);
}

.app-shell { grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { padding: 18px 12px 16px; }
.brand { padding: 0 12px 22px; }
.page-label { display: none; }
.topbar { height: 64px; gap: 16px; padding: 0 36px; background: rgba(255, 255, 255, .9); }
.global-search { max-width: 400px; height: 38px; border-radius: 9px; background: #f7f9fc; box-shadow: none; }
.header-actions { gap: 14px; }
main { padding: 24px 36px 56px; }

.hero-card {
  min-height: 144px;
  margin: -24px -36px 16px;
  padding: 22px 36px;
  align-items: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  background-image: linear-gradient(90deg, #f5f7fa 0%, rgba(245,247,250,.98) 23%, rgba(245,247,250,.80) 40%, rgba(245,247,250,.32) 59%, rgba(245,247,250,.04) 78%), url("assets/berdychiv-monastery.jpg");
  background-position: center 50%;
  background-size: cover;
}
.hero-copy { max-width: 600px; }
.hero-date { color: #5d7189; font-size: 12px; font-weight: 700; }
.hero-copy h1 { margin: 5px 0 4px; color: #10243e; font-size: 32px; letter-spacing: -.045em; }
.hero-copy p:not(.eyebrow) { color: #536a83; font-size: 13px; line-height: 1.5; }
.hero-caption { right: 36px; bottom: 13px; color: rgba(37, 65, 84, .7); font-size: 9px; text-shadow: 0 1px 4px rgba(255,255,255,.75); }

.kpi-grid { gap: 16px; margin: 0 0 16px; }
.kpi-card {
  min-height: 120px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-color: #e7edf4;
  border-radius: var(--ref-radius);
  box-shadow: var(--ref-shadow);
}
.kpi-icon { width: 50px; height: 50px; border-radius: 13px; font-size: 23px; }
.kpi-main > div { display: flex; align-items: center; gap: 8px; }
.kpi-card strong { margin: 0; color: #10243e; font-size: 28px; letter-spacing: -.05em; }
.kpi-card p { margin-top: 2px; color: #243a55; font-size: 12px; font-weight: 800; }
.kpi-card small { display: block; margin-top: 2px; color: #8190a3; font-size: 10px; }
.kpi-trend { padding: 3px 6px; border-radius: 7px; background: var(--green-tint); color: #168357; font-size: 10px; font-weight: 800; }
.kpi-trend.negative { background: var(--red-tint); color: #d9464f; }
.kpi-trend.violet-trend { background: var(--violet-tint); color: #6842d5; }
.kpi-chevron { color: #7c8da1; font-size: 25px; font-weight: 300; }
.kpi-blue .kpi-icon { background: var(--blue-tint); color: var(--blue-primary); }
.kpi-green .kpi-icon { background: var(--green-tint); color: var(--green-primary); }
.kpi-orange .kpi-icon { background: var(--orange-tint); color: var(--orange-primary); }
.kpi-violet .kpi-icon { background: var(--violet-tint); color: var(--violet-primary); }

.dashboard-grid {
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1.02fr) minmax(300px, .88fr);
  grid-template-areas:
    "attention tasks calendar"
    "distribution trend latest";
  gap: 16px;
  align-items: stretch;
}
.dashboard-grid .eyebrow { display: none; }
.attention-panel { grid-area: attention; }
.tasks-panel { grid-area: tasks; }
.distribution-panel { grid-area: distribution; }
.calendar-panel { grid-area: calendar; }
.trend-panel { grid-area: trend; }
.latest-panel { grid-area: latest; }
.surface { padding: 20px; border-color: #e7edf4; border-radius: var(--ref-radius); box-shadow: var(--ref-shadow); }
.section-heading { align-items: center; margin-bottom: 14px; }
.section-heading h2 { margin-top: 0; color: #182d48; font-size: 17px; letter-spacing: -.03em; }
.text-button { color: #2078d4; font-size: 11px; font-weight: 800; }
.heading-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 5px; vertical-align: 2px; border-radius: 50%; color: #fff; font-size: 10px; letter-spacing: 0; }
.heading-count.critical { background: var(--red-primary); }
.heading-count.warning { background: var(--orange-primary); }

.attention-list { display: grid; }
.attention-row {
  grid-template-columns: 38px minmax(0, 1fr) max-content 12px;
  gap: 10px;
  min-height: 62px;
  padding: 9px 0;
  align-items: center;
}
.attention-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-size: 16px; font-weight: 800; }
.attention-icon.icon-blue { background: var(--blue-primary); color: #fff; }
.attention-icon.icon-green { background: #2fba7a; color: #fff; }
.attention-icon.icon-orange { background: #f39a41; color: #fff; }
.attention-icon.icon-violet { background: var(--violet-primary); color: #fff; }
.attention-main strong { color: #1f3550; font-size: 11px; line-height: 1.3; }
.attention-main small { margin-top: 2px; color: #75869b; font-size: 9px; line-height: 1.3; }
.attention-meta { display: grid; justify-items: end; gap: 4px; }
.status-chip { min-height: 19px; padding: 3px 6px; border-radius: 6px; font-size: 9px; }
.evaluating { background: var(--blue-tint); color: #2878c5; }
.working { background: var(--violet-tint); color: #694bba; }
.application { background: var(--orange-tint); color: #c56824; }
.incoming { background: #eff4f8; color: #5f7287; }
.deadline { font-size: 9px; font-weight: 800; }
.deadline.urgent { color: var(--red-primary); }
.row-chevron { color: #7c8da1; font-size: 21px; font-weight: 300; }

.tasks-panel { display: flex; flex-direction: column; }
.task-line { grid-template-columns: 18px minmax(0, 1fr) max-content; gap: 9px; min-height: 55px; padding: 8px 0; }
.task-line input { width: 16px; height: 16px; border-radius: 5px; }
.task-copy strong, .task-copy small { display: block; }
.task-copy strong { color: #273d58; font-size: 10px; line-height: 1.25; }
.task-copy small { margin-top: 2px; color: #8090a2; font-size: 9px; line-height: 1.25; }
.task-meta { display: grid; justify-items: end; gap: 4px; }
.task-meta small { color: #718297; font-size: 9px; font-weight: 700; white-space: nowrap; }
.priority { padding: 3px 6px; border-radius: 6px; font-size: 9px; font-weight: 800; }
.priority.high { background: var(--red-tint); color: #d84b54; }
.priority.medium { background: var(--orange-tint); color: #bf7025; }
.priority.low { background: var(--blue-tint); color: #2676c0; }
.task-line input:checked + .task-copy strong { color: #8f9cac; }
.add-task { margin-top: auto; padding-top: 12px; color: #2078d4; font-size: 11px; }

.distribution-panel .donut-wrap { gap: 16px; }
.distribution-panel .donut { width: 126px; height: 126px; }
.distribution-panel .donut::before { width: 88px; height: 88px; }
.distribution-panel .legend { gap: 7px; font-size: 10px; }
.distribution-panel .legend li { gap: 6px; }

.calendar-panel .section-heading { margin-bottom: 12px; }
.calendar-add { min-height: 29px; padding: 0 9px; border: 0; border-radius: 7px; background: var(--blue-primary); color: #fff; font-size: 10px; font-weight: 800; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.calendar-month { display: flex; align-items: center; gap: 4px; color: #203650; font-size: 10px; }
.calendar-month strong { margin-right: 2px; font-size: 11px; }
.calendar-month button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #6f8195; font-size: 16px; line-height: 1; }
.calendar-month button:hover { background: #f0f5fa; }
.calendar-views { display: flex; align-items: center; gap: 2px; }
.calendar-views button { border: 0; border-radius: 5px; padding: 4px 5px; background: transparent; color: #7a8b9e; font-size: 8px; font-weight: 700; }
.calendar-views button.is-selected { background: var(--blue-tint); color: var(--blue-primary); }
.calendar-days { gap: 2px; }
.calendar-days span { padding-bottom: 4px; font-size: 8px; }
.calendar-days b { position: relative; height: 22px; font-size: 9px; }
.calendar-days .has-event::after { content: ""; position: absolute; width: 3px; height: 3px; bottom: 2px; border-radius: 50%; background: var(--blue-primary); }
.calendar-days .deadline-day::after { background: var(--red-primary); }
.calendar-days .event-day { background: var(--blue-primary); color: #fff; }
.calendar-days .event-day::after { background: #fff; }
.calendar-days .deadline-day { background: var(--orange-tint); color: #bf6d23; }
.calendar-events { display: grid; gap: 7px; margin-top: 11px; padding-top: 10px; }
.calendar-events p { display: grid; grid-template-columns: 7px 62px minmax(0, 1fr); gap: 5px; align-items: center; color: #607289; font-size: 8px; }
.calendar-events span { color: #74869a; font-size: 8px; }
.calendar-events strong { color: #354b66; font-size: 9px; line-height: 1.15; }
.calendar-events .dot { width: 6px; height: 6px; }

.trend-panel, .latest-panel { min-height: 260px; }
.trend-panel .trend-chart { height: 164px; }
.trend-panel .trend-chart svg { height: 144px; }
.latest-panel .table-row { padding: 9px 0; font-size: 10px; }
.latest-panel .table-row strong { font-size: 11px; }

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    grid-template-areas:
      "attention tasks"
      "calendar distribution"
      "trend latest";
  }
}

@media (max-width: 930px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar { padding: 0 22px; }
  main { padding: 22px; }
  .hero-card { margin: -22px -22px 16px; padding: 22px; }
  .dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "attention" "tasks" "calendar" "distribution" "trend" "latest"; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .topbar { padding: 0 15px; }
  main { padding: 16px; }
  .hero-card { min-height: 202px; margin: -16px -16px 14px; padding: 24px 16px; background-image: linear-gradient(90deg, rgba(245,247,250,.97) 0%, rgba(245,247,250,.82) 52%, rgba(245,247,250,.10) 100%), url("assets/berdychiv-monastery.jpg"); background-position: 62% center; }
  .hero-copy { max-width: 265px; }
  .hero-copy h1 { font-size: 27px; }
  .hero-caption { display: none; }
  .kpi-grid { gap: 10px; }
  .kpi-card { min-height: 108px; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; padding: 14px; }
  .kpi-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
  .kpi-card strong { font-size: 24px; }
  .kpi-card p { font-size: 10px; }
  .kpi-card small, .kpi-chevron { display: none; }
  .attention-row { grid-template-columns: 34px minmax(0, 1fr) 10px; gap: 8px; }
  .attention-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
  .attention-meta { display: none; }
  .task-line { grid-template-columns: 18px minmax(0, 1fr); }
  .task-meta { display: none; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
}

/* Single icon language: 1.8px rounded outlines aligned to each component grid. */
.nav-icon,
.icon-button svg,
.kpi-icon svg,
.attention-icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-icon { width: 18px; height: 18px; flex: none; color: #7d8c9c; }
.nav-item.is-active .nav-icon { color: #fff; }
.icon-button svg { width: 18px; height: 18px; }
.kpi-icon svg { width: 24px; height: 24px; }
.attention-icon svg { width: 18px; height: 18px; }

.attention-row { min-height: 66px; }
.attention-row:first-child { padding-top: 9px; }
.attention-row:last-child { padding-bottom: 9px; }
.attention-main strong { font-size: 12px; }
.attention-main small { font-size: 10px; }
.deadline { font-size: 10px; }
.task-line { min-height: 59px; }
.task-copy strong { font-size: 11px; }
.task-copy small,
.task-meta small { font-size: 10px; }
.priority { font-size: 9px; }
.calendar-month,
.calendar-month strong { font-size: 12px; }
.calendar-views button { font-size: 9px; }
.calendar-days span { font-size: 9px; }
.calendar-days b { font-size: 10px; }
.calendar-events span,
.calendar-events strong { font-size: 9px; }

/* Reference-scale type, brand treatment, and small-control alignment. */
body { font-size: 15px; }
.sidebar { padding: 16px 12px 18px; }
.brand { min-height: 62px; gap: 10px; padding: 0 12px 16px; }
.brand-mark { display: none; }
.brand-logo { width: 44px; height: 44px; flex: none; object-fit: contain; }
.brand strong { font-size: 15px; line-height: 1.15; }
.brand small { margin-top: 3px; font-size: 11px; line-height: 1.2; }
.nav-item { height: 44px; padding: 0 13px; font-size: 14px; font-weight: 650; }
.sidebar-foot { padding: 16px 12px 2px; font-size: 12px; }
.nav-divider { margin: 14px 8px; }

.global-search { align-items: center; min-height: 40px; padding: 0 12px; }
.search-icon { width: 17px; height: 17px; flex: none; color: #74879a; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.global-search input { font-size: 13px; line-height: 1; }
.global-search kbd { font-size: 10px; }

.hero-card { min-height: 160px; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; inset: auto 0 0; z-index: 0; height: 34px; background: linear-gradient(180deg, rgba(245,247,250,0), var(--bg)); pointer-events: none; }
.hero-copy, .hero-caption { z-index: 1; }
.hero-date { font-size: 13px; }
.hero-copy h1 { font-size: 34px; }
.hero-copy p:not(.eyebrow) { font-size: 15px; }

.kpi-card strong { font-size: 30px; }
.kpi-card p { font-size: 13px; }
.kpi-card small { font-size: 11px; }
.kpi-trend { font-size: 11px; }
.section-heading h2 { font-size: 19px; }
.text-button { font-size: 12px; }
.heading-count { min-width: 19px; height: 19px; font-size: 11px; }

.attention-main strong { font-size: 13px; }
.attention-main small { font-size: 11px; }
.status-chip { font-size: 10px; }
.deadline { font-size: 11px; }
.task-copy strong { font-size: 12px; }
.task-copy small, .task-meta small { font-size: 11px; }
.priority { font-size: 10px; }
.distribution-panel .legend { font-size: 11px; }
.calendar-month, .calendar-month strong { font-size: 13px; }
.calendar-views button { font-size: 10px; }
.calendar-days span { font-size: 10px; }
.calendar-days b { font-size: 11px; }
.calendar-events span, .calendar-events strong { font-size: 10px; }
.latest-panel .table-row { font-size: 11px; }
.latest-panel .table-row strong { font-size: 12px; }

.status-control { margin-bottom: 16px; }

@media (max-width: 620px) {
  .brand-logo { width: 34px; height: 34px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 10px; }
  .nav-item { height: 38px; font-size: 12px; }
  .hero-card { min-height: 216px; }
  .hero-copy h1 { font-size: 29px; }
  .hero-copy p:not(.eyebrow) { font-size: 13px; }
  .section-heading h2 { font-size: 18px; }
}

@media (max-width: 930px) {
  .primary-nav { padding-bottom: 4px; scrollbar-width: none; -ms-overflow-style: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .detail-side { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
