/* Studioleie – felles stil for katalog, kundesider, firmaadmin og plattformadmin.
   Designretning A «Lys og rolig»: hvit flate, Inter, én grønn aksentfarge, myke kanter. */
:root {
  --bg: #ffffff; --surface: #ffffff; --soft: #f4f3ef; --ink: #1c1f1e; --muted: #5b6461;
  --line: #e4e2dc; --field: #d9d6ce; --grid: #ecebe6;
  --accent: #2f6f62; --accent-ink: #ffffff; --accent-hover: #1f4d44; --accent-soft: #e6f0ed;
  --warn: #a8431d; --warn-soft: #fbeae4; --ok: #23634f; --ok-soft: #e9f4ef;
  --r-sm: 8px; --r: 10px; --r-lg: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 15px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; margin: 8px 0 18px; }
h2 { font-size: 19px; font-weight: 700; margin: 28px 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.inline { display: inline; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* Topp */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: var(--r); background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.mainnav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.mainnav a, .linkbtn { color: var(--muted); text-decoration: none; }
.mainnav a:hover, .linkbtn:hover { color: var(--ink); }
.mainnav a.btn { color: var(--accent-ink); }
.linkbtn { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.mainnav select { width: auto; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; min-height: 70vh; }
.footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; }

/* Knapper */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink);
  border: 1.5px solid var(--accent); border-radius: var(--r); padding: 11px 18px; min-height: 44px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 13px; border-radius: var(--r-sm); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn.danger { background: var(--warn); border-color: var(--warn); }
.btn:focus-visible, .tabs a:focus-visible, .sidenav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Skjema */
form p { margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=month], input[type=search], input[type=url], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: var(--r); background: #fff;
  font: inherit; font-size: 15px; color: var(--ink); }
input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--field); border-radius: var(--r-sm); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
input[type=checkbox] { width: auto; margin-right: 6px; accent-color: var(--accent); }
.helptext { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.errorlist { color: var(--warn); margin: 4px 0; padding-left: 18px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.form-grid .full, .form-grid p:has(textarea), .form-grid p:has(ul) { grid-column: 1 / -1; }
ul#id_studios, .checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
ul#id_studios label { font-weight: 400; display: inline; font-size: 14px; }

/* Kort og layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.tile img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--soft); }
.tile .ph { aspect-ratio: 16/9; background: var(--soft); }
.tile .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tile .body .btn { align-self: flex-start; margin-top: auto; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-hover); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.grey { background: var(--soft); color: var(--muted); }
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: 40px; max-width: 18em; letter-spacing: -.02em; }
.search { display: flex; gap: 10px; flex-wrap: wrap; }
.search input[type=search] { flex: 1 1 260px; }
.search select { width: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--accent); color: var(--ink); }
.stat b { display: block; font-size: 24px; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 13px; }

/* Tabeller */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
th { background: var(--soft); font-size: 12px; font-weight: 600; color: var(--muted); }
tbody tr:hover td { background: #fbfaf8; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: var(--soft); border-top: 1px solid var(--line); }
.prices { margin: 0; padding: 0; list-style: none; }
.prices li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--grid); padding: 5px 0; }
.prices s { color: var(--muted); margin-right: 6px; }

/* Meldinger */
.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: 12px 14px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); }
.msg.error { background: var(--warn-soft); color: var(--warn); }

/* Admin-layout */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
.sidenav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; align-self: start; }
.sidenav a { padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: 14px; }
.sidenav a:hover { background: var(--soft); color: var(--ink); }
.sidenav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.sidenav .label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 16px 12px 4px; }
.sidenav .label:first-child { margin-top: 0; color: var(--ink); font-size: 14px; }
@media (max-width: 760px) { .admin-layout { grid-template-columns: 1fr; gap: 16px; } .sidenav { position: static; flex-direction: row; flex-wrap: wrap; } .sidenav .label { display: none; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters label { font-size: 12px; }
.filters input, .filters select { width: auto; }
.tabs { display: inline-flex; gap: 0; margin-bottom: 14px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink); background: var(--surface); font-size: 14px; border-right: 1px solid var(--line); }
.tabs a:last-child { border-right: 0; }
.tabs a:hover { background: var(--soft); color: var(--ink); }
.tabs a.active { background: var(--ink); color: #fff; }

/* Booking */
.price-box { position: sticky; top: 16px; }
.total-line { display: flex; justify-content: space-between; padding: 5px 0; }
.total-line.big { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.addon { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.addon:last-child { border-bottom: 0; }
.addon .name { font-weight: 600; }

/* Kalender (samme uttrykk som bookingsiden) */
#calendar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.fc { --fc-border-color: var(--grid); --fc-today-bg-color: var(--soft); --fc-now-indicator-color: var(--accent); font-size: 13px; }
.fc .fc-button-primary { background: #fff; border-color: var(--line); color: var(--ink); border-radius: var(--r-sm); box-shadow: none !important; }
.fc .fc-button-primary:hover { background: var(--soft); border-color: var(--line); color: var(--ink); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--ink); border-color: var(--ink); color: #fff; }
.fc .fc-button-group > .fc-button { border-radius: 0; }
.fc .fc-button-group > .fc-button:first-child { border-radius: 8px 0 0 8px; }
.fc .fc-button-group > .fc-button:last-child { border-radius: 0 8px 8px 0; }
.fc .fc-toolbar-title { font-size: 17px; font-weight: 700; }
.fc .fc-col-header-cell-cushion { color: var(--ink); font-weight: 600; text-decoration: none; }
.fc .fc-timegrid-slot-label-cushion { color: var(--muted); font-size: 11px; }
.fc .ev-busy { background: #e3e1db; border-color: #e3e1db; }
.fc .ev-busy .fc-event-main { color: var(--muted); }
.fc .ev-own, .fc .fc-event-mirror { background: var(--accent-soft); border: 2px solid var(--accent); }
.fc .ev-own .fc-event-main, .fc .fc-event-mirror .fc-event-main { color: var(--ink); font-weight: 600; }
.fc .fc-highlight { background: color-mix(in srgb, var(--accent) 18%, transparent); }
@media (max-width: 640px) { .fc .fc-toolbar { flex-wrap: wrap; gap: 8px; } }

/* Utskrift av faktura */
@media print {
  .topbar, .footer, .sidenav, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  .admin-layout { display: block; }
  .card, .table-wrap { border: 0; padding: 0; }
}
