/* 20-LOCLIST-MODAL — Grey List edit modal redesign */
@layer pages {

  /* ════════════════════════════════════════
     GREY LIST EDIT MODAL — REDESIGN
     ════════════════════════════════════════ */

  /* ── Header ── */
  .gl-modal-header {
    padding: 16px 20px;
    position: relative;
  }

  .gl-modal-header .btn-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    transition: opacity 0.15s;
  }

  .gl-modal-header .btn-close:hover {
    opacity: 1;
  }

  .gl-modal-title {
    font-size: var(--fs-md-s);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--white-a85);
    margin: 0;
    text-align: center;
    width: 100%;
  }

  /* ── Body ── */
  .gl-modal-body {
    padding: 0;
  }

  .gl-modal-body-inner {
    display: grid !important;
    grid-template-columns: 1fr 340px !important;
    min-height: 400px;
    overflow: hidden;
  }

  .gl-modal-content .modal-body {
    overflow: visible !important;
  }

  .gl-modal-col-left {
    padding: 20px 20px 20px 24px;
    border-right: 1px solid var(--white-a06);
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .gl-modal-col-right {
    padding: 20px;
    background: rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 520px;
  }


  /* ── Fields ── */
  .gl-modal-field {
    margin-bottom: 12px;
  }

  .gl-modal-label {
    display: block;
    font-size: var(--label-font);
    font-weight: var(--label-weight);
    text-transform: var(--label-transform);
    letter-spacing: 0.08em;
    color: var(--white-a60);
    margin-bottom: 4px;
  }

  .gl-modal-sublabel {
    display: block;
    font-size: var(--label-font);
    color: var(--white-a45);
    margin-bottom: 3px;
    text-transform: var(--label-transform);
    letter-spacing: 0.05em;
  }

  .gl-modal-input {
    width: 100%;
    background: var(--white-a04);
    border: 1px solid var(--white-a15);
    border-radius: 6px;
    color: rgba(255,255,255,0.95);
    font-size: var(--fs-lg-s);
    padding: 7px 10px;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
  }

  .gl-modal-input:focus {
    outline: var(--focus-outline);
    border-color: var(--focus-border);
    background: var(--white-a06);
    box-shadow: none;
  }

  .gl-modal-input::placeholder {
    color: var(--text-placeholder);
    font-size: var(--fs-md-s);
  }

  select.gl-modal-input {
    background-color: var(--white-a04) !important;
    color: var(--white-a90) !important;
    cursor: pointer;
  }

  select.gl-modal-input option {
    background: #1a1a2e;
    color: #e8e8f0;
  }

  textarea.gl-modal-input {
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
  }

  .gl-modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* ── Blocks — pill style ── */
  .gl-modal-blocks {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 2px 0;
  }

  .gl-modal-block-label {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
  }

  .gl-modal-block-label input[type="checkbox"] {
    display: none;
  }

  .gl-modal-block-label span {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--comp-radius-pill);
    font-size: var(--fs-base-s);
    font-weight: 600;
    border: 1px solid var(--white-a15);
    color: var(--white-a45);
    background: transparent;
    transition: all 0.15s;
    user-select: none;
  }

  .gl-modal-block-label input:checked + span {
    background: var(--clr-berry-500);
    border-color: var(--clr-berry-400);
    color: var(--clr-white);
  }

  .gl-modal-block-label:hover span {
    border-color: var(--white-a30);
    color: var(--white-a70);
  }

  /* ── Contacts column ── */
  .gl-modal-contacts-header {
    font-size: var(--label-font);
    font-weight: var(--label-weight);
    text-transform: var(--label-transform);
    letter-spacing: 0.08em;
    color: var(--text-placeholder);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--white-a06);
  }

  .gl-modal-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-bottom: 8px;
  }

  .gl-modal-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr 28px;
    gap: 4px;
    align-items: center;
    background: var(--white-a03);
    border: 1px solid var(--white-a06);
    border-radius: 6px;
    padding: 6px 8px;
    transition: background 0.15s;
  }

  .gl-modal-contact-row:hover {
    background: var(--white-a05);
  }

  .gl-modal-contact-name-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .gl-modal-contact-detail-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .gl-modal-contact-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--white-a20);
    color: rgba(255,255,255,0.95);
    font-size: var(--fs-lg-s);
    padding: 2px 3px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
  }

  .gl-modal-contact-input:focus {
    outline: var(--focus-outline);
    border-bottom-color: var(--clr-berry-400);
  }

  .gl-modal-contact-input::placeholder {
    color: var(--text-placeholder);
    font-size: var(--fs-lg-s);
  }

  .gl-modal-contact-remove {
    background: none;
    border: none;
    color: var(--white-a15);
    cursor: pointer;
    font-size: var(--fs-md-s);
    padding: 2px;
    border-radius: var(--comp-radius-sm);
    line-height: 1;
    align-self: center;
    transition: color 0.15s;
  }

  .gl-modal-contact-remove:hover {
    color: var(--clr-danger);
  }

  .gl-modal-no-contacts {
    font-size: var(--fs-base-s);
    font-style: italic;
    color: rgba(255,220,0,0.5);
    padding: 8px;
    background: rgba(255,255,0,0.04);
    border: 1px dashed rgba(255,220,0,0.2);
    border-radius: 6px;
    margin-bottom: 8px;
    text-align: center;
  }

  /* ── Footer ── */
  .gl-modal-footer {
    padding: 12px 20px;
  }

  .gl-modal-save-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .gl-modal-status {
    flex: 1;
    font-size: var(--fs-base-s);
    color: var(--text-placeholder);
    font-style: italic;
  }

  .gl-modal-status.is-dirty {
    color: rgba(255,200,0,0.65);
  }

  .gl-modal-status.is-saving {
    color: var(--white-a45);
  }

  .gl-modal-status.is-saved {
    color: var(--clr-success-light);
  }

  .gl-modal-status.is-error {
    color: #f87171;
  }

  .gl-modal-btn-save {
    background: var(--clr-berry-500);
    border: none;
    border-radius: 6px;
    color: var(--clr-white);
    font-size: var(--fs-base-s);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 20px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
  }

  .gl-modal-btn-save:hover {
    background: var(--clr-berry-400);
  }

  .gl-modal-btn-save:disabled {
    opacity: 0.45;
    cursor: default;
  }

  .gl-modal-btn-cancel {
    background: transparent;
    border: 1px solid var(--white-a12);
    border-radius: 6px;
    color: var(--white-a45);
    font-size: var(--fs-base-s);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .gl-modal-btn-cancel:hover {
    border-color: var(--white-a25);
    color: var(--white-a70);
  }

  .gl-modal-btn-secondary {
    background: var(--white-a06);
    border: 1px solid var(--white-a15);
    border-radius: 6px;
    color: var(--white-a70);
    font-size: var(--fs-base-s);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .gl-modal-btn-secondary:hover {
    background: var(--white-a10);
    color: var(--clr-white);
  }

  /* Responsive — stack columns on narrow */
  @media (max-width: 700px) {
    .gl-modal-body-inner {
      grid-template-columns: 1fr;
    }
    .gl-modal-col-left {
      border-right: none;
      border-bottom: 1px solid var(--white-a06);
    }
  }


} /* end @layer pages */
