:root {
  --nho-blue: #004F9F;
  --nho-dark: #002D62;
  --nho-light: #E8F4FF;
  --nho-gray: #F0F4F8;
  --border: #d7e0ec;
  --text: #1a1f2b;
  --muted: #5b6676;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: #f4f7fb;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  background: var(--nho-dark);
  color: white;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--nho-dark);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-header p {
  font-size: 12px;
  color: #a8c8f0;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav .loading {
  padding: 16px 20px;
  color: #a8c8f0;
  font-size: 13px;
  font-style: italic;
}

.month-group {
  margin-bottom: 8px;
}

.month-label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 20px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8c8f0;
  font-weight: 600;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.month-label:hover {
  color: #cfe2fb;
}

.month-label .chevron {
  font-size: 9px;
  line-height: 1;
  transition: transform 0.15s;
  transform: rotate(90deg); /* expanded: pointing down */
}

.month-group.collapsed .month-label .chevron {
  transform: rotate(0deg); /* collapsed: pointing right */
}

.month-label .month-count {
  margin-left: auto;
  font-size: 10px;
  color: #7fa8d8;
  font-weight: 500;
}

.month-group.collapsed .month-days {
  display: none;
}

.report-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  color: white;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.report-link:hover {
  background: rgba(255,255,255,0.06);
}

.report-link.active {
  background: rgba(255,255,255,0.1);
  border-left-color: #6aa9f0;
  font-weight: 500;
}

.report-link .weekday {
  font-size: 11px;
  color: #a8c8f0;
  margin-left: 8px;
}

.report-link.weekly {
  background: rgba(255,255,255,0.03);
}

.report-link.weekly::before {
  content: "📋";
  margin-right: 6px;
  font-size: 11px;
}

.empty-archive {
  padding: 16px 20px;
  color: #a8c8f0;
  font-size: 13px;
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  color: #a8c8f0;
}

/* ── Report area ───────────────────────────────────── */
.report-area {
  display: flex;
  flex-direction: column;
  background: #f4f7fb;
  overflow: hidden;
}

.report-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: white;
  border-bottom: 1px solid var(--border);
}

.report-header-bar h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--nho-dark);
}

.report-actions a {
  color: var(--nho-blue);
  text-decoration: none;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
}

.report-actions a:hover {
  background: var(--nho-light);
}

#report-frame {
  flex: 1;
  border: none;
  background: white;
}

.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.hidden { display: none; }

/* ── Responsive (basic) ────────────────────────────── */
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { max-height: 45vh; border-right: none;
             border-bottom: 1px solid rgba(255,255,255,0.12); }
  .sidebar-header { padding: 14px 16px 12px; }
  .sidebar-header h1 { font-size: 16px; }
  .sidebar-nav { padding: 6px 0; }
  .report-link { padding: 9px 16px; }
  .month-label { padding: 8px 16px 4px; }
  .report-header-bar { padding: 10px 14px; }
  .report-header-bar h2 { font-size: 14px; }
  .sidebar-footer { display: none; }
}

/* E1: utgave-veksler (NO / EU) — ligger i den faste sidebar-headeren */
.edition-toggle {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.edition-btn {
  flex: 1;
  padding: 5px 10px;
  font-size: 12px;
  color: white;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.edition-btn:hover {
  background: rgba(255,255,255,0.15);
}

.edition-btn.active {
  background: rgba(255,255,255,0.22);
  border-color: #6aa9f0;
  font-weight: 600;
}
