/* ============================================================
   قالب "دفء عضوي" — Organic Warmth
   ملف واحد يُحمَّل بعد styles.css و performance-portal-theme.css
   يعمل عبر body[data-dashboard-theme="organic-warmth"]
   لا يتطلب أي تعديل على HTML.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2:wght@500;600;700;800&family=Rubik:wght@400;500;600;700&display=swap');

body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] {
  --theme-bg: #f5ead8;
  --theme-card: #fdf8ee;
  --theme-card-alt: #efe1c6;
  --theme-line: #e3d1b0;
  --theme-accent: #c67139;
  --theme-accent-2: #7a8a5e;
  --theme-text: #201e1d;
  --theme-muted: #6f6252;
  --theme-muted-2: #8a7a64;
  --theme-on-dark: #201e1d;
  --theme-on-dark-muted: #6f6252;
  --theme-panel: #fdf8ee;
  --theme-panel-2: #f3e7d0;
  --navy: #201e1d;
  --navy-2: #efe1c6;
  --blue: #c67139;
  --cyan: #7a8a5e;
  --green: #7a8a5e;
  --red: #b44742;
  --amber: #b57b22;
  --orange: #d97757;
  --ink: #201e1d;
  --muted: #6f6252;
  --line: #e3d1b0;
  --soft: #f3e7d0;
  --white: #fdf8ee;
  --shadow: 0 14px 34px rgba(122, 84, 40, .14);
  --ow-radius: 18px;
  background: #f5ead8 !important;
  color: #201e1d;
  font-family: "Rubik", Almarai, Tahoma, sans-serif;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .workspace { background: transparent !important; }

/* ---------- الخط ---------- */
body[data-dashboard-theme="organic-warmth"] h1,
body[data-dashboard-theme="organic-warmth"] h2,
body[data-dashboard-theme="organic-warmth"] h3,
body[data-dashboard-theme="organic-warmth"] h4,
body[data-dashboard-theme="organic-warmth"] .sidebar-brand strong,
body[data-dashboard-theme="organic-warmth"] .command-copy h2 {
  font-family: "Baloo Bhaijaan 2", "Rubik", Almarai, sans-serif;
  letter-spacing: 0;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric strong {
  font-family: "Baloo Bhaijaan 2", "Rubik", sans-serif;
  font-weight: 700;
}

/* ---------- استدارة عامة: حاويات ناعمة وأزرار حبوب ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .table-wrap,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .approval-card,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .timeline-item,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .period-toolbar,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .dialog {
  border-radius: var(--ow-radius) !important;
  border-color: var(--theme-line);
  box-shadow: 0 2px 10px rgba(122, 84, 40, .06);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .decision-item,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .branch-count-card,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .branch-archive-row { border-radius: 14px; }
body[data-dashboard-theme="organic-warmth"] .button,
body[data-dashboard-theme="organic-warmth"] .period-toolbar > button:not(.button),
body[data-dashboard-theme="organic-warmth"] .icon-button,
body[data-dashboard-theme="organic-warmth"] .dashboard-theme-button { border-radius: 999px !important; }
body[data-dashboard-theme="organic-warmth"] input,
body[data-dashboard-theme="organic-warmth"] select,
body[data-dashboard-theme="organic-warmth"] textarea,
body[data-dashboard-theme="organic-warmth"] .search-box { border-radius: 14px; border-color: #d9c5a0; background: #fdf8ee; }
body[data-dashboard-theme="organic-warmth"] input:focus,
body[data-dashboard-theme="organic-warmth"] select:focus,
body[data-dashboard-theme="organic-warmth"] textarea:focus,
body[data-dashboard-theme="organic-warmth"] button:focus-visible {
  outline: 2px solid #c67139; outline-offset: 2px; border-color: #c67139;
}

/* ---------- الشريط الجانبي: بني محمّص داكن وعنصر نشط حبّة طينية ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar {
  background: linear-gradient(180deg, #3a2519, #2a1a11) !important;
  border-inline-start: 0;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-brand { border-bottom-color: rgba(245, 234, 216, .16); }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-brand strong { color: #f5ead8 !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-brand span,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-foot span { color: #c9ab8e !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-brand img { border-radius: 50%; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar .nav-item {
  border-radius: 999px; color: #e8d5bd !important; font-weight: 700;
  transition: background .18s ease, color .18s ease;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar .nav-item span { color: #e0a878 !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar .nav-item:hover {
  color: #fff !important; background: rgba(245, 234, 216, .12) !important; box-shadow: none;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar .nav-item.active {
  color: #fff !important; background: #c67139 !important; box-shadow: none;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar .nav-item.active span { color: #ffe0c4 !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-foot { border-top-color: rgba(245, 234, 216, .16); }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-logout {
  color: #f5ead8 !important; background: transparent; border-color: rgba(245, 234, 216, .4);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .sidebar-logout:hover { border-color: #e0a878; background: rgba(245, 234, 216, .1); }
body[data-dashboard-theme="organic-warmth"] .nav-count { background: #b44742; }

/* ---------- الشريط العلوي ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .topbar {
  background: rgba(245, 234, 216, .92) !important;
  border-bottom: 1px solid #e3d1b0;
  backdrop-filter: blur(6px);
}
body[data-dashboard-theme="organic-warmth"] .icon-button { background: #fdf8ee; border-color: #ddc79c; }
body[data-dashboard-theme="organic-warmth"] .icon-button:hover { color: #c67139; border-color: #c67139; background: #f8ecd9; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .account-chip > span {
  color: #fff; background: #7a8a5e; border-radius: 50%;
}

/* ---------- بانر القيادة: بطاقة كريمية بلمسة عضوية ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(140deg, #fdf8ee, #f6ebd4) !important;
  border: 1px solid #e3d1b0 !important;
  padding: 24px 28px;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner::before,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner::after {
  content: ""; display: block; position: absolute; border-radius: 50%; pointer-events: none; opacity: 1;
  inset: auto; border: 0; width: auto; height: auto; background: none;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner::after {
  width: 240px; height: 240px; left: -70px; top: -110px;
  background: radial-gradient(circle, rgba(198,113,57,.16), rgba(198,113,57,0) 68%);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner::before {
  width: 150px; height: 150px; left: 110px; bottom: -90px;
  background: radial-gradient(circle, rgba(122,138,94,.18), rgba(122,138,94,0) 70%);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-kicker { color: #8a4a24 !important; letter-spacing: .06em; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-copy h2,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner h2 { color: #201e1d !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-copy > p:last-child,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-banner p,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .dashboard-date { color: #6f6252 !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .status-pill {
  color: #45522f; background: #e4e8d4; border-color: #b9c39c; border-radius: 999px;
}
body[data-dashboard-theme="organic-warmth"] .status-pill.warning { color: #8a5f14; background: #f6e8c8; border-color: #dfc286; }
body[data-dashboard-theme="organic-warmth"] .status-pill.danger { color: #8e3630; background: #f4dcd8; border-color: #ddab9f; }

/* ---------- شريط الفترات ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .period-toolbar { background: #fdf8ee; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .period-toolbar > button:not(.button) { background: #f3e7d0; color: #6f6252; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .period-toolbar > button.active { background: #c67139; color: #fff; }

/* ---------- بطاقات المؤشرات ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric {
  background: #fdf8ee !important;
  border: 1px solid #e3d1b0;
  border-top-width: 1px !important;
  box-shadow: 0 2px 10px rgba(122, 84, 40, .06);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric::after {
  content: ""; position: absolute; inset: 14px 14px auto auto; width: 10px; height: 10px;
  border-radius: 50%; background: var(--tone, #c67139);
}
body[data-dashboard-theme="organic-warmth"] .metric[data-tone="blue"]   { --tone: #c67139; }
body[data-dashboard-theme="organic-warmth"] .metric[data-tone="green"]  { --tone: #7a8a5e; }
body[data-dashboard-theme="organic-warmth"] .metric[data-tone="cyan"]   { --tone: #9aa877; }
body[data-dashboard-theme="organic-warmth"] .metric[data-tone="amber"]  { --tone: #b57b22; }
body[data-dashboard-theme="organic-warmth"] .metric[data-tone="red"]    { --tone: #b44742; }
body[data-dashboard-theme="organic-warmth"] .metric[data-tone="orange"] { --tone: #d97757; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric-icon,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .section-icon {
  color: #8a4a24 !important; background: #f3ddc9 !important; border-radius: 50% !important;
}
body[data-dashboard-theme="organic-warmth"] .metric small.metric-delta.up { color: #55613f; }
body[data-dashboard-theme="organic-warmth"] .metric small.metric-delta.down { color: #8e3630; }

/* ---------- الرسوم البيانية ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-column i {
  background: linear-gradient(180deg, #d68a52, #b25f2b) !important;
  border-radius: 8px 8px 4px 4px; box-shadow: 0 3px 9px rgba(178, 95, 43, .25);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-column i.credit {
  background: linear-gradient(180deg, #93a370, #67754b) !important;
  box-shadow: 0 3px 9px rgba(103, 117, 75, .25);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-legend i { background: #c67139 !important; box-shadow: 0 0 0 3px rgba(198,113,57,.16); }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-legend .credit i { background: #7a8a5e !important; box-shadow: 0 0 0 3px rgba(122,138,94,.18); }
body[data-dashboard-theme="organic-warmth"] .sales-chart { border-bottom-color: #e3d1b0; }

/* ---------- الأزرار ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .button.primary,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .button.success { background: #c67139 !important; color: #fff; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .button.primary:hover,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .button.success:hover { background: #a3572a !important; }
body[data-dashboard-theme="organic-warmth"] .button.ghost { background: #fdf8ee; border-color: #d9c5a0; color: #4a4438; }
body[data-dashboard-theme="organic-warmth"] .button.ghost:hover { border-color: #c67139; background: #f8ecd9; }
body[data-dashboard-theme="organic-warmth"] .text-action { color: #8a4a24; }
body[data-dashboard-theme="organic-warmth"] .text-action:hover { color: #6d3a1c; }

/* ---------- القوائم والبطاقات الداخلية ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .decision-item {
  background: #f9efdb; border-color: #e6cf9e; border-inline-start-color: #b57b22;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .decision-item.danger {
  background: #f7e5df; border-color: #ddab9f; border-inline-start-color: #b44742;
}
body[data-dashboard-theme="organic-warmth"] .decision-item b { border-radius: 50%; background: #b57b22; }
body[data-dashboard-theme="organic-warmth"] .decision-item.danger b { background: #b44742; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item { background: #f3e7d0; border-color: #e3d1b0; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item:hover,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item:focus-visible {
  border-color: #c67139; background: #fdf8ee; box-shadow: 0 0 0 3px rgba(198, 113, 57, .14);
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .rep-avatar,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .message-row > span {
  color: #fff; background: #7a8a5e !important; border-radius: 50%;
}
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .rep-performance-row { border-bottom-color: #eee0c5; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .rep-performance-row:hover,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .rep-performance-row:focus-visible { background: #f6ebd4; border-radius: 14px; }
body[data-dashboard-theme="organic-warmth"] .rep-score.good { color: #55613f; }
body[data-dashboard-theme="organic-warmth"] .row-chevron { color: #c67139; }

/* ---------- الجداول ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] th {
  color: #6f6252 !important; background: #f3e7d0 !important; font-weight: 700;
}
body[data-dashboard-theme="organic-warmth"] th, body[data-dashboard-theme="organic-warmth"] td { border-bottom-color: #eee0c5; }
body[data-dashboard-theme="organic-warmth"] tbody tr:hover td { background: #f8f0de; }
body[data-dashboard-theme="organic-warmth"] .role-badge { color: #8a4a24; background: #f3ddc9; }
body[data-dashboard-theme="organic-warmth"] .state-badge.active { color: #45522f; background: #e4e8d4; }
body[data-dashboard-theme="organic-warmth"] .state-badge.inactive { color: #8e3630; background: #f4dcd8; }

/* ---------- الحوارات والإشعارات ---------- */
body[data-dashboard-theme="organic-warmth"] .dialog::backdrop { background: rgba(45, 34, 20, .55); backdrop-filter: blur(3px); }
body[data-dashboard-theme="organic-warmth"] .toast { background: #201e1d; border-radius: 12px; }
body[data-dashboard-theme="organic-warmth"] .toast.error { background: #8e3630; }
body[data-dashboard-theme="organic-warmth"] ::selection { background: rgba(198, 113, 57, .3); }

/* ---------- منتقي القوالب ---------- */
body[data-dashboard-theme="organic-warmth"] .dashboard-theme-button.active { border-color: #c67139; box-shadow: 0 0 0 2px rgba(198,113,57,.25); }

/* ---------- نصوص البطاقات: داكنة على الأرضية الكريمية ---------- */
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric strong,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface h2,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface h3,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface h4,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface strong,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item strong,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .rep-performance-row strong,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .decision-item strong,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .message-row strong,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .message-row p,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] td,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] td strong { color: #201e1d !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric > span,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .metric small:not(.metric-delta),
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface-title p,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface p.muted,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item span,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .pulse-item small,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .rep-performance-row small:not(.online):not(.stale),
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .decision-item small,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .message-row small,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .message-row time,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-column span,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-column-value,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-legend,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .chart-legend span,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .target-gauge-sub,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .target-gauge-legend,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .detail-row span,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] td small,
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .empty { color: #6f6252 !important; }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .target-gauge-num { color: #201e1d !important; }

/* ---------- الروح: حركة دخول ناعمة وتفاصيل حية ---------- */
@keyframes owRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes owGrow { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
body[data-dashboard-theme="organic-warmth"] .metric,
body[data-dashboard-theme="organic-warmth"] .surface,
body[data-dashboard-theme="organic-warmth"] .command-banner { animation: owRise .5s cubic-bezier(.22,1,.36,1) both; }
body[data-dashboard-theme="organic-warmth"] .metric:nth-child(2) { animation-delay: .05s; }
body[data-dashboard-theme="organic-warmth"] .metric:nth-child(3) { animation-delay: .1s; }
body[data-dashboard-theme="organic-warmth"] .metric:nth-child(4) { animation-delay: .15s; }
body[data-dashboard-theme="organic-warmth"] .metric:nth-child(5) { animation-delay: .2s; }
body[data-dashboard-theme="organic-warmth"] .metric:nth-child(6) { animation-delay: .25s; }
body[data-dashboard-theme="organic-warmth"] .chart-column i { transform-origin: bottom; animation: owGrow .6s cubic-bezier(.22,1,.36,1) both; }
body[data-dashboard-theme="organic-warmth"] .chart-column:nth-child(odd) i { animation-delay: .08s; }
body[data-dashboard-theme="organic-warmth"] .surface,
body[data-dashboard-theme="organic-warmth"] .decision-item,
body[data-dashboard-theme="organic-warmth"] .pulse-item { transition: transform .22s ease, box-shadow .22s ease, background .18s ease, border-color .18s ease; }
body[data-dashboard-theme="organic-warmth"] .decision-item:hover { transform: translateX(-3px); }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .command-copy h2 { font-size: clamp(24px, 2.8vw, 32px); }
body[data-dashboard-theme="organic-warmth"][data-dashboard-theme] .surface-title h3 { font-size: 17px; }
body[data-dashboard-theme="organic-warmth"] ::-webkit-scrollbar { width: 10px; height: 10px; }
body[data-dashboard-theme="organic-warmth"] ::-webkit-scrollbar-thumb { background: #d9b98c; border-radius: 999px; border: 2px solid #f5ead8; }
body[data-dashboard-theme="organic-warmth"] ::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  body[data-dashboard-theme="organic-warmth"] .metric,
  body[data-dashboard-theme="organic-warmth"] .surface,
  body[data-dashboard-theme="organic-warmth"] .command-banner,
  body[data-dashboard-theme="organic-warmth"] .chart-column i { animation: none; }
}
