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

:root {
  --primary: #1a56db;
  --primary-dark: #1341b0;
  --success: #0e9f6e;
  --danger: #e02424;
  --warning: #ff8c00;
  --pro: #7c3aed;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }

/* Header */
.header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.logo-icon { font-size: 22px; }
.logo-badge { background: var(--primary); color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.header-nav { display: flex; gap: 4px; margin-left: 16px; }
.nav-btn { background: none; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-muted); font-weight: 500; transition: all 0.15s; }
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--primary); color: white; }
.pro-btn { color: var(--pro) !important; }
.header-actions { margin-left: auto; }

/* Main */
.main { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.view { display: none; }
.view.active { display: block; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.view-header h1 { font-size: 24px; font-weight: 700; }

/* Buttons */
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-pro { background: var(--pro); color: white; }
.btn-pro:hover { background: #6d28d9; }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }

/* Summary Cards */
.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.card-value { font-size: 22px; font-weight: 700; }
.card-value.positive { color: var(--success); }
.card-value.negative { color: var(--danger); }

/* Table */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.portfolio-table { width: 100%; border-collapse: collapse; }
.portfolio-table th { background: var(--bg); padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.portfolio-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.portfolio-table tr:last-child td { border-bottom: none; }
.portfolio-table tr:hover td { background: #fafafa; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 40px; }
.depot-badge { font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.depot-fri { background: #dbeafe; color: #1e40af; }
.depot-ask { background: #d1fae5; color: #065f46; }
.depot-pension { background: #fef3c7; color: #92400e; }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 4px; color: var(--text-muted); font-size: 16px; }
.btn-icon:hover { background: var(--bg); color: var(--danger); }

/* Tax View */
.tax-overview { display: flex; flex-direction: column; gap: 24px; }
.tax-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.tax-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.tax-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tax-card { background: var(--bg); border-radius: 6px; padding: 16px; }
.tax-card.highlight { background: #eff6ff; border: 1px solid #bfdbfe; }
.tax-note { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.tax-year-selector { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tax-year-selector select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }

/* Pro Section */
.pro-locked { border: 2px dashed var(--pro); background: #faf5ff !important; }
.pro-tag { background: var(--pro); color: white; font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 500px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-pro { max-width: 420px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.15s; }
.form-group input:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.15); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.input-status { font-size: 12px; margin-top: 4px; min-height: 16px; }
.input-status.ok { color: var(--success); }
.input-status.error { color: var(--danger); }
.input-status.loading { color: var(--text-muted); }

/* Pro Modal */
.pro-price { text-align: center; padding: 16px 0 24px; }
.price-amount { font-size: 42px; font-weight: 800; color: var(--pro); }
.price-period { font-size: 18px; color: var(--text-muted); }
.pro-features { list-style: none; margin-bottom: 24px; }
.pro-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.pro-features li:last-child { border-bottom: none; }
.pro-note { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; text-align: center; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1f2937; color: white; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 300; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 768px) {
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .header-inner { padding: 0 16px; }
  .main { padding: 20px 16px; }
  .portfolio-table { font-size: 13px; }
  .portfolio-table th, .portfolio-table td { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .summary-cards { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

.tax-section-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}

.currency-badge {
  color: var(--text-muted, #888);
  font-size: 0.75rem;
  margin-left: 2px;
}

/* Sprint 2 — Transaktioner & Konti */
.view-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.accounts-section {
  background: var(--card-bg, #1e2a3a);
  border: 1px solid var(--border, #2d3f55);
  border-radius: 8px;
  padding: 16px 20px;
}

.accounts-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.accounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary, #3b82f6);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

.btn-icon-sm {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
  transition: color 0.15s;
}

.btn-icon-sm:hover {
  color: #fff;
}
