@import url("gigi.css");

/* Instrumentpanelen (Översikt, Att göra, Ekonomi) – efter Figma-sektionerna i "Angelicas kopia". */
:root {
  --purple: #270949;
  --purple-10: rgba(39, 9, 73, 0.1);
  --purple-5: rgba(39, 9, 73, 0.05);
  --charcoal: #3d404c;
  --ink: #1c1c1c;
  --light-grey: #f8f8fb;
  --white: #ffffff;
  --stroke: rgba(198, 198, 198, 0.5);
  --pink: #ce0088;
  --green-bg: rgba(10, 190, 17, 0.33);
  --green-text: #007219;
  --yellow-bg: rgba(223, 202, 14, 0.33);
  --yellow-text: #726000;
  --card-shadow: 0 2px 8.3px rgba(94, 94, 94, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--charcoal);
  background: var(--white);
}
/* Döljer sidan tills inloggningen är kontrollerad */
body.is-checking { visibility: hidden; }

button { font: inherit; cursor: pointer; }
a { color: inherit; }

.dash {
  max-width: 1728px;
  margin: 0 auto;
  padding: 24px 40px 160px;
}

/* ---------- Toppfältet ---------- */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 0 24px;
  border-radius: 5px;
  background: linear-gradient(to right, #270949, #2f065d);
  color: var(--white);
}
.dash-logo {
  font-family: "Sacramento", cursive;
  font-size: 34.3px;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
}
.dash-topbar-actions { display: flex; align-items: center; gap: 32px; }
.dash-settings {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--white);
  font-weight: 500;
  font-size: 18px;
}
.dash-settings img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.dash-logout {
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
}
.dash-logout:hover, .dash-settings:hover { opacity: .85; }

/* ---------- Rubrik, flikar och knapp ---------- */
.dash-title {
  margin: 32px 0 0;
  font-weight: 700;
  font-size: 40px;
  color: var(--charcoal);
}
.dash-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.dash-tabs { display: flex; align-items: center; gap: 21px; }
.dash-tab {
  min-width: 110px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 18px;
  color: var(--charcoal);
  text-align: center;
  text-decoration: none;
}
.dash-tab:hover { background: var(--purple-5); }
.dash-tab[aria-current="page"] { background: var(--purple-10); min-width: 0; }

.dash-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  background: var(--purple);
  color: var(--white);
  font-weight: 600;
  font-size: 18px;
}
.dash-action img { width: 24px; height: 24px; }
.dash-action:hover { opacity: .9; }
.dash-count {
  position: absolute;
  top: -14px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border-radius: 14px;
  background: var(--pink);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Boarden ---------- */
.board {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 39px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.board-stack { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }

.col {
  flex-shrink: 0;
  width: 404px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  border: 1px solid var(--purple-5);
  border-radius: 12px;
  background: var(--light-grey);
  filter: drop-shadow(0 2px 4.15px rgba(94, 94, 94, 0.1));
  scroll-snap-align: start;
}
.board-stack .col { width: 404px; }
.col-title { margin: 0; font-weight: 600; font-size: 20px; color: var(--charcoal); }
.col-group { display: flex; flex-direction: column; gap: 16px; }
.col-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 -8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.col-create {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 404px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--purple);
  color: var(--white);
  font-weight: 500;
  font-size: 16px;
}
.col-create img { width: 20px; height: 20px; }

/* Välj alla */
.select-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; cursor: pointer; }
.check {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--charcoal);
  border-radius: 3px;
  background: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.check:checked { background: var(--purple); border-color: var(--purple); }
.check:checked::after {
  content: "";
  width: 5px;
  height: 10px;
  margin-top: -2px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

/* ---------- Statistikruta ---------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 8px;
  background: var(--purple-10);
}
.stat-label { margin: 0; font-size: 16px; line-height: 20px; color: rgba(28, 28, 28, 0.8); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stat-value { margin: 0; font-weight: 600; font-size: 32px; line-height: 1; color: var(--ink); }
.stat-value small { font-size: 16px; font-weight: 600; margin-left: 4px; }
.stat-value .sep { font-weight: 400; margin: 0 8px; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 16px; color: var(--ink); }
.stat-delta img { width: 16px; height: 16px; }
.stat-delta { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.stat-delta-note { flex-basis: 100%; text-align: right; font-size: 12px; font-weight: 400; color: rgba(28, 28, 28, 0.7); }

/* Inställningar */
.settings {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-radius: 16px;
  color: var(--charcoal);
  box-shadow: 0 12px 40px rgba(39, 9, 73, .2);
}
.settings::backdrop { background: rgba(39, 9, 73, .35); }
.settings h2 { margin: 0 0 16px; font-size: 22px; color: var(--purple); }
.settings-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 16px; }
.settings-list dt { font-weight: 600; }
.settings-list dd { margin: 0; overflow-wrap: anywhere; }
.settings-help { margin: 20px 0 0; font-size: 14px; }
.settings-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.settings-close { border: 1px solid var(--purple); border-radius: 6px; padding: 6px 14px; background: var(--white); color: var(--purple); font-weight: 600; font-size: 15px; }

/* ---------- Kort ---------- */
.card {
  position: relative;
  width: 100%;
  padding: 23px 15px 20px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--white);
  box-shadow: var(--card-shadow);
}
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-who { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-line { display: flex; align-items: center; gap: 16px; margin: 0; font-size: 18px; line-height: 1.3; color: var(--charcoal); min-width: 0; }
.card-line > span:last-child { min-width: 0; }
.card-line img { width: 24px; height: 24px; flex-shrink: 0; }
.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.card-text { margin: 12px 0 0; padding-right: 36px; font-weight: 300; font-size: 16px; line-height: 1.35; color: var(--charcoal); }
.card-text b { font-weight: 600; color: var(--purple); }
.card-text a { font-weight: 700; color: var(--purple); }
.card-date { font-size: 14px; color: var(--charcoal); }
.card-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0 0 40px; font-size: 14px; }
.card-meta dt { font-weight: 500; color: var(--ink); }
.card-meta dd { margin: 0; }
.card-select { display: flex; align-items: flex-start; gap: 14px; }
.card-select > .check { margin-top: 2px; }
.card-select > .card-who { flex: 1; }

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 16px;
  background: var(--dot) center / contain no-repeat;
}

/* Etiketter */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 31px;
  font-size: 14px;
  white-space: nowrap;
  background: var(--purple-10);
  color: var(--purple);
}
.badge img { width: 16px; height: 16px; }
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow-text); }
.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 50px;
  background: var(--purple-10);
  color: var(--purple);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
}
.ref {
  display: inline-block;
  margin-left: 4px;
  vertical-align: 2px;
  padding: 2px 6px;
  border-radius: 50px;
  background: var(--purple-10);
  color: var(--purple);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  background: var(--purple);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
}
.btn-small img { width: 18px; height: 18px; }

/* Utfällbara kort */
.card-toggle {
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
}
.card-toggle:hover { background: var(--purple-5); }
.card-toggle img { width: 24px; height: 24px; transition: transform .2s ease; }
.card-toggle[aria-expanded="true"] img { transform: rotate(180deg); }
.card.has-toggle { padding-bottom: 44px; }
.checklist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist label { display: flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; }

/* Liten bekräftelse */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--purple);
  color: var(--white);
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(39, 9, 73, .25);
}

/* ---------- Mindre skärmar ---------- */
@media (max-width: 900px) {
  .dash { padding: 16px 16px 140px; }
  .dash-topbar { height: 60px; padding: 0 16px; }
  .dash-settings span { display: none; }
  .dash-topbar-actions { gap: 16px; }
  .dash-title { font-size: 30px; margin-top: 24px; }
  .dash-tabs { gap: 6px; }
  .dash-tab { min-width: 0; font-size: 16px; padding: 8px 12px; }
  .dash-action { font-size: 16px; }
  .board { margin-top: 28px; margin-right: -16px; padding-right: 16px; }
  .col, .board-stack .col, .col-create { width: min(86vw, 404px); }
}

@media (prefers-reduced-motion: reduce) {
  .card-toggle img { transition: none; }
}
