@charset "UTF-8";

.new-shp-panel.v2 {
  --panel-width: 910px;
  --focus-border: #FFA600;
  --focus-bg: #FFF8DD;
  --bg: #F4F5F7;
  --todo-bg: #EFCECD;
  --todo-border: #F0381D;
  display: grid;
  min-height: 500px;
  width: var(--panel-width);
  min-width: var(--panel-width);
  max-width: var(--panel-width);
  max-height: calc(100vh - 48px); /* calc(100% - 40px); */
  border-radius: 10px;
  animation: fadeInOpacity ease .25s;
  /* box-shadow: 4px 4px 5px var(--pl-brownish); */
  font-size: 14px;
  padding-top: 6px;
  background-color: var(--bg);

  input { color: black; font-size: inherit; }

  overflow: visible;
  transition: transform 1s;

  grid-template: "main context";

  .space { padding-left: 24px; padding-right: 24px; box-sizing: border-box; align-content: center; display: flex; clear: both; }
  .space.right { justify-content: right;  }

  .context { border-bottom-right-radius: 8px; border-top-right-radius: 8px; }
  .main    { border-bottom-left-radius:  8px; border-top-left-radius:  8px; }

  .norm-text {
    color: #32343A;
  }

  .at-area {
    display: flex;
    align-items: center;
    padding-left: 4px;
    gap: 8px;
  }

  ::placeholder { color: var(--gray-text); vertical-align: baseline; }
  [contenteditable] { outline: 0 none; padding: 2px 4px; border: 1px solid transparent; min-width: 20px; border-radius: 4px; }
  [contenteditable]:hover { background-color: var(--focus-bg); cursor: pointer; }
  [contenteditable][value=""] { color: var(--gray-text); }
  [contenteditable]:focus,
  .hilight {
    background-color: var(--focus-bg);
    border: 1px solid var(--focus-border);
  }
  label { display: block; }

  .head {
    display: flex;
    /* padding: 14px 24px 6px 24px; */
    align-items: center;
    color: black;
    background-color: var(--bg);
    font-weight: 700;
    height: 42px;
    padding-left: 24px; padding-right: 24px;

    .h { flex-grow: 1; }

    .close-dialog { width: 24px; height: 24px;  display: inline-block; background-color: #E1E4EA; border-radius: 8px; display: flex; justify-content:center; align-items: center; z-index: 10; }
    .close-dialog .msymbol { font-size: 17px; border-radius: 50%; cursor:pointer; }
    /* .close-dialog:hover .msymbol { color: var(--pl-salmon-pink); cursor:pointer; } */
  }
  .context .head { justify-content: flex-end; }

  .main {
    grid-area: main;
    width: calc(var(--panel-width) / 2);
    max-height: 100%;
    padding: 0; margin: 0; box-sizing: border-box;
    overflow: visible; /* ilma selleta viskab suggestion scrolli peale */
    background-color: var(--bg);
    padding-bottom: 24px;
  }
  .context {
    grid-area: context;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: calc(var(--panel-width) / 2);
    background-color: var(--bg);
  }
  .content { flex-grow: 1; display: flex; }

  .ctx-head {
    display: flex;
    flex-direction: row;
    gap: 18px;
    margin-top: -32px;
    margin-bottom: 18px;
    margin-left: 4px; /* inline tekstide padding */
    margin-right: 60px;
    font-weight: bold;
    user-select: none;
    .used {
      background-color: var(--focus-border); color: white;
      height: 18px;
      box-sizing: border-box;
      display: inline-flex;
      padding-left: 4px; padding-right: 4px;
      border-radius: 4px;
      margin-left: 6px;
    }

    .active {
      border-bottom: 2px solid var(--focus-border);
    }
  }

/*
  .company,
  .contact,
  .phone   { margin: 6px 16px 6px 0; }
*/
  .loc { margin: 6px 0; }
  input.hhmm {
    width: 3.2em;
    text-align: center;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
  }
  input.hhmm:hover { background-color: var(--focus-bg); }
  input.hhmm:focus {
    border: 1px solid var(--focus-border);
    background-color: var(--focus-bg);
  }
  input[type="text"] { border: 1px solid transparent; }

  input { outline: none; }
  select { outline: 0 none }

  .window { display: flex; align-items: center; }
  .window .msymbol { color: var(--gray-text); margin-left: 2px; margin-right: 2px; padding-top: 2px; }
  .comp-win { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

  .adr-context .company { font-weight: bold; ul { font-weight: normal; } }

  .inline-suggest, .inline-choice { border-radius: 4px; }
  .inline-suggest *, .inline-choice * { padding-left: 4px; padding-right: 4px; }
  .inline-suggest .placeholder, .inline-choice .placeholder { color: var(--gray-text); padding-left: 6px; } /* TODO: see on main.css */
  .inline-suggest:hover, .inline-choice:hover { background-color: var(--focus-bg); cursor: pointer; }

  .input-choice.carrier,
  .input-choice.client,
  .input-choice.address {
    background-color: white;
    border: 1px solid #BCC7DD;
    border-radius: 4px;
    color: var(--pl-rhino);
    height: 2.2em;
    box-sizing: border-box;
    input { border-radius: 4px; padding-left: 8px; height: calc(2.2em - 2px); background-color: transparent; }
  }
  .inline-choice.company,
  .inline-suggest.company,
  .input-suggest.company {
    [contenteditable] { border-radius: 4px; min-width: 80px; }
    [contenteditable][value=""] { color: var(--gray-text); }
    li { padding: 4px 8px; gap: 6px; display: flex; justify-items: space-between; width: 100%; }
    li .regnr { font-size: 90%; color: var(--gray-text); }
  }
  .inline-choice.company,
  .inline-suggest.company,
  .input-choice.company {
    li.unknown { display: flex; justify-items: space-between; width: 100%; }
    li :first-child { flex-grow: 1 }
    li.unknown .regnr { font-size: 90%; color: var(--gray-text); }
  }
  .input-choice.address li.known {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    .comp, .contact { margin-left: 6px; color: var(--gray-text); font-size: 90%; }
    .contact { max-width: 9em; text-overflow: ellipsis; overflow: hidden; }
  }
  .input-choice.carrier { background-color: white; }
  .input-choice.hilight {
    border-color: var(--focus-border);
    background-color: var(--focus-bg);
  }

  .clean-input {
    --bolder: .5px;
    --text-color: white;
    background-color: #2A3D4F; color: var(--text-color);
    border-radius: 50%;
    width: 12px; height: 12px;
    font-size: 12px; text-shadow: var(--bolder) 0 var(--text-color), calc(var(--bolder) * -1) 0 var(--text-color), 0 var(--bolder) var(--text-color), 0 calc(var(--bolder) * -1) var(--text-color);
    display: flex; align-items:center; justify-content:center;
    margin-right: 8px;
  }

  .label { user-select: none; }
  .carrier .label.new,
  .fwd .label.new,
  .client .label.new {
    font-size: 10px;
    /* border: 1px solid var(--pl-quicksand); */ border-radius: 4px;
    background-color: var(--pl-aqua-green);
    color: #3FB1B2;
    padding: 2px 4px;
    margin: auto 4px;
    border: 1px solid #3FB1B2;
    background-color: #DBF0EF;
  }
  .label.debt { color: var(--traffic-red); }
  .label.new {
    font-size: 10px;
    /* border: 1px solid var(--pl-quicksand); */ border-radius: 4px;
    background-color: var(--pl-aqua-green);
    color: #3FB1B2;
    padding: 2px 4px;
    margin: auto 4px;
    border: 1px solid #3FB1B2;
    background-color: #DBF0EF;
  }

/*
  .inf { display: flex; width: 100%; align-items: baseline; }
  .inf .notes { flex-grow: 1; margin-right: 12px; }
*/

  .epoint {
    /*position: relative; */ /* colorlegend pos:absolute works this way */
    display: flex;
    flex-direction: row;

    .loc { flex-grow: 1; }
    .colorlegend { font-size: 12px; margin: 12px 8px 0 0; }
  }

  &.show-todo {
    &.todo-client .client,
    &.todo-aadr   .epoint.a .input-choice,
    &.todo-aadr   .epoint.a input::placeholder,
    &.todo-badr   .epoint.b .input-choice,
    &.todo-badr   .epoint.b input::placeholder,
    &.todo-adate  .epoint.a .dates span,
    &.todo-goods  .goods .kind input:placeholder-shown,
    .go {
      border-color: var(--todo-border);
      background-color: var(--todo-bg);
      transition: background-color .5s, border-color .5s;
    }
    &.todo-goods .goods .kind input:placeholder-shown { border-radius: 4px; }
  }

  .carrier { [contenteditable] { max-width: 200px; white-space: nowrap; overflow: hidden; } }
  .refs { clear: both; }
  .buyprice {
    display: inline-block;
    input.price { border: 1px solid transparent; background-color: transparent; width: 4em; border-radius: 4px; }
  }

  div.client {
    margin-top: 12px;
    box-sizing: border-box;
    width: 100%;

    input { display: inline-block; width: 100%; box-sizing: border-box; padding: 6px; }
    .action {
      color: var(--pl-teal-green);
      cursor: pointer;
    }
    em { color: var(--gray-text); }
  }

  .dates {
    user-select: none;
    display: flex;
    font-weight: 400;
    margin-right: 4px;
    height: 24px;
    box-sizing: border-box;
    gap: 2px;

    /* span:first-child { padding-left: 8px; } span:last-child  { padding-right: 8px; } */
    span.text { display: flex; width: auto; padding-left: 6px; padding-right: 6px; align-items:center; justify-content: center; }
    span:hover { background-color: var(--focus-bg); }
    span {
      border-radius: 4px;
      display: inline-flex;
      aspect-ratio: 1 / 1;
      border: 1px solid #C5CCE5;
      text-align: center;
      cursor: pointer;
      color: #32343A;
      vertical-align: middle;
      background-color: white;
      align-items: center;
      justify-content: center;
    }
    .sel { background-color: var(--focus-bg); border-color: var(--focus-border); font-weight: bold; }
  }
  .epoint.b .dates span { color: var(--pl-dark-sand); }
  input.price { margin-left: 12px; width: 5.5em; border: 1px solid transparent; background-color: transparent; border-radius: 4px; padding: 2px 4px; &::after { content: "X"; } }
  input.price::after { content: "€"; display: inline-block; }
  input.price::before { content: "AKSDJF"; }
  /* input.price:not(:empty):after { content: "€"; } */
  input.price:focus { border-color: var(--focus-border); background-color: var(--focus-bg); }

  button.go {
    font-weight: 700;
    color: white;
    border: 0 none;
    background-color: #FFA600;
    border: 1px solid transparent;
  }
  .doit { text-align: right; padding-top: 8px; }

  .maeitea {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding-right: 6px;
    min-height: 26px;
    box-sizing: border-box;
    .bdate-choose:hover { background-color: var(--focus-bg); }
    .bdate-choose { color: black; cursor: pointer; padding: 2px; }
    .bdate-choose.empty { color: var(--gray-text); }

    .show-details { flex-grow: 1; user-select: none; }
    .msymbol.more { font-size: 16px; color: var(--pl-gray-olive); }
    .msymbol.more:hover { color: var(--pl-bluish-green); border: 0px solid var(--pl-eggshell); border-radius: 50%; background-color: var(--pl-early-dawn); }
    .grower { flex-grow: 1; }
  }

  .details {
    margin-top: 16px;
    max-width: 500px;
    width: calc(100% - 24px);
    & > div { margin: 8px 0; }
    /* display: block; flex-wrap: wrap; gap: 19px; */
    .cont-phone { display: flex; width: 100%; gap: 18px; }
    div.notes { display: flex; width: 100%; }
  }
  .details input {
    border-bottom: 1px solid var(--pl-eggshell);
    color: var(--pl-rhino);
  }
  .details .contact {  flex-grow: 1; }
  .details .phone {  flex-grow: 1; }
  .details .notes { flex-grow: 1; }
  .details span.spot { text-align: right; color: var(--pl-teal-green); text-decoration: none; }
  .details div.spot { display: flex; justify-content: space-between; }
  .details div.spot .is-changed {  }

  .vsplit {
    display: flex; flex-direction: row; justify-content: space-between; box-sizing: border-box;
  }
  .inliners { align-items: center; }

  .pricehist {
    div { margin: 12px 0; }
    span { margin-left: 6px; }
    .price { font-weight: bold; }
    .count { color: var(--gray-text); }
  }

  .refs {
    padding-top: .5em;
    display: flex; flex-direction: row;
    box-sizing: border-box;
    align-items: center;
  }

  .refs-fwd {
    justify-content: space-between;
  }

  .show-details.link {
    color: Royalblue;
    text-align: right;
  }

  svg.close:hover {
    fill: #F0381D;
  }

  .knob {
    color: #8E91A4;
    border: 1px solid transparent;
    border-color: transparent;
    border-radius: 8px;
    font-size: 18px;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    line-height: 23px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
  }
  .knob:hover {
    border-color: var(--focus-border);
    background-color: var(--focus-bg);
    transition: border-color .6s, background-color .6s;
  }
  .knob.on { 
    color: var(--focus-border);
    border-color: var(--focus-border);
    background-color: var(--focus-bg);
  }
  .knob.notactive {
    color: var(--focus-border);
  }

  input.waybill_note { border: 1px solid var(--pl-eggshell); width: 100%; box-sizing: border-box; padding: 6px; margin-top: 8px; border-radius: 6px; }

  .adr-latlng { /* this is in shadow, so some things must be redefined */
    background-color: #F7CD38;
    padding: 4px 6px;
    font: 14px "PT Sans", sans-serif;
    transform: translateY(calc(100% + 4px));
    border-radius: 4px;

    display: flex; flex-direction: row; gap: 6px; align-items: center;
    .msymbol { cursor: pointer; }
  }
  .dist-box {
    background-color: #F7CD38;
    padding: 4px 6px;
    font: 14px "PT Sans", sans-serif;
    transform: translateY(50%);
    border-radius: 4px;
  }
  .used-point {
    height: 15px;
    aspect-ratio: 1/1;
    background-color: #F7CD38;
    border: 1px solid #F5AD31;
    border-radius: 50%;
  }

  .goods {
    /*            idx kind count ldm kg vol x y z */
    --sizes-head: 2em 1fr 2.6em 3.2em 3.2em 3em auto;
    --sizes-item: 2em 1fr 2.6em 3.2em 3.2em 3em 3em 3em 3em;
    --sizes-foot: auto auto 1fr 2.6em 3.2em 3em auto;
    background-color: white;
    border-radius: 4px;

    display: grid;
    width: 100%;
    gap: 1;

    margin-top: 8px;
    margin-bottom: 8px;

    .row { display: contents; }

    * { box-sizing: border-box; }
    input { width: 100%; padding: 8px 4px; box-sizing:border-box; }
    input:hover { background-color: var(--focus-bg); }

    /* grid-template-areas: "h-idx h-kind h-count h-ldm h-kg h-vol h-xyz" "idx kind count ldm kg vol x y z" ". f-text f-count f-ldm f-kg . . . ." ; */
    grid-template-columns: 2em 6em 2.6em 3.2em 3.2em 3em 3em 3em 3em;

    [class^="h-"] { text-align: center; padding-top: 6px; padding-bottom: 6px; white-space: nowrap; }
    [class^="f-"] { text-align: right; padding-top: 6px; padding-bottom: 6px; white-space: nowrap;  padding-right: 2px; }

    .spc { grid-column: 1 / -1; height: 1px; background-color: var(--bg); }

    .input-choice ul { max-height: 20em; overflow: auto; }
    .add-item {
      grid-column: 1 / -1;
      height: 2px;
      position: relative;
      .mouser { 
        --h: 24px;
        position: absolute;
        height: var(--h);
        top: calc(((var(--h) / 2) * -1) - 1px);
        left: 0;
        right: 0;
        z-index: 1;
      }

      .line { opacity: 0; transition: opacity .4s; height: 2px; justify-content: center; align-items:center; display: flex; height: 2px; background-color: var(--focus-border); }
      &.show .line { opacity: 1; z-index: 2; }
      .msymbol {
        font-size: 16px;
        color: white;
        background-color: var(--focus-border);
        border-radius: 50%;
        z-index: 2;
      }
    }

    /* rea kustutamine */
    .act { display: none; }
    .item:hover { .act { display: inline-block; } .nr { display: none } }
    .idx { text-align: center; }

/*
      .act { float: right; position: absolute; display: none; height: 18px; width: 18px; }
      .act .msymbol { cursor: default; font-size: 20px; /* transform: scale(1.2); * / }
      .act .msymbol:hover { color: var(--pl-brownish); position: relative; }
*/

    .num input { text-align: right;  }
    * input { width: 100%; }
    .row.sum .num { color: var(--gray-text); }

    .h-xyz { grid-column: span 3; text-align: center; }
    .f-text { grid-column: span 2; text-align: left; padding-left: 12px; font-weight: bold; }
    .notes, .shp-container {  grid-column: 2 / span 8; }
    .idx   {  padding-top: 8px; padding-bottom: 8px; }
    .shp-container { display: flex; flex-direction: row; justify-content: space-between; }
  }

  .fwd {
    display: flex; margin-top: 8px; gap: 22px; align-items: center; justify-content: space-between;
  }

  /* TODO: find out if it`s ok just to merge this with .fwd rule */
  .ref-fwd { justify-content: space-between; }

  /* TODO: remove after you are replaced Autocomplete component */
  .suggestions {
    list-style-type: none;
    margin: 0;
    padding: 0;
    position: absolute;
    background-color: white;
    border: 1px solid var(--pl-eggshell);
    min-width: 200px;
    max-height: 370px;
    overflow-y: auto;
    background-color: #FDFDFF;
    cursor: default;
    user-select: none;
    box-shadow: 3px 3px 6px var(--pl-eggshell);
    border-radius: 5px;
    z-index: 100;
    &:empty { display: none; }
    li {
      display: flex;
      padding: 5px 12px 5px 8px;
    }
    li.sel { background-color: var(--pl-champagne); }

    .db-client { color: var(--pl-teal-green); }
    .msymbol { padding: 0 6px 0 0; }
  }
  .compitem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 2px;
    color: var(--pl-dark-sand);
    .regnr { color: var(--pl-aluminium); font-size: 85%; vertical-align: bottom; text-align: right; flex-grow: 1; }
  }
  .suggestions {
    .in-db { color: var(--pl-beetle-green);  line-height: 20px; }
    .pred { color: var(--pl-dark-sand); .adr { margin-left: 6px; } }
  }
  .adr-context {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 20;
    /* .info { flex-direction: column; align-items: flex-end; padding-right: 12px; display: flex; margin-top: 12px; .grow { flex-grow: 1 } } */
    /* box-shadow: 4px 4px 5px var(--pl-brownish); */
    .cancel { margin-right: 20px; color: var(--pl-gray-olive); }

    .map {
      flex-grow: 1;
      min-width: calc(var(--panel-width) / 2 - 28px); /* ma ei tea, miks 28, silma järgi */
      max-width: calc(var(--panel-width) / 2 - 28px);
      border-radius: 8px;
      .spot-map { width: 100%; height: 100%; border-radius: 8px; }
      margin: 12px 0 0 4px; /* left 4px = same as other fields left padding */
      padding-bottom: 24px;
    }

    .shp-map-view {
      /* padding: 12px 24px; */
      min-height: 550px;
      min-width: 600px;
      box-sizing: border-box;
      background-color: white;
      z-index: 20;
      border-radius: 8px;
      /* box-shadow: 4px 4px 5px var(--pl-brownish); */
    }

  }
}


