@import url("vendor/flaticon-uicons/regular/rounded.css");

/* Flaticon UIcons (Regular Rounded, fi-rr): se public/vendor/flaticon-uicons/LICENSE */

[data-theme="dark"] {
  --bg-body: #111318;
  --bg-topbar: #0d1117;
  --bg-surface: #1a1f29;
  --bg-input: #10151c;
  --bg-input-hover: #1a2230;
  --bg-dropdown: #1a1f29;
  --bg-dropdown-option-hover: rgba(127, 179, 240, 0.12);
  --bg-dropdown-option-active: rgba(127, 179, 240, 0.18);
  --text-primary: #e9edf5;
  --text-secondary: #9faec5;
  --text-muted: #9faec5;
  --text-nav: #d9e6f8;
  --chart-surface: #10151c;
  --chart-surface-alt: #1a1f29;
  --chart-bar-primary: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
  --chart-bar-report: linear-gradient(180deg, #5fa8f0, #2f7a55);
  --chart-hour-fill: rgba(34, 211, 238, 0.15);
  --chart-hour-fill-hover: rgba(34, 211, 238, 0.3);
  --kpi-surface: linear-gradient(165deg, #1a2332 0%, #121a26 100%);
  --card-chart-surface: linear-gradient(165deg, #1c2431 0%, #141a24 100%);
  --donut-center-bg: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  --border: #253347;
  --border-input: #2f3f54;
  --border-strong: #31445d;
  --accent: #1f5fa8;
  --accent-hover: #2c74c5;
  --accent-soft: #7cb3f0;
  --danger: #8a3c44;
  --danger-hover: #a34852;
  --shadow-dropdown: 0 12px 28px rgba(0, 0, 0, 0.45);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239faec5' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  --focus-border: #3d5570;
  --focus-ring: 0 0 0 1px rgba(124, 179, 240, 0.35);
  --theme-color-meta: #0d1117;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-body: #f0f4f8;
  --bg-topbar: #ffffff;
  --bg-surface: #ffffff;
  --bg-input: #ffffff;
  --bg-input-hover: #f5f8fc;
  --bg-dropdown: #ffffff;
  --bg-dropdown-option-hover: rgba(31, 95, 168, 0.08);
  --bg-dropdown-option-active: rgba(31, 95, 168, 0.14);
  --text-primary: #1a2332;
  --text-secondary: #4a5d73;
  --text-muted: #5c6f85;
  --text-nav: #0f1a2e;
  --chart-surface: #eef2f7;
  --chart-surface-alt: #ffffff;
  --chart-bar-primary: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  --chart-bar-report: linear-gradient(180deg, #60a5fa, #2563eb);
  --chart-hour-fill: rgba(37, 99, 235, 0.2);
  --chart-hour-fill-hover: rgba(37, 99, 235, 0.38);
  --kpi-surface: linear-gradient(165deg, #ffffff 0%, #f1f5f9 100%);
  --card-chart-surface: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  --donut-center-bg: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  --border: #d4dde8;
  --border-input: #c5d0de;
  --border-strong: #b8c5d6;
  --accent: #1f5fa8;
  --accent-hover: #174d8a;
  --accent-soft: #2563b8;
  --danger: #b42334;
  --danger-hover: #9a1f2d;
  --shadow-dropdown: 0 12px 28px rgba(26, 35, 50, 0.12);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c6f85' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  --focus-border: #1f5fa8;
  --focus-ring: 0 0 0 1px rgba(31, 95, 168, 0.28);
  --theme-color-meta: #ffffff;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  color-scheme: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
  min-width: 0;
}

.brand-logo {
  height: clamp(23px, 5.4vw, 41px);
  width: auto;
  max-width: min(162px, 28vw);
  object-fit: contain;
  object-position: left center;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: visible;
}

.brand-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  min-height: 23px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #9faec5;
  background: #1a1f29;
  border: 1px dashed #31445d;
  border-radius: 12px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .brand-logo {
    height: clamp(32px, 5vw, 54px);
    max-width: min(207px, 22vw);
  }

  .brand-logo-placeholder {
    min-width: 32px;
    min-height: 32px;
  }
}

@media (min-width: 1200px) {
  .brand-logo {
    height: clamp(43px, 4vw, 68px);
    max-width: min(270px, 19vw);
  }

  .brand-logo-placeholder {
    min-width: 43px;
    min-height: 43px;
  }
}

@media (min-width: 1600px) {
  .brand-logo {
    height: clamp(50px, 3.6vw, 79px);
    max-width: min(324px, 18vw);
  }

  .brand-logo-placeholder {
    min-width: 50px;
    min-height: 50px;
  }
}

.brand-name {
  font-weight: 700;
}

/* Wordmark already inside the SVG; avoid duplicate title next to the image */
.brand:has(> img.brand-logo) .brand-name {
  display: none;
}

.menu {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo--theme-light {
  display: none;
}

[data-theme="light"] .brand-logo--theme-dark {
  display: none;
}

[data-theme="light"] .brand-logo--theme-light {
  display: block;
}

.topbar-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-nav);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.topbar-menu-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-input-hover);
}

.topbar-menu-toggle:focus-visible {
  outline: 2px solid #7cb3f0;
  outline-offset: 2px;
}

.topbar-menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--text-nav);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.menu a i[class^="fi-rr-"],
.menu a i[class*=" fi-rr-"] {
  font-size: 1.05em;
  opacity: 0.92;
}

.menu a:hover {
  color: var(--accent-soft);
}

.topbar-nav-dropdown {
  position: relative;
}

.topbar-nav-dropdown-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-nav);
  font-weight: 500;
  user-select: none;
}

.topbar-nav-dropdown-summary::-webkit-details-marker {
  display: none;
}

.topbar-nav-dropdown-summary::marker {
  content: "";
}

.topbar-nav-dropdown-summary:hover,
.topbar-nav-dropdown[open] .topbar-nav-dropdown-summary {
  color: var(--accent-soft);
}

.topbar-nav-dropdown--current .topbar-nav-dropdown-summary {
  color: var(--accent-soft);
}

.topbar-nav-dropdown-summary i[class^="fi-rr-"],
.topbar-nav-dropdown-summary i[class*=" fi-rr-"] {
  font-size: 1.05em;
  opacity: 0.92;
}

.topbar-nav-dropdown-chevron {
  font-size: 0.85em;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.topbar-nav-dropdown[open] .topbar-nav-dropdown-chevron {
  transform: rotate(-180deg);
}

.topbar-nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-dropdown);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-nav);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.topbar-nav-dropdown-link i[class^="fi-rr-"],
.topbar-nav-dropdown-link i[class*=" fi-rr-"] {
  font-size: 1.05em;
  opacity: 0.92;
}

.topbar-nav-dropdown-link:hover {
  background: var(--bg-dropdown-option-hover);
  color: var(--accent-soft);
}

.topbar-nav-dropdown-link--current {
  background: var(--bg-dropdown-option-active);
  color: var(--accent-soft);
}

.org-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  max-width: 18rem;
}

.org-switch-wrap > i[class^="fi-rr-"],
.org-switch-wrap > i[class*=" fi-rr-"] {
  font-size: 15px;
  color: #9faec5;
  flex-shrink: 0;
}

.org-switch {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.topbar .menu .org-switch-select {
  width: auto;
  min-width: 9rem;
  max-width: 16rem;
  margin: 0;
  padding: 7px 32px 7px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.25;
  color: var(--text-nav);
  background-color: var(--bg-input);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.topbar .menu .org-switch-select:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-input-hover);
}

.topbar .menu .org-switch-select:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.topbar .menu .org-switch-select option {
  color: var(--text-primary);
  background-color: var(--bg-dropdown);
}

.topbar .menu .org-switch-select option:checked {
  background-color: var(--bg-dropdown-option-active);
  color: var(--text-primary);
}

.topbar .menu .org-current-name {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 16rem;
  padding: 7px 12px;
  font-size: 14px;
  line-height: 1.25;
  color: var(--text-nav);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .topbar-inner {
    position: relative;
    flex-wrap: wrap;
    padding: 10px 14px;
    row-gap: 10px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
  }

  .topbar.is-menu-open .menu {
    display: flex;
  }

  .menu a {
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 15px;
  }

  .menu a:hover {
    background: var(--bg-dropdown-option-hover);
    color: var(--accent-soft);
  }

  .org-switch-wrap {
    max-width: none;
    width: 100%;
    gap: 0.5em;
  }

  .org-switch {
    width: 100%;
  }

  .topbar .menu .org-switch-select,
  .topbar .menu .org-current-name {
    max-width: none;
    width: 100%;
  }

  .topbar-nav-dropdown-panel {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }
}

.container {
  max-width: 1100px;
  margin: 24px auto 40px;
  padding: 24px;
}

.container.container--work-order,
.container.container--work-orders {
  max-width: 1420px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.card-heading-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-heading-actions h1 {
  margin-bottom: 0;
}

h1, h2, h3 {
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
}

/* .btn sätter display; måste slå användarstilens [hidden] så knappar verkligen döljs */
.btn[hidden],
a.btn[hidden] {
  display: none !important;
}

.btn i[class^="fi-rr-"],
.btn i[class*=" fi-rr-"] {
  font-size: 1.05em;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

input, select, textarea {
  width: calc(100% - 2px);
  padding: 10px;
  margin: 8px 0 14px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  box-sizing: border-box;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* Mjukare systemmarkeringsfärg; listrader styrs nedan där webbläsaren tillåter. */
select {
  accent-color: #5f7d9a;
}

select option {
  background-color: var(--bg-dropdown);
  color: var(--text-primary);
}

select option:checked {
  background-color: var(--bg-dropdown-option-active);
  color: var(--text-primary);
}

label {
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.muted {
  color: var(--text-muted);
}

.topbar-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
}

.topbar-theme-toggle:hover {
  background: var(--bg-input-hover);
  border-color: var(--border-strong);
}

.topbar-theme-toggle[aria-pressed="true"] .topbar-theme-icon-light {
  display: none;
}

.topbar-theme-toggle[aria-pressed="false"] .topbar-theme-icon-dark {
  display: none;
}

.form-narrow {
  max-width: 520px;
}

.h2-spaced {
  margin-top: 28px;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.h3-spaced {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.mail-provider-panel[hidden] {
  display: none !important;
}

.mail-ad-settings-subtle {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

/* Super admin e-post: samma custom-select som widget/rapporter */
.form-narrow .super-admin-settings-select.report-custom-select {
  width: 100%;
  max-width: 520px;
  /* Native select har margin 0; wrappern måste ge samma 8/14-rytm som övriga fält. */
  margin: 8px 0 14px;
}

.form-narrow .super-admin-settings-select select.report-custom-select-native,
.form-narrow #mail_provider.report-custom-select-native,
.form-narrow #mail_smtp_encryption.report-custom-select-native {
  margin: 0 !important;
}

.super-admin-card {
  overflow: visible;
}

.super-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #2f3f54;
  background: #10151c;
}

.super-admin-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #9faec5;
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.super-admin-tab:hover {
  color: #d9e6f8;
  background: rgba(127, 179, 240, 0.08);
}

.super-admin-tab.is-active {
  background: #1f5fa8;
  color: #fff;
}

.super-admin-panel {
  display: none;
}

.super-admin-panel.is-active {
  display: block;
}

.super-admin-org-form {
  margin-bottom: 8px;
}

.stack-form {
  max-width: 520px;
  margin-bottom: 8px;
}

.stack-form--modal {
  max-width: none;
  margin-top: 12px;
  margin-bottom: 0;
}

.stack-form .small {
  margin-top: -6px;
}

.small {
  font-size: 13px;
  line-height: 1.45;
}

.password-row {
  margin-bottom: 8px;
}

.password-row-fields label {
  display: block;
}

.password-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 8px 0 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #5f7d9a;
}

.input-with-toggle {
  position: relative;
  margin: 8px 0 14px;
}

.input-with-toggle__input {
  margin: 0;
  width: 100%;
  padding-right: 44px;
}

.input-with-toggle__btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9faec5;
  cursor: pointer;
}

.input-with-toggle__btn:hover:not(:disabled) {
  color: #d9e6f8;
  background: rgba(255, 255, 255, 0.06);
}

.input-with-toggle__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.input-with-toggle__icon {
  display: block;
  flex-shrink: 0;
}

/* display:block ovan slår annars ut HTML hidden på den dolda SVG-ikonen. */
.input-with-toggle__btn .input-with-toggle__icon[hidden] {
  display: none;
}

.btn-secondary {
  background: transparent;
  color: #b8c9e0;
  border: 1px solid #3d5270;
}

.btn-secondary:hover {
  background: #222a38;
  color: #e4eaf2;
}

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  max-width: min(480px, calc(100vw - 28px));
  pointer-events: none;
}

/* toast.js: endast under #toastStack — undvik krock med .toast-host .toast */
.toast-stack .toast {
  pointer-events: auto;
  margin: 0;
  padding: 16px 20px;
  min-width: min(100%, 280px);
  max-width: 100%;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  color: #f0f4fa;
  background: #2d3748;
  border: 1px solid #4a5568;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-stack .toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-stack .toast--success {
  color: #ecfdf5;
  background: #166534;
  border-color: #22c55e;
}

.toast-stack .toast--error {
  color: #fef2f2;
  background: #991b1b;
  border-color: #f87171;
}

.toast-stack .toast--warning {
  color: #fffbeb;
  background: #92400e;
  border-color: #fbbf24;
}

.toast-stack .toast--info {
  color: #eff6ff;
  background: #1e3a5f;
  border-color: #60a5fa;
}

@media (max-width: 520px) {
  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 16px;
    max-width: none;
    align-items: stretch;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Global input/select margins break row borders; keep table cells compact. */
.team-members-table td,
.team-members-table th {
  vertical-align: middle;
}

/* Rollväljare: samma custom-select som rapporter/widget (native select dold). */
.team-members-table .report-custom-select {
  width: 100%;
  max-width: 220px;
}

.stack-form--modal .report-custom-select {
  width: 100%;
  max-width: none;
}

.team-members-table select.role-select.report-custom-select-native,
#directRole.report-custom-select-native {
  margin: 0 !important;
}

.team-members-table .table-input {
  max-width: 220px;
  margin: 0;
  font-size: 14px;
}

.team-members-table .member-actions {
  min-width: 200px;
}

.team-members-table .member-actions-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.team-members-table tr.member-row--editing td {
  background: rgba(40, 90, 140, 0.12);
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #2f3f54;
}

.entry-actions {
  display: flex;
  gap: 8px;
}

.favorites-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 520px;
}

.favorites-list-item-wrap {
  margin: 0;
  padding: 0;
}

.favorites-list-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 520px;
}

.favorites-list-row--edit {
  flex-wrap: wrap;
  align-items: center;
}

.favorites-list-name-input {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #2f3f54;
  border-radius: 8px;
  background: #10151c;
  color: #e9edf5;
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.favorites-list-rename-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid #2f3f54;
  border-radius: 10px;
  background: #151b24;
  color: #9faec5;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.favorites-list-rename-btn:hover {
  border-color: #3d5570;
  background: #1a2230;
  color: #7cb3f0;
}

.favorites-list-rename-btn:focus {
  outline: none;
}

.favorites-list-rename-btn:focus-visible {
  outline: 2px solid rgba(124, 179, 240, 0.45);
  outline-offset: 2px;
}

.favorites-list-delete-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid #2f3f54;
  border-radius: 10px;
  background: #151b24;
  color: #9faec5;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.favorites-list-delete-btn:hover {
  border-color: #6b3a40;
  background: rgba(138, 60, 68, 0.2);
  color: #e8a0a8;
}

.favorites-list-delete-btn:focus {
  outline: none;
}

.favorites-list-delete-btn:focus-visible {
  outline: 2px solid rgba(200, 90, 100, 0.55);
  outline-offset: 2px;
}

.favorites-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid #2f3f54;
  border-radius: 10px;
  background: #10151c;
  color: #e4eaf2;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.favorites-list-item:hover {
  border-color: #3d5570;
  background: #141a24;
}

.favorites-list-item:focus {
  outline: none;
}

.favorites-list-item:focus-visible {
  outline: 2px solid rgba(124, 179, 240, 0.45);
  outline-offset: 2px;
}

.favorites-list-item-icon {
  flex-shrink: 0;
  display: flex;
  color: #7cb3f0;
  font-size: 1rem;
}

.favorites-list-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.table-entry-rubrik {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  max-width: 420px;
}

.table-entry-rubrik-name {
  font-weight: 600;
  color: #e4eaf2;
  line-height: 1.35;
}

.table-entry-rubrik-bc {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-stat {
  background: #10151c;
  border: 1px solid #2f3f54;
  border-radius: 10px;
  padding: 14px 16px;
}

.report-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #9faec5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.report-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #7cb3f0;
}

.report-filter-menus {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.report-filter-menu {
  min-width: 150px;
  border: 1px solid #2f3f54;
  border-radius: 9px;
  background: #10151c;
}

.report-filter-menu > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 13px;
  color: #d9e6f8;
}

.report-filter-menu > summary::-webkit-details-marker {
  display: none;
}

.report-filter-menu > summary::after {
  content: "▾";
  float: right;
  color: #9faec5;
}

.report-filter-menu[open] > summary::after {
  content: "▴";
}

.report-filter-panel {
  padding: 0 12px 10px;
  min-width: 280px;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* AppToast (app.js): klasser toast toast-success m.m. */
.toast-host .toast {
  min-width: 280px;
  max-width: min(400px, calc(100vw - 36px));
  padding: 16px 20px;
  border: 1px solid #4a5568;
  border-radius: 12px;
  background: #2d3748;
  color: #f0f4fa;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.toast-host .toast-out {
  opacity: 0;
  transform: translateY(8px);
}

.toast-host .toast-success {
  color: #ecfdf5;
  background: #166534;
  border-color: #22c55e;
}

.toast-host .toast-warning {
  color: #fffbeb;
  background: #92400e;
  border-color: #fbbf24;
}

.toast-host .toast-error {
  color: #fef2f2;
  background: #991b1b;
  border-color: #f87171;
}

.toast-host .toast-info {
  color: #eff6ff;
  background: #1e3a5f;
  border-color: #60a5fa;
}

.app-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(7, 10, 15, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px) + 8px) max(16px, env(safe-area-inset-right, 0px) + 8px)
    max(16px, env(safe-area-inset-bottom, 0px) + 8px) max(16px, env(safe-area-inset-left, 0px) + 8px);
  pointer-events: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-modal-backdrop[hidden] {
  display: none !important;
}

.app-modal {
  width: min(520px, 100%);
  /* Primary scroll surface for long forms (mobile Safari/touch). */
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #1a1f29;
  border: 1px solid #2f3f54;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.app-modal--wide {
  width: min(620px, 100%);
}

/* Phones / small tablets: anchor modal to top so keyboard + long forms stay reachable. */
@media (max-width: 900px) {
  .app-modal-backdrop {
    align-items: flex-start;
  }
}

.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.app-modal-header .app-modal-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.app-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: -4px -6px 0 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9faec5;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-modal-close:hover {
  color: #e4eaf2;
  background: rgba(255, 255, 255, 0.06);
}

.app-modal-close:focus {
  outline: none;
}

.app-modal-close:focus-visible {
  outline: 2px solid #7cb3f0;
  outline-offset: 2px;
}

.app-modal-title {
  margin: 0 0 8px;
}

.app-modal-message {
  margin: 0;
  color: #9faec5;
}

.app-modal-input {
  width: 100%;
  margin-top: 14px;
  margin-bottom: 12px;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-modal--reminder .app-modal-message {
  margin-bottom: 16px;
}

.app-modal--reminder .app-modal-actions {
  margin-top: 10px;
}

.app-modal-actions--spaced {
  margin-top: 16px;
}

.app-modal-actions--unsaved {
  flex-wrap: wrap;
  margin-top: 8px;
}

#reportsApp.container {
  max-width: 1280px;
}

.report-page {
  padding: 12px 14px 16px;
}

.report-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.report-page-header--spaced {
  margin-bottom: 20px;
}

.report-page-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.report-page-lead {
  margin: 0 0 8px;
  max-width: 900px;
  line-height: 1.35;
  font-size: 13px;
}

/* Filter: max ~25 % av viewport; totals/export utanför scroll så dropdown inte klipps */
.report-toolbar-zone {
  overflow: visible;
  margin-bottom: 6px;
  padding-right: 2px;
}

.report-toolbar-zone .report-filter-bar {
  max-height: 25vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.report-filter-bar {
  /* border: 1px solid #2f3f54; */
  /* border-radius: 8px; */
  /* background: #10151c; */
  padding: 6px 8px 8px;
  margin-bottom: 6px;
  /* Mörk list-popup i webbläsare som respekterar color-scheme (t.ex. Edge/Chrome på Windows). */
  color-scheme: dark;
}

.report-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 8px;
}

.report-filter-row--dropdowns {
  flex-direction: row;
  align-items: flex-end;
}

.report-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 0 0 auto;
  width: min(9.25rem, 28vw);
  max-width: 10rem;
  min-width: 6.5rem;
}

.report-filter-field--period {
  width: min(10.5rem, 32vw);
  max-width: 11rem;
  min-width: 7.5rem;
}

/* Rapportfilter: samma mönster som widgetens favorit (dold native select + trigger/listbox). */
.report-custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.report-custom-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.report-apply-btn {
  flex: 0 0 auto;
  align-self: flex-end;
  margin-left: 2px;
}

.report-custom-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.report-custom-dates[hidden] {
  display: none !important;
}

.report-date-input {
  margin: 0 !important;
  width: auto !important;
  min-width: 7.5rem;
  max-width: 9.5rem;
  flex: 0 0 auto;
  padding: 5px 8px !important;
  font-size: 12px !important;
}

.report-date-sep {
  color: #9faec5;
  flex-shrink: 0;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  color: #7cb3f0;
  border: 1px solid #2f3f54;
}

.btn-ghost:hover {
  background: rgba(127, 179, 240, 0.08);
  border-color: #3d5280;
}

.report-totals-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  min-height: 0;
}

.report-totals-row--spaced {
  margin-top: 50px;
}

.report-totals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 900px) {
  .report-totals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .report-totals-grid {
    grid-template-columns: 1fr;
  }
}

.report-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  min-height: 52px;
  background: #10151c;
  border: 1px solid #2f3f54;
  border-radius: 8px;
}

.report-stat-card-label {
  font-size: 10px;
  font-weight: 600;
  color: #9faec5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.report-stat-card-value {
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 700;
  color: #f0f4fc;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.report-totals-actions {
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
}

.report-totals-actions .btn {
  white-space: nowrap;
}

.report-export-dropdown {
  position: relative;
}

.report-export-summary {
  list-style: none;
  cursor: pointer;
}

.report-export-summary::-webkit-details-marker {
  display: none;
}

.report-export-summary::marker {
  content: "";
}

.report-export-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  padding: 6px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-dropdown);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-export-include-ts {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 2px 2px 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.25;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.report-export-include-ts:hover {
  background: var(--bg-dropdown-option-hover);
}

.report-export-include-ts input {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin: 0;
  accent-color: #5b9bd5;
}

.report-export-item {
  display: flex;
  align-items: center;
  gap: 0.55em;
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.report-export-item i[class^="fi-rr-"],
.report-export-item i[class*=" fi-rr-"] {
  flex-shrink: 0;
  width: 1.15em;
  font-size: 1.05em;
  opacity: 0.92;
  text-align: center;
}

.report-export-item span {
  flex: 1;
  min-width: 0;
}

.report-export-item:hover {
  background: var(--bg-dropdown-option-hover);
  color: var(--accent-soft);
}

.report-status-line {
  margin: 4px 0 8px;
  min-height: 1.2em;
  font-size: 12px;
}

.report-vat-note {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.35;
}

.report-chart {
  min-height: 200px;
  margin: 6px 0 14px;
  padding: 12px 10px 6px;
  border: 1px solid var(--border-input);
  border-radius: 10px;
  background: var(--chart-surface);
}

.report-chart-empty {
  margin: 0;
  padding: 24px 8px;
  text-align: center;
}

.report-chart-inner {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  min-height: 180px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.report-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 36px;
}

.report-chart-bar-wrap {
  width: 28px;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.report-chart-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: var(--chart-bar-report);
}

.report-chart-x {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  max-width: 72px;
  line-height: 1.2;
  word-break: break-word;
}

.report-table-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
  padding: 4px;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border-input);
  border-bottom: none;
  background: var(--chart-surface);
}

.report-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #9faec5;
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.report-tab:hover {
  color: #d9e6f8;
  background: rgba(127, 179, 240, 0.06);
}

.report-tab.is-active {
  background: #1f5fa8;
  color: #fff;
}

.report-aggregate-table {
  margin-top: 0;
  border: 1px solid #2f3f54;
  border-radius: 0 0 10px 10px;
  padding: 12px;
  background: #10151c;
}

.report-data-table tfoot td {
  font-weight: 600;
  background: rgba(31, 95, 168, 0.12);
  border-top: 2px solid #2f3f54;
}

.report-data-table {
  min-width: 720px;
}

.team-members-table {
  min-width: 720px;
}

/* Fast tidstämpling på alla sidor (inloggad + aktiv organisation) */
.global-clock-widget {
  position: fixed;
  z-index: 900;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  transform: none;
  width: min(288px, calc(100vw - 24px));
  margin: 0;
  padding: 0;
  border: 1px solid #2f3f54;
  border-radius: 10px;
  background: #141a22;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  color: #e9edf5;
}

.global-clock-widget[data-clock-position="br"] {
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

.global-clock-widget[data-clock-position="tr"] {
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
}

.global-clock-widget[data-clock-position="bl"] {
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

.global-clock-widget[data-clock-position="tl"] {
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
}

.global-clock-widget[data-clock-position="tc"] {
  top: max(12px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
}

.global-clock-widget[data-clock-position="bc"] {
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
}

.global-clock-widget[data-clock-position="ml"] {
  left: max(12px, env(safe-area-inset-left, 0px));
  top: 50%;
  transform: translateY(-50%);
}

.global-clock-widget[data-clock-position="mr"] {
  right: max(12px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
}

.global-clock-widget-inner {
  padding: 10px 12px 12px;
}

.global-clock-widget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.global-clock-widget-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.global-clock-widget-header-statusline {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
  gap: 8px;
}

.global-clock-widget-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
  margin: -4px 6px 0 0;
}

.global-clock-widget-collapse-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  background-color: transparent;
  box-shadow: none;
  color: #9faec5;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.global-clock-widget-collapse-btn::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.global-clock-widget-collapse-btn:hover {
  background: rgba(127, 179, 240, 0.12);
  color: #d9e6f8;
}

.global-clock-widget-collapse-btn:active {
  background: rgba(127, 179, 240, 0.12);
}

.global-clock-widget-collapse-btn:focus {
  outline: none;
}

.global-clock-widget-collapse-btn:focus-visible {
  outline: 2px solid #1f5fa8;
  outline-offset: 1px;
}

.global-clock-widget-collapse-chevron {
  display: block;
  background: none;
  font-size: 14px;
  line-height: 1;
  opacity: 0.85;
  color: inherit;
}

.global-clock-widget-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.global-clock-widget-menu-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #9faec5;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.global-clock-widget-menu-btn:hover {
  background: rgba(127, 179, 240, 0.12);
  color: #d9e6f8;
}

.global-clock-widget-menu-btn:focus {
  outline: none;
}

.global-clock-widget-menu-btn:focus-visible {
  outline: 2px solid #1f5fa8;
  outline-offset: 1px;
}

/* box-shadow räknas inte in i träffytan — ge span en verklig bredd så hela ⋯ får hover/klick. */
.global-clock-widget-menu-dots {
  display: inline-block;
  width: 15px;
  height: 3px;
  vertical-align: middle;
}

.global-clock-widget-menu-dots::before {
  content: "";
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor;
}

.global-clock-widget-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  max-width: min(260px, calc(100vw - 32px));
  padding: 10px 10px 12px;
  background: #1a1f29;
  border: 1px solid #2f3f54;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Popover API: återställ UA-standard så panelen ser likadan ut och kan positioneras med JS. */
.global-clock-widget-menu:popover-open {
  display: block;
}

/* Undvik flash i mitten: JS sätter fixed-position och lägger till .is-positioned när klart. */
.global-clock-widget-menu:popover-open:not(.is-positioned) {
  opacity: 0;
  pointer-events: none;
}

.global-clock-widget-menu-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9faec5;
}

.global-clock-widget-menu-title--sub {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2f3f54;
}

.global-clock-widget-menu-rowbtn {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  border: 1px solid #31445d;
  border-radius: 8px;
  background: #151b24;
  color: #d9e6f8;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.global-clock-widget-menu-rowbtn:hover {
  background: #1a2230;
  border-color: #3d5a80;
}

.global-clock-widget-menu-rowbtn--danger {
  border-color: #5a3038;
  color: #e8b4b9;
}

.global-clock-widget-menu-rowbtn--danger:hover {
  background: rgba(138, 60, 68, 0.2);
  border-color: #8a3c44;
}

.global-clock-widget-pos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* Visuell ordning: mitten upp/nere på egen rad centrerad; hörn/mitten sida två och två. */
.global-clock-widget-pos-option[data-clock-position="tc"] {
  grid-column: 2;
  grid-row: 1;
}

.global-clock-widget-pos-option[data-clock-position="tl"] {
  grid-column: 1;
  grid-row: 2;
}

.global-clock-widget-pos-option[data-clock-position="tr"] {
  grid-column: 3;
  grid-row: 2;
}

.global-clock-widget-pos-option[data-clock-position="ml"] {
  grid-column: 1;
  grid-row: 3;
}

.global-clock-widget-pos-option[data-clock-position="mr"] {
  grid-column: 3;
  grid-row: 3;
}

.global-clock-widget-pos-option[data-clock-position="bl"] {
  grid-column: 1;
  grid-row: 4;
}

.global-clock-widget-pos-option[data-clock-position="br"] {
  grid-column: 3;
  grid-row: 4;
}

.global-clock-widget-pos-option[data-clock-position="bc"] {
  grid-column: 2;
  grid-row: 5;
}

.global-clock-widget-pos-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #10151c;
  color: #d9e2f0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  text-align: center;
  line-height: 1.2;
}

.global-clock-widget-pos-option:hover {
  border-color: #3d5280;
  background: #141a22;
}

.global-clock-widget-pos-option:focus {
  outline: none;
}

.global-clock-widget-pos-option:focus-visible {
  border-color: #1f5fa8;
}

.global-clock-widget-pos-option.is-active {
  border-color: #1f5fa8;
  box-shadow: 0 0 0 1px rgba(31, 95, 168, 0.35);
}

.global-clock-widget-pos-frame {
  position: relative;
  width: 40px;
  height: 26px;
  border: 1px solid #4a5c78;
  border-radius: 4px;
  background: #0d1117;
  flex-shrink: 0;
}

.global-clock-widget-pos-marker {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #5fa8f0;
  box-sizing: border-box;
}

.global-clock-widget-pos-option[data-clock-position="br"] .global-clock-widget-pos-marker {
  right: 3px;
  bottom: 3px;
}

.global-clock-widget-pos-option[data-clock-position="tr"] .global-clock-widget-pos-marker {
  top: 3px;
  right: 3px;
}

.global-clock-widget-pos-option[data-clock-position="bl"] .global-clock-widget-pos-marker {
  left: 3px;
  bottom: 3px;
}

.global-clock-widget-pos-option[data-clock-position="tl"] .global-clock-widget-pos-marker {
  top: 3px;
  left: 3px;
}

.global-clock-widget-pos-option[data-clock-position="tc"] .global-clock-widget-pos-marker {
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.global-clock-widget-pos-option[data-clock-position="bc"] .global-clock-widget-pos-marker {
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.global-clock-widget-pos-option[data-clock-position="ml"] .global-clock-widget-pos-marker {
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
}

.global-clock-widget-pos-option[data-clock-position="mr"] .global-clock-widget-pos-marker {
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
}

.global-clock-widget-pos-label {
  display: block;
  max-width: 100%;
}

.global-clock-widget-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5c6578;
  flex-shrink: 0;
}

.global-clock-widget-dot--on {
  background: #3d9e62;
  box-shadow: 0 0 0 2px rgba(61, 158, 98, 0.35);
}

.global-clock-widget-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9faec5;
}

.global-clock-widget--active .global-clock-widget-heading {
  color: #b8e6c8;
}

.global-clock-widget-summary {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
  color: #d9e2f0;
  word-break: break-word;
}

.global-clock-widget-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.global-clock-widget-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

/* display:flex annars slår ut HTML hidden — snabbval syntes vid instämpling. */
.global-clock-widget-quick[hidden] {
  display: none !important;
}

.global-clock-widget-quick-last {
  flex: 1 1 120px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  margin: 0;
  border: 1px solid #31445d;
  border-radius: 8px;
  background: #151b24;
  color: #d9e6f8;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.global-clock-widget-quick-last:hover {
  border-color: #3d5a80;
  background: #1a2230;
}

.global-clock-widget--minimized {
  width: auto;
  min-width: min(200px, calc(100vw - 24px));
  max-width: 260px;
  cursor: pointer;
}

/* display:flex på knappen kan annars slå ut HTML hidden (minibaren syntes i expanderat läge). */
.global-clock-widget-minibar[hidden] {
  display: none !important;
}

.global-clock-widget-minibar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #d9e6f8;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.global-clock-widget-minibar:hover {
  background: rgba(127, 179, 240, 0.08);
}

.global-clock-widget-minibar:focus {
  outline: none;
}

.global-clock-widget-minibar:focus-visible {
  outline: 2px solid rgba(124, 179, 240, 0.5);
  outline-offset: 2px;
}

.global-clock-widget-minibar-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9faec5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-clock-widget--active .global-clock-widget-minibar-text {
  color: #b8e6c8;
}

.global-clock-widget-minibar-chevron {
  flex-shrink: 0;
  font-size: 14px;
  opacity: 0.75;
}

.global-clock-widget-quick-last.is-selected {
  border-color: #1f5fa8;
  box-shadow: 0 0 0 1px rgba(31, 95, 168, 0.45);
}

.global-clock-widget-quick-last-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9faec5;
}

.global-clock-widget-quick-last-text {
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
  color: #e9edf5;
}

.global-clock-widget-reminders {
  margin: 14px 0 14px;
  border: 1px solid #2a3648;
  border-radius: 8px;
  padding: 6px 8px;
}

.global-clock-widget-reminders[open] {
  background: #131a23;
}

.global-clock-widget-reminders > summary {
  list-style: none;
}

.global-clock-widget-reminders > summary::-webkit-details-marker {
  display: none;
}

.global-clock-widget-reminders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  cursor: pointer;
  gap: 8px;
}

.global-clock-widget-reminders-chevron {
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.15s ease;
}

.global-clock-widget-reminders[open] .global-clock-widget-reminders-chevron {
  transform: rotate(90deg);
}

.global-clock-widget-reminder-countdown {
  color: #7cb3f0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin-left: 6px;
}

.global-clock-widget-reminder-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1f5fa8;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.global-clock-widget-reminders-info {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #9fc0e7;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.global-clock-widget-reminders-popover {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-dropdown);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
}

.global-clock-widget-reminders-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}

.global-clock-widget-reminders-select,
.global-clock-widget-reminders-input {
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.global-clock-widget-reminders-select {
  padding-right: 30px;
  background-color: var(--bg-input);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.global-clock-widget-reminders-select:hover {
  border-color: #3d5a80;
  background-color: #1a2230;
}

.global-clock-widget-reminders-select:focus {
  outline: none;
  border-color: #3d5570;
  box-shadow: 0 0 0 1px rgba(124, 179, 240, 0.35);
}

.global-clock-widget-reminders-add {
  width: 100%;
}

.global-clock-widget-reminder-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.global-clock-widget-reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #2f3f54;
  border-radius: 8px;
  background: #131a23;
  font-size: 12px;
}

.global-clock-widget-reminder-remove {
  border: 1px solid #5a3038;
  background: rgba(138, 60, 68, 0.2);
  color: #e8b4b9;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px 8px;
}

/* Egen favoritlista (undviker Windows/Chrome vit markeringsruta i <select>). */
.global-clock-widget-fav {
  flex: 1 1 140px;
  min-width: 0;
  position: relative;
}

.global-clock-widget-fav-trigger,
.report-custom-select-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 8px 32px 8px 10px;
  box-sizing: border-box;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.25;
  color: var(--text-primary);
  background-color: var(--bg-input);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.global-clock-widget-fav-trigger:hover,
.report-custom-select-trigger:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-input-hover);
}

.global-clock-widget-fav-trigger:focus,
.report-custom-select-trigger:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.global-clock-widget-fav-trigger span,
.report-custom-select-trigger .report-custom-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-clock-widget-fav-dropdown,
.report-custom-select-dropdown {
  margin: 0;
  padding: 4px;
  max-height: min(240px, 50vh);
  overflow-y: auto;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  box-shadow: var(--shadow-dropdown);
}

.global-clock-widget-fav-option,
.report-custom-select-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  word-break: break-word;
  transition: background 0.12s ease;
}

.global-clock-widget-fav-option:hover,
.report-custom-select-option:hover {
  background: var(--bg-dropdown-option-hover);
}

.global-clock-widget-fav-option.is-active,
.report-custom-select-option.is-active {
  background: var(--bg-dropdown-option-active);
  color: var(--text-primary);
}

.dashboard-clock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #253347;
}

.dashboard-clock-status {
  margin: 0;
  flex: 1 1 220px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}

.dashboard-clock-widget-pref {
  margin: 0;
  flex: 0 1 320px;
  font-size: 13px;
  line-height: 1.45;
  color: #9faec5;
}

.dashboard-clock-widget-pref-label {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dashboard-clock-widget-pref-label input[type="checkbox"] {
  flex-shrink: 0;
  margin: 2px 0 0;
  width: auto;
  accent-color: #5f7d9a;
}

.global-clock-widget-elapsed {
  flex: 0 0 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #7cb3f0;
  margin: 0;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.global-clock-widget-action {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.global-clock-widget-action i {
  font-size: 1rem;
}

.global-clock-widget-action--compact {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.global-clock-widget-action--compact.global-clock-widget-action--stop {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

.global-clock-widget-action--compact i {
  font-size: 0.78rem;
  line-height: 1;
}

.global-clock-widget-action--mini {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

.global-clock-widget-action--mini i {
  font-size: 0.8rem;
  line-height: 1;
}

.global-clock-widget-action--mini.global-clock-widget-action--stop i,
.global-clock-widget-action--compact.global-clock-widget-action--stop i {
  font-size: 0.8rem;
  position: relative;
  top: 1px;
}

.global-clock-widget-minibar-elapsed {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #7cb3f0;
}

.global-clock-widget-action--play {
  background: #2a7a4a;
}

.global-clock-widget-action--play:hover:not(:disabled) {
  background: #34925a;
}

.global-clock-widget-action--stop {
  background: #b83232;
}

.global-clock-widget-action--stop:hover:not(:disabled) {
  background: #c94a4a;
}

.global-clock-widget-action:focus {
  outline: none;
}

.global-clock-widget-action:focus-visible {
  outline: 2px solid #e9edf5;
  outline-offset: 2px;
}

.global-clock-widget-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ——— Dashboard: tech-inspirerad överblick ——— */
.dashboard-page {
  padding-bottom: 48px;
}

.dashboard-overview {
  margin-bottom: 28px;
}

.dashboard-overview-skeleton {
  text-align: center;
  padding: 32px 16px;
  letter-spacing: 0.04em;
}

.dashboard-overview-hero {
  position: relative;
  border-radius: 16px;
  padding: 28px 28px 32px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(135deg, #0c1220 0%, #111a2e 45%, #0a1628 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(34, 211, 238, 0.06);
}

.dashboard-overview-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 20%, black 20%, transparent 70%);
  pointer-events: none;
}

.dashboard-overview-hero-content {
  position: relative;
  z-index: 1;
}

.dashboard-overview-hero--split {
  padding-bottom: 28px;
}

.dashboard-overview-hero-split {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 22px 28px;
}

.dashboard-overview-hero--split .dashboard-overview-hero-content {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 560px;
}

.dashboard-bento-root {
  margin-top: 0;
}

.dashboard-hero-clock-root.global-clock-widget {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  transform: none;
  flex: 0 1 300px;
  width: 100%;
  max-width: 320px;
  margin: 0;
  margin-left: auto;
  align-self: center;
  border-radius: 12px;
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 12px 36px rgba(0, 0, 0, 0.4);
  background: linear-gradient(165deg, #171f2b 0%, #0f1419 100%);
}

.dashboard-hero-clock-root.global-clock-widget--active {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12) inset,
    0 12px 40px rgba(34, 211, 238, 0.1);
}

@media (max-width: 720px) {
  .dashboard-hero-clock-root.global-clock-widget {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
}

.dashboard-hero-clock-root .global-clock-widget-inner {
  padding: 12px 14px 14px;
}

.dashboard-overview-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #67e8f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-overview-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 12px #22d3ee;
  animation: dashboard-pulse-dot 2s ease-in-out infinite;
}

@keyframes dashboard-pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-overview-eyebrow-dot {
    animation: none;
  }

  .dashboard-longest-glow {
    animation: none !important;
  }
}

.dashboard-overview-title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(110deg, #f8fafc 0%, #a5f3fc 40%, #c4b5fd 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dashboard-overview-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 42rem;
  line-height: 1.5;
}

.dashboard-bento {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-bento--empty {
  padding: 36px 24px;
  text-align: center;
  border-style: dashed;
  border-color: var(--border-strong);
  background: var(--chart-surface);
}

.dashboard-empty-inner {
  max-width: 400px;
  margin: 0 auto;
}

.dashboard-empty-rings {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.25);
  box-shadow:
    0 0 0 12px rgba(34, 211, 238, 0.06),
    0 0 0 28px rgba(167, 139, 250, 0.05);
}

.dashboard-empty-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #e2e8f0;
}

.dashboard-empty-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 720px) {
  .dashboard-kpi-strip {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

.dashboard-kpi {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--kpi-surface);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  text-align: center;
  overflow: hidden;
}

.dashboard-kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), transparent);
  opacity: 0.7;
}

.dashboard-kpi-ic {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
  color: #22d3ee;
}

.dashboard-kpi-val {
  display: block;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.dashboard-kpi-lbl {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-bento-mid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .dashboard-bento-mid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.dashboard-bento-donut.card,
.dashboard-bento-longest.card,
.dashboard-bento-week.card,
.dashboard-bento-hour.card {
  margin: 0;
  background: var(--card-chart-surface);
  border-color: var(--border);
}

.dashboard-bento-heading {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-bento-heading i {
  color: #38bdf8;
  font-size: 1.1em;
}

.dashboard-bento-hint {
  margin: -6px 0 14px;
  font-size: 12px;
}

.dashboard-donut-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

@media (min-width: 520px) {
  .dashboard-donut-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}

.dashboard-donut-wrap {
  position: relative;
  width: min(200px, 55vw);
  aspect-ratio: 1;
  flex-shrink: 0;
}

.dashboard-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 0 40px rgba(34, 211, 238, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.dashboard-donut-center {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--donut-center-bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
}

.dashboard-donut-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dashboard-donut-v {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-top: 2px;
}

.dashboard-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 280px;
}

.dashboard-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  font-size: 14px;
}

.dashboard-legend-item:last-child {
  border-bottom: none;
}

.dashboard-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.dashboard-legend-name {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-legend-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.dashboard-bento-longest {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-bento-longest--muted {
  justify-content: flex-start;
  min-height: auto;
}

.dashboard-longest-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.2) 0%, transparent 70%);
  pointer-events: none;
  animation: dashboard-longest-glow 5s ease-in-out infinite;
}

@keyframes dashboard-longest-glow {
  0%,
  100% {
    opacity: 0.6;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
  }
}

.dashboard-longest-label {
  position: relative;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #67e8f9;
}

.dashboard-longest-duration {
  position: relative;
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-shadow: none;
}

[data-theme="dark"] .dashboard-longest-duration {
  text-shadow: 0 0 40px rgba(34, 211, 238, 0.25);
}

.dashboard-longest-meta {
  position: relative;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.dashboard-longest-when {
  position: relative;
  margin: 10px 0 0;
  font-size: 13px;
}

.dashboard-bento-bottom {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .dashboard-bento-bottom {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-wday-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 140px;
  padding: 8px 4px 0;
}

.dashboard-wday-cell {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-wday-bar {
  width: 100%;
  max-width: 36px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: var(--chart-bar-primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease;
}

.dashboard-wday-cell:hover .dashboard-wday-bar {
  transform: scaleY(1.03);
}

.dashboard-wday-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-hour-wrap {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  padding: 4px 2px 0;
}

.dashboard-hour-cell {
  flex: 1;
  min-width: 0;
  height: 100%;
  border-radius: 3px 3px 1px 1px;
  background: color-mix(in srgb, var(--accent) calc(var(--a, 0.15) * 100%), transparent);
  box-shadow: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

[data-theme="dark"] .dashboard-hour-cell {
  background: rgba(34, 211, 238, var(--a, 0.15));
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.08);
}

[data-theme="light"] .dashboard-hour-cell {
  background: rgba(37, 99, 235, calc(var(--a, 0.15) * 1.2));
}

.dashboard-hour-cell:hover {
  transform: scaleY(1.04);
}

[data-theme="dark"] .dashboard-hour-cell:hover {
  background: rgba(34, 211, 238, calc(var(--a, 0.15) + 0.15));
}

[data-theme="light"] .dashboard-hour-cell:hover {
  background: rgba(37, 99, 235, calc(var(--a, 0.15) + 0.22));
}

.dashboard-hour-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dashboard-workbench.card {
  margin-top: 0;
}

/* Auth pages: centered compact cards with consistent spacing */
.auth-page {
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8px;
  padding-bottom: 16px;
}

.auth-card {
  width: min(100%, 560px);
  margin: 0;
}

.auth-form .btn {
  width: 100%;
}

.auth-links {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.auth-links-sep {
  color: var(--text-muted);
}

.auth-flash {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0 0;
}

.auth-flash--ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--text);
}

.auth-flash--err {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--text);
}

/* Self-service registration landing */
.register-page {
  max-width: 1120px;
  margin: 0 auto;
}

.register-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 400px);
  gap: 32px;
  align-items: start;
  padding: 8px 0 32px;
}

@media (max-width: 900px) {
  .register-layout {
    grid-template-columns: 1fr;
  }

  .register-form-card {
    position: static;
  }
}

.register-hero {
  padding: 8px 0 16px;
}

.register-hero h1 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.register-hero-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

.register-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.register-perks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
}

.register-perk-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.register-trial-note {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2, rgba(15, 23, 42, 0.04));
  border: 1px solid var(--border, rgba(15, 23, 42, 0.08));
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.register-form-card {
  position: sticky;
  top: 24px;
}

.register-form-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.register-form-message {
  margin: 0 0 12px;
  min-height: 1.25em;
  font-size: 14px;
}

.register-form-message--err {
  color: #b91c1c;
}

[data-theme="dark"] .register-form-message--err {
  color: #fca5a5;
}

.register-form-message--ok {
  color: #15803d;
}

.register-success h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.register-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0 16px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.register-checkbox input {
  margin-top: 3px;
  flex-shrink: 0;
}

.register-checkbox span {
  flex: 1 1 auto;
  min-width: 0;
}

.register-checkbox--subtle span {
  font-size: 13px;
  color: var(--text-muted);
}

.register-cookie-note {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
}

/* Juridiska dokument */
.legal-doc-page {
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 32px;
}

.legal-doc {
  padding: 22px 26px 28px;
}

.legal-doc-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
}

.legal-doc-meta {
  margin: 0 0 20px;
  font-size: 14px;
}

.legal-doc-body section {
  margin-bottom: 1.35rem;
}

.legal-doc-body h2 {
  font-size: 1.08rem;
  margin: 0 0 0.5rem;
}

.legal-doc-body p,
.legal-doc-body li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.legal-doc-body ul {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.25rem;
}

.legal-doc-body a {
  color: var(--accent, #2563eb);
}

.legal-doc-version {
  margin-top: 1rem;
  font-size: 13px;
}

.legal-doc-nav {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.legal-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0 16px;
}

.legal-doc-table th,
.legal-doc-table td {
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.legal-doc-table th {
  background: var(--surface-2, rgba(15, 23, 42, 0.04));
  font-weight: 600;
}

.legal-doc-table code {
  font-size: 12px;
}

/* Cookie-samtycke (fullskärm tills accepterat) */
.cookie-consent-barrier {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

html.cookie-consent-ok .cookie-consent-barrier[hidden] {
  display: none !important;
}

.cookie-consent-panel {
  width: min(100%, 440px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px 22px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.cookie-consent-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.cookie-consent-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
}

.cookie-consent-actions {
  margin: 18px 0 0;
}

.cookie-consent-actions .btn {
  width: 100%;
}

.cookie-consent-footnote {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.cookie-consent-policy-link {
  font-weight: 600;
}

/* Länklista under inloggning/registrering */
.legal-strip {
  margin-top: 14px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.legal-strip-sep {
  color: var(--text-muted);
}

/* Prenumeration / Stripe */
.subscription-page {
  max-width: 640px;
  margin: 0 auto;
}

.subscription-card {
  padding: 20px 22px 24px;
}

.subscription-status {
  margin: 14px 0;
  line-height: 1.55;
}

.subscription-status--ok {
  color: #15803d;
}

.subscription-status--err {
  color: #b91c1c;
}

[data-theme="dark"] .subscription-status--err {
  color: #fca5a5;
}

.subscription-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.subscription-banner {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
}

.subscription-banner--ok {
  background: rgba(34, 197, 94, 0.1);
}

.subscription-banner--muted {
  background: var(--surface-2, rgba(15, 23, 42, 0.04));
}

.subscription-footnote {
  margin-top: 1.25rem;
  font-size: 13px;
}

/* -------- Responsive polish across pages -------- */
@media (max-width: 1200px) {
  .container {
    margin-top: 16px;
    margin-bottom: 28px;
    padding: 18px;
  }
}

@media (max-width: 980px) {
  .container {
    padding: 14px;
  }

  .card {
    padding: 16px;
  }

  .card-heading-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar.is-menu-open .menu {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  .report-page {
    padding: 10px 10px 12px;
  }

  .report-page-header--spaced {
    margin-bottom: 12px;
  }

  .report-totals-row--spaced {
    margin-top: 14px;
  }

  .report-toolbar-zone .report-filter-bar {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .report-filter-row {
    align-items: stretch;
  }

  .report-filter-field,
  .report-filter-field--period {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  .report-custom-dates {
    width: 100%;
    gap: 8px;
  }

  .report-date-input {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    width: auto !important;
  }

  .report-apply-btn {
    width: 100%;
    margin-left: 0;
  }

  .report-totals-row {
    align-items: stretch;
  }

  .report-totals-actions {
    width: 100%;
    margin-left: 0;
  }

  .report-export-summary {
    width: 100%;
    justify-content: center;
  }

  .report-export-panel {
    left: 0;
    right: 0;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .auth-page {
    min-height: auto;
    align-items: stretch;
    padding-top: 0;
    padding-bottom: 0;
  }

  .auth-card {
    width: 100%;
  }

  .container {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 10px;
  }

  .card {
    padding: 12px;
    border-radius: 10px;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
  }

  .table-wrap {
    margin-top: 10px;
  }

  th,
  td {
    padding: 7px 6px;
    font-size: 13px;
  }

  .entry-actions {
    flex-direction: column;
    gap: 6px;
  }

  .entry-actions .btn {
    width: 100%;
  }

  .favorites-list-row {
    max-width: none;
  }

  .favorites-list-item {
    max-width: none;
  }

  .dashboard-overview-hero {
    padding: 18px 14px 20px;
    margin-bottom: 14px;
  }

  .dashboard-overview-hero-split {
    gap: 14px;
  }

  .dashboard-overview-sub {
    font-size: 13px;
  }

  .dashboard-kpi {
    padding: 14px 12px;
  }

  .dashboard-bento-donut.card,
  .dashboard-bento-longest.card,
  .dashboard-bento-week.card,
  .dashboard-bento-hour.card {
    padding: 14px;
  }

  .team-members-table .member-actions {
    min-width: 0;
  }

  .team-members-table .member-actions-inner {
    width: 100%;
  }

  .team-members-table .member-actions-inner .btn {
    width: 100%;
  }

  .app-modal {
    width: min(96vw, 680px);
    padding: 16px;
  }

  .app-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .team-members-table,
  .report-data-table {
    min-width: 0;
    width: 100%;
    border: 0;
  }

  .team-members-table thead,
  .report-data-table thead {
    display: none;
  }

  .team-members-table tbody tr,
  .report-data-table tbody tr {
    display: block;
    border: 1px solid #2f3f54;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: #111821;
  }

  .team-members-table tbody td,
  .report-data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid rgba(47, 63, 84, 0.55);
    padding: 8px 6px;
    font-size: 13px;
    text-align: right;
  }

  .team-members-table tbody td:last-child,
  .report-data-table tbody td:last-child {
    border-bottom: none;
  }

  .team-members-table tbody td::before,
  .report-data-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    text-align: left;
    color: #9faec5;
    font-weight: 600;
  }

  .team-members-table .member-actions,
  .team-members-table .member-actions-inner {
    width: 100%;
  }

  .team-members-table .member-actions-inner {
    justify-content: flex-end;
  }

  .team-members-table .member-actions-inner .btn {
    width: 100%;
  }

  .report-data-table tfoot {
    display: block;
    margin-top: 8px;
  }

  .report-data-table tfoot tr {
    display: block;
    border: 1px solid #2f3f54;
    border-radius: 10px;
    padding: 8px;
    background: rgba(31, 95, 168, 0.12);
  }

  .report-data-table tfoot td {
    display: block;
    border: 0;
    background: transparent;
    padding: 4px 2px;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .topbar-inner {
    padding: 8px 10px;
    gap: 8px;
  }

  .brand-logo {
    max-width: min(138px, 41vw);
    height: clamp(20px, 6vw, 32px);
  }

  .topbar-menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .menu a {
    font-size: 14px;
    padding: 9px 8px;
  }

  .container {
    padding: 8px;
  }

  .card {
    padding: 10px;
  }

  h1 {
    font-size: 1.25rem;
  }

  .btn {
    padding: 9px 11px;
    font-size: 14px;
  }

  .report-page {
    padding: 8px;
  }

  .report-chart {
    min-height: 170px;
    padding: 10px 8px 6px;
  }

  .report-chart-inner {
    gap: 6px;
    min-height: 148px;
  }

  .report-chart-col {
    min-width: 28px;
  }

  .report-chart-bar-wrap {
    width: 22px;
    height: 120px;
  }

  .report-chart-x {
    max-width: 56px;
    font-size: 9px;
  }

  .report-table-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding: 4px;
  }

  .report-tab {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .dashboard-overview-hero {
    padding: 14px 10px 16px;
  }

  .dashboard-overview-eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
    gap: 6px;
  }

  .dashboard-overview-title {
    font-size: clamp(1.2rem, 7vw, 1.6rem);
  }

  .dashboard-hero-clock-root .global-clock-widget-inner {
    padding: 10px 10px 12px;
  }

  .dashboard-kpi-strip {
    gap: 8px;
  }

  .dashboard-kpi {
    padding: 12px 10px;
  }

  .dashboard-kpi-lbl {
    font-size: 11px;
  }

  .favorites-list-row {
    gap: 6px;
  }

  .favorites-list-name-input {
    padding: 8px 10px;
    font-size: 13px;
  }

  .favorites-list-rename-btn,
  .favorites-list-delete-btn {
    width: 38px;
    border-radius: 9px;
  }

  .app-modal {
    width: min(98vw, 680px);
    padding: 12px;
  }
}

/* Landscape mobiler / låg viewport-höjd */
@media (max-height: 560px) and (max-width: 980px) {
  .auth-page {
    min-height: auto;
    align-items: stretch;
  }

  .topbar.is-menu-open .menu {
    max-height: calc(100vh - 76px);
  }

  .report-export-panel {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .app-modal-backdrop {
    align-items: flex-start;
    overflow-y: auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-modal {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

/* Arbetsordrar */
.work-orders-filters {
  max-width: 280px;
  margin-top: 1.5rem;
  margin-bottom: 16px;
}

.work-orders-list .table-wrap {
  overflow-x: auto;
}

.wo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.wo-table th,
.wo-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.wo-table th {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wo-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wo-list-sub {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.wo-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--wo-badge, #94a3b8) 22%, transparent);
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--wo-badge, #94a3b8) 45%, transparent);
}

.wo-quick-status {
  max-width: 140px;
  margin-right: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

.wo-table tbody tr.wo-list-row {
  cursor: pointer;
}

.wo-table tbody tr.wo-list-row:hover {
  background: var(--bg-input-hover);
}

.wo-table .wo-actions {
  cursor: default;
}

.wo-list-order-num {
  font-weight: 600;
}

.card-heading-actions + .wo-form-fields {
  margin-top: 1.25rem;
}

/* Arbetsorder: knappar överst, rubrik på egen rad, extra luft före formulär */
.wo-card-header {
  display: block;
}

.wo-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.wo-header-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.wo-card-header .wo-page-title {
  flex: 1 1 100%;
  order: 100;
  margin: 0 0 22px;
  width: 100%;
}

.wo-card-header + .wo-form-fields {
  margin-top: 0;
}

.wo-page-title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.375rem;
}

.card-heading-actions h1.wo-page-title,
.wo-card-header h1.wo-page-title {
  word-break: normal;
  overflow-wrap: normal;
}

.wo-form-fields label {
  display: block;
  margin-top: 0;
  margin-bottom: 8px;
}

.wo-form-fields input,
.wo-form-fields select,
.wo-form-fields textarea {
  margin-top: 0;
  margin-bottom: 16px;
}

.wo-form-fields .report-custom-select {
  margin-top: 0;
  margin-bottom: 16px;
}

.wo-form-fields .report-custom-select-native {
  margin: 0 !important;
}

.wo-field-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.wo-field-label-row label {
  margin-bottom: 0;
}

.wo-field-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--accent-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wo-field-action-btn:hover {
  background: var(--bg-input-hover);
  border-color: var(--border-strong);
  color: var(--accent);
}

.wo-field-action-btn:focus-visible {
  outline: none;
  border-color: var(--focus-border, var(--accent));
  box-shadow: var(--focus-ring, 0 0 0 1px rgba(124, 179, 240, 0.35));
}

.wo-field-action-btn i[class^="fi-rr-"],
.wo-field-action-btn i[class*=" fi-rr-"] {
  font-size: 1.05em;
}

.wo-notes-block {
  margin-top: 20px;
  max-width: none;
}

.wo-readonly-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--border-input) 55%, transparent);
  border: 1px solid var(--border-input);
  white-space: nowrap;
}

.wo-readonly-pill i[class^="fi-rr-"],
.wo-readonly-pill i[class*=" fi-rr-"] {
  font-size: 0.95em;
  opacity: 0.9;
}

.wo-order-number-field input.wo-input-readonly {
  margin-bottom: 6px;
}

.wo-field-hint--readonly {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.wo-form-fields input.wo-input-readonly {
  cursor: default;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-input) 88%, var(--border) 12%);
  border-style: dashed;
  border-color: var(--border-strong);
  caret-color: transparent;
}

.wo-form-fields input.wo-input-readonly:focus {
  outline: none;
}

.wo-form-fields input.wo-input-readonly:focus-visible {
  outline: 2px solid var(--focus-border, var(--accent-soft));
  outline-offset: 2px;
  border-color: var(--border-strong);
}

.wo-form-fields input.wo-input-readonly::selection {
  background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
}

.wo-meta-grid {
  margin-bottom: 0;
}

.wo-lines-heading {
  margin-top: 1.75rem;
}

.wo-add-line-btn {
  margin-top: 14px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  min-height: 42px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wo-add-line-btn:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .wo-add-line-btn:hover {
  box-shadow: 0 4px 12px rgba(15, 26, 46, 0.12);
}

/* Arbetsorder: tydligare, mer tryck i huvudknappar */
.wo-header-bar .btn-wo-header,
.wo-header-bar a.btn-wo-header,
.wo-header-extra .btn-wo-header {
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.25;
  flex: 0 0 auto;
}

a.btn-wo-header {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-wo-header {
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.01em;
}

.btn-wo-header:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.btn-wo-header--primary {
  padding-left: 22px;
  padding-right: 22px;
}

[data-theme="light"] .btn-wo-header {
  box-shadow: 0 1px 3px rgba(15, 26, 46, 0.1);
}

[data-theme="light"] .btn-wo-header:hover {
  box-shadow: 0 4px 14px rgba(15, 26, 46, 0.14);
}

.wo-lines-table input,
.wo-lines-table select {
  margin: 0;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  padding: 6px 8px;
}

.wo-lines-table .wo-col-type {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.wo-lines-table .wo-col-type .wo-line-type {
  min-width: 6rem;
}

.wo-lines-table .wo-col-code {
  width: 1%;
  min-width: 11.25rem;
  max-width: 14rem;
  vertical-align: middle;
}

.wo-lines-table .wo-col-code .wo-line-code-input {
  font-size: 13px;
  padding: 6px 8px;
}

.wo-line-code-ac {
  position: relative;
}

.wo-line-code-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-primary);
}

.wo-line-code-dropdown {
  display: flex;
  flex-direction: column;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  box-shadow: var(--shadow-dropdown);
  overflow: hidden;
}

.wo-line-code-dropdown[hidden] {
  display: none !important;
}

.wo-line-code-dropdown-scroll {
  overflow-y: auto;
  min-height: 0;
}

.wo-line-code-dropdown-footer {
  flex-shrink: 0;
  padding: 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.wo-line-code-dropdown-footer .wo-line-code-new-btn {
  width: 100%;
}

.wo-code-ac-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.wo-code-ac-item:last-child {
  border-bottom: none;
}

.wo-code-ac-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

.wo-code-ac-pick:hover {
  background: var(--bg-dropdown-option-hover);
}

.wo-code-ac-pick-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wo-code-ac-pick-code {
  font-weight: 600;
}

.wo-code-ac-pick-desc {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

.wo-code-ac-pick-price {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.wo-code-ac-edit {
  flex-shrink: 0;
  align-self: center;
  margin-right: 6px;
}

.wo-code-ac-delete {
  flex-shrink: 0;
  align-self: center;
  margin-right: 6px;
  color: var(--danger, #c53030);
}

.wo-code-ac-delete:hover {
  color: var(--danger-hover, #9b2c2c);
}

.wo-code-ac-empty {
  padding: 10px;
  font-size: 13px;
}

.wo-lines-table .wo-col-desc {
  min-width: 6rem;
  width: 15.4%;
  vertical-align: middle;
}

.wo-lines-table .wo-col-desc .wo-line-desc {
  min-width: 5.1rem;
  font-size: 13px;
  padding: 6px 8px;
}

.wo-lines-table .wo-col-price {
  width: 1%;
  min-width: 6.75rem;
  max-width: 9.5rem;
  vertical-align: middle;
}

.wo-lines-table .wo-col-price .wo-line-price {
  font-size: 13px;
  padding: 6px 7px;
  text-align: right;
}

.wo-lines-table .wo-col-qty {
  width: 1%;
  max-width: 4.25rem;
  vertical-align: middle;
}

.wo-lines-table .wo-col-qty .wo-line-qty {
  font-size: 12px;
  padding: 5px 6px;
  text-align: right;
}

.wo-lines-table .wo-col-total-ex,
.wo-lines-table .wo-col-total-in {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.wo-lines-table .wo-col-vat {
  width: 1%;
  max-width: 4.75rem;
  vertical-align: middle;
}

.wo-lines-table .wo-col-vat .wo-line-vat {
  font-size: 12px;
  padding: 5px 6px;
  text-align: right;
}

.wo-lines-table .wo-col-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.wo-line-actions-inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.wo-line-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wo-line-toggle:hover {
  background: var(--bg-input-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.wo-line-toggle:focus-visible {
  outline: none;
  border-color: var(--focus-border, var(--accent));
  box-shadow: var(--focus-ring, 0 0 0 1px rgba(124, 179, 240, 0.35));
}

.wo-line-toggle i[class^="fi-rr-"],
.wo-line-toggle i[class*=" fi-rr-"] {
  font-size: 1.1em;
}

.wo-lines-th-numeric {
  text-align: right;
}

.wo-lines-th-hint {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.wo-line-total-cell {
  text-align: right;
  vertical-align: middle;
}

.wo-line-total {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.wo-line-total-incl {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .wo-header-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "back title save"
      "extra extra extra";
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 12px;
  }

  .wo-header-back {
    grid-area: back;
    padding: 8px 10px;
    min-height: 40px;
    font-size: 13px;
    background: color-mix(in srgb, var(--bg-input) 90%, transparent);
    box-shadow: none;
  }

  .wo-card-header .wo-page-title {
    grid-area: title;
    order: unset;
    flex: none;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
  }

  #saveOrderBtn {
    grid-area: save;
    padding: 8px 14px;
    min-height: 40px;
    font-size: 13px;
  }

  .wo-header-extra {
    grid-area: extra;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  }

  .wo-header-extra:not(:has(:not([hidden]))) {
    display: none;
  }

  .wo-header-extra .btn-wo-header {
    padding: 7px 12px;
    min-height: 36px;
    font-size: 12px;
    box-shadow: none;
  }

  .wo-header-extra .wo-header-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 65%, var(--border));
  }

  .wo-header-extra .wo-header-danger:hover {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger-hover, var(--danger));
  }

  @media (max-width: 400px) {
    .wo-header-back-text {
      display: none;
    }

    .wo-header-back {
      padding: 8px;
    }
  }

  .wo-lines-table-wrap {
    overflow-x: visible;
    margin-top: 12px;
  }

  .wo-lines-table,
  .wo-lines-table tbody,
  .wo-lines-table tfoot {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
  }

  .wo-lines-table thead {
    display: none;
  }

  .wo-lines-table tbody tr.wo-line-row {
    display: block;
    position: relative;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 12px 4px;
    margin-bottom: 12px;
    background: var(--bg-input);
  }

  .wo-lines-table tbody td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 10px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
    text-align: left;
    vertical-align: top;
    white-space: normal;
    box-sizing: border-box;
  }

  .wo-lines-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
  }

  .wo-lines-table tbody td.wo-col-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
    padding: 0;
    border-bottom: none;
  }

  .wo-lines-table tbody td.wo-col-actions::before {
    display: none;
  }

  .wo-lines-table tbody td.wo-col-type {
    padding-right: 96px;
  }

  .wo-lines-table .wo-col-type,
  .wo-lines-table .wo-col-code,
  .wo-lines-table .wo-col-desc,
  .wo-lines-table .wo-col-price,
  .wo-lines-table .wo-col-qty,
  .wo-lines-table .wo-col-vat,
  .wo-lines-table .wo-col-total-ex,
  .wo-lines-table .wo-col-total-in {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .wo-lines-table .wo-col-price,
  .wo-lines-table .wo-col-qty,
  .wo-lines-table .wo-col-total-ex,
  .wo-lines-table .wo-col-total-in {
    display: inline-block;
    width: calc(50% - 6px);
    vertical-align: top;
    box-sizing: border-box;
  }

  .wo-lines-table .wo-col-price,
  .wo-lines-table .wo-col-total-ex {
    margin-right: 12px;
  }

  .wo-lines-table .wo-col-vat {
    clear: both;
  }

  .wo-lines-table .wo-col-actions .wo-line-actions-inner {
    gap: 4px;
  }

  .wo-line-toggle {
    display: inline-flex;
  }

  .wo-lines-table .wo-col-actions .wo-line-toggle {
    width: 40px;
    height: 40px;
  }

  .wo-line-row--collapsed .wo-col-code,
  .wo-line-row--collapsed .wo-col-price,
  .wo-line-row--collapsed .wo-col-total-ex,
  .wo-line-row--collapsed .wo-col-total-in,
  .wo-line-row--collapsed .wo-col-vat {
    display: none !important;
  }

  .wo-line-row--collapsed.wo-line-row--freetext .wo-col-price,
  .wo-line-row--collapsed.wo-line-row--freetext .wo-col-qty,
  .wo-line-row--collapsed.wo-line-row--freetext .wo-col-vat {
    display: none !important;
  }

  .wo-lines-table .wo-col-actions .wo-line-remove {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.25rem;
    line-height: 1;
  }

  .wo-line-row--collapsed .wo-col-price,
  .wo-line-row--collapsed .wo-col-total-ex,
  .wo-line-row--collapsed .wo-col-total-in {
    display: none !important;
  }

  .wo-line-row--collapsed .wo-col-qty {
    display: block !important;
    width: 100%;
    clear: both;
  }

  .wo-lines-table input,
  .wo-lines-table select {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    padding: 10px 12px;
    min-height: 44px;
    box-sizing: border-box;
  }

  .wo-lines-table .wo-col-type .wo-line-type {
    min-width: 0;
  }

  .wo-lines-table .wo-line-code-ac,
  .wo-lines-table .wo-line-pricing-fields,
  .wo-lines-table .wo-line-qty-field,
  .wo-lines-table .wo-line-vat-field {
    width: 100%;
    max-width: 100%;
  }

  .wo-lines-table .wo-col-price .wo-line-price,
  .wo-lines-table .wo-col-qty .wo-line-qty,
  .wo-lines-table .wo-col-vat .wo-line-vat {
    text-align: left;
  }

  .wo-lines-table .wo-line-total-cell {
    text-align: left;
  }

  .wo-lines-table .wo-line-total,
  .wo-lines-table .wo-line-total-incl {
    display: block;
    min-height: 1.25rem;
    font-size: 15px;
    white-space: normal;
    word-break: break-word;
  }

  .wo-line-row--freetext .wo-col-code,
  .wo-line-row--freetext .wo-col-price,
  .wo-line-row--freetext .wo-col-qty,
  .wo-line-row--freetext .wo-col-vat {
    display: none;
  }

  .wo-line-row--freetext .wo-col-total-ex,
  .wo-line-row--freetext .wo-col-total-in {
    display: inline-block;
    width: calc(50% - 6px);
  }

  .wo-line-row--package .wo-line-package-ui:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
  }

  .wo-line-row--package .wo-package-edit-btn {
    width: 100%;
    min-height: 44px;
  }

  .wo-add-line-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .wo-invoice-totals {
    max-width: none;
    margin-left: 0;
  }
}

.wo-line-row--freetext .wo-line-code-ac {
  display: none !important;
}

.wo-line-row--freetext .wo-line-code-placeholder:not([hidden]) {
  display: inline-block;
  padding: 0.35rem 0;
}

.wo-line-row--freetext .wo-line-pricing-fields,
.wo-line-row--freetext .wo-line-qty-field,
.wo-line-row--freetext .wo-line-vat-field {
  display: none !important;
}

.wo-line-freetext-dash {
  display: none;
}

.wo-line-row--freetext .wo-line-freetext-dash {
  display: inline-block;
  padding: 0.35rem 0;
  vertical-align: middle;
}

.wo-line-row--package .wo-line-code-ac {
  display: none !important;
}

.wo-line-row--package .wo-line-package-ui:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wo-line-row--package .wo-package-line-count {
  font-size: 12px;
}

.wo-pdf-export-hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.wo-pdf-export-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.wo-pdf-export-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

.wo-package-modal-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.wo-package-modal-table-wrap {
  margin-bottom: 1rem;
  max-height: min(50vh, 360px);
  overflow: auto;
}

.wo-package-modal-table {
  width: 100%;
  border-collapse: collapse;
}

.wo-package-modal-table th,
.wo-package-modal-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-default, #e2e8f0);
  vertical-align: middle;
}

.wo-package-modal-table .wo-line-code-ac {
  min-width: 0;
}

.wo-package-modal-table .wo-line-code-input {
  width: 100%;
  min-width: 160px;
}

.wo-package-modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wo-package-modal-actions .wo-package-modal-actions-spacer {
  flex: 1;
  min-width: 8px;
}

.wo-code-ac-item--no-price .wo-code-ac-pick-main {
  padding-right: 0.25rem;
}

.wo-invoice-totals {
  margin-top: 24px;
  max-width: 360px;
  margin-left: auto;
  background: var(--bg-input);
}

.wo-invoice-heading {
  margin: 0 0 12px;
  font-size: 1rem;
}

.wo-invoice-dl {
  margin: 0;
}

.wo-invoice-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.wo-invoice-type-row dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.wo-invoice-subtotal-row {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.wo-invoice-subtotal-row dt {
  font-weight: 600;
}

.wo-invoice-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.wo-invoice-dl dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.wo-invoice-total-row {
  border-bottom: none !important;
  padding-top: 10px !important;
  font-size: 1.05rem;
}

.wo-clock-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.wo-clock-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.wo-clock-section-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.wo-clock-section[hidden] {
  display: none !important;
}

.wo-clock-entries-table {
  margin-top: 8px;
}

.wo-clock-entries-table tfoot td {
  font-weight: 600;
  border-top: 2px solid var(--border);
  background: var(--bg-input-hover);
  padding-top: 12px;
  padding-bottom: 12px;
}

.wo-clock-live {
  font-weight: 600;
  color: var(--accent-soft);
}

.report-custom-select-option--add {
  font-weight: 600;
  color: var(--accent-soft);
}

/* —— Ljust tema: komponenter med kvarvarande hårdkodade ytor —— */
[data-theme="light"] select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

[data-theme="light"] .toast-host .toast,
[data-theme="light"] .toast-stack .toast {
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="light"] .toast-host .toast-success,
[data-theme="light"] .toast-stack .toast--success {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

[data-theme="light"] .toast-host .toast-error,
[data-theme="light"] .toast-stack .toast--error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

[data-theme="light"] .toast-host .toast-warning,
[data-theme="light"] .toast-stack .toast--warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

[data-theme="light"] .toast-host .toast-info,
[data-theme="light"] .toast-stack .toast--info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

[data-theme="light"] .app-modal {
  background: var(--bg-surface);
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="light"] .app-modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .app-modal-header {
  border-bottom-color: var(--border);
}

[data-theme="light"] .global-clock-widget {
  background: var(--bg-surface);
  border-color: var(--border-input);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-inner,
[data-theme="light"] .global-clock-widget-minibar {
  background: var(--bg-surface);
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-minibar:hover {
  background: var(--bg-input-hover);
}

[data-theme="light"] .global-clock-widget-minibar:focus-visible {
  outline-color: var(--focus-border, var(--accent));
}

[data-theme="light"] .global-clock-widget-heading {
  color: var(--text-secondary);
}

[data-theme="light"] .global-clock-widget--active .global-clock-widget-heading {
  color: #166534;
}

[data-theme="light"] .global-clock-widget-summary {
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-elapsed,
[data-theme="light"] .global-clock-widget-minibar-elapsed {
  color: #1e40af;
}

[data-theme="light"] .global-clock-widget-minibar-text {
  color: var(--text-secondary);
}

[data-theme="light"] .global-clock-widget--active .global-clock-widget-minibar-text {
  color: #166534;
}

[data-theme="light"] .global-clock-widget-reminder-countdown {
  color: #1e40af;
}

[data-theme="light"] .global-clock-widget-quick-last {
  background: var(--bg-input);
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-quick-last:hover {
  background: var(--bg-input-hover);
  border-color: var(--border-strong);
}

[data-theme="light"] .global-clock-widget-quick-last-label {
  color: var(--text-muted);
}

[data-theme="light"] .global-clock-widget-quick-last-text {
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-quick-last.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

[data-theme="light"] .global-clock-widget-reminders {
  border-color: var(--border-input);
  background: var(--bg-input);
}

[data-theme="light"] .global-clock-widget-reminders[open] {
  background: var(--bg-input-hover);
}

[data-theme="light"] .global-clock-widget-collapse-btn,
[data-theme="light"] .global-clock-widget-menu-btn {
  color: var(--text-muted);
}

[data-theme="light"] .global-clock-widget-collapse-btn:hover,
[data-theme="light"] .global-clock-widget-menu-btn:hover {
  color: var(--text-primary);
  background: var(--bg-dropdown-option-hover);
}

[data-theme="light"] .global-clock-widget-reminders-info {
  color: var(--accent);
}

[data-theme="light"] .global-clock-widget-dot:not(.global-clock-widget-dot--on) {
  background: #94a3b8;
}

[data-theme="light"] .global-clock-widget-menu {
  background: var(--bg-dropdown);
  border-color: var(--border-input);
  box-shadow: var(--shadow-dropdown);
}

[data-theme="light"] .global-clock-widget-menu-title {
  color: var(--text-muted);
}

[data-theme="light"] .global-clock-widget-menu-title--sub {
  border-top-color: var(--border);
}

[data-theme="light"] .global-clock-widget-menu-rowbtn {
  background: var(--bg-input);
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-menu-rowbtn:hover {
  background: var(--bg-input-hover);
  border-color: var(--border-strong);
}

[data-theme="light"] .global-clock-widget-menu-rowbtn--danger {
  border-color: #fecaca;
  color: #991b1b;
}

[data-theme="light"] .global-clock-widget-menu-rowbtn--danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

[data-theme="light"] .global-clock-widget-pos-option {
  background: var(--bg-input);
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-pos-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-input-hover);
}

[data-theme="light"] .global-clock-widget-pos-frame {
  border-color: var(--border-strong);
  background: var(--bg-body);
}

[data-theme="light"] .global-clock-widget-pos-label {
  color: var(--text-secondary);
}

[data-theme="light"] .dashboard-hero-clock-root.global-clock-widget {
  background: var(--bg-surface);
  border-color: var(--border-input);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .dashboard-hero-clock-root.global-clock-widget--active {
  border-color: #0ea5e9;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #0ea5e9 25%, transparent) inset,
    0 12px 36px rgba(14, 165, 233, 0.12);
}

[data-theme="light"] .global-clock-widget-reminder-item {
  border-color: var(--border-input);
  background: var(--bg-surface);
  color: var(--text-primary);
}

[data-theme="light"] .global-clock-widget-reminder-remove {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

[data-theme="light"] .dashboard-clock-toolbar {
  border-top-color: var(--border);
}

[data-theme="light"] .dashboard-clock-widget-pref {
  color: var(--text-muted);
}

[data-theme="light"] .report-stat-card {
  background: var(--bg-input);
  border-color: var(--border-input);
}

[data-theme="light"] .report-stat-card-label {
  color: var(--text-muted);
}

[data-theme="light"] .report-stat-card-value {
  color: var(--text-primary);
}

[data-theme="light"] .report-export-panel,
[data-theme="light"] .topbar-nav-dropdown-panel,
[data-theme="light"] .global-clock-widget-fav-dropdown,
[data-theme="light"] .report-custom-select-dropdown,
[data-theme="light"] .global-clock-widget-reminders-popover {
  background: var(--bg-dropdown);
  border-color: var(--border-input);
  box-shadow: var(--shadow-dropdown);
}

[data-theme="light"] .global-clock-widget-fav-trigger,
[data-theme="light"] .report-custom-select-trigger,
[data-theme="light"] .topbar .menu .org-switch-select,
[data-theme="light"] .global-clock-widget-reminders-select {
  color: var(--text-primary);
  background-color: var(--bg-input);
  border-color: var(--border-input);
}

[data-theme="light"] .global-clock-widget-fav-trigger:hover,
[data-theme="light"] .report-custom-select-trigger:hover,
[data-theme="light"] .topbar .menu .org-switch-select:hover,
[data-theme="light"] .global-clock-widget-reminders-select:hover {
  background-color: var(--bg-input-hover);
  border-color: var(--border-strong);
}

[data-theme="light"] table th {
  color: var(--text-muted);
}

[data-theme="light"] table td {
  color: var(--text-primary);
}

[data-theme="light"] .topbar .menu .org-switch-select,
[data-theme="light"] .topbar .menu .org-current-name {
  color: var(--text-nav);
}

[data-theme="light"] .dashboard-overview-hero {
  background: linear-gradient(135deg, #e8eef6 0%, #f0f4f8 50%, #e2e8f0 100%);
  border-color: var(--border);
}

[data-theme="light"] .dashboard-overview-title {
  background: linear-gradient(90deg, #0f1a2e 0%, #1e3a5f 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

[data-theme="light"] .dashboard-empty-title {
  color: var(--text-primary);
}

[data-theme="light"] .dashboard-longest-label {
  color: var(--accent);
}

[data-theme="light"] .report-tab {
  color: var(--text-secondary);
}

[data-theme="light"] .report-tab.is-active {
  color: var(--text-primary);
  background: var(--bg-dropdown-option-active);
}

[data-theme="light"] .report-tab:hover {
  color: var(--accent-soft);
  background: var(--bg-dropdown-option-hover);
}

@media (max-width: 980px) {
  [data-theme="light"] .topbar.is-menu-open .menu {
    background: var(--bg-topbar);
    border-color: var(--border);
  }

  [data-theme="light"] .menu a:hover {
    color: var(--accent);
  }
}
