/* ==========================================================================
   לוח הבקרה — נתוני שימוש
   ========================================================================== */

.admin-body {
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(111, 58, 160, 0.55), transparent 55%),
    radial-gradient(ellipse at 90% 0%, rgba(232, 188, 85, 0.18), transparent 45%),
    var(--purple-950);
  color: var(--text-light);
}

/* ------------------------------ שער הכניסה ------------------------------ */
.admin-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-panel {
  width: min(440px, 94vw);
  padding: 34px 38px 30px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--cream-50), var(--cream-100));
  border: 3px solid var(--gold-400);
  box-shadow: var(--shadow-card);
  animation: pop-in 0.4s ease both;
}

.gate-icon {
  font-size: 44px;
}

.gate-title {
  font-size: 34px;
  font-weight: 800;
  color: var(--purple-700);
  margin-top: 6px;
}

.gate-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.gate-label {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--purple-700);
  margin-bottom: 10px;
}

.gate-panel .btn {
  width: 100%;
  margin-top: 6px;
}

.gate-hint {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.gate-back {
  display: inline-block;
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-muted);
}

/* ------------------------------ ניהול משתמשות ------------------------------ */

.user-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.uf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 170px;
}

.uf-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-100);
  opacity: 0.85;
}

.user-form .field {
  padding: 10px 14px;
  font-size: 15px;
  text-align: start;
  border-color: rgba(168, 124, 212, 0.5);
}

.user-form .btn {
  flex: 0 0 auto;
  height: 44px;
}

.form-msg {
  min-height: 22px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #A6E4AC;
}

.form-msg.is-error {
  color: #F0A79F;
}

.cell-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.mini-btn {
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-300);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(232, 188, 85, 0.4);
  transition: background 0.15s ease;
}

.mini-btn:hover {
  background: rgba(232, 188, 85, 0.22);
}

.mini-btn.is-danger {
  color: #F0A79F;
  box-shadow: inset 0 0 0 1px rgba(217, 72, 59, 0.5);
}

.mini-btn.is-danger:hover {
  background: rgba(217, 72, 59, 0.25);
}

/* ------------------------------ הלוח ------------------------------ */
.admin-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 26px 50px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(232, 188, 85, 0.3);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
}

.admin-brand b {
  display: block;
  font-size: 26px;
  color: var(--gold-300);
}

.admin-brand small {
  display: block;
  font-size: 14px;
  color: var(--purple-100);
  opacity: 0.75;
}

.admin-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--purple-100);
}

.admin-select {
  font-family: inherit;
  font-size: 15px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 2px solid rgba(232, 188, 85, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-select option {
  color: #222;
}

.btn-xs {
  padding: 9px 16px;
  font-size: 15px;
}

.admin-body .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-300);
  box-shadow: inset 0 0 0 2px rgba(232, 188, 85, 0.45);
}

.admin-body .btn-ghost:hover:not(:disabled) {
  background: rgba(232, 188, 85, 0.2);
}

.admin-updated {
  margin: 14px 0 20px;
  font-size: 14px;
  color: var(--purple-100);
  opacity: 0.7;
}

/* ------------------------------ כרטיסי סיכום ------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(111, 58, 160, 0.35), rgba(44, 18, 80, 0.55));
  border: 2px solid rgba(232, 188, 85, 0.35);
}

.kpi-label {
  font-size: 14px;
  color: var(--purple-100);
  opacity: 0.85;
}

.kpi-value {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--gold-300);
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

/* ערך טקסטואלי ארוך יותר (תאריך ושעה) — גופן קטן יותר */
.kpi-value.is-text {
  font-size: 21px;
}

.kpi-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--purple-100);
  opacity: 0.65;
}

/* ------------------------------ כרטיסים ------------------------------ */
.card {
  margin-bottom: 20px;
  padding: 22px 24px 24px;
  border-radius: var(--radius-lg);
  background: rgba(30, 11, 54, 0.62);
  border: 2px solid rgba(168, 124, 212, 0.28);
  box-shadow: var(--shadow-soft);
}

.card-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--gold-300);
  margin-bottom: 6px;
}

.card-note {
  font-size: 14px;
  color: var(--purple-100);
  opacity: 0.75;
  margin-bottom: 14px;
  line-height: 1.6;
}

.card-note code {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 5px;
  direction: ltr;
  display: inline-block;
}

/* ------------------------------ טבלאות ------------------------------ */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  white-space: nowrap;
}

.data-table th {
  text-align: start;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-300);
  padding: 8px 12px;
  border-bottom: 2px solid rgba(232, 188, 85, 0.3);
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-light);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.num {
  direction: ltr;
  unicode-bidi: isolate;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.pill-ok {
  background: rgba(76, 163, 85, 0.28);
  color: #A6E4AC;
}

.pill-bad {
  background: rgba(217, 72, 59, 0.26);
  color: #F0A79F;
}

.pill-neutral {
  background: rgba(168, 124, 212, 0.25);
  color: var(--purple-100);
}

.pill-wait {
  background: rgba(232, 188, 85, 0.24);
  color: var(--gold-300);
}

.rate-bar {
  position: relative;
  width: 110px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-inline-end: 8px;
}

.rate-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-500), var(--green-400));
}

/* ------------------------------ תרשים ------------------------------ */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  /* ציר זמן מתקדם משמאל לימין, כמקובל בתרשימים */
  direction: ltr;
  height: 190px;
  margin-top: 16px;
  padding-top: 10px;
  overflow-x: auto;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 42px;
  flex: 1;
}

.chart-bar {
  width: 100%;
  max-width: 46px;
  min-height: 3px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-600));
  transition: height 0.3s ease;
}

.chart-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-300);
}

.chart-label {
  font-size: 12px;
  color: var(--purple-100);
  opacity: 0.7;
  direction: ltr;
}

.empty-note {
  padding: 22px 4px;
  text-align: center;
  font-size: 16px;
  color: var(--purple-100);
  opacity: 0.65;
}

.admin-foot {
  margin-top: 26px;
  text-align: center;
  font-size: 13px;
  color: var(--purple-100);
  opacity: 0.55;
  line-height: 1.8;
}

.admin-foot code {
  direction: ltr;
  display: inline-block;
}
