:root {
  --brand-primary: #0f6e6e;
  --brand-primary-dark: #0b4f4f;
  --bg: #f7fafa;
  --text: #1a2626;
  --border: #d8e4e4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--brand-primary-dark);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-logo {
  height: 32px;
  margin-bottom: 20px;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  opacity: 0.8;
}

.nav-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  opacity: 1;
  background: var(--brand-primary);
  font-weight: 600;
}

.main {
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.range-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-picker select,
.range-picker input,
.range-picker button {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text);
}

.range-picker button {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
  cursor: pointer;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.comparison-table thead th {
  background: var(--brand-primary-dark);
  color: white;
}

.comparison-table .totals-row {
  font-weight: 700;
  background: var(--bg);
}

.stat-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 16px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-primary-dark);
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.site-chart {
  width: 100%;
  max-height: 320px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.breakdown-panel {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  font: inherit;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.6;
}

.tab-button.active {
  opacity: 1;
  border-bottom: 2px solid var(--brand-primary);
  font-weight: 600;
}

.tab-panel[hidden] {
  display: none;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.breakdown-table th,
.breakdown-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.logout-link {
  opacity: 0.65;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--brand-primary-dark);
}

.login-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 32px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.login-logo {
  height: 32px;
  margin-bottom: 16px;
}

.login-card h1 {
  font-size: 1.2rem;
  margin: 0 0 16px;
}

.login-error {
  color: #b3261e;
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.login-form label {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 8px;
}

.login-form input {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.login-form .btn-primary {
  width: 100%;
  margin-top: 16px;
  font: inherit;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--brand-primary);
  color: white;
  cursor: pointer;
}

.login-form .btn-primary:hover {
  background: var(--brand-primary-dark);
}
