* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Tahoma, sans-serif;
}

body {
  background: #f4f6fb;
  height: 100vh;
  overflow: hidden;
}

.login-screen {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #eef2f7;
}

.login-card {
  width: 380px;
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
}

.login-card p {
  color: #666;
  margin: 10px 0 20px;
}

.login-card label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.login-card button {
  width: 100%;
  margin-top: 20px;
  border: 0;
  padding: 14px;
  border-radius: 10px;
  background: #6d4aff;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.error {
  color: #dc2626;
  margin-top: 10px;
  min-height: 20px;
}

.admin-app {
  width: 100%;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: #050520;
  color: white;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand h2 {
  font-size: 28px;
}

.brand span {
  color: #9ca3af;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 15px;
  gap: 10px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: white;
  text-align: right;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
}

.nav-item.active {
  background: #6d4aff;
}

.logout-btn {
  margin: auto 15px 15px;
  border: 0;
  background: #dc2626;
  color: white;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 82px;
  flex: 0 0 82px;
  background: white;
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
}

.page-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: #f4f6fb;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.05);
}

/* UI MANAGER */
#ui-manager-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  direction: rtl;
}

.ui2-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  height: 100%;
  direction: ltr;
}

.ui2-left {
  order: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ui2-right {
  order: 1;
  padding: 18px;
  overflow: auto;
  direction: rtl;
}

.ui2-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(15,23,42,.08);
  overflow: hidden;
}

.ui2-toolbar {
  padding: 18px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #fff, #f8fafc);
  direction: rtl;
}

.ui2-title {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: #020617;
}

.ui2-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.ui2-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.ui2-select,
.ui2-input {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
}

.ui2-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ui2-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
  white-space: nowrap;
}

.ui2-btn-primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
}

.ui2-btn-dark {
  background: #0f172a;
  color: white;
}

.ui2-content-scroll {
  padding: 18px;
  overflow: auto;
  min-height: 0;
  direction: rtl;
}

.ui2-preview-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.ui2-phone {
  width: 300px;
  height: 620px;
  margin: 0 auto;
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  background: #07071a;
  box-shadow: 0 22px 70px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  user-select: none;
}

.ui2-preview-layer {
  position: absolute;
  inset: 0;
}

.ui2-note {
  margin: 12px auto 0;
  max-width: 300px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.ui2-empty {
  padding: 30px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  font-weight: 800;
}

.ui2-element-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 10px 25px rgba(15,23,42,.06);
}

.ui2-element-card.is-active {
  border: 2px solid #22c55e;
}

.ui2-element-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.ui2-element-title {
  font-size: 17px;
  font-weight: 900;
  color: #020617;
}

.ui2-element-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}

.ui2-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ui2-visible {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 800;
}

.ui2-card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ui2-small-btn {
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
}

.ui2-small-btn.save { background: #2563eb; color: white; }
.ui2-small-btn.blue { background: #1d4ed8; color: white; }
.ui2-small-btn.blue2 { background: #1e3a8a; color: white; }
.ui2-small-btn.green { background: #059669; color: white; }
.ui2-small-btn.dark { background: #334155; color: white; }
.ui2-small-btn.orange { background: #b45309; color: white; }
.ui2-small-btn.red { background: #dc2626; color: white; }

.ui2-functional-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}
.exercises-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.section-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
}

.form-grid,
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.section-card label {
  display: block;
  margin: 12px 0 8px;
  font-weight: 700;
}

.section-card input,
.section-card select,
.section-card textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
}

.section-card textarea {
  min-height: 90px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn {
  background: #111827;
  color: white;
}

.secondary-btn {
  background: #eef2f7;
  color: #111827;
}

.danger-btn {
  background: #ef4444;
  color: white;
}

.small-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.exercise-card {
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 16px;
  background: #fafafa;
}

.exercise-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.exercise-card-header h3 {
  margin-bottom: 6px;
}

.exercise-card-header p {
  color: #666;
  font-size: 14px;
}

.exercise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exercise-media {
  width: 100%;
  max-height: 320px;
  border-radius: 16px;
  background: #111;
  object-fit: contain;
  margin: 10px 0 14px;
}

.media-placeholder {
  background: #eef2f7;
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  color: #777;
  margin: 10px 0 14px;
}

.exercise-info strong {
  display: block;
  margin-top: 10px;
}

.exercise-info p {
  margin-top: 5px;
  color: #444;
  line-height: 1.8;
}

.empty-text {
  color: #777;
  text-align: center;
  padding: 25px;
}
.foods-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.food-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.list-stats {
  margin-top: 16px;
  font-weight: 700;
  color: #444;
}

.food-card {
  display: flex;
  gap: 16px;
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 16px;
  background: #fafafa;
}

.food-image-wrap {
  width: 120px;
  min-width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef2f7;
}

.food-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.food-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.food-content {
  flex: 1;
}

.food-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.food-card-header h3 {
  margin-bottom: 6px;
}

.food-card-header p {
  color: #666;
  font-size: 14px;
}

.food-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
}

.macro-grid div {
  background: white;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  border: 1px solid #eee;
}

.macro-grid span {
  display: block;
  color: #777;
  font-size: 13px;
  margin-bottom: 6px;
}

.macro-grid strong {
  font-size: 18px;
}

@media (max-width: 700px) {
  .food-card {
    flex-direction: column;
  }

  .food-image-wrap {
    width: 100%;
    height: 180px;
  }

  .macro-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.recipes-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.recipe-card {
  display: flex;
  gap: 16px;
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 16px;
  background: #fafafa;
}

.recipe-image-wrap {
  width: 140px;
  min-width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef2f7;
}

.recipe-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 38px;
}

.recipe-content {
  flex: 1;
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.recipe-card-header h3 {
  margin-bottom: 6px;
}

.recipe-card-header p {
  color: #666;
  font-size: 14px;
}

.recipe-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.recipe-info {
  margin-top: 14px;
}

.recipe-info strong {
  display: block;
  margin-top: 10px;
}

.recipe-info p {
  margin-top: 5px;
  color: #444;
  line-height: 1.8;
  white-space: pre-line;
}

@media (max-width: 700px) {
  .recipe-card {
    flex-direction: column;
  }

  .recipe-image-wrap {
    width: 100%;
    height: 190px;
  }
}
.notifications-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.notification-card {
  border: 1px solid #eee;
  border-radius: 18px;
  background: #fafafa;
  padding: 16px;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.notification-header h3 {
  margin-bottom: 8px;
}

.notification-header p {
  color: #555;
  line-height: 1.7;
}

.notification-badge {
  background: #111827;
  color: white;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  height: fit-content;
  white-space: nowrap;
}

.notification-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: #777;
}

.notification-actions {
  display: flex;
  gap: 8px;
}
.analytics-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.analytics-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
  text-align: center;
}

.analytics-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.analytics-value {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 6px;
}

.analytics-label {
  color: #666;
  font-weight: 700;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.summary-list div {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 12px;
}

.muted-text {
  color: #777;
}
.sd-page {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: flex-start;
}

.sd-toolbar {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.sd-toolbar h2,
.sd-toolbar h3 {
  margin: 0 0 14px;
}

.sd-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.sd-toolbar input,
.sd-toolbar select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.sd-toolbar button {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: #6d45ff;
  color: white;
}

.sd-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sd-inspector {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.sd-save {
  width: 100%;
  margin-top: 10px;
  background: #111827 !important;
}

.sd-danger {
  background: #dc2626 !important;
}

.sd-preview-wrap {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  min-height: 760px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sd-preview-title {
  font-weight: 800;
  margin-bottom: 12px;
}

.sd-phone {
  width: 273.6px;
  height: 608px;
  position: relative;
  background: #080010;
  overflow: hidden;
  border-radius: 24px;
  border: 8px solid #111827;
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
}

.sd-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.sd-empty {
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 20px;
}

.sd-item {
  position: absolute;
  cursor: move;
  user-select: none;
  box-sizing: border-box;
}

.sd-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: 1px dashed rgba(255,255,255,0.45);
  background: rgba(0,0,0,0.18);
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.sd-hotspot {
  border: 2px dashed rgba(255, 193, 7, 0.85);
  background: rgba(255, 193, 7, 0.18);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-item.selected {
  outline: 3px solid #00e5ff;
}
.sd-ring {
  border: 1px dashed rgba(255,255,255,0.4);
  border-radius: 50%;
}

.sd-ring svg {
  position: absolute;
  inset: 0;
}

.sd-ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: inherit;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.65);
}

.sd-ring-content strong {
  font-size: 0.62em;
  line-height: 1;
}

.sd-ring-content span {
  font-weight: 900;
  line-height: 1;
}

.sd-app-preview .sd-text {
  border: none;
  background: transparent;
}

.sd-app-preview .sd-hotspot {
  border: none;
  background: transparent;
  color: transparent;
}

.sd-app-preview .sd-ring {
  border: none;
}

.sd-preview-toggle {
  width: 100%;
  background: #0891b2 !important;
  margin-bottom: 14px;
}
.sd-resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #00e5ff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  z-index: 9999;
  display: block;
}

.sd-resize-br {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.sd-resize-bl {
  left: -7px;
  bottom: -7px;
  cursor: nesw-resize;
}

.sd-resize-tr {
  right: -7px;
  top: -7px;
  cursor: nesw-resize;
}

.sd-resize-tl {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
}

.sd-app-preview .sd-resize-handle {
  display: none;
}
.sd-resize-handle {
  pointer-events: auto;
}

.sd-item {
  touch-action: none;
}

.sd-ring svg {
  pointer-events: none;
}
