/* ═══════════════════════════════════════════════════════════════
   Sheet System — Namespace: bsh-* (Bottom SHeet)
   Path: /opt/public_html/admin/assets/css/sheet-system.css
   ─────────────────────────────────────────────────────────────
   الـ prefix bsh-* عشان ما يعملش تعارض مع .sheet القديم فى style.css
   
   HTML:
     <div class="bsh-wrap" data-sheet="my-sheet">
       <div class="bsh-scrim" data-close></div>
       <div class="bsh-box">
         <div class="bsh-grip"></div>
         <div class="bsh-head">...</div>
         <div class="bsh-body">...</div>
         <div class="bsh-foot">...</div>
       </div>
     </div>

   Default: display: none
   Open:    class="is-open"
   ═══════════════════════════════════════════════════════════════ */

.bsh-wrap {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.bsh-wrap.is-open {
  display: flex;
  pointer-events: auto;
}

.bsh-scrim {
  position: absolute;
  inset: 0;
  background: hsl(228 30% 3% / .55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.bsh-wrap.is-open .bsh-scrim { opacity: 1; }

.bsh-box {
  position: relative;
  z-index: 1;
  inline-size: 100%;
  max-inline-size: 500px;
  max-block-size: 92vh;
  background: var(--surface);
  border-start-start-radius: var(--r-lg, 16px);
  border-start-end-radius: var(--r-lg, 16px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.bsh-wrap.is-open .bsh-box { transform: translateY(0); }

.bsh-grip {
  inline-size: 40px;
  block-size: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.bsh-head {
  padding: 8px 20px 16px;
  border-block-end: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.bsh-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
}

.bsh-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--txt-2);
}

.bsh-close {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--txt-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm, 8px);
  transition: background 0.15s;
}

.bsh-close:hover {
  background: var(--surface-2);
  color: var(--txt);
}

.bsh-close .ic { inline-size: 18px; block-size: 18px; }

.bsh-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.bsh-foot {
  padding: 14px 20px;
  border-block-start: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

.bsh-foot .btn { flex: 1; }

/* Form fields */
.bsh-field { margin-block-end: 14px; }

.bsh-field label {
  display: block;
  font-size: 12.5px;
  color: var(--txt-2);
  margin-block-end: 6px;
  font-weight: 600;
}

.bsh-field input,
.bsh-field textarea,
.bsh-field select {
  inline-size: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md, 10px);
  color: var(--txt);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s;
}

.bsh-field input:focus,
.bsh-field textarea:focus,
.bsh-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.bsh-field .err {
  display: none;
  font-size: 12px;
  color: var(--bad);
  margin-block-start: 6px;
}

.bsh-field .err.is-visible { display: block; }

/* Desktop */
@media (min-width: 768px) {
  .bsh-wrap { align-items: center; padding: 24px; }

  .bsh-box {
    border-radius: var(--r-lg, 16px);
    max-block-size: 85vh;
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  }

  .bsh-wrap.is-open .bsh-box {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .bsh-grip { display: none; }
}
