/* ADD DriftNav — Digital theme
   Visual override only. Portal behavior and component structure remain unchanged. */

:root {
  --navy: #102526;
  --navy-2: #173536;
  --blue: #668a2b;
  --blue-2: #7ea43b;
  --red: #d3483f;
  --text: #102526;
  --muted: #657573;
  --bg: #f5f5ef;
  --card: #ffffff;
  --line: #d9ded8;
  --soft: #edf2e5;
  --shadow: 0 18px 55px rgba(16, 37, 38, 0.08);
  --radius: 8px;
  --success: #527725;
  --danger: #b63832;
  --warning: #8a6817;
  --digital-lime: #c9f06a;
  --digital-lime-dark: #91b83f;
  --digital-ink: #102526;
  --digital-paper: #fafaf7;
}

body.season-theme,
body.season-spring,
body.season-summer,
body.season-autumn,
body.season-winter,
body.season-christmas,
body.season-easter,
body.season-new-year {
  --season-accent: #89ad3f;
  --season-secondary: #c9f06a;
  --season-soft: #f2f7e7;
  --season-border: #d6e4b9;
  --season-on-dark: #c9f06a;
}

/* Seasonal palettes must be declared after the shared digital defaults.
   Otherwise the combined selector above hides every seasonal accent. */
body.season-autumn {
  --season-accent: #b85c32;
  --season-secondary: #d99845;
  --season-soft: #fff3e8;
  --season-border: #e6b994;
  --season-on-dark: #f3b568;
  --digital-lime: #e2a24f;
  --digital-lime-dark: #a94f2d;
}

body.season-autumn {
  background:
    radial-gradient(circle at 88% 3%, rgba(226, 162, 79, 0.22), transparent 28rem),
    radial-gradient(circle at 7% 88%, rgba(184, 92, 50, 0.08), transparent 24rem),
    linear-gradient(180deg, #fcfaf6 0%, #f7f1e9 100%);
}

body.season-autumn .topbar::after,
body.season-autumn.has-sidebar .topbar::after {
  background: linear-gradient(90deg, #9f452a 0%, #e2a24f 55%, #c87538 100%);
}

body.season-autumn .seasonal-panel {
  border-color: var(--season-border);
  background: linear-gradient(135deg, #fff8ef 0%, #fbe7d4 100%);
}

body.season-autumn .seasonal-panel-icon {
  color: #f3b568;
  background: #38251e;
  box-shadow: inset 0 0 0 1px rgba(243, 181, 104, 0.22);
}

body.season-autumn .seasonal-panel-detail {
  background: linear-gradient(180deg, #e2a24f, #a94f2d);
}

body.season-autumn .hero {
  border-left-color: var(--season-accent);
  background: linear-gradient(135deg, #102526 0%, #26352f 72%, #4a2d22 100%);
}

body.season-autumn .hero::after {
  border-color: rgba(226, 162, 79, 0.48);
  box-shadow: 0 0 0 52px rgba(184, 92, 50, 0.09);
}

body.season-autumn .hero .eyebrow {
  color: #f3b568;
}

body.season-autumn .topbar nav a:hover,
body.season-autumn.season-theme .topbar nav a:hover {
  color: #42271d;
  background: #f8dfc6;
}

body.season-autumn .dashboard-home .card,
body.season-autumn.dashboard-home .card,
body.season-autumn .action-dashboard {
  border-top-color: rgba(184, 92, 50, 0.42);
}

body {
  color: var(--digital-ink);
  background:
    radial-gradient(circle at 86% 4%, rgba(201, 240, 106, 0.19), transparent 26rem),
    linear-gradient(180deg, #fafaf7 0%, #f4f5ef 100%);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: -0.01em;
}

a { color: #567923; }

.topbar {
  padding: 17px clamp(18px, 4vw, 48px);
  border-color: var(--line);
  background: rgba(250, 250, 247, 0.94);
  box-shadow: 0 7px 26px rgba(16, 37, 38, 0.055);
}

.season-theme .topbar::after { height: 2px; background: var(--digital-lime); }

.brand { gap: 13px; color: var(--digital-ink); }
.brand-icon,
.login-logo,
.logo-big {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 5px;
  box-shadow: none;
}
.season-theme .brand-icon { outline: 0; }
.brand strong { color: var(--digital-ink); font-size: 17px; letter-spacing: -0.025em; }
.brand-copy small { color: #75827f; font-size: 10px; letter-spacing: 0.02em; }

.seasonal-panel,
.weather-widget {
  min-height: 62px;
  border-radius: 7px;
  border-color: #dce5ca;
  background: #f4f8ea;
  box-shadow: none;
}
.seasonal-panel { grid-template-columns: 40px minmax(0, 1fr); padding: 10px 20px 10px 10px; }
.seasonal-panel-icon,
.weather-widget-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--digital-ink);
  color: var(--digital-lime);
  font-size: 19px;
}
.seasonal-panel-copy strong { color: var(--digital-ink); font-size: 14px; }
.seasonal-panel-detail { width: 6px; border: 0; background: var(--digital-lime); }
.weather-widget:hover { border-color: #aaca65; background: #f0f6e1; }
.weather-widget-arrow { color: #668a2b; }

.topbar nav { gap: 4px; }
.topbar nav a {
  color: #5d6d6b;
  border-radius: 4px;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 700;
}
.topbar nav a:hover,
.season-theme .topbar nav a:hover { color: var(--digital-ink); background: #eaf2d8; }
.nav-badge { background: var(--digital-lime); color: var(--digital-ink); box-shadow: none; }

.container { width: min(1180px, calc(100% - 36px)); margin-top: 34px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 46px);
  border: 0;
  border-radius: 8px;
  background: var(--digital-ink);
  box-shadow: 0 20px 60px rgba(16, 37, 38, 0.14);
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -125px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(201, 240, 106, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(201, 240, 106, 0.055);
  pointer-events: none;
}
.season-theme .hero { border: 0; border-left: 5px solid var(--digital-lime); }
.hero h1 { color: #fff; font-weight: 650; letter-spacing: -0.05em; }
.hero p { color: #c2ceca; }
.eyebrow,
.season-theme .eyebrow,
.season-theme .hero .eyebrow {
  color: #789b35;
  font-size: 11px;
  letter-spacing: 0.18em;
}
.season-theme .hero .eyebrow { color: var(--digital-lime); }

.stats div,
.card,
.login-card,
.admin-action,
.doc-card,
.event-card,
.action-dashboard,
.user-management-panel {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}
.card,
.login-card,
.admin-action,
.doc-card,
.event-card { padding: 25px; }
.stats strong { color: var(--digital-ink); font-weight: 650; }
.stats span,
.muted,
.card p,
.login-card p,
.doc-card p,
.event-card p { color: var(--muted); }

.login-card {
  max-width: 540px;
  margin: clamp(62px, 9vh, 110px) auto;
  padding: clamp(30px, 5vw, 48px);
  text-align: left;
  border-top: 5px solid var(--digital-lime);
}
.login-card::before {
  content: "15 ÅR MED EIENDOM");
  display: inline-block;
  margin-bottom: 22px;
  color: #77953e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
}
.login-card .eyebrow { margin-bottom: 12px; }
.login-card h1,
.card h1,
.card h2,
.doc-card h3,
.event-card h3,
.section-head h2 { color: var(--digital-ink); letter-spacing: -0.035em; }
.login-card h1 { margin-bottom: 13px; font-size: clamp(35px, 5vw, 48px); }
.auth-links { justify-content: flex-start; }
.auth-links a { color: #587826; }

input,
select,
textarea {
  border-color: #cfd7d2;
  border-radius: 5px;
  background: #fff;
  color: var(--digital-ink);
}
input:hover,
select:hover,
textarea:hover { border-color: #aab8b1; }
input:focus,
select:focus,
textarea:focus {
  border-color: #7da33a;
  box-shadow: 0 0 0 4px rgba(201, 240, 106, 0.27);
}
.form label,
.check-row,
.chat-compose label { color: var(--digital-ink); font-weight: 700; }

button,
.button {
  min-height: 44px;
  border-radius: 4px;
  background: var(--digital-lime);
  color: var(--digital-ink);
  font-weight: 800;
  box-shadow: none;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover,
.button:hover { background: #bce356; transform: translateY(-1px); box-shadow: 0 9px 24px rgba(102, 138, 43, .15); }
.button.light { background: #fff; color: var(--digital-ink); border-color: #cbd5cf; }
.button.light:hover { background: #f3f7ec; border-color: #aabe83; }
.button-danger,
.danger-link-button,
.inline-danger-button { background: #fff1f0; color: var(--danger); border-color: #e8b9b5; }
.button-danger:hover,
.danger-link-button:hover { background: #fde3e0; color: #952c27; }

.status,
.tag,
.activity-status,
.key-status,
.company-status,
.collaborator-status {
  border-radius: 3px;
  border-color: #d2e2b4;
  background: #f1f7e5;
  color: #587526;
}

.action-item,
.document-tile,
.file-tile,
.folder-row,
.company-card,
.collaborator-card,
.lease-card,
.meter-card,
.building-photo-card,
.document-template-card {
  border-radius: 6px;
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}
.action-item { border-left: 4px solid #98be49; background: #fbfcf8; }
.action-item-main > span { border-radius: 3px; background: #eff5e2; color: #607f2a; }
.action-item-main > strong { color: var(--digital-ink); }
.action-item:hover,
.admin-action:hover,
.doc-card:hover,
.event-card:hover { border-color: #b8cc92; box-shadow: 0 12px 32px rgba(16, 37, 38, .09); }

.table-wrap { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
table { background: #fff; }
th { color: #687874; background: #f2f4ee; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
th, td { border-color: #e2e6e0; }
tbody tr:hover td { background: #f7f9f2; }

.footer { border-color: var(--line); color: var(--muted); }
.footer-main span:first-child { color: var(--digital-ink); }
.footer-owner {
  border: 0;
  border-left: 3px solid var(--digital-lime);
  border-radius: 0;
  background: transparent;
  color: #687673;
}

@media (min-width: 901px) {
  .has-sidebar .topbar {
    width: 276px;
    padding: 24px 16px;
    border: 0;
    border-right: 1px solid #294243;
    background: var(--digital-ink);
    box-shadow: 10px 0 32px rgba(16, 37, 38, .08);
  }
  .season-theme.has-sidebar .topbar::after { width: 3px; background: var(--digital-lime); }
  .has-sidebar .brand { border-color: #2d4647; }
  .has-sidebar .brand strong { color: #fff; }
  .has-sidebar .brand-copy small { color: #9eaeaa; }
  .has-sidebar .brand-icon { background: #f8f9f4; }
  .has-sidebar .seasonal-panel,
  .has-sidebar .weather-widget { border-color: #3b5252; background: #173031; color: #fff; }
  .has-sidebar .seasonal-panel-copy strong,
  .has-sidebar .weather-widget-copy strong { color: #fff; }
  .has-sidebar .seasonal-panel-copy small,
  .has-sidebar .weather-widget-copy > span,
  .has-sidebar .weather-widget-copy small { color: #aebbb8; }
  .has-sidebar .topbar nav { scrollbar-color: #4b6462 transparent; }
  .has-sidebar .topbar nav a { color: #bdc9c6; border-radius: 4px; padding: 11px 12px; }
  .has-sidebar .topbar nav a:hover,
  .season-theme.has-sidebar .topbar nav a:hover { color: var(--digital-ink); background: var(--digital-lime); }
  .has-sidebar .container { margin: 34px 34px 88px 310px; }
  .has-sidebar .footer { margin: 0 34px 30px 310px; }
}

@media (max-width: 900px) {
  .has-sidebar .topbar {
    position: sticky;
    z-index: 230;
    inset: 0 auto auto 0;
    width: 100%;
    min-height: 70px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    overflow: visible;
    border: 0;
    border-bottom: 1px solid #dbe4df;
    background: rgba(255,255,255,.97);
    box-shadow: 0 8px 24px rgba(16,37,38,.08);
  }
  .has-sidebar .brand { min-width: 0; padding: 0; border: 0; }
  .has-sidebar .brand-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 11px; }
  .has-sidebar .brand strong { color: var(--digital-ink); font-size: 17px; }
  .has-sidebar .brand-copy small { color: #71807d; font-size: 10px; }
  .has-sidebar .topbar > .seasonal-panel,
  .has-sidebar .topbar > .weather-widget { display: none; }
  .mobile-menu-toggle {
    position: relative;
    z-index: 260;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 86px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #cad7d2;
    border-radius: 8px;
    background: #fff;
    color: var(--digital-ink);
    font: inherit;
    font-weight: 900;
  }
  .mobile-menu-icon { display: grid; gap: 4px; width: 19px; }
  .mobile-menu-icon i { display: block; width: 19px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .mobile-nav-open .mobile-menu-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mobile-nav-open .mobile-menu-icon i:nth-child(2) { opacity: 0; }
  .mobile-nav-open .mobile-menu-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mobile-nav-open .mobile-menu-label { font-size: 0; }
  .mobile-nav-open .mobile-menu-label::after { content: "Lukk"; font-size: 14px; }
  .has-sidebar .topbar nav {
    position: fixed;
    z-index: 240;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(88vw, 370px);
    height: 100dvh;
    display: grid;
    align-content: start;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: calc(82px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) 16px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    box-shadow: -18px 0 50px rgba(16,37,38,.22);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .24s ease, visibility .24s ease;
  }
  .mobile-nav-open .topbar nav { transform: translateX(0); visibility: visible; }
  .has-sidebar .topbar nav a,
  .has-sidebar .topbar nav .nav-mobile-only {
    display: block !important;
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid #e0e7e3;
    border-radius: 6px;
    background: #f8faf7;
    color: var(--digital-ink);
    line-height: 1.25;
  }
  .has-sidebar .topbar nav a:active { background: var(--digital-lime); }
  .mobile-nav-backdrop {
    position: fixed;
    z-index: 220;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(7,24,25,.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
  }
  .mobile-nav-open .mobile-nav-backdrop { opacity: 1; visibility: visible; }
  body.mobile-nav-open { overflow: hidden; }
  .hero { border-left-width: 4px; }
  .container { width: min(100% - 20px, 1180px); margin-top: 14px; }
  .footer { width: calc(100% - 24px); }
}

@media (min-width: 901px) {
  .mobile-menu-toggle,
  .mobile-nav-backdrop { display: none; }
}

@media (max-width: 560px) {
  .brand-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .no-sidebar .seasonal-panel { width: auto; min-width: 146px; }
  .seasonal-panel-copy small { display: none; }
  .login-card { margin: 34px auto; padding: 28px 22px; }
  .hero { padding: 20px 16px; border-radius: 6px; }
  .hero h1 { font-size: clamp(28px, 9vw, 34px); }
  .hero p { line-height: 1.45; }
  .stats div,
  .card,
  .login-card,
  .admin-action,
  .doc-card,
  .event-card { padding: 16px; }
  .form-two,
  .form-grid { grid-template-columns: 1fr !important; }
  input,
  select,
  textarea,
  button,
  .button { max-width: 100%; }
}

/* Autumn: stronger, legible accents in the desktop sidebar. */
body.season-autumn .seasonal-panel-copy small {
  display: none !important;
}

@media (min-width: 981px) {
  body.season-autumn.has-sidebar .topbar {
    background:
      radial-gradient(circle at 18% 96%, rgba(226, 162, 79, .14), transparent 31%),
      linear-gradient(180deg, #102526 0%, #162a28 58%, #2f241f 100%);
  }

  body.season-autumn.has-sidebar .seasonal-panel {
    border-color: #e4a05b;
    background: linear-gradient(135deg, #6f3527 0%, #9f4c2c 55%, #c56b35 100%);
    box-shadow:
      inset 0 0 0 1px rgba(255, 232, 199, .16),
      0 8px 24px rgba(72, 35, 25, .28);
  }

  body.season-autumn.has-sidebar .seasonal-panel-icon {
    color: #ffd18a;
    background: #2e211c;
    box-shadow: inset 0 0 0 1px rgba(255, 209, 138, .3);
  }

  body.season-autumn.has-sidebar .seasonal-panel-copy strong {
    color: #fffaf3;
    font-size: 15px;
    letter-spacing: .01em;
    text-shadow: 0 1px 1px rgba(46, 27, 20, .35);
  }

  body.season-autumn.has-sidebar .seasonal-panel-detail {
    width: 8px;
    border-left: 1px solid rgba(255, 244, 225, .45);
    background: linear-gradient(180deg, #ffc36d, #df7138);
  }

  body.season-autumn.has-sidebar .topbar nav a:hover,
  body.season-autumn.has-sidebar .topbar nav a[aria-current="page"] {
    color: #2b211c;
    background: linear-gradient(90deg, #f5c06c, #df8b47);
  }
}

.invoice-basis-form { display: grid; gap: 18px; }
.invoice-basis-form .card { margin: 0; }
.invoice-basis-form table input,
.invoice-basis-form table select { min-width: 92px; margin: 0; }
.invoice-basis-form table td:first-child input { min-width: 260px; }
.invoice-summary { margin: 24px 0 0 auto; width: min(100%, 430px); display: grid; gap: 9px; }
.invoice-summary span { display: flex; justify-content: space-between; border-bottom: 1px solid #dce5df; padding: 8px 0; }
.invoice-summary span:last-child { font-size: 1.15rem; border: 0; }
.invoice-document { background: #fff; color: #172425; border: 1px solid #d9e2dc; border-radius: 8px; padding: 42px; box-shadow: 0 14px 40px rgba(16,37,38,.08); font-variant-numeric: tabular-nums; }
.invoice-document-head { display: flex; justify-content: space-between; gap: 36px; border-bottom: 2px solid #172425; padding-bottom: 22px; }
.invoice-document-head h1 { margin: 4px 0 7px; font-size: 2.5rem; }
.invoice-document-head>div:first-child>p:last-child { max-width: 470px; color: #536562; }
.invoice-kicker { margin: 0; color: #5f6f6c; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.invoice-document-number { min-width: 235px; display: grid; grid-template-columns: auto auto; gap: 8px 16px; align-content: start; }
.invoice-document-number span,.invoice-parties span,.invoice-meta span,.invoice-notes>span { color: #687875; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-document-number strong { text-align: right; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0; }
.invoice-parties>div { border: 1px solid #d5ddd8; border-radius: 4px; padding: 18px; display: grid; gap: 6px; }
.invoice-parties strong { font-size: 1.15rem; }
.invoice-parties small { color: #536562; line-height: 1.5; }
.invoice-meta { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 12px; margin-bottom: 28px; }
.invoice-meta>div { display: grid; gap: 5px; }
.invoice-document-lines { width: 100%; border-collapse: collapse; }
.invoice-document-lines th { background: #172425; color: #fff; white-space: nowrap; }
.invoice-document-lines th,.invoice-document-lines td { padding: 12px 10px; border-bottom: 1px solid #dce5df; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-document-total { margin: 24px 0 0 auto; width: min(100%,410px); }
.invoice-document-total div { display: flex; justify-content: space-between; padding: 8px 0; }
.invoice-document-total .grand { margin-top: 8px; padding: 14px; border-top: 2px solid #172425; border-bottom: 2px solid #172425; background: #f2f4f1; font-size: 1.15rem; }
.invoice-notes { margin-top: 28px; border-top: 1px solid #dce5df; padding-top: 18px; }
.invoice-document-footer { margin-top: 36px; padding-top: 14px; border-top: 1px solid #dce5df; display: flex; justify-content: space-between; gap: 20px; color: #687875; font-size: .8rem; }
.status-draft { background:#eef1ef; }.status-ready { background:#fff2bf; }.status-approved { background:#dff5d6; }.status-invoiced { background:#dcecf8; }.status-cancelled { background:#f7dddd; }

@media (max-width: 760px) {
  .invoice-document { padding: 22px; }
  .invoice-document-head,.invoice-document-footer { flex-direction: column; }
  .invoice-parties,.invoice-meta { grid-template-columns: 1fr; }
  .invoice-document-number { min-width: 0; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  .no-print,.topbar,.footer { display:none!important; }
  html,body { margin:0!important; padding:0!important; background:#fff!important; }
  body,.container { background:#fff!important; margin:0!important; width:100%!important; max-width:none!important; }
  .invoice-document { border:0; box-shadow:none; border-radius:0; padding:0; font-size:10.5pt; }
  .invoice-document-head { gap:10mm; padding-bottom:4mm; }
  .invoice-document-head h1 { font-size:27pt; margin:1mm 0; }
  .invoice-document-number { min-width:49mm; gap:1.5mm 4mm; }
  .invoice-parties { gap:5mm; margin:5mm 0; }
  .invoice-parties>div { padding:4mm; }
  .invoice-meta { gap:3mm; margin-bottom:5mm; }
  .invoice-document-lines th,.invoice-document-lines td { padding:2.4mm 2mm; }
  .invoice-document-lines th { background:#172425!important; color:#fff!important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .invoice-document-total { margin-top:4mm; }
  .invoice-document-total div { padding:1.5mm 0; }
  .invoice-document-total .grand { margin-top:1.5mm; padding:3mm; background:#f2f4f1!important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .invoice-notes { margin-top:5mm; padding-top:3mm; }
  .invoice-document-footer { margin-top:6mm; padding-top:3mm; }
  .invoice-document-head,.invoice-parties,.invoice-meta,.invoice-document-total,.invoice-notes,.invoice-document-footer,tr { break-inside:avoid; page-break-inside:avoid; }
}
