/**
 * Kutby Admin UI — مركز تحكم عربي (RTL)
 * Local-only styles for the Theme Options dashboard.
 */

@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/tajawal/tajawal-arabic-400.woff2") format("woff2");
}

@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../fonts/tajawal/tajawal-arabic-700.woff2") format("woff2");
}

.kutby-admin,
.kutby-admin * {
  font-family: "Tajawal", Tahoma, sans-serif;
}

.kutby-admin {
  margin: 20px 0 20px 20px;
  max-width: 1280px;
  direction: rtl;
  text-align: right;
}

/* Hide default WP page chrome feeling */
.toplevel_page_kutby #wpbody-content > .wrap > h1 {
  display: none;
}

.kutby-admin__shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 720px;
  background: #f4f6f8;
  border: 1px solid #d8dee6;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.kutby-admin__sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 24px 16px;
}

.kutby-admin__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.kutby-admin__brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-weight: 700;
}

.kutby-admin__brand strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.kutby-admin__brand small {
  color: #94a3b8;
}

.kutby-admin__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kutby-admin__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease;
}

.kutby-admin__nav-item:hover,
.kutby-admin__nav-item.is-active {
  background: rgba(20, 184, 166, 0.16);
  color: #fff;
}

.kutby-admin__nav-item .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.kutby-admin__main {
  padding: 28px;
  background: #f8fafc;
}

.kutby-panel__header {
  margin-bottom: 24px;
}

.kutby-panel__header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #0f172a;
}

.kutby-panel__lead {
  margin: 0;
  color: #64748b;
  max-width: 60ch;
}

.kutby-cards {
  display: grid;
  gap: 12px;
}

.kutby-card {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.kutby-card__label {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.kutby-card__hint,
.kutby-field__desc {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
}

.kutby-field {
  width: 100%;
  max-width: 420px;
}

.kutby-field--text,
.kutby-field--url,
.kutby-field--number,
.kutby-field--textarea,
.kutby-field--select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
}

.kutby-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.kutby-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.kutby-toggle__track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.15s ease;
}

.kutby-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.kutby-toggle input:checked + .kutby-toggle__track {
  background: #0f766e;
}

.kutby-toggle input:checked + .kutby-toggle__track::after {
  transform: translateX(18px);
}

.kutby-toggle input:focus-visible + .kutby-toggle__track {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.kutby-panel__footer {
  margin-top: 24px;
}

.kutby-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.kutby-btn--primary {
  background: #0f766e;
  color: #fff;
}

.kutby-btn--primary:hover {
  background: #0d9488;
}

.kutby-notice {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.kutby-notice--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

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

.kutby-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.kutby-stat-card__label {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 6px;
}

.kutby-stat-card__value {
  font-size: 20px;
  color: #0f172a;
}

.kutby-steps {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.kutby-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.kutby-table th,
.kutby-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.kutby-media-field__preview img {
  max-width: 160px;
  height: auto;
  display: block;
  margin-bottom: 8px;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .kutby-admin__shell {
    grid-template-columns: 1fr;
  }

  .kutby-card {
    grid-template-columns: 1fr;
  }

  .kutby-stats {
    grid-template-columns: 1fr;
  }
}
