/* Stiler for Oljefondets Porteføljeanalyse per 30. juni 2026 */
:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;
  --brand-blue: #0369a1;
  --brand-dark: #0f172a;
  --brand-accent: #0284c7;
  --brand-light: #e0f2fe;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header & Banner */
.header {
  background: linear-gradient(135deg, #0b192c 0%, #1e3e62 100%);
  color: #ffffff;
  padding: 2.2rem 2rem 1.8rem;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid #00000020;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
}

.header-tag {
  display: inline-block;
  background-color: rgba(2, 132, 199, 0.25);
  color: #7dd3fc;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(125, 211, 252, 0.3);
}

.header-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 900px;
  margin-bottom: 1.25rem;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: #94a3b8;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-item strong {
  color: #f1f5f9;
}

/* Main Navigation (Tabs) */
.nav-tabs {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--brand-blue);
  background-color: var(--bg-subtle);
}

.tab-btn.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Tab Content Visibility */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  padding: 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* Section Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Layout Grids */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Text & Analysis Styling */
.prose {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.7;
}

.prose p {
  margin-bottom: 1.1rem;
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--brand-dark);
}

.prose ul, .prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

/* Info Box / Alert */
.info-box {
  background-color: var(--brand-light);
  border-left: 4px solid var(--brand-blue);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.93rem;
  color: #0c4a6e;
}

.info-box strong {
  color: #0369a1;
}

.warning-box {
  background-color: #fffbeb;
  border-left: 4px solid var(--warning);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.93rem;
  color: #92400e;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

thead {
  background-color: var(--bg-subtle);
  border-bottom: 2px solid var(--border-color);
}

th {
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th:hover {
  background-color: #e2e8f0;
}

th.sortable::after {
  content: " ↕";
  opacity: 0.4;
  font-size: 0.8rem;
}

th.sort-asc::after {
  content: " ↑";
  opacity: 1;
  color: var(--brand-blue);
}

th.sort-desc::after {
  content: " ↓";
  opacity: 1;
  color: var(--brand-blue);
}

th.no-sort {
  cursor: default;
}
th.no-sort:hover {
  background-color: inherit;
}

td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

tbody tr:hover {
  background-color: #f8fafc;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.font-mono {
  font-family: var(--font-mono);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.badge-blue {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-yellow {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-gray {
  background-color: #f1f5f9;
  color: #475569;
}

/* Filter Controls Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.2rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 200px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-input, .filter-select {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-reset {
  padding: 0.55rem 1.1rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
  height: 38px;
  transition: all 0.15s ease;
}

.btn-reset:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.filter-stats {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-controls {
  display: flex;
  gap: 0.35rem;
}

.page-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.page-btn.active {
  background-color: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-size-select {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 0.85rem;
}

/* Findings & Risks Cards */
.finding-card {
  border-left: 4px solid var(--brand-blue);
  background: #ffffff;
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.finding-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.risk-card {
  border-left: 4px solid #ea580c;
  background: #ffffff;
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.risk-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Chart Canvas Wrapper */
.chart-container {
  position: relative;
  width: 100%;
  height: 380px;
}

.chart-container-tall {
  position: relative;
  width: 100%;
  height: 480px;
}

/* Footer */
.footer {
  background-color: var(--brand-dark);
  color: #94a3b8;
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid #334155;
  font-size: 0.9rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-section {
  flex: 1 1 300px;
}

.footer-title {
  color: #f1f5f9;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.footer-list {
  list-style: none;
}

.footer-list li {
  margin-bottom: 0.35rem;
}
