@import url('https://fonts.googleapis.com/css?family=Oswald:300,400,500,700');

@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800');

:root,
[data-bs-theme=light] {
  --card-text-color: #FFF !important;
  --card-link-color: #FFF !important;
}

[data-bs-theme=dark] {
  --card-text-color: #FFF !important;
  --card-link-color: #FFF !important;
}

.gr-1 {
  background: linear-gradient(170deg, #09c5d3 0%, #00384e 100%);
}

.gr-2 {
  background: linear-gradient(170deg, #3ac52d 0%, #2f7713 100%);
}

.gr-3 {
  background: linear-gradient(170deg, #C86DD7 0%, #3023AE 100%);
}

.gr-4 {
  background: linear-gradient(170deg, #0992d1 0%, #132eb4 100%);
}

.gr-5 {
  background: linear-gradient(170deg, #c0c0c0 0%, #505050 100%);
}

.gr-6 {
  background: linear-gradient(170deg, #ff4747 0%, #4d0000 100%);
}

.gr-7 {
  background: linear-gradient(170deg, #e7c219 0%, #8d6c00 100%);
}

.gr-8 {
  background: linear-gradient(170deg, #ff5dc1 0%, #a7085f 100%);
}

.gr-9 {
  background: linear-gradient(170deg, #185ff8 0%, #070046 100%);
}

.column {
  transition: .4s;
  padding-left: 0rem;
  opacity: 1;

  &:hover {
    padding-left: 0rem;

    .ico-card {
      opacity: 0.6;
      transition: .4s;
    }

    .dashboard-card .dashboard-txt {
      margin-left: 1rem;

      h1,
      p {
        margin-left: -1rem;
        color:#000;
        opacity: 1;
      }
    }

    a {
      color: rgba(255, 255, 255, 1);

      &:after {
        width: 100%;
        transition: 0.4s;
      }
    }
  }
}

.ico-card {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.dashboard-card {
  min-height: 200px;
  margin: 0;
  padding: 1.0rem 1.2rem;
  border: none;
  border-radius: 0;
  color: #FFF !important;
  letter-spacing: .1rem;
  font-family: 'Oswald';
  box-shadow: 0 0 10px rgba(0, 0, 0, .27);
  text-shadow: 2px 2px 3px rgb(109, 109, 109);
  position: relative;
}

.dashboard-card-apl {
  min-height: 162px;
  margin: 0;
  padding: 1.0rem 1.2rem;
  border: none;
  border-radius: 0;
  color: #FFF !important;
  letter-spacing: .1rem;
  font-family: 'Oswald';
  box-shadow: 0 0 21px rgba(0, 0, 0, .27);
  text-shadow: 2px 2px 3px rgb(109, 109, 109);
  position: relative;
}

.dashboard-txt {
  transition: 0.4s;
  margin-left: 1rem;
  z-index: 1;

  h1 {
    transition: 0.4s;
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: uppercase;
    color: #FFF !important;
  }

  p {
    transition: 0.4s;
    font-size: .9rem;
    /*font-family: 'Open Sans', sans-serif;*/
    letter-spacing: .05rem;
    margin-top: -5px;
    /*opacity: 0;*/
    color: #FFF !important;
  }
}

.dashboard-card a:hover {
  z-index: 3;
  font-size: .9rem;
  color: rgb(233, 233, 233);
  margin-left: 1rem;
  position: relative;
  text-decoration: none;
  text-underline-offset: 2px;
  text-transform: uppercase;

  display: inline-block;
  padding: 3px 8px 3px 8px;
  margin-bottom: 1px;
  border-radius: 10px;
  /* Rundade hörn */
  background-color: rgba(0, 0, 0, 0.1);
  /* Svag ruta */
  /* Textfärg */
  cursor: pointer;
  /* Muspekare ändras till hand */

}

.dashboard-card a {
  z-index: 3;
  font-size: .9rem;
  color: rgb(255, 255, 255);
  margin-left: 1rem;
  position: relative;
  text-decoration: none;
  text-transform: uppercase;

  display: inline-block;
  padding: 3px 8px 3px 8px;
  margin-bottom: 1px;
  border-radius: 10px;
  /* Rundade hörn */
  background-color: rgba(0, 0, 0, 0.05);
  /* Svag ruta */
  /* Textfärg */
  cursor: pointer;
  /* Muspekare ändras till hand */

  &:after {
    content: "";
    display:block;
    height: 0.2em;
    width: 0px;
    margin-right: -100%;
    margin-left: 1%;
    opacity: 1;
    
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    transition: 0.4s;
  }
}

.dashboard-card i {
  position: relative;
  right: -50%;
  top: 60%;
  font-size: 12rem;
  line-height: 0;
  opacity: .2;
  color: rgba(255, 255, 255, 1);
  z-index: 0;
}

.card-timer {
  position: absolute;
  bottom: 10px;
  font-size: 0.7rem;
  /* Avstånd från botten */
  right: 10px;
  /* Avstånd från höger */
}

/* ============================================================================
   S.O.F.I.A · Dashboard-kort v2  (läggs SIST i din befintliga dashboards-CSS)
   Lämnar dina gamla .dashboard-card/.column orörda så omigrerade kort funkar.
   ============================================================================ */

/* ---- Kortet: fast höjd anpassad för två rader chips ---- */
.card-base {
  position: relative;
  overflow: hidden;
  height: 140px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .27);
  transition: box-shadow .25s, transform .12s;
}

.card-base:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .34);
}

.card-inner {
  position: absolute;
  inset: 0;
  padding: .8rem 1rem;
  color: #FFF !important;
  font-family: 'Oswald';
  letter-spacing: .05rem;
  text-shadow: 2px 2px 3px rgb(109, 109, 109);
  transition: filter .3s, opacity .3s;
  isolation: isolate;
}

/* Rubrik: vattenstämpel nere till höger, skarp cutout */
.card-inner h1 {
  position: absolute;
  bottom: .05rem;
  left: .6rem;
  font-size: 1.0rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: .85;
  letter-spacing: .04rem;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
  color: rgba(0, 0, 0, .1) !important;
  -webkit-text-stroke: 0;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, .4),
    1px 1px 0 rgba(255, 255, 255, .1);
  transition: color .35s, text-shadow .35s;
}

.card-base:hover .card-inner h1 {
  color: rgba(0, 0, 0, .26) !important;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, .5),
    1px 1px 0 rgba(255, 255, 255, .1);
    transition: transform .5s;
}

#grid:not(.editing) .card-base:hover .card-inner h1 {
  transform: translateX(3px);
}

.card-inner h2 {
  position: relative;
  z-index: 2;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06rem;
  line-height: 1.2;
  margin: -.3rem 0 .3rem;
  color: rgba(255, 255, 255, .85) !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .4);
  overflow-wrap: break-word;
  padding-right: 1rem;
  /* luft mot hörn-badge */
}

.card-inner p {
  position: relative;
  z-index: 2;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06rem;
  line-height: 1.2;
  margin: .1rem 0 .3rem;
  color: rgba(255, 255, 255, .85) !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .4);
  overflow-wrap: break-word;
  padding-right: 1rem;
  /* luft mot hörn-badge */
}

.chips {
  margin: -.2rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  position: relative;
  z-index: 2;
}

@media (max-width: 992px) {
  .chips a {
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 10px;
    margin-bottom: 4px;
    display: block;
    width: 100%;
  }

  .chips a:hover {
    background: rgba(255, 255, 255, 0.35);
  }
}

.chips a {
  position: relative;
  font-size: .90rem;
  padding: 7px 5px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .05rem;
  line-height: 1.05;
  transition: background .25s;
  display: inline-block;
  width: fit-content;
}


.chips a::before {
  content: "›";
  margin-right: .25rem;
  opacity: .6;
  transition: opacity .2s;
}

.chips a:hover::before {
  opacity: 1;
}


.chips a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1px;
  background: rgba(255, 255, 255, .8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}

.chips-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
}

#grid:not(.editing) .chips a:hover::after {
  transform: scaleX(1);
}


/* ---- Bakgrundsikon (dina fad-ikoner) ---- */
.card-inner .ico-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.card-inner .ico-card i {
  position: absolute;
  right: -1.4rem;
  bottom: -1.2rem;
  font-size: 9rem;
  line-height: 1;
  opacity: .23;
  color: #000000;
  transition: opacity .3s;
}

.card-base:hover .ico-card i {
  opacity: .45;
  transition: opacity .5s;
}


.card-timer {
  position: absolute;
  bottom: 5px;
  right: 9px;
  font-size: .66rem;
  z-index: 3;
  opacity: .75;
}

/* ---- Notis-flik: mjuka piller i tonat hörnfält ---- */
.dc-badges {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 6;
  display: flex;
  gap: .3rem;
  align-items: center;
  padding: .28rem .5rem .5rem .65rem;
  background: rgba(0, 0, 0, .16);
  border-bottom-left-radius: 12px;
  text-shadow: none;
}

.dc-b {
  font-family: 'Open Sans', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .34rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dc-b-red {
  background: #e04444;
  color: #fff;
}

.dc-b-blue {
  background: #425cf0;
  color: #fff;
}

/* ============================================================================
   REDIGERINGSLÄGE
   ============================================================================ */
/* Dolda kort: syns bara i redigeringsläget */
#grid:not(.editing) .cardcol[data-active="0"] {
  display: none;
}

#grid.editing {
  user-select: none;
}

#grid.editing .cardcol {
  cursor: grab;
  touch-action: none;
}

#grid.editing .cardcol .card-inner {
  pointer-events: none;
}

/* länkar stör ej drag/klick */
#grid.editing .cardcol[data-active="0"] .card-inner {
  filter: grayscale(1) brightness(.92);
  opacity: .72;
}

#grid.editing .cardcol[data-active="0"] .card-base {
  outline: 2px dashed rgba(120, 120, 120, .55);
  outline-offset: -5px;
}

#grid.editing .card-timer {
  display: none;
}

/* Under drag */
.cardcol.dragging {
  z-index: 1000;
}

.cardcol.dragging .card-base {
  transform: rotate(-1.5deg) scale(1.02);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .45);
  cursor: grabbing;
}

/* Platshållare som visar var kortet landar */
.ph-slot {
  border-radius: 6px;
  border: 2px dashed rgba(120, 120, 120, .7);
  background: rgba(0, 0, 0, .04);
}

/* Hörn-reglage nere till höger: text vänster, +/- pinnad till höger */
.dc-toggle {
  display: none;
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 8;
  align-items: center;
  gap: .45rem;
  padding: .32rem .5rem .34rem .6rem;
  background: rgba(0, 0, 0, .24);
  border-top-left-radius: 12px;
  text-shadow: none;
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: .78rem;
  color: #fff;
}

#grid.editing .dc-toggle {
  display: inline-flex;
}

.dc-toggle .pm {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  color: #fff;
}

.cardcol[data-active="1"] .pm {
  background: #d76a6a;
}

/* ? dölj (röd) */
.cardcol[data-active="0"] .pm {
  background: #4f9e6a;
}

/* + lägg till (grön, alltid) */

/* Tom-läge-spärr (visas om användaren dolt allt) */
.dashboard-empty {
  font-family: 'Open Sans', sans-serif;
  color: #8b9096;
  text-align: center;
  padding: 2.5rem 1rem;
  border: 2px dashed rgba(120, 120, 120, .4);
  border-radius: 8px;
}


/* ===== APL närvaro-flik (nere till vänster, speglar notis-fliken) ===== */
.presence-flik{
  position:absolute; bottom:0; left:0; z-index:8;
  display:flex; align-items:center; gap:.4rem;
  padding:.3rem .65rem .34rem .5rem;
  border-top-right-radius:12px; cursor:pointer;
  text-shadow:none; transition:opacity .2s;
}
.presence-flik:hover{ opacity:.85; }
.presence-flik .pf-dot{
  width:.55rem; height:.55rem; border-radius:999px;
  background:#fff; opacity:.9; flex:0 0 auto;
}
.presence-flik .pf-text{
  font-family:'Open Sans',sans-serif; font-size:.72rem; font-weight:700;
  text-transform:uppercase; letter-spacing:.04rem; color:#fff;
}

/* Närvaro statusfärger */
.ns-0{ background:#0dcaf0; }
.ns-1{ background:#28a745; }
.ns-2{ background:#ffc107; }
.ns-3{ background:#ffc107; }
.ns-4{ background:#dc3545; }
.ns-5{ background:#28a745; }

/* Modal-knappar */
.presence-modal-btn{
  display:flex; align-items:center; gap:.6rem;
  padding:.6rem .9rem; border-radius:6px; cursor:pointer;
  border:none; width:100%; text-align:left;
  font-family:'Open Sans',sans-serif; font-size:.88rem; font-weight:600;
  transition:opacity .2s; color:#fff; text-shadow:none;
}
.presence-modal-btn:hover{ opacity:.88; }
.presence-modal-btn .pm-dot{
  width:.7rem; height:.7rem; border-radius:999px; flex:0 0 auto;
}

.supervisor-card .card-base {
  min-height: 140px;
  height: auto !important;
  overflow: visible !important;
}

.supervisor-card .card-inner {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  min-height: 140px;
  padding-bottom: 2rem !important;
}

.show-more-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 8;
  padding: .28rem .5rem .34rem .65rem;
  background: rgba(0, 0, 0, .16);
  border-top-left-radius: 12px;
  border: none;
  color: #fff;
  font-family: 'Open Sans', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  text-shadow: none;
}

.show-more-btn:hover {
  background: rgba(0, 0, 0, .28);
}

.dc-b-orange {
  background: #fd7e14;
  color: #fff;
}

.gr-light-1 {
  background-color: rgba(9, 197, 211, 0.15);
}

.gr-light-2 {
  background-color: rgba(58, 197, 45, 0.15);
}

.gr-light-3 {
  background-color: rgba(200, 109, 215, 0.15);
}

.gr-light-4 {
  background-color: rgba(9, 146, 209, 0.15);
}

.gr-light-5 {
  background-color: rgba(192, 192, 192, 0.15);
}

.gr-light-6 {
  background-color: rgba(255, 71, 71, 0.15);
}

.gr-light-7 {
  background-color: rgba(231, 194, 25, 0.15);
}

.gr-light-8 {
  background-color: rgba(255, 93, 193, 0.15);
}

.gr-light-9 {
  background-color: rgba(24, 95, 248, 0.15);
}

.gr-light-1 i {
  color: #0c919b;
}

.gr-light-2 i {
  color: #3ac52d;
}

.gr-light-3 i {
  color: #C86DD7;
}

.gr-light-4 i {
  color: #0992d1;
}

.gr-light-5 i {
  color: #505050;
}

.gr-light-6 i {
  color: #ff4747;
}

.gr-light-7 i {
  color: #caaa1d;
}

.gr-light-8 i {
  color: #ff5dc1;
}

.gr-light-9 i {
  color: #185ff8;
}

.gr-light-1,
.gr-light-1 a,
.gr-light-1 i {
  color: #0e858d;
}

.gr-light-2,
.gr-light-2 a,
.gr-light-2 i {
  color: #3ac52d;
}

.gr-light-3,
.gr-light-3 a,
.gr-light-3 i {
  color: #C86DD7;
}

.gr-light-4,
.gr-light-4 a,
.gr-light-4 i {
  color: #0992d1;
}

.gr-light-5,
.gr-light-5 a,
.gr-light-5 i {
  color: #505050;
}

.gr-light-6,
.gr-light-6 a,
.gr-light-6 i {
  color: #ff4747;
}

.gr-light-7,
.gr-light-7 a,
.gr-light-7 i {
  color: #b1961d;
}

.gr-light-8,
.gr-light-8 a,
.gr-light-8 i {
  color: #ff5dc1;
}

.gr-light-9,
.gr-light-9 a,
.gr-light-9 i {
  color: #185ff8;
}

.column {
  transition: .4s;
  padding-left: 0rem;
  opacity: 1;

  &:hover {
    padding-left: 0rem;

    .ico-card {
      opacity: 0.6;
      transition: .4s;
    }

    .dashboard-card .dashboard-txt {
      margin-left: 1rem;

      h1,
      p {
        margin-left: -1rem;
        color: #000;
        opacity: 1;
      }
    }

    a {
      color: rgba(255, 255, 255, 1);

      &:after {
        width: 100%;
        transition: 0.4s;
      }
    }
  }
}