/* =====================================================
   ahmad says hi — لوحة الإدارة (ملف مستقل بالكامل)
   لا يستخدم modal / backdrop-filter / btn-info المشتركة
   ===================================================== */

.ash-root {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  background: #09090b;
  color: #f4f4f5;
  font-family: "Cairo", sans-serif;
  overflow: auto;
}

.ash-root.is-open {
  display: block;
}

.ash-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px 18px 40px;
}

.ash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.ash-top h1 {
  margin: 4px 0 6px;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
}

.ash-top p {
  margin: 0;
  color: #9ca3af;
  font-size: 0.82rem;
}

.ash-kicker {
  display: inline-block;
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 800;
}

.ash-top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ash-btn {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #2a2a33;
  border-radius: 10px;
  background: #17171c;
  color: #f4f4f5;
  font: 800 0.78rem/1 "Cairo", sans-serif;
  cursor: pointer;
}

.ash-btn:hover {
  border-color: #3b82f6;
}

.ash-btn-primary {
  background: #f4f4f5;
  color: #09090b;
  border-color: #f4f4f5;
}

.ash-btn-danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.ash-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ash-error {
  display: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
  font-size: 0.78rem;
}

.ash-error.is-visible {
  display: block;
}

.ash-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.ash-metric {
  padding: 14px;
  border: 1px solid #22222a;
  border-radius: 12px;
  background: #121218;
}

.ash-metric span {
  display: block;
  color: #6b7280;
  font-size: 0.66rem;
  font-weight: 700;
}

.ash-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.ash-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid #22222a;
  border-radius: 12px;
  background: #121218;
}

.ash-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6b7280;
  font: 800 0.76rem/1 "Cairo", sans-serif;
  cursor: pointer;
}

.ash-tab.is-active {
  background: #1c1c22;
  color: #f4f4f5;
}

.ash-pane {
  display: none;
}

.ash-pane.is-active {
  display: block;
}

.ash-toolbar,
.ash-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ash-toolbar {
  grid-template-columns: minmax(180px, 1fr) 150px 140px auto;
}

.ash-form {
  grid-template-columns: 170px 100px minmax(180px, 1fr) auto;
  align-items: end;
  padding: 14px;
  border: 1px solid #22222a;
  border-radius: 12px;
  background: #121218;
}

.ash-field label {
  display: block;
  margin-bottom: 6px;
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 700;
}

.ash-input,
.ash-select,
.ash-textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #2a2a33;
  border-radius: 10px;
  background: #0f0f13;
  color: #f4f4f5;
  font: 600 0.8rem/1.4 "Cairo", sans-serif;
}

.ash-textarea {
  min-height: 110px;
  direction: ltr;
  font-family: Consolas, monospace;
  resize: vertical;
}

.ash-list {
  display: grid;
  gap: 8px;
}

.ash-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #22222a;
  border-radius: 12px;
  background: #121218;
}

.ash-card strong {
  display: block;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ash-card small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 0.68rem;
}

.ash-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.ash-tag {
  padding: 3px 8px;
  border: 1px solid #2a2a33;
  border-radius: 999px;
  color: #9ca3af;
  font-size: 0.62rem;
  font-weight: 800;
}

.ash-tag.ok { color: #86efac; border-color: rgba(34, 197, 94, 0.35); }
.ash-tag.warn { color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
.ash-tag.bad { color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }

.ash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ash-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 20px;
  border: 1px dashed #2a2a33;
  border-radius: 12px;
  color: #6b7280;
  text-align: center;
}

.ash-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  color: #6b7280;
  font-size: 0.72rem;
}

.ash-codes-box {
  display: none;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
}

.ash-codes-box.is-visible {
  display: block;
}

.ash-codes-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ash-drawer {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: none;
  background: rgba(0, 0, 0, 0.72);
}

.ash-drawer.is-open {
  display: grid;
  place-items: center;
  padding: 18px;
}

.ash-drawer-panel {
  width: min(720px, 100%);
  max-height: 90dvh;
  overflow: auto;
  padding: 18px;
  border: 1px solid #2a2a33;
  border-radius: 14px;
  background: #121218;
}

.ash-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ash-drawer-head h2 {
  margin: 0;
  direction: ltr;
  font-size: 1rem;
  text-align: right;
}

.ash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ash-stat {
  padding: 10px;
  border: 1px solid #22222a;
  border-radius: 10px;
  background: #0f0f13;
}

.ash-stat span {
  display: block;
  color: #6b7280;
  font-size: 0.62rem;
}

.ash-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  word-break: break-word;
}

.ash-block {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #22222a;
  border-radius: 10px;
  background: #0f0f13;
}

.ash-block h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
}

.ash-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
}

@media (max-width: 980px) {
  .ash-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ash-form { grid-template-columns: 1fr 1fr; }
  .ash-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .ash-layout { padding: 16px 12px 28px; }
  .ash-top { flex-direction: column; }
  .ash-metrics { grid-template-columns: 1fr 1fr; }
  .ash-toolbar,
  .ash-form,
  .ash-row { grid-template-columns: 1fr; }
  .ash-card { grid-template-columns: 1fr; }
  .ash-actions > * { flex: 1; }
  .ash-codes-box > div { flex-direction: column; align-items: flex-start; }
}
