@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    /* Rentekutt-identitet (fra rentekutt.no) */
    --green: #459a07;
    --green-dark: #3a8206;
    --green-soft: #459a0714;
    --ink: #08050d;            /* nær-sort tekst */
    --bg: #f8f8f8;             /* off-white */
    --surface: #ffffff;
    --surface-2: #f3f4f2;
    --border: #e7e6e3;
    --text: #08050d;
    --text-muted: #6b6f73;
    --accent: #459a07;
    --accent-soft: #459a0714;
    /* lekne aksenter */
    --purple: #b790e8;
    --orange: #f8a742;
    --pink: #f47984;
    --warn: #b7791f;
    --warn-soft: #f8e9c8;
    --danger: #d1242f;
    --success: #459a07;
    /* runde hjørner */
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 24px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

h1, h2 { font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
a { color: var(--green); text-decoration: none; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.staging-badge {
    font-size: 12px; color: var(--warn); font-weight: 600;
    background: var(--warn-soft); padding: 5px 12px; border-radius: 999px;
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 600; }
.user-role { font-size: 12px; color: var(--text-muted); }
.btn-logout {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 7px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.btn-logout:hover { background: var(--surface-2); }

.app-content { padding: 28px 32px; max-width: 1200px; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 244px; flex-shrink: 0; background: var(--surface);
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    padding: 18px 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 8px 12px 24px; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 12px; background: var(--green);
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.brand-mark.large { width: 56px; height: 56px; font-size: 26px; border-radius: 18px; }
.brand-text { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.nav-group-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-muted); padding: 0 12px 6px; font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px; border-radius: 12px; color: var(--text); font-weight: 600;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--green); color: #fff; }
.nav-icon { width: 18px; text-align: center; }

.sidebar-footer {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-muted); padding: 12px; font-weight: 600;
}
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* ---------- Page ---------- */
.page-title { margin: 0 0 4px; font-size: 26px; }
.page-sub { margin: 0 0 24px; color: var(--text-muted); }

.section { margin-bottom: 34px; }
.section h2 { font-size: 17px; margin: 0 0 14px; }

/* ---------- KPI ---------- */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.kpi-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 20px 22px;
}
.kpi-value { font-size: 28px; font-weight: 700; color: var(--ink); }
.kpi-label { color: var(--text-muted); margin-top: 4px; font-size: 13px; font-weight: 600; }

/* ---------- Priority ---------- */
.priority-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
}
.priority-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 16px 18px;
}
.priority-card.high { border-left: 4px solid var(--pink); }
.priority-count { font-size: 24px; font-weight: 700; color: var(--ink); }
.priority-label { color: var(--text-muted); font-size: 13px; margin-top: 2px; font-weight: 600; }

.pill { font-size: 12px; padding: 3px 12px; border-radius: 999px; font-weight: 700; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }

.btn-sm { background: var(--green); color: #fff; border: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 13px; font-family: inherit; font-weight: 700; }
.btn-sm:hover { background: var(--green-dark); }
.btn-danger { background: var(--surface); border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--surface); }

.inline-input { background: var(--surface); border: 1px solid var(--border); color: var(--text);
    border-radius: 10px; padding: 5px 10px; width: 70px; font-family: inherit; }

/* ---------- Goals ---------- */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.goal-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.goal-bar { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.goal-fill { height: 100%; background: var(--green); border-radius: 999px; }

/* ---------- Funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-step { display: flex; align-items: center; gap: 14px; }
.funnel-bar {
    background: var(--green); color: #fff; padding: 9px 16px; border-radius: 999px;
    min-width: 44px; font-weight: 700; text-align: right; transition: width .3s;
}
.funnel-label { color: var(--text); font-weight: 600; }
.muted { color: var(--text-muted); }

.bullet-list { line-height: 1.9; color: var(--text); padding-left: 20px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 40px 34px; width: 100%; max-width: 390px;
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand h1 { margin: 16px 0 6px; }
.login-brand .brand-mark { margin: 0 auto; }
.login-sub { color: var(--green); font-size: 14px; margin: 0; font-weight: 700; }
.login-tagline { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); font-weight: 600; }
.form-field input {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    color: var(--text); border-radius: 12px; padding: 11px 14px; font-size: 14px; font-family: inherit;
}
.form-field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.btn-primary {
    background: var(--green); color: #fff; border: none; border-radius: 999px;
    padding: 12px 20px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary.full { width: 100%; margin-top: 8px; }
.login-note { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 20px; }
