/* ==========================================================================
   SILIO V7 — طبقة المظهر الأروق (الخط، التابات، الأيقونات، الحقول)
   تُحمَّل بعد كل ملفات الأنماط، وتخصّ الأنظمة الثلاثة: CUT / OPERATIONS / VISION
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
  --polish-radius: 16px;
  --polish-radius-sm: 11px;
  --polish-ring: 0 0 0 3px rgba(20, 184, 166, .22);
  --polish-line: rgba(15, 23, 42, .08);
  --polish-shadow-soft: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px -10px rgba(15, 23, 42, .18);
  --polish-ease: cubic-bezier(.2, .7, .3, 1);
}

body,
#hub,
#vision-root,
.ops-root,
#operations-root,
input,
select,
textarea,
button,
.btn {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}

body { line-height: 1.7; letter-spacing: 0; }
h1, h2, h3, h4 { letter-spacing: -.2px; font-weight: 700; }

/* ---------- التابات ---------- */
#tabs {
  gap: 6px;
  padding: 6px;
  border-radius: var(--polish-radius);
}
#tabs button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: background .18s var(--polish-ease), color .18s var(--polish-ease),
              border-color .18s var(--polish-ease), box-shadow .18s var(--polish-ease);
}
#tabs button:hover { background: rgba(20, 184, 166, .08); }
#tabs button.on {
  border-color: rgba(20, 184, 166, .35);
  box-shadow: var(--polish-shadow-soft);
}

#operations-root nav.main-tabs button.tab-btn,
#operations-root .tab-btn {
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 500;
  transition: background .18s var(--polish-ease), color .18s var(--polish-ease),
              box-shadow .18s var(--polish-ease), transform .14s var(--polish-ease);
}
#operations-root .tab-btn:hover { transform: translateY(-1px); }

/* ---------- الأزرار والأيقونات ---------- */
header button,
header .b,
.ops-silio-nav-btn,
.vs-btn,
.btn {
  border-radius: var(--polish-radius-sm);
  transition: background .18s var(--polish-ease), border-color .18s var(--polish-ease),
              box-shadow .18s var(--polish-ease), transform .14s var(--polish-ease), color .18s var(--polish-ease);
}
header button:hover,
header .b:hover,
.ops-silio-nav-btn:hover,
.vs-btn:hover,
.btn:hover { transform: translateY(-1px); box-shadow: var(--polish-shadow-soft); }
header button:active,
.ops-silio-nav-btn:active,
.vs-btn:active,
.btn:active { transform: translateY(0); }

#hub .hub-card,
#hub [data-hub] {
  border-radius: var(--polish-radius);
  transition: transform .18s var(--polish-ease), box-shadow .18s var(--polish-ease), border-color .18s var(--polish-ease);
}
#hub .hub-card:hover { transform: translateY(-2px); box-shadow: var(--polish-shadow-soft); }

#hub-home-fab {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 500;
  box-shadow: 0 10px 24px -12px rgba(13, 148, 136, .75);
  transition: transform .16s var(--polish-ease), box-shadow .16s var(--polish-ease), background .16s var(--polish-ease);
}
#hub-home-fab:hover { transform: translateY(-1px); }

/* ---------- الحقول ---------- */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-radius: var(--polish-radius-sm);
  transition: border-color .16s var(--polish-ease), box-shadow .16s var(--polish-ease), background .16s var(--polish-ease);
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--polish-ring);
  border-color: rgba(20, 184, 166, .55);
}
:focus-visible { outline: 2px solid rgba(20, 184, 166, .85); outline-offset: 2px; }

/* محرّر متعدد الأسطر يحلّ محل خانة النص المفردة */
textarea.silio-multiline {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  line-height: 1.6;
  resize: none;
  overflow: hidden;
  font-size: inherit;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- البطاقات والجداول ---------- */
#operations-root .card,
#operations-root .panel,
#operations-root .kpi,
#operations-root .metric-card,
#view .card,
#view .box {
  border-radius: var(--polish-radius);
  box-shadow: var(--polish-shadow-soft);
}
#operations-root table,
#view table { border-collapse: separate; border-spacing: 0; }
#operations-root th,
#view th { font-weight: 600; letter-spacing: 0; }
#operations-root tbody tr,
#view tbody tr { transition: background .14s var(--polish-ease); }

@media print {
  #hub-home-fab { display: none !important; }
}

/* محاذاة الخانات المحوّلة مع بقية الحقول في الشبكات */
#operations-root form textarea.silio-multiline,
#addPullForm textarea.silio-multiline,
#view textarea.silio-multiline {
  display: block;
  height: auto;
  max-height: 220px;
  overflow-y: auto;
}
