/*
 * Top Bar / Toolbar Stylesheet
 */

@layer components {
  .toolbar,
  div.toolbar {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    top: 0;
    height: var(--toolbar-height);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 32px;
    z-index: 30;
    transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @media only screen and (max-width: 767px) {
    .toolbar,
    div.toolbar {
      left: 0;
      padding: 0 16px;
    }
  }

  /* Title & Breadcrumbs container */
  .toolbar > span,
  div.toolbar > span {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toolbar span span.margin-20,
  div.toolbar span span.margin-20 {
    display: none;
  }

  /* Mobile Nav button */
  .navbutton,
  .toolbar span .navbutton,
  div.toolbar span .navbutton {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #334155;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  }

  .navbutton:hover,
  .toolbar span .navbutton:hover,
  div.toolbar span .navbutton:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
  }

  @media only screen and (max-width: 767px) {
    .navbutton,
    .toolbar span .navbutton,
    div.toolbar span .navbutton {
      display: inline-flex;
    }
  }

  /* Back Link Arrow */
  .toolbar span a:not(.navbutton),
  div.toolbar span a:not(.navbutton) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    margin-right: 6px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    text-decoration: none;
  }

  .toolbar span a:not(.navbutton):hover,
  div.toolbar span a:not(.navbutton):hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
  }

  .toolbar span a svg,
  div.toolbar span a svg {
    width: 18px;
    height: 18px;
  }

  /* Right Actions Container */
  .toolbar > div,
  div.toolbar > div {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
  }

  /* Toolbar Buttons & Links */
  .toolbar div a,
  .toolbar div button,
  .toolbar div input[type="submit"],
  div.toolbar div a,
  div.toolbar div button,
  div.toolbar div input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    line-height: normal;
  }

  .toolbar div a:hover,
  .toolbar div button:hover,
  div.toolbar div a:hover,
  div.toolbar div button:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    text-decoration: none;
  }

  .toolbar div svg,
  div.toolbar div svg {
    width: 18px;
    height: 18px;
  }

  /* Submit Action Button (#toolbar-submit-button) */
  #toolbar-submit-button,
  .toolbar div button#toolbar-submit-button,
  div.toolbar div button#toolbar-submit-button {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: #4338ca;
    font-weight: 600;
    gap: 6px;
    padding: 0 16px;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
  }

  #toolbar-submit-button:hover,
  .toolbar div button#toolbar-submit-button:hover,
  div.toolbar div button#toolbar-submit-button:hover {
    background-color: #4338ca;
    color: #ffffff;
  }

  #toolbar-submit-button svg {
    color: #ffffff;
  }

  /* Input Fields inside Toolbar (like month selector) */
  .toolbar div form,
  div.toolbar div form {
    display: flex;
    align-items: center;
    margin: 0;
  }

  .toolbar div input[type="month"],
  div.toolbar div input[type="month"] {
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px;
    background-color: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease;
    margin: 0;
  }

  .toolbar div input[type="month"]:focus,
  div.toolbar div input[type="month"]:focus {
    border-color: #6366f1;
  }
}