/* ===== واجهة على نمط Odoo 17 — اتجاه RTL ===== */
:root {
  /* لون الهوية: تركواز أوفيس بلس ومجموعة بلس للصناعة.
     عميق بما يكفي ليبقى النص الأبيض فوقه واضحاً (تباين 5.3). عند تغييره غيّر المتغيّرات الخمسة معاً. */
  --o-brand: #00777d;
  --o-brand-dark: #00666b;
  --o-brand-darker: #005459;
  --o-brand-light: #dff2f3;
  --o-brand-rgb: 0, 119, 125;
  --o-action: #017e84;
  --o-action-dark: #01666b;
  --o-action-light: #e6f2f3;
  --o-bg: #f9fafb;
  --o-view: #ffffff;
  --o-border: #d8dadd;
  --o-border-light: #e7e9ed;
  --o-text: #374151;
  --o-heading: #111827;
  --o-muted: #6b7280;
  --o-faint: #9ca3af;
  --o-success: #1f8a4c;
  --o-success-bg: #dff3e6;
  /* أزرق صريح: حتى لا تختلط وسوم «معلومة» بوسوم لون الهوية التركوازي */
  --o-info: #1f5fa8;
  --o-info-bg: #e2ecf8;
  --o-warning: #9a6700;
  --o-warning-bg: #fdf0cf;
  --o-danger: #c0392b;
  --o-danger-bg: #fbe1de;
  --o-secondary: #e7e9ed;
  --o-secondary-hover: #d8dadd;
  --o-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .08);
  --o-radius: 4px;
  --o-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "SF Arabic", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--o-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--o-text);
  background: var(--o-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--o-heading); margin: 0; font-weight: 600; }
a { color: var(--o-action); text-decoration: none; cursor: pointer; }
a:hover { color: var(--o-action-dark); }
button { font: inherit; }
.o_icon { flex: none; vertical-align: -3px; }
.text-muted { color: var(--o-muted); }
.text-end { text-align: end; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
td.num, th.num { white-space: nowrap; }
.bidi { unicode-bidi: plaintext; }
.grow { flex: 1; }

#app { display: flex; flex-direction: column; height: 100%; }

#o_storage_warn { flex: none; display: flex; align-items: center; gap: 10px; background: var(--o-danger-bg); color: #8c2a20; padding: 7px 16px; font-size: 13.5px; border-bottom: 1px solid #f0b4ad; }
#o_update { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--o-warning-bg); color: #6b4a00; padding: 7px 16px; font-size: 13.5px; border-bottom: 1px solid #f0d98c; }
/* ---------- الشريط العلوي ---------- */
.o_navbar {
  flex: none; height: 46px; background: var(--o-brand); color: #fff;
  display: flex; align-items: stretch; padding-inline: 4px 10px;
}
.o_navbar_brand { display: flex; align-items: center; gap: 8px; padding-inline: 12px 14px; font-weight: 600; font-size: 16px; color: #fff; }
.o_navbar_brand .o_icon { opacity: .9; }
.o_nav_menu { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.o_nav_menu::-webkit-scrollbar { display: none; }
.o_nav_item {
  display: flex; align-items: center; padding-inline: 12px; color: rgba(255, 255, 255, .9); white-space: nowrap;
  border: 0; background: none; cursor: pointer; font-size: 14px;
}
.o_nav_item:hover { background: rgba(0, 0, 0, .1); color: #fff; }
.o_nav_item.active { background: rgba(0, 0, 0, .18); color: #fff; font-weight: 500; }
.o_nav_end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.o_save_state { font-size: 12px; color: rgba(255, 255, 255, .9); min-width: 60px; text-align: end; }
.o_user_menu { display: flex; align-items: center; gap: 6px; }
.o_avatar {
  width: 28px; height: 28px; border-radius: 4px; background: #fff; color: var(--o-brand);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none;
}
.o_user_menu select {
  background: transparent; color: #fff; border: 0; font: inherit; max-width: 170px; cursor: pointer; padding: 4px 2px;
}
.o_user_menu select option { color: var(--o-text); }

/* ---------- لوحة التحكم ---------- */
.o_control_panel {
  flex: none; background: var(--o-view); border-bottom: 1px solid var(--o-border);
  padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 52px;
}
.o_cp_start { display: flex; align-items: center; gap: 10px; min-width: 0; }
.o_cp_center { flex: 1 1 320px; display: flex; justify-content: center; min-width: 240px; }
.o_cp_end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.o_breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 17px; min-width: 0; }
.o_breadcrumb a { color: var(--o-action); white-space: nowrap; }
.o_breadcrumb .sep { color: var(--o-faint); }
.o_breadcrumb .current { color: var(--o-heading); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_breadcrumb .sub { font-size: 12px; color: var(--o-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--o-radius); padding: 5px 12px; font-size: 14px; font-weight: 500;
  cursor: pointer; line-height: 1.5; user-select: none; transition: background .12s, border-color .12s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--o-brand); color: #fff; border-color: var(--o-brand); }
.btn-primary:hover:not(:disabled) { background: var(--o-brand-dark); border-color: var(--o-brand-dark); }
.btn-secondary { background: var(--o-secondary); color: var(--o-text); border-color: var(--o-secondary); }
.btn-secondary:hover:not(:disabled) { background: var(--o-secondary-hover); border-color: var(--o-secondary-hover); }
.btn-outline { background: #fff; color: var(--o-text); border-color: var(--o-border); }
.btn-outline:hover:not(:disabled) { background: var(--o-bg); }
.btn-danger { background: var(--o-danger); color: #fff; border-color: var(--o-danger); }
.btn-link { background: none; border: 0; color: var(--o-action); padding: 4px 6px; }
.btn-link:hover { color: var(--o-action-dark); background: var(--o-action-light); }
.btn-sm { padding: 2px 8px; font-size: 13px; }
.btn-icon { padding: 5px 7px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-start-start-radius: var(--o-radius); border-end-start-radius: var(--o-radius); }
.btn-group .btn:last-child { border-start-end-radius: var(--o-radius); border-end-end-radius: var(--o-radius); }
.btn-group .btn.active { background: var(--o-action-light); color: var(--o-action); border-color: #b9dadc; }

/* ---------- البحث والفلاتر ---------- */
.o_searchview {
  display: flex; align-items: center; gap: 6px; width: 100%; max-width: 620px; border: 1px solid var(--o-border);
  border-radius: var(--o-radius); background: #fff; padding: 3px 8px; min-height: 34px; flex-wrap: wrap;
}
.o_searchview:focus-within { border-color: var(--o-action); box-shadow: 0 0 0 2px rgba(1, 126, 132, .15); }
.o_searchview input { border: 0; outline: 0; flex: 1; min-width: 120px; font: inherit; background: none; color: var(--o-text); padding: 3px 0; }
.o_searchview .o_icon { color: var(--o-muted); }
.o_facet { display: inline-flex; align-items: center; background: var(--o-brand); color: #fff; border-radius: 3px; font-size: 12px; overflow: hidden; }
.o_facet span { padding: 2px 7px; }
.o_facet button { border: 0; background: rgba(0, 0, 0, .15); color: #fff; cursor: pointer; padding: 2px 5px; display: flex; align-items: center; }
.o_filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.o_chip {
  border: 1px solid var(--o-border); background: #fff; border-radius: 999px; padding: 2px 11px; font-size: 13px; cursor: pointer; color: var(--o-text);
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.o_chip:hover { background: var(--o-bg); }
.o_chip.active { background: var(--o-action-light); border-color: #9fcfd2; color: var(--o-action-dark); font-weight: 500; }
.o_chip .cnt { color: var(--o-muted); font-size: 12px; }
.o_pager { display: flex; align-items: center; gap: 6px; color: var(--o-muted); font-size: 13px; white-space: nowrap; }
.o_filter_select { border: 1px solid var(--o-border); border-radius: var(--o-radius); background: #fff; padding: 4px 6px; font: inherit; color: var(--o-text); max-width: 190px; }

/* ---------- المحتوى ---------- */
.o_content { flex: 1; overflow: auto; position: relative; }
.o_subbar { background: var(--o-view); border-bottom: 1px solid var(--o-border-light); padding: 8px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- القوائم ---------- */
.o_list_view { background: var(--o-view); min-height: 100%; }
.o_list_table { width: 100%; border-collapse: collapse; }
.o_list_table th {
  position: sticky; top: 0; z-index: 2; background: var(--o-view); text-align: start; font-weight: 600; color: var(--o-heading);
  padding: 9px 10px; border-bottom: 1px solid var(--o-border); white-space: nowrap; cursor: default; font-size: 13.5px;
}
.o_list_table th.sortable { cursor: pointer; }
.o_list_table th.sortable:hover { background: var(--o-bg); }
.o_list_table td { padding: 8px 10px; border-bottom: 1px solid var(--o-border-light); vertical-align: middle; }
.o_list_table tbody tr { cursor: pointer; }
.o_list_table tbody tr:hover { background: #f3f4f6; }
.o_list_table td.o_strong { color: var(--o-heading); font-weight: 500; }
.o_list_table td.o_ellipsis { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_list_table tfoot td { font-weight: 600; color: var(--o-heading); border-top: 1px solid var(--o-border); border-bottom: 0; background: var(--o-view); position: sticky; bottom: 0; }
.o_list_table .o_group_row td { background: #f3f4f6; font-weight: 600; color: var(--o-heading); cursor: default; }
.o_empty { text-align: center; color: var(--o-muted); padding: 70px 20px; }
.o_empty h3 { margin-bottom: 6px; font-weight: 500; }

.o_tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 500; white-space: nowrap; margin-inline-start: 6px; }
td > .o_tag:first-child, .o_tag.flush { margin-inline-start: 0; }
.o_tag_muted { background: #eceef1; color: #4b5563; }
.o_tag_info { background: var(--o-info-bg); color: var(--o-info); }
.o_tag_success { background: var(--o-success-bg); color: var(--o-success); }
.o_tag_danger { background: var(--o-danger-bg); color: var(--o-danger); }
.o_tag_warning { background: var(--o-warning-bg); color: var(--o-warning); }
.o_tag_brand { background: var(--o-brand-light); color: var(--o-brand); }

/* ---------- النموذج ---------- */
.o_form_statusbar {
  background: var(--o-view); border-bottom: 1px solid var(--o-border); padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; position: sticky; top: 0; z-index: 5;
}
.o_statusbar_buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.o_statusbar_status { margin-inline-start: auto; display: flex; }
.o_arrow_button {
  position: relative; padding: 5px 20px 5px 14px; background: #fff; color: var(--o-muted); font-size: 13px; font-weight: 500;
  border-block: 1px solid var(--o-border); white-space: nowrap;
}
[dir=rtl] .o_arrow_button { padding: 5px 14px 5px 20px; }
.o_arrow_button:first-child { border-inline-start: 1px solid var(--o-border); border-start-start-radius: var(--o-radius); border-end-start-radius: var(--o-radius); }
.o_arrow_button:last-child { border-inline-end: 1px solid var(--o-border); border-start-end-radius: var(--o-radius); border-end-end-radius: var(--o-radius); padding-inline-end: 14px; }
.o_arrow_button:not(:last-child)::after {
  content: ''; position: absolute; top: 50%; inset-inline-end: -8px; width: 15px; height: 15px; background: inherit; z-index: 1;
  border-top: 1px solid var(--o-border); border-inline-end: 1px solid var(--o-border); transform: translateY(-50%) rotate(45deg) skew(8deg, 8deg);
}
[dir=rtl] .o_arrow_button:not(:last-child)::after { transform: translateY(-50%) rotate(-45deg) skew(-8deg, -8deg); }
.o_arrow_button.current { background: var(--o-action-light); color: var(--o-action-dark); font-weight: 600; }
.o_arrow_button.danger.current { background: var(--o-danger-bg); color: var(--o-danger); }
.o_arrow_button.success.current { background: var(--o-success-bg); color: var(--o-success); }

.o_form_sheet_bg { padding: 16px; display: flex; gap: 16px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.o_form_sheet {
  background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 22px 28px 26px;
  width: 100%; max-width: 1220px; flex: 1 1 760px; min-width: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
fieldset.o_fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.o_form_title { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.o_form_title h1 { font-size: 28px; font-weight: 500; line-height: 1.2; }
.o_form_title .o_sub { color: var(--o-muted); font-size: 13px; padding-bottom: 5px; }
.o_stat_buttons { display: flex; gap: 0; margin: -22px -28px 18px; border-bottom: 1px solid var(--o-border-light); justify-content: flex-end; flex-wrap: wrap; }
.o_stat_button { display: flex; align-items: center; gap: 9px; padding: 9px 18px; border: 0; border-inline-start: 1px solid var(--o-border-light); background: none; cursor: pointer; color: var(--o-text); text-align: start; }
.o_stat_button:hover { background: var(--o-bg); }
.o_stat_button .o_icon { color: var(--o-brand); }
.o_stat_button b { display: block; color: var(--o-heading); font-size: 14px; }
.o_stat_button small { color: var(--o-muted); font-size: 12px; }

.o_group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 40px; margin-bottom: 14px; }
.o_group_1 { grid-template-columns: 1fr; }
.o_field { display: grid; grid-template-columns: 150px 1fr; align-items: baseline; gap: 10px; min-height: 34px; }
.o_field_wide { grid-column: 1 / -1; }
.o_form_label { font-weight: 500; color: var(--o-heading); font-size: 13.5px; padding-top: 5px; }
.o_req { color: var(--o-danger); }
.o_field_widget { min-width: 0; }
.o_hint { font-size: 12px; color: var(--o-muted); margin-top: 2px; }
.o_hint.warn { color: var(--o-warning); }
.o_input {
  width: 100%; border: 0; border-bottom: 1px solid var(--o-border); background: transparent; padding: 4px 2px; font: inherit; color: var(--o-heading);
  outline: 0; border-radius: 0; min-width: 0;
}
.o_input:hover { border-bottom-color: #9ca3af; }
.o_input:focus { border-bottom-color: var(--o-action); box-shadow: 0 1px 0 var(--o-action); }
.o_input::placeholder { color: var(--o-faint); }
.o_input:disabled { color: var(--o-text); border-bottom-color: transparent; -webkit-text-fill-color: var(--o-text); opacity: 1; }
.o_select { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat left 4px center; padding-inline-end: 18px; cursor: pointer; }
.o_select:disabled { background-image: none; }
.o_area { resize: none; overflow: hidden; display: block; line-height: 1.45; }
.o_num { text-align: end; font-variant-numeric: tabular-nums; }
.o_inline { display: flex; align-items: baseline; gap: 8px; }
.o_inline .o_input { width: auto; flex: 0 1 90px; }
.o_inline .unit { color: var(--o-muted); font-size: 13px; white-space: nowrap; }
.o_m2o { position: relative; display: flex; align-items: center; }
.o_m2o .o_input { padding-inline-end: 24px; }
.o_m2o_open { position: absolute; inset-inline-end: 0; border: 0; background: none; color: var(--o-muted); cursor: pointer; padding: 4px; display: flex; }
.o_m2o_open:hover { color: var(--o-action); }

.o_alert { border-radius: var(--o-radius); padding: 9px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.o_alert_info { background: var(--o-info-bg); color: #17487f; }
.o_alert_warning { background: var(--o-warning-bg); color: #6b4a00; }
.o_alert_success { background: var(--o-success-bg); color: #14613a; }
.o_alert_danger { background: var(--o-danger-bg); color: #8c2a20; }
.o_alert a { font-weight: 600; }

/* ---------- التبويبات ---------- */
.o_notebook { margin-top: 10px; }
.o_tabs { display: flex; border-bottom: 1px solid var(--o-border); gap: 2px; overflow-x: auto; }
.o_tab {
  padding: 8px 16px; border: 1px solid transparent; border-bottom: 0; background: none; cursor: pointer; color: var(--o-muted); font-weight: 500;
  border-radius: var(--o-radius) var(--o-radius) 0 0; margin-bottom: -1px; white-space: nowrap; font-size: 14px;
}
.o_tab:hover { color: var(--o-heading); }
.o_tab.active { color: var(--o-heading); border-color: var(--o-border); border-bottom: 1px solid var(--o-view); background: var(--o-view); box-shadow: inset 0 2px 0 var(--o-brand); }
.o_tab_pane { padding-top: 12px; }

/* ---------- بنود العرض ---------- */
.o_lines_toolbar {
  display: flex; align-items: center; gap: 8px; background: var(--o-action-light); border: 1px solid #b9dadc; border-radius: var(--o-radius);
  padding: 6px 10px; margin-bottom: 8px; flex-wrap: wrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.o_lines_toolbar_slot { position: sticky; top: 50px; z-index: 4; }
.o_lines_toolbar_slot:empty { display: none; }
.o_lines_toolbar b { color: var(--o-action-dark); margin-inline-end: 6px; }
.o_lines_wrap { overflow-x: auto; }
.o_lines { width: 100%; border-collapse: collapse; min-width: 820px; }
.o_lines th { text-align: start; font-weight: 600; color: var(--o-heading); padding: 7px 6px; border-bottom: 1px solid var(--o-border); font-size: 13px; white-space: nowrap; }
.o_lines td { padding: 4px 6px; border-bottom: 1px solid var(--o-border-light); vertical-align: top; }
.o_lines tr.o_line:hover > td { background: #fafbfc; }
.o_lines tr.o_selected > td { background: #eef7f8 !important; }
.o_lines tr.dragging { opacity: .35; }
.o_lines tr.drop-before > td { box-shadow: inset 0 2px 0 var(--o-action); }
.o_lines tr.drop-after > td { box-shadow: inset 0 -2px 0 var(--o-action); }
.o_lines tr.drop-into > td { background: #cbe8ea !important; }
.o_lines .c_sel { width: 26px; padding-top: 9px; }
.o_lines .c_grip { width: 20px; color: var(--o-faint); cursor: grab; padding-top: 9px; }
.o_lines .c_grip:active { cursor: grabbing; }
.o_lines .c_sr { width: 30px; color: var(--o-muted); padding-top: 8px; text-align: center; font-size: 13px; }
.o_lines .c_img { width: 52px; }
.o_lines .c_unit { width: 92px; }
.o_lines .c_qty { width: 74px; }
.o_lines .c_price { width: 112px; }
.o_lines .c_disc { width: 62px; }
.o_lines .c_total { width: 118px; text-align: end; padding-top: 8px; font-variant-numeric: tabular-nums; color: var(--o-heading); font-weight: 500; white-space: nowrap; }
.o_lines .c_act { width: 64px; white-space: nowrap; padding-top: 6px; text-align: end; }
.o_lines .o_input { border-bottom-color: transparent; }
.o_lines tr:hover .o_input, .o_lines .o_input:focus { border-bottom-color: var(--o-border); }
.o_lines .o_input:focus { border-bottom-color: var(--o-action); }
.o_line_name { font-weight: 500; }
.o_line_desc { color: var(--o-muted); font-size: 13px; padding-top: 1px; padding-bottom: 3px; }
.o_thumb {
  width: 44px; height: 44px; border: 1px dashed var(--o-border); border-radius: var(--o-radius); display: flex; align-items: center; justify-content: center;
  color: var(--o-faint); cursor: pointer; background: #fff center/contain no-repeat; margin-top: 3px; padding: 0;
}
.o_thumb:hover { border-color: var(--o-action); color: var(--o-action); }
.o_thumb.has { border-style: solid; }
.o_icon_btn { border: 0; background: none; color: var(--o-faint); cursor: pointer; padding: 4px; border-radius: var(--o-radius); display: inline-flex; }
.o_icon_btn:hover { color: var(--o-heading); background: var(--o-secondary); }
.o_icon_btn.danger:hover { color: var(--o-danger); background: var(--o-danger-bg); }
.o_icon_btn.on { color: var(--o-action); }
.o_line_optional .c_total { color: var(--o-faint); text-decoration: line-through; font-weight: 400; }
.o_line_optional .o_line_name { color: var(--o-muted); }
.o_bundle_row > td { background: #f6fafb; }
.o_bundle_head { display: flex; align-items: center; gap: 4px; }
.o_bundle_toggle { border: 0; background: none; cursor: pointer; padding: 2px; color: var(--o-brand); display: flex; transition: transform .15s; }
.o_bundle_toggle.closed { transform: rotate(90deg); }
[dir=rtl] .o_bundle_toggle.closed { transform: rotate(90deg); }
.o_kid_row > td { background: #fbfdfd; border-bottom-color: #e4f0f1; padding-top: 1px; padding-bottom: 1px; font-size: 13px; }
.o_kid_row .c_name { padding-inline-start: 34px; position: relative; }
.o_kid_row .c_name::before { content: ''; position: absolute; inset-inline-start: 18px; top: 0; bottom: 50%; width: 10px; border-inline-start: 1px solid #a3d1d4; border-bottom: 1px solid #a3d1d4; }
.o_kid_row .c_total { font-weight: 400; color: var(--o-muted); padding-top: 5px; }
.o_kid_add > td { background: #fbfdfd; padding-inline-start: 46px; padding-block: 3px 7px; }
.o_price_wrap { display: flex; align-items: center; gap: 2px; }
.o_section_row > td { background: #f3f4f6; }
.o_section_row .o_input { font-weight: 700; color: var(--o-heading); }
.o_note_row .o_input { font-style: italic; color: var(--o-muted); }
.o_lines_add { display: flex; gap: 4px; padding: 8px 0 2px; flex-wrap: wrap; align-items: center; }
.o_lines_add .sep { width: 1px; height: 18px; background: var(--o-border); margin-inline: 6px; }
.o_lines_empty td { text-align: center; color: var(--o-muted); padding: 26px 10px !important; }

.o_totals_row { display: flex; justify-content: space-between; gap: 24px; margin-top: 14px; flex-wrap: wrap; align-items: flex-start; }
.o_terms_note { flex: 1 1 300px; color: var(--o-muted); font-size: 13px; max-width: 520px; }
.o_totals { width: 380px; max-width: 100%; margin-inline-start: auto; }
.o_totals .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.o_totals .row label { color: var(--o-text); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.o_totals .row .v { font-variant-numeric: tabular-nums; color: var(--o-heading); white-space: nowrap; }
.o_totals .row.sub { border-top: 1px solid var(--o-border); margin-top: 4px; padding-top: 8px; }
.o_totals .row.grand { border-top: 1px solid var(--o-border); margin-top: 4px; padding-top: 8px; font-size: 18px; font-weight: 600; }
.o_totals .row.grand .v { color: var(--o-brand); }
.o_totals .row.muted, .o_totals .row.muted .v { color: var(--o-muted); font-size: 13px; }
.o_totals .mini { display: flex; align-items: center; gap: 4px; }
.o_totals .mini .o_input { width: 70px; }
.o_totals .mini select { border: 0; background: none; color: var(--o-muted); font: inherit; cursor: pointer; padding: 0; }
.o_margin_good { color: var(--o-success) !important; }
.o_margin_bad { color: var(--o-danger) !important; }

/* ---------- سجل النشاط ---------- */
.o_chatter { flex: 0 1 300px; min-width: 240px; background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 14px 16px; }
.o_chatter h4 { font-size: 14px; margin-bottom: 10px; }
.o_log { display: flex; gap: 9px; padding: 7px 0; border-top: 1px solid var(--o-border-light); font-size: 13px; }
.o_log:first-of-type { border-top: 0; }
.o_log .o_avatar { width: 24px; height: 24px; background: var(--o-brand-light); font-size: 10px; }
.o_log time { color: var(--o-faint); font-size: 12px; display: block; }
.o_note_box { display: flex; gap: 6px; margin-bottom: 8px; }
.o_note_box input { flex: 1; border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 5px 8px; font: inherit; min-width: 0; }

/* ---------- الفرص ---------- */
.o_leads_board { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(250px, 1fr)); gap: 12px; padding: 14px; align-items: start; overflow-x: auto; }
.o_leads_col { background: #eef0f3; border-radius: 6px; padding: 8px; min-height: 180px; }
.o_leads_col.drop { outline: 2px dashed var(--o-action); outline-offset: -2px; }
.o_leads_col_head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; color: var(--o-heading); font-size: 15px; }
.o_leads_col_head .cnt { color: var(--o-muted); font-weight: 400; font-size: 13px; background: #fff; border-radius: 999px; padding: 0 8px; }
.o_lead_card { background: #fff; border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 9px 11px; margin-bottom: 8px; cursor: pointer; }
.o_lead_card:hover { box-shadow: var(--o-shadow); border-color: #c4c7cc; }
.o_lead_card .ttl { font-weight: 600; color: var(--o-heading); line-height: 1.35; }
.o_lead_card .ln { font-size: 13px; color: var(--o-text); display: flex; gap: 6px; align-items: center; margin-top: 3px; min-width: 0; }
.o_lead_card .ln .o_icon { color: var(--o-faint); }
.o_lead_card .ln span, .o_lead_card .ln a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o_lead_card .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--o-muted); }
.o_lead_card .foot .o_avatar { width: 22px; height: 22px; font-size: 10px; background: var(--o-brand-light); }
.o_leads_empty { width: 100%; border: 1px dashed #c4c7cc; background: transparent; border-radius: var(--o-radius); padding: 18px 8px; color: var(--o-muted); cursor: pointer; display: flex; gap: 6px; align-items: center; justify-content: center; font: inherit; }
.o_leads_empty:hover { color: var(--o-action); border-color: var(--o-action); background: #fff; }
a.o_sub { color: var(--o-action); cursor: pointer; }

/* ---------- أوامر العمل ---------- */
.o_orders_kpis { padding: 12px 14px 4px; margin: 0; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.o_orders_kpis .o_kpi { padding: 10px 14px; }
.o_orders_kpis .o_kpi .val { font-size: 22px; }
.c_prog { width: 124px; cursor: default; }
.o_prog { display: flex; align-items: center; gap: 6px; }
.o_prog_bar { flex: 1; height: 8px; background: #eceef1; border-radius: 4px; overflow: hidden; min-width: 50px; }
.o_prog_bar i { display: block; height: 100%; background: var(--o-brand); border-radius: 4px; }
.o_prog_bar i.done { background: var(--o-success); }
.o_prog input { width: 38px; border: 0; border-bottom: 1px solid transparent; background: none; font: inherit; text-align: end; color: var(--o-heading); outline: 0; padding: 1px 2px; font-variant-numeric: tabular-nums; }
.o_prog input:hover { border-bottom-color: var(--o-border); }
.o_prog input:focus { border-bottom-color: var(--o-action); }
.o_prog span { color: var(--o-muted); font-size: 12px; }
.o_order_bar label { display: inline-flex; align-items: center; gap: 6px; }
.o_order_bar input { border: 1px solid #a9d8ba; border-radius: var(--o-radius); background: #fff; font: inherit; padding: 2px 6px; color: var(--o-heading); }
.o_order_bar .o_order_pct { width: 52px; text-align: center; }
.o_factory_note { display: grid; grid-template-columns: 150px 1fr; gap: 4px 10px; align-items: baseline; margin: -6px 0 14px; }
.o_factory_note label { font-weight: 500; color: var(--o-heading); font-size: 13.5px; }
.o_list_table .c_act { width: 34px; text-align: center; cursor: default; }
/* تصنيف التنفيذ داخل أمر العمل */
.o_src_cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.o_src_card { border: 1px solid var(--o-border); border-top: 3px solid; border-radius: var(--o-radius); padding: 8px 10px; background: #fff; }
.o_src_card.empty { opacity: .5; }
.o_src_card .ttl { font-weight: 600; color: var(--o-heading); font-size: 13.5px; }
.o_src_card .big { font-size: 20px; font-weight: 600; color: var(--o-heading); line-height: 1.3; }
.o_src_card .big small { font-size: 12px; font-weight: 400; color: var(--o-muted); }
.o_src_card .sub { font-size: 12.5px; color: var(--o-muted); }
.o_src_card .btn-link { padding: 2px 0; margin-top: 2px; }
.o_src_bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.o_src_bar .o_bar_track { flex: 1; min-width: 160px; height: 10px; }
.o_seg { display: inline-flex; flex-wrap: nowrap; }
.o_seg button { border: 1px solid var(--o-border); background: #fff; padding: 3px 9px; font-size: 12.5px; cursor: pointer; color: var(--o-text); margin-inline-start: -1px; white-space: nowrap; }
.o_seg button:first-child, .o_seg button.gap { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.o_seg button:first-child { margin-inline-start: 0; }
.o_seg button.gap { margin-inline-start: 8px; }
.o_seg button:nth-child(3), .o_seg button:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.o_seg button:hover { background: var(--o-bg); }
.o_seg button.active { color: #fff; font-weight: 600; }
.o_exec td { vertical-align: middle; padding-block: 5px; }
.o_exec .c_name.kid { padding-inline-start: 26px; }
.o_exec .c_src { width: 1%; white-space: nowrap; }
.o_exec .o_thumb { margin-top: 0; }
/* ---------- مرحلتا الإنتاج والمشتريات ---------- */
.o_stage_kpi { text-align: start; cursor: pointer; border-top: 3px solid; font: inherit; color: inherit; }
.o_stage_kpi:hover { box-shadow: var(--o-shadow); }
.o_stage_kpi.active { background: var(--o-action-light); }
.o_src_dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; }
.o_prog b { font-size: 12.5px; color: var(--o-heading); min-width: 34px; text-align: end; font-weight: 600; }
.o_stage_head .o_form_title { margin-bottom: 8px; }
.o_stage_grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 18px; margin-bottom: 12px; }
.o_stage_grid > div { min-width: 0; }
.o_stage_grid span { display: block; font-size: 12px; color: var(--o-muted); }
.o_stage_grid b { display: block; font-weight: 500; color: var(--o-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o_stage_grid small { font-weight: 400; font-size: 12.5px; }
.o_stage_nav { margin-bottom: 14px; max-width: 100%; overflow-x: auto; }
.o_stage_nav button:disabled { color: var(--o-faint); cursor: default; }
.o_stage_nav .cnt, .o_tab .cnt { font-size: 12px; background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 0 7px; font-weight: 400; }
.o_tab .cnt { margin-inline-start: 6px; }
.o_stage_total { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13.5px; }
.o_stage_total .o_prog_bar { flex: 0 1 260px; height: 10px; }
.o_stage_total .o_tag { margin: 0; }
.o_stage_sec { border: 1px solid var(--o-border); border-top: 3px solid; border-radius: var(--o-radius); margin-bottom: 14px; background: #fff; }
.o_stage_sec > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--o-border-light); background: #fafbfc; }
.o_stage_sec > header h3 { font-size: 15px; }
.o_stage_sec > header .meta { color: var(--o-muted); font-size: 13px; }
.o_stage_sec > header .o_prog_bar { flex: 0 1 150px; }
.o_stage_sec .o_lines { min-width: 780px; }
.o_stage_sec .o_lines th:first-child, .o_stage_sec .o_lines td:first-child { padding-inline-start: 12px; }
.o_stage_sec .o_lines tr:last-child td { border-bottom: 0; }
.o_segs { display: inline-flex; }
.o_segs button { border: 1px solid var(--o-border); background: #fff; padding: 3px 9px; font-size: 12.5px; cursor: pointer; color: var(--o-text); margin-inline-start: -1px; white-space: nowrap; }
.o_segs button:first-child { margin-inline-start: 0; border-start-start-radius: 4px; border-end-start-radius: 4px; }
.o_segs button:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.o_segs button:hover { background: var(--o-bg); }
.o_segs button.active { color: #fff; font-weight: 600; }
.o_prod .c_done { width: 100px; }
.o_done { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.o_prod .o_done .o_input { width: 48px; border-bottom-color: var(--o-border); }
.o_done span { color: var(--o-muted); font-size: 12.5px; }
.o_prod .c_note { min-width: 150px; }
/* مقارنة عروض الموردين */
.o_offers_bar { align-items: center; margin-bottom: 8px; }
.o_policy { color: var(--o-muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.o_offers th.o_offer_th { vertical-align: top; min-width: 172px; width: 172px; background: #fafbfc; border-inline-start: 1px solid var(--o-border-light); font-weight: 400; white-space: normal; padding: 8px; }
.o_offers th.o_offer_th.chosen { background: #eef8f1; box-shadow: inset 0 3px 0 var(--o-success); }
.o_offer_th .top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.o_offer_th .top b { color: var(--o-heading); font-weight: 600; }
.o_offer_th .top .o_tag { margin: 0; }
.o_offers .o_offer_th .o_input { border-bottom-color: var(--o-border); margin-bottom: 3px; }
.o_offers .o_offer_th .o_input:focus { border-bottom-color: var(--o-action); }
.o_offers .o_offer_th .o_input:disabled { border-bottom-color: transparent; }
.o_offer_th .o_offer_sup { font-weight: 600; }
.o_offer_th .o_inline .o_input { flex: 0 1 52px; }
.o_attach { display: flex; align-items: center; gap: 2px; min-height: 26px; font-size: 12.5px; min-width: 0; }
.o_attach a { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.o_attach a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.o_attach .btn-link { padding: 2px; font-size: 12.5px; }
.o_attach.none { color: var(--o-faint); }
.o_attach.none.warn { color: var(--o-danger); }
/* مستندات أمر العمل (PO، اعتماد الألوان والخامات): خانة بملفاتها وزر الإرفاق، تقبل السحب والإفلات */
.o_docs_slot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 30px; padding: 1px 4px; border: 1px dashed transparent; border-radius: var(--o-radius); min-width: 0; }
.o_docs_slot.over { border-color: var(--o-action); background: var(--o-brand-light); }
.o_docs_slot.invalid { border-color: var(--o-danger); background: #fdf1ef; }
.o_docs_slot.busy { opacity: .75; }
.o_doc_chip { background: #eef0f3; border-radius: 999px; padding: 0 10px 0 3px; max-width: 100%; }
.o_doc_chip a { cursor: pointer; color: var(--o-action); }
.o_doc_chip a span { max-width: 240px; }
.o_order_docs { align-items: center; margin-bottom: 8px; }
.o_stage_docs { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; font-size: 13px; }
.o_stage_docs > span { color: var(--o-muted); font-size: 12px; white-space: nowrap; }
.o_stage_docs > b { font-weight: 500; color: var(--o-heading); margin-inline-end: 14px; }
/* خانة التسليم في العرض: توريد وتركيب (والمدينة) أو استلام أرض المصنع */
.o_delivery { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 2px 4px; border: 1px dashed transparent; border-radius: var(--o-radius); }
.o_delivery.invalid { border-color: var(--o-danger); background: #fdf1ef; }
.o_delivery .o_delivery_city { width: 200px; }
.o_delivery .o_radio_tabs button:disabled { cursor: default; opacity: .75; }
/* المكتب الفني — بنود التصنيع: جدول البنود، شريط التصنيف الجماعي، وما يظهر منها في صفحة الإنتاج */
.o_mfg { min-width: 1080px; }
.o_mfg td { white-space: nowrap; }
.o_mfg td.c_name { white-space: normal; min-width: 200px; }
.o_mfg .o_mfg_sel { min-width: 150px; max-width: 230px; padding-block: 3px; }
.o_mfg_due { width: 140px; padding-block: 3px; }
.o_mfg .o_tag { margin: 0 0 0 4px; }
.o_mfg_draws { min-height: 0; max-width: 300px; white-space: normal; }
.o_mfg_act { text-align: end; }
.o_mfg_act > * { margin-inline-start: 6px; vertical-align: middle; }
.o_mfg_bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border: 1px dashed var(--o-border); border-radius: var(--o-radius); background: #fafbfc; font-size: 13.5px; }
.o_mfg_bulk.on { border-style: solid; border-color: var(--o-action); background: var(--o-brand-light); }
.o_mfg_bulk .o_mfg_sel { width: auto; min-width: 160px; }
.o_mfg_bulk b { color: var(--o-heading); }
.o_mfg_prod { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; }
.o_mfg_held { padding: 8px 12px; border-top: 1px solid var(--o-border-light); font-size: 13px; color: var(--o-text); background: #fffaf0; }
.o_mfg_held summary { cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.o_mfg_held summary a { margin-inline-start: auto; }
.o_mfg_held ul { margin: 6px 22px 2px; padding: 0; }
.o_mfg_held li { margin: 2px 0; }
.o_offers td.o_offer_cell { border-inline-start: 1px solid var(--o-border-light); padding: 4px 6px; }
.o_offers td.o_offer_cell.picked { background: #e3f4e9 !important; }
.o_offer_price { display: flex; align-items: center; gap: 4px; }
.o_offers .o_offer_price .o_input { flex: 1; min-width: 0; border-bottom-color: var(--o-border); }
.o_offers .o_offer_price .o_input:focus { border-bottom-color: var(--o-action); }
.o_offers .o_offer_price .o_input:disabled { border-bottom-color: transparent; }
.o_pick { flex: none; width: 22px; height: 22px; border: 1px solid var(--o-border); border-radius: 50%; background: #fff; color: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.o_pick:hover:not(:disabled) { border-color: var(--o-success); color: var(--o-success); }
.o_pick.on { background: var(--o-success); border-color: var(--o-success); color: #fff !important; }
.o_pick:disabled { opacity: .3; cursor: default; }
.o_pick.on:disabled { opacity: 1; }
.o_offer_sub { font-size: 12px; color: var(--o-muted); text-align: end; padding-inline-end: 26px; }
.o_offer_cell.low .o_offer_sub { color: var(--o-success); font-weight: 600; }
.o_offers tfoot td { padding: 8px 6px; border-top: 1px solid var(--o-border); border-bottom: 0; font-weight: 600; color: var(--o-heading); vertical-align: top; }
.o_offers tfoot td.o_offer_total { border-inline-start: 1px solid var(--o-border-light); text-align: end; font-weight: 400; }
.o_offer_total.low b { color: var(--o-success); }
.o_offer_total .o_offer_sub { padding-inline-end: 0; }
.o_offer_total .btn-link { padding: 2px 0; }
.o_offers .c_sale { color: var(--o-muted); }
.o_award { border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 12px 14px; margin-top: 14px; background: #fcfcfd; }
.o_award h4 { font-size: 15px; margin-bottom: 8px; display: flex; gap: 10px; align-items: baseline; }
.o_award h4 small { font-weight: 400; color: var(--o-muted); font-size: 12.5px; }
.o_award .o_subtable { margin-bottom: 10px; }
.o_award .o_alert { margin: 10px 0; }
.o_award .o_factory_note { margin: 0 0 10px; }
.o_award_margin { margin: 0 0 8px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.o_award_margin b { unicode-bidi: isolate; }
.o_rate { justify-content: flex-end; }
.o_rate .o_input { text-align: center; flex: 0 0 68px; }
/* تكلفة الوصول للاستيراد */
.o_import .c_fx { width: 116px; }
.o_offers.o_import .c_fx .o_input { border-bottom-color: var(--o-border); }
.o_import td.o_strong { color: var(--o-heading); font-weight: 600; }
.o_landed td { padding-block: 5px; }
.o_landed .c_in { width: 290px; }
.o_landed tr.sum td { background: #f3f4f6; font-weight: 600; color: var(--o-heading); }
.o_landed tr.grand td { background: var(--o-brand-light); font-weight: 600; color: var(--o-heading); font-size: 15px; border-bottom: 0; }
.o_amt { display: flex; align-items: baseline; gap: 6px; }
.o_amt .o_input { width: 110px; flex: none; }
.o_amt .unit { color: var(--o-muted); font-size: 12.5px; white-space: nowrap; }
.o_cur_sel { border: 1px solid var(--o-border); border-radius: var(--o-radius); background: #fff; font: inherit; font-size: 12.5px; padding: 1px 4px; color: var(--o-text); }
.o_track { margin-top: 10px; }
.o_attach_view { display: block; max-width: 100%; margin: 0 auto; }
.o_attach_view.pdf { width: 100%; height: 72vh; border: 1px solid var(--o-border); }
/* مؤشرا المرحلتين في قائمة أوامر العمل */
.o_stage_chips { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.o_stage_chips a { font-size: 11.5px; border: 1px solid var(--o-border); border-radius: 999px; padding: 0 7px; color: var(--o-text); background: #fff; white-space: nowrap; }
.o_stage_chips a:hover { border-color: var(--o-action); color: var(--o-action); }
@media (max-width: 760px) { .o_stage_grid { grid-template-columns: 1fr 1fr; } }

/* ---------- كانبان / بطاقات ---------- */
.o_split { display: flex; min-height: 100%; }
.o_search_panel { flex: none; width: 210px; background: var(--o-view); border-inline-end: 1px solid var(--o-border); padding: 14px 10px; }
.o_search_panel h5 { margin: 0 6px 8px; font-size: 12px; color: var(--o-muted); font-weight: 600; letter-spacing: .02em; display: flex; gap: 6px; align-items: center; }
.o_sp_item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: var(--o-radius); cursor: pointer; color: var(--o-text); font-size: 13.5px; border: 0; background: none; width: 100%; text-align: start; }
.o_sp_item:hover { background: var(--o-bg); }
.o_sp_item.active { background: var(--o-action-light); color: var(--o-action-dark); font-weight: 600; }
.o_sp_item .cnt { color: var(--o-faint); font-size: 12px; font-weight: 400; }
.o_split_main { flex: 1; min-width: 0; }
/* دليل المنتجات: قسما التصنيف والعائلة، التجميع، المصفوفة */
.o_search_panel { width: 252px; }
.o_search_panel h5:not(:first-child) { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--o-border-light); }
.o_search_panel h5 .o_icon { color: var(--o-brand); }
.o_sp_row { display: flex; align-items: center; }
.o_sp_row .o_sp_item { flex: 1; min-width: 0; }
.o_sp_item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o_sp_item.empty:not(.active) { color: var(--o-faint); }
.o_sp_edit { flex: none; width: 22px; height: 22px; border: 0; background: none; color: var(--o-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--o-radius); visibility: hidden; padding: 0; }
.o_sp_row:hover button.o_sp_edit { visibility: visible; }
button.o_sp_edit:hover { color: var(--o-action); background: var(--o-action-light); }
.o_sp_add { border: 0; background: none; color: var(--o-action); cursor: pointer; padding: 2px; display: flex; border-radius: var(--o-radius); }
.o_sp_add:hover { background: var(--o-action-light); }
.o_group_head { padding: 14px 16px 0; font-weight: 600; color: var(--o-heading); display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
.o_group_head small { color: var(--o-muted); font-weight: 400; font-size: 12.5px; }
.o_group_head + .o_kanban { padding-top: 8px; }
.o_kanban_tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
/* شجرة التصنيف: أولي ← فرعي */
.o_sp_tools { flex: none; width: 44px; display: inline-flex; justify-content: flex-end; }
.o_sp_div { margin-top: 6px; }
.o_sp_div .o_sp_item { font-weight: 600; color: var(--o-heading); }
.o_sp_div .o_sp_item.empty:not(.active) { color: var(--o-muted); }
.o_sp_sub .o_sp_item { padding-inline-start: 20px; }
.o_tag_outline { background: transparent; border: 1px dashed #c4c7cc; color: var(--o-muted); padding-block: 0; }
.o_matrix_div th, .o_matrix_div td { background: #e4f0f1 !important; font-weight: 700 !important; color: var(--o-heading); padding: 8px 14px; }
.o_matrix tbody tr:not(.o_matrix_div) th { padding-inline-start: 30px; font-weight: 400; }
/* أكواد البنود */
.o_code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--o-muted); direction: ltr; unicode-bidi: isolate; white-space: nowrap; letter-spacing: .01em; }
b.o_code, .o_code b { color: var(--o-heading); }
input.o_code { font-size: 13.5px; color: var(--o-heading); }
td.o_code { text-align: start; }
.o_card_code { margin-inline-start: auto; align-self: center; }
.o_notes { margin: 0 0 6px; padding-inline-start: 20px; color: var(--o-text); font-size: 13.5px; }
.o_notes li { padding: 2px 0; }
.o_kanban_tags .o_tag { margin: 0; }
.o_bulk { margin: 10px 14px 0; position: sticky; top: 6px; z-index: 3; }
.o_list_table .c_chk { width: 34px; text-align: center; }
.o_list_table tr.o_selected td { background: #eef7f8; }
.o_matrix_wrap { padding: 16px; overflow: auto; }
.o_matrix_note { color: var(--o-muted); font-size: 13px; margin: 0 0 10px; }
.o_matrix { border-collapse: collapse; background: #fff; }
.o_matrix th, .o_matrix td { border: 1px solid var(--o-border-light); padding: 0; text-align: center; }
.o_matrix thead th { background: #f3f4f6; padding: 9px 16px; font-weight: 600; color: var(--o-heading); white-space: nowrap; }
.o_matrix thead th.corner { color: var(--o-muted); font-weight: 500; font-size: 12.5px; }
.o_matrix tbody th { text-align: start; padding: 8px 16px; white-space: nowrap; font-weight: 500; color: var(--o-heading); background: #fff; }
.o_matrix .clk { cursor: pointer; }
.o_matrix .clk:hover { color: var(--o-action); text-decoration: underline; }
.o_matrix_cell { display: block; width: 100%; min-width: 96px; border: 0; background: none; padding: 9px 10px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; color: var(--o-heading); font-weight: 600; }
.o_matrix_cell:hover { outline: 2px solid var(--o-action); outline-offset: -2px; }
.o_matrix_cell.zero { color: transparent; font-weight: 400; }
.o_matrix_cell.zero:hover { color: var(--o-action); }
.o_matrix .tot { background: #f9fafb; font-weight: 600; padding: 9px 14px; color: var(--o-heading); }
.o_kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 14px; }
.o_kanban_card {
  background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 10px; display: flex; gap: 10px; cursor: pointer;
  min-height: 86px; position: relative;
}
.o_kanban_card:hover { box-shadow: var(--o-shadow); border-color: #c4c7cc; }
.o_kanban_img { width: 64px; height: 64px; flex: none; border-radius: var(--o-radius); background: #f3f4f6 center/contain no-repeat; display: flex; align-items: center; justify-content: center; color: #c4c7cc; }
.o_kanban_body { min-width: 0; flex: 1; }
.o_kanban_title { font-weight: 600; color: var(--o-heading); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.o_kanban_sub { color: var(--o-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_kanban_price { color: var(--o-heading); font-size: 13.5px; margin-top: 2px; }
.o_kanban_card .o_tag { margin: 0; }

/* كتالوج الاختيار داخل العرض */
.o_catalog { display: flex; gap: 0; height: min(68vh, 640px); margin: -16px; }
.o_catalog .o_search_panel { overflow: auto; width: 190px; }
.o_catalog_main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.o_catalog_search { padding: 10px 14px; border-bottom: 1px solid var(--o-border-light); }
.o_catalog_grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 12px 14px; align-content: start; background: var(--o-bg); }
.o_cat_card { background: #fff; border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 9px; display: flex; gap: 9px; position: relative; }
.o_cat_card.in { border-color: var(--o-action); box-shadow: 0 0 0 1px var(--o-action); }
.o_cat_card .o_kanban_img { width: 54px; height: 54px; }
.o_qty_stepper { display: inline-flex; align-items: center; border: 1px solid var(--o-border); border-radius: var(--o-radius); overflow: hidden; margin-top: 5px; }
.o_qty_stepper button { border: 0; background: var(--o-secondary); width: 26px; height: 24px; cursor: pointer; color: var(--o-text); font-size: 15px; line-height: 1; }
.o_qty_stepper button:hover { background: var(--o-secondary-hover); }
.o_qty_stepper span { min-width: 30px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.o_add_btn { margin-top: 5px; }

/* ---------- النوافذ ---------- */
.o_modal_backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px 14px; overflow: auto; }
.o_modal { background: var(--o-view); border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); width: 100%; display: flex; flex-direction: column; max-height: 90vh; }
.o_modal_sm { max-width: 440px; }
.o_modal_md { max-width: 720px; }
.o_modal_lg { max-width: 1080px; }
.o_modal_header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--o-border-light); }
.o_modal_header h4 { font-size: 17px; font-weight: 500; }
.o_modal_close { border: 0; background: none; cursor: pointer; color: var(--o-muted); padding: 4px; display: flex; border-radius: var(--o-radius); }
.o_modal_close:hover { background: var(--o-secondary); color: var(--o-heading); }
.o_modal_body { padding: 16px; overflow: auto; flex: 1; }
.o_modal_footer { padding: 10px 16px; border-top: 1px solid var(--o-border-light); display: flex; gap: 8px; justify-content: flex-start; }
.o_modal_footer:empty { display: none; }
.o_confirm_text { margin: 4px 0; font-size: 15px; }

.o_ac_dropdown { position: fixed; z-index: 3000; background: #fff; border: 1px solid var(--o-border); border-radius: var(--o-radius); box-shadow: var(--o-shadow); max-height: 320px; overflow: auto; padding: 3px 0; }
.o_ac_item { display: flex; align-items: center; gap: 9px; padding: 6px 12px; cursor: pointer; }
.o_ac_item.active, .o_ac_item:hover { background: var(--o-action-light); }
.o_ac_main { flex: 1; min-width: 0; }
.o_ac_label { color: var(--o-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_ac_sub { color: var(--o-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_ac_right { color: var(--o-muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.o_ac_extra { color: var(--o-action); border-top: 1px solid var(--o-border-light); font-style: italic; }
.o_ac_extra .o_ac_label { color: var(--o-action); }
.o_ac_thumb { width: 30px; height: 30px; border-radius: 3px; object-fit: contain; flex: none; background: #f3f4f6; }
.o_ac_thumb_empty { display: inline-flex; align-items: center; justify-content: center; color: #c4c7cc; }

#o_toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; }
.o_toast { background: #1f2937; color: #fff; padding: 9px 16px; border-radius: var(--o-radius); box-shadow: var(--o-shadow); font-size: 13.5px; animation: toastIn .2s ease-out; max-width: 380px; }
.o_toast_success { background: #1f8a4c; }
.o_toast_danger { background: #b83227; }
.o_toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------- صفحة البند ---------- */
.o_product_head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 12px; }
.o_product_image { width: 120px; height: 120px; border: 1px dashed var(--o-border); border-radius: var(--o-radius); flex: none; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--o-faint); cursor: pointer; background: #fff center/contain no-repeat; font-size: 12px; position: relative; padding: 0; }
.o_product_image:hover { border-color: var(--o-action); color: var(--o-action); }
.o_product_image.has { border-style: solid; }
.o_product_image .rm { position: absolute; top: 3px; inset-inline-end: 3px; background: rgba(255, 255, 255, .9); }
.o_big_name { font-size: 24px; font-weight: 500; }
.o_radio_tabs { display: inline-flex; border: 1px solid var(--o-border); border-radius: var(--o-radius); overflow: hidden; }
.o_radio_tabs button { white-space: nowrap; border: 0; background: #fff; padding: 5px 14px; cursor: pointer; color: var(--o-text); display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.o_radio_tabs button + button { border-inline-start: 1px solid var(--o-border); }
.o_radio_tabs button.active { background: var(--o-brand); color: #fff; }
.o_subtable { width: 100%; border-collapse: collapse; }
.o_subtable th { text-align: start; font-weight: 600; color: var(--o-heading); padding: 6px; border-bottom: 1px solid var(--o-border); font-size: 13px; }
.o_subtable td { padding: 4px 6px; border-bottom: 1px solid var(--o-border-light); vertical-align: middle; }
.o_subtable tfoot td { border-bottom: 0; font-weight: 600; color: var(--o-heading); padding-top: 9px; }

/* ---------- لوحة المعلومات ---------- */
.o_dash { padding: 16px; max-width: 1320px; margin: 0 auto; }
.o_kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.o_kpi { background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 14px 16px; }
.o_kpi .lbl { color: var(--o-muted); font-size: 13px; }
.o_kpi .val { font-size: 26px; font-weight: 600; color: var(--o-heading); line-height: 1.3; font-variant-numeric: tabular-nums; }
.o_kpi .val small { font-size: 13px; font-weight: 400; color: var(--o-muted); }
.o_kpi .foot { color: var(--o-muted); font-size: 12.5px; }
.o_dash_grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 12px; }
.o_card { background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 14px 16px; min-width: 0; }
.o_card h4 { font-size: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.o_card h4 small { font-weight: 400; color: var(--o-muted); font-size: 12px; }
.o_bar_row { display: grid; grid-template-columns: 130px 1fr 96px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.o_bar_row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_bar_track { height: 14px; background: #f0f1f3; border-radius: 3px; overflow: hidden; display: flex; }
.o_bar_fill { height: 100%; background: var(--o-brand); }
.o_bar_fill.alt { background: #a3d1d4; }
.o_bar_row .val { text-align: end; font-variant-numeric: tabular-nums; color: var(--o-heading); }
.o_months { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 8px; }
.o_month { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.o_month .bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; }
.o_month .bar { width: 42%; max-width: 20px; background: #a3d1d4; border-radius: 2px 2px 0 0; min-height: 1px; }
.o_month .bar.won { background: var(--o-brand); }
.o_month .lbl { font-size: 11px; color: var(--o-muted); white-space: nowrap; }
.o_follow { table-layout: fixed; }
.o_follow td { padding: 6px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o_legend { display: flex; gap: 14px; font-size: 12px; color: var(--o-muted); font-weight: 400; }
.o_legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 4px; background: #a3d1d4; }
.o_legend i.won { background: var(--o-brand); }

/* لوحة المعلومات: مفتاح الأقسام، مسار العمل، بطاقات متابعة الأقسام */
.o_dash_head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 10px; flex-wrap: wrap; }
.o_dash_head h3 { font-size: 16px; }
.o_dash_head small { color: var(--o-muted); font-size: 12.5px; }
.o_dash_grid + .o_dash_head { margin-top: 22px; }
.o_div_switch button { padding: 6px 18px; font-size: 14px; font-weight: 500; }
.o_flow { display: flex; align-items: stretch; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.o_flow_tile { flex: 1 1 172px; min-width: 0; background: var(--o-view); border: 1px solid var(--o-border); border-top: 3px solid; border-radius: var(--o-radius); padding: 10px 14px; color: var(--o-text); display: flex; flex-direction: column; gap: 1px; }
.o_flow_tile:hover { box-shadow: var(--o-shadow); color: var(--o-text); }
.o_flow_tile .lbl { display: flex; gap: 6px; align-items: center; color: var(--o-heading); font-weight: 600; font-size: 13.5px; }
.o_flow_tile .val { font-size: 26px; font-weight: 600; color: var(--o-heading); line-height: 1.25; }
.o_flow_tile .val small { font-size: 12.5px; font-weight: 400; color: var(--o-muted); }
.o_flow_tile .foot { color: var(--o-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_flow_tile .warn, .o_flow_tile .ok { margin-top: auto; padding-top: 6px; font-size: 12.5px; display: flex; gap: 5px; align-items: center; }
.o_flow_tile .warn { color: var(--o-danger); font-weight: 600; }
.o_flow_tile .ok { color: var(--o-success); }
.o_flow_arrow { align-self: center; color: var(--o-faint); flex: none; display: flex; }
.o_dash_sec { border-top: 3px solid; }
.o_dash_sec h4 a { color: var(--o-heading); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.o_dash_sec h4 a:hover { color: var(--o-action); }
.o_dash_sec h4 small { text-align: end; }
.o_dash_stats { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 8px 0 10px; }
.o_dash_stats > div { background: #f3f4f6; border-radius: var(--o-radius); padding: 3px 10px; display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; color: var(--o-muted); }
.o_dash_stats b { font-size: 15px; color: var(--o-heading); font-weight: 600; }
.o_dash_stats .bad b { color: var(--o-danger); }
.o_dash_stats .warn b { color: var(--o-warning); }
.o_dash_stats .good b { color: var(--o-success); }
.o_todo { display: flex; align-items: center; gap: 9px; padding: 6px 4px; border-top: 1px solid var(--o-border-light); cursor: pointer; font-size: 13px; }
.o_todo:hover { background: #f6f7f9; }
.o_todo > i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #c4c7cc; }
.o_todo.danger > i { background: var(--o-danger); }
.o_todo.warning > i { background: #e0a100; }
.o_todo .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.o_todo .tx b { display: flex; gap: 8px; min-width: 0; font-weight: 500; color: var(--o-heading); }
.o_todo .tx .code { flex: none; font-weight: 600; }
.o_todo .tx .nm, .o_todo .tx .sb { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.o_todo .tx .sb { color: var(--o-muted); font-size: 12px; }
.o_todo .end { flex: none; color: var(--o-muted); font-size: 12.5px; white-space: nowrap; }
.o_todo.danger .end { color: var(--o-danger); }
.o_todo_empty { color: var(--o-muted); font-size: 13px; padding: 10px 4px 2px; border-top: 1px solid var(--o-border-light); }
.o_todo_more { display: block; padding: 7px 4px 0; font-size: 12.5px; border-top: 1px solid var(--o-border-light); }
.o_card.wide { grid-column: 1 / -1; }
.o_div_pick { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--o-muted); padding-bottom: 3px; }
/* الحسابات والصلاحيات */
.o_static { display: inline-block; padding-top: 5px; color: var(--o-heading); }
.o_users td { vertical-align: top; padding-block: 7px; }
.o_users tr.off td { opacity: .55; }
.o_users .c_scope { color: var(--o-muted); font-size: 12.5px; max-width: 360px; }
.o_users .c_btns { white-space: nowrap; text-align: end; }
.o_users .o_tag { margin-inline-start: 6px; }
.o_perm_title { font-size: 14px; margin: 14px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--o-border-light); }
.o_perm_groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 22px; }
.o_perm_group h5 { margin: 0 0 4px; font-size: 13px; color: var(--o-brand); font-weight: 600; }
.o_perm { display: flex; gap: 7px; align-items: flex-start; padding: 2px 0; cursor: pointer; font-size: 13px; line-height: 1.45; }
.o_perm input { margin-top: 3px; flex: none; }
.o_perm input:disabled + span { color: var(--o-muted); }
.o_perm_fac { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 4px; }
.o_perm_fac .o_perm { padding: 0; }
select:disabled.o_filter_select { opacity: .75; cursor: default; }
/* عمود «القسم» في قائمة العروض: يُعدَّل مباشرة، والمستنتج تلقائياً بإطار متقطع حتى يُثبَّت */
.o_list_table .c_div { white-space: nowrap; cursor: default; padding-block: 4px; }
.o_div_inline { border: 1px solid transparent; border-radius: var(--o-radius); background: transparent; font: inherit; font-size: 12.5px; color: var(--o-text); padding: 2px 3px; cursor: pointer; max-width: 108px; }
.o_div_inline:hover, .o_div_inline:focus { border-color: var(--o-border); background: #fff; outline: 0; }
.o_div_inline.auto { color: var(--o-muted); border: 1px dashed #b9bdc4; font-style: italic; }
.c_div .o_icon_btn { vertical-align: middle; color: var(--o-success); }
.o_bulk .o_icon { flex: none; }

/* ---------- الإعدادات ---------- */
.o_settings { max-width: 980px; margin: 0 auto; padding: 16px; }
.o_settings_block { background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); margin-bottom: 14px; }
.o_settings_block > h3 { font-size: 15px; padding: 11px 18px; background: #f3f4f6; border-bottom: 1px solid var(--o-border-light); border-radius: var(--o-radius) var(--o-radius) 0 0; }
.o_settings_body { padding: 14px 18px; }
.o_settings_body p { margin: 0 0 10px; color: var(--o-muted); font-size: 13px; }
.o_btn_row { display: flex; gap: 8px; flex-wrap: wrap; }
.o_tag_list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.o_tag_edit { display: inline-flex; align-items: center; gap: 2px; background: var(--o-secondary); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
[dir=rtl] .o_tag_edit { padding: 2px 10px 2px 4px; }
.o_tag_edit { max-width: 100%; }
/* الخانة بعرض نصها (نسخة مخفية منه تحدد العرض)، بحد أدنى 130px وبلا تجاوز لعرض الحاوية */
.o_tag_fit { position: relative; display: inline-block; flex: 0 1 auto; min-width: 130px; overflow: hidden; line-height: 1.5; }
.o_tag_fit > span { display: block; visibility: hidden; white-space: pre; min-height: 1.5em; padding-inline-end: 4px; }
.o_tag_edit input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; font: inherit; outline: 0; color: var(--o-heading); }
.o_tag_edit button { border: 0; background: none; cursor: pointer; color: var(--o-muted); display: flex; padding: 2px; border-radius: 50%; }
.o_tag_edit button:hover { color: var(--o-danger); }

.o_narrow_only { display: none; }
@media (max-width: 760px) {
  .o_narrow_only { display: flex; }
  .o_group { grid-template-columns: 1fr; }
  .o_field { grid-template-columns: 112px 1fr; }
  .o_form_sheet { padding: 16px 14px; }
  .o_stat_buttons { margin: -16px -14px 14px; }
  .o_search_panel { display: none; }
  .o_statusbar_status { margin-inline-start: 0; }
  .o_dash_grid { grid-template-columns: 1fr; }
  .o_navbar_brand span { display: none; }
}

/* ---------- CRM: تبويبات، لوحة المراحل، الأنشطة ---------- */
.o_break { flex-basis: 100%; height: 0; }
.o_crm_nav { display: flex; gap: 2px; flex-wrap: wrap; margin: -2px 0; }
.o_crm_nav a { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--o-radius); color: var(--o-text); text-decoration: none; font-weight: 500; font-size: 14px; cursor: pointer; }
.o_crm_nav a:hover { background: var(--o-bg); color: var(--o-heading); }
.o_crm_nav a.active { background: var(--o-brand-light); color: var(--o-brand); }
.o_crm_nav .cnt { font-size: 11.5px; font-weight: 600; background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.o_crm_nav .cnt.due { background: var(--o-danger); color: #fff; }
.o_crm_div button { padding: 4px 12px; }
.o_chip.warn .cnt { color: var(--o-danger); font-weight: 600; }

.o_crm_board { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(190px, 1fr)); gap: 10px; padding: 12px 14px 22px; align-items: start; overflow-x: auto; min-height: 100%; }
.o_crm_col { background: #eef0f3; border-radius: 6px; padding: 8px; min-height: 260px; transition: background .12s ease, box-shadow .12s ease; }
.o_crm_board.dragging .o_crm_col { box-shadow: inset 0 0 0 1px #d2d7de; }
.o_crm_board.dragging .o_crm_col.drop, .o_crm_col.drop { background: var(--o-action-light); box-shadow: inset 0 0 0 2px var(--o-action); }
.o_crm_col_head { display: flex; align-items: center; gap: 8px; padding: 2px 6px 0; color: var(--o-heading); }
.o_crm_col_head .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.o_crm_col_head .nm b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.o_crm_col_head .nm small { color: var(--o-muted); font-size: 12px; font-weight: 400; }
.o_crm_col_head .cnt { color: var(--o-muted); font-size: 13px; background: #fff; border-radius: 999px; padding: 0 8px; }
/* مجموع العمود: الرقم في سطر، ومصدره (عروض / متوقعة) في سطر — السطران حاضران دائماً لتبقى الأعمدة متحاذية */
.o_crm_col_sum { padding: 5px 6px 7px; font-size: 12px; line-height: 1.45; color: var(--o-muted); border-bottom: 2px solid #dce0e6; margin-bottom: 8px; }
.o_crm_col_sum .tot, .o_crm_col_sum .of { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_crm_col_sum .tot { font-size: 13px; color: var(--o-heading); }
.o_crm_col_sum .tot b { font-size: 15.5px; font-weight: 700; color: var(--o-brand); }
.o_crm_col.success .o_crm_col_sum .tot b { color: var(--o-success); }
.o_crm_col.danger .o_crm_col_sum .tot b { color: var(--o-danger); }
/* قيمة الفرصة على البطاقة: من عروض الأسعار (ملوّنة)، أو مكتوبة يدوياً (رمادية)، أو عرض لم يُسعَّر */
.o_lead_card .ln.val { margin-top: 5px; }
.o_lead_card .ln.val b { font-weight: 600; color: var(--o-brand); white-space: nowrap; }
.o_lead_card .ln.val .o_icon { color: var(--o-brand); }
.o_lead_card .ln.val .sub { font-size: 12px; color: var(--o-muted); }
.o_lead_card .ln.val.est b { color: var(--o-text); }
.o_lead_card .ln.val.est .o_icon, .o_lead_card .ln.val.none .o_icon { color: var(--o-faint); }
.o_list_table tr.o_row_off td { color: var(--o-faint); }
.o_crm_col.success .o_crm_col_head .nm b { color: var(--o-success); }
.o_crm_col.success .o_crm_col_sum { border-color: var(--o-success); }
.o_crm_col.danger .o_crm_col_head .nm b { color: var(--o-danger); }
.o_crm_col.danger .o_crm_col_sum { border-color: var(--o-danger); }
.o_crm_card { cursor: grab; transition: box-shadow .12s ease, transform .12s ease, opacity .12s ease; }
.o_crm_card:active { cursor: grabbing; }
.o_crm_card.dragging { opacity: .35; transform: scale(.98); }
.o_crm_none { color: var(--o-faint); font-size: 12.5px; text-align: center; padding: 18px 6px; border: 1px dashed #cfd4da; border-radius: var(--o-radius); }
.o_crm_more { width: 100%; border: 0; background: none; color: var(--o-action); cursor: pointer; padding: 6px; font: inherit; font-size: 13px; }
.o_crm_more:hover { text-decoration: underline; }
.o_act_dot { display: inline-flex; align-items: center; gap: 4px; border: 0; background: #eceef1; color: var(--o-muted); border-radius: 999px; padding: 1px 8px; font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.o_act_dot.planned { background: var(--o-success-bg); color: var(--o-success); }
.o_act_dot.today { background: var(--o-warning-bg); color: var(--o-warning); }
.o_act_dot.late { background: var(--o-danger-bg); color: var(--o-danger); font-weight: 600; }
.o_act_dot:hover { filter: brightness(.95); }
.o_arrow_button.clk { cursor: pointer; }
.o_arrow_button.clk:not(.current):hover { color: var(--o-action-dark); font-weight: 600; }

.o_agenda { padding: 14px 16px 30px; max-width: 1120px; margin: 0 auto; }
.o_ag_kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.o_ag_kpis .o_kpi { padding: 10px 14px; }
.o_ag_kpis .o_kpi .val { font-size: 22px; }
.o_ag_kpis .o_kpi.bad .val { color: var(--o-danger); }
.o_ag_kpis .o_kpi.warn .val { color: var(--o-warning); }
.o_ag_day { background: var(--o-view); border: 1px solid var(--o-border); border-radius: var(--o-radius); margin-bottom: 10px; overflow: hidden; }
.o_ag_day > header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--o-border-light); color: var(--o-heading); }
.o_ag_day > header.clk { cursor: pointer; }
.o_ag_day > header .cnt { background: rgba(0, 0, 0, .07); border-radius: 999px; padding: 0 8px; font-size: 12.5px; }
.o_ag_day > header .o_tag { margin: 0; }
.o_ag_day.today { border-color: var(--o-brand); }
.o_ag_day.today > header { background: var(--o-brand-light); color: var(--o-brand-darker); }
.o_ag_day.late > header { background: var(--o-danger-bg); color: var(--o-danger); }
.o_ag_day.done > header { border-bottom: 0; }
.o_ag_day .o_todo_empty { border-top: 0; padding: 10px 14px; }
.o_ag_row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--o-border-light); font-size: 13.5px; }
.o_ag_list > .o_ag_row:first-child { border-top: 0; }
.o_ag_row:hover { background: #f8f9fa; }
.o_ag_ic { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--o-info-bg); color: var(--o-info); display: flex; align-items: center; justify-content: center; }
.o_ag_row.late .o_ag_ic { background: var(--o-danger-bg); color: var(--o-danger); }
.o_ag_row.sug .o_ag_ic { background: #eceef1; color: var(--o-muted); }
.o_ag_row.done .o_ag_ic { background: var(--o-success-bg); color: var(--o-success); }
.o_ag_row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.o_ag_row .tx b { font-weight: 600; color: var(--o-heading); }
.o_ag_row .tx b .o_tag { margin-inline-start: 6px; font-weight: 400; }
.o_ag_row .tx .nt { font-weight: 400; color: var(--o-text); }
.o_ag_row .tx .sb { color: var(--o-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; unicode-bidi: plaintext; text-align: right; }
.o_ag_row .tx a.sb:hover { color: var(--o-action); }
.o_ag_row .ph { flex: none; display: inline-flex; gap: 4px; align-items: center; color: var(--o-action); text-decoration: none; font-size: 13px; }
.o_ag_row .due { flex: none; color: var(--o-muted); font-size: 12.5px; white-space: nowrap; }
.o_ag_row.late .due { color: var(--o-danger); font-weight: 600; }
.o_ag_row .btns { flex: none; display: flex; gap: 6px; align-items: center; }
.o_ag_row .o_avatar { width: 24px; height: 24px; font-size: 10px; background: var(--o-brand-light); }
.o_ag_post { max-width: 92px; padding: 2px 4px; font-size: 12.5px; }
.o_ag_h { font-size: 13.5px; margin: 16px 0 6px; color: var(--o-heading); }
.o_ag_h:first-child { margin-top: 0; }
.o_tab_pane .o_ag_list { border: 1px solid var(--o-border); border-radius: var(--o-radius); }
.o_date_chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.o_date_chips .o_input { width: auto; flex: 1 1 130px; }
.o_date_chips .o_chip { padding: 1px 8px; font-size: 12.5px; }
.o_team td, .o_team th { white-space: nowrap; }
.o_team .o_hint { margin-inline-start: 34px; }
.o_list_table .c_btns { white-space: nowrap; cursor: default; }
.o_list_table .c_btns .btn + .btn { margin-inline-start: 6px; }
@media (max-width: 760px) {
  .o_ag_row { flex-wrap: wrap; }
  .o_ag_row .tx { flex-basis: 70%; }
}

/* ---------- القاعدة المشتركة: شاشة الدخول وشريط انقطاع الاتصال ---------- */
#o_login { position: fixed; inset: 0; z-index: 5000; background: #eef0f3; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.o_login_card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--o-border); border-radius: 8px; box-shadow: var(--o-shadow); overflow: hidden; margin: auto; }
.o_login_head { background: var(--o-brand); color: #fff; padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; }
.o_login_head b { font-size: 18px; }
.o_login_head span { font-size: 13px; opacity: .92; }
.o_login_body { padding: 20px 22px 22px; }
.o_login_body h3 { margin-bottom: 6px; font-size: 17px; }
.o_login_body form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.o_login_body .o_form_label { margin-top: 8px; }
.o_login_body form > .btn-primary { margin-top: 12px; padding: 8px; justify-content: center; }
.o_login_msg { color: var(--o-danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
#o_offline { flex: none; background: var(--o-danger-bg); color: #8c2a20; padding: 7px 16px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; border-bottom: 1px solid #f0b4ad; }
.o_users .c_pw { white-space: nowrap; }

/* ===== الطلبات الداخلية بين المصانع، تقارير الإنتاج، التخطيط ===== */
.o_segs button:disabled { cursor: default; }
.o_segs button:disabled:not(.active) { color: var(--o-faint); background: #fafbfc; }
.o_io_lines td { padding: 3px 4px; }
.o_io_lines .c_sr { color: var(--o-muted); width: 26px; text-align: center; }
.o_io_total td { background: #fafbfc; font-weight: 600; color: var(--o-heading); }
.o_prod .c_price .o_input { width: 84px; text-align: end; }
.o_io_log { margin-top: 4px; }
.o_io_linked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; font-size: 13px; }
.o_io_linked label { font-weight: 500; color: var(--o-heading); }
.o_io_linked a { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--o-border); border-radius: 999px; padding: 2px 10px; color: var(--o-text); text-decoration: none; background: #fff; }
.o_io_linked a:hover { border-color: var(--o-brand); }
.o_io_linked .o_tag { margin: 0; }
tr.clk { cursor: pointer; }
tr.clk:hover td { background: var(--o-bg); }

.o_rep { max-width: 1280px; }
.o_rep_card { margin-bottom: 14px; }
.o_rep_card h5 { font-size: 13.5px; margin-bottom: 6px; color: var(--o-heading); }
.o_rep_scroll { overflow-x: auto; }
.o_rep_table th, .o_rep_table td { white-space: nowrap; font-size: 13px; }
.o_rep_table .o_prog { min-width: 96px; }
.o_rep_table .o_rep_sum td { font-weight: 600; color: var(--o-heading); border-top: 1px solid var(--o-border); border-bottom: 0; }
.o_rep_cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }

.o_plan_table td { vertical-align: middle; }
.o_plan_chips { display: flex; gap: 4px; flex-wrap: wrap; }
.o_plan_chips > span { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.o_plan_chips > span:not(.o_tag) { border: 1px solid var(--o-border-light); border-radius: 999px; padding: 0 8px; background: #fff; }
.o_plan_chips .o_src_dot { margin: 0; }
.o_plan_chips b { font-weight: 600; color: var(--o-heading); }
.o_plan_chips .o_tag { margin: 0; }
.o_plan_why { font-size: 12px; color: var(--o-muted); max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_plan_sec > header .meta { font-size: 12.5px; }
.o_plan_sec .o_subtable { margin: 0; }
.o_plan_sec .o_subtable th, .o_plan_sec .o_subtable td { padding: 6px 12px; }
.o_plan_sec .o_subtable tr:last-child td { border-bottom: 0; }
.o_plan_sec .o_todo_empty { border-top: 0; padding: 12px; }
.o_plan_sec .o_ag_row:first-child { border-top: 0; }
.o_plan_sec .c_btns { text-align: end; white-space: nowrap; font-size: 13px; }
.o_plan_date { width: 150px; }

.o_plan_load { max-width: 1120px; }
.o_plan_cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 12px; }
.o_plan_big { font-size: 15px; color: var(--o-muted); line-height: 1.2; }
.o_plan_big b { font-size: 30px; font-weight: 600; color: var(--o-heading); }
.o_plan_line { font-size: 13px; margin-top: 3px; }
.o_plan_cap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.o_plan_cap label { font-weight: 500; color: var(--o-heading); }
.o_plan_cap small { color: var(--o-muted); }
.o_plan_note { margin-bottom: 12px; font-size: 13px; color: var(--o-text); }
.o_plan_note .o_icon { vertical-align: -2px; color: var(--o-muted); }
.o_plan_find, .o_plan_vals { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
.o_plan_find label, .o_plan_vals label { font-weight: 500; color: var(--o-heading); min-width: 200px; }
.o_plan_find .o_input { flex: 1; min-width: 220px; max-width: 460px; }
.o_plan_vals > span { display: inline-flex; align-items: center; gap: 5px; }
.o_plan_vals small { color: var(--o-muted); }
.o_plan_found { display: flex; flex-direction: column; margin: -2px 0 8px; border: 1px solid var(--o-border); border-radius: var(--o-radius); max-width: 620px; overflow: hidden; }
.o_plan_found a { padding: 6px 10px; cursor: pointer; color: var(--o-text); border-top: 1px solid var(--o-border-light); font-size: 13.5px; }
.o_plan_found a:first-child { border-top: 0; }
.o_plan_found a:hover { background: var(--o-brand-light); }
.o_plan_result { border-top: 1px solid var(--o-border-light); margin-top: 10px; padding-top: 10px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.o_plan_result .o_alert { margin: 6px 0 0; }
.o_plan_total { font-size: 15.5px; color: var(--o-heading); margin-top: 6px; }
.o_plan_total b { font-size: 20px; color: var(--o-brand); }

.o_trip { flex-wrap: wrap; }
.o_trip.off { opacity: .55; }
.o_trip .o_tag { margin: 0; }
.o_trip_when { min-width: 62px; color: var(--o-heading); font-weight: 500; white-space: nowrap; }
.o_trip_main { display: flex; flex-direction: column; min-width: 180px; }
.o_trip_main b { font-weight: 600; color: var(--o-heading); }
.o_trip_main span { color: var(--o-muted); font-size: 12.5px; }
.o_trip_car { font-size: 13px; white-space: nowrap; }
.o_trip_btns { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.o_trip_items { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; max-height: 190px; overflow: auto; border: 1px solid var(--o-border-light); border-radius: var(--o-radius); padding: 6px 10px; }
.o_vehicles td { padding: 3px 4px; }
.o_vehicles tr.off input[type=text] { color: var(--o-faint); }
@media (max-width: 900px) {
  .o_rep_cols { grid-template-columns: 1fr; }
  .o_plan_find label, .o_plan_vals label { min-width: 0; flex-basis: 100%; }
}
.o_stage_sec .o_lines .c_name { min-width: 150px; }
.o_list_table td.o_strong .o_tag { margin-inline-start: 6px; }

/* ===== R&D ===== */
.o_rnd_card .o_rnd_thumb { height: 92px; margin: -9px -11px 8px; border-radius: var(--o-radius) var(--o-radius) 0 0; background: #f3f4f6 center / cover no-repeat; border-bottom: 1px solid var(--o-border-light); }
.o_rnd_card .foot .o_icon { vertical-align: -2px; }
.o_rnd_facs { display: flex; gap: 4px 16px; flex-wrap: wrap; padding-top: 4px; }
.o_rnd_task { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--o-border-light); }
.o_rnd_task > .o_input[type=text] { flex: 1; min-width: 120px; }
.o_rnd_task.done > .o_input[type=text] { color: var(--o-muted); text-decoration: line-through; }
.o_rnd_task input[type=checkbox] { width: 16px; height: 16px; flex: none; }
.o_rnd_add { display: flex; align-items: center; gap: 8px; padding: 8px 0 2px; color: var(--o-muted); }
.o_rnd_add .o_input { flex: 1; }
.o_rnd_post { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.o_rnd_post .o_input { flex: 1; }
.o_rnd_log .o_tag { margin: 0 2px; }
.o_rnd_log .msg { white-space: pre-wrap; }
.o_rnd_log.note .o_log { background: var(--o-brand-light); border-radius: var(--o-radius); padding-inline: 8px; }
.o_rnd_log.edit .msg { color: var(--o-muted); }
.o_rnd_gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.o_rnd_gallery figure { margin: 0; border: 1px solid var(--o-border); border-radius: var(--o-radius); overflow: hidden; background: #fff; }
.o_rnd_gallery .pic { height: 150px; background: #f3f4f6 center / contain no-repeat; cursor: zoom-in; }
.o_rnd_gallery figcaption { display: flex; align-items: center; gap: 4px; padding: 4px 6px 0; }
.o_rnd_gallery figcaption .o_input { flex: 1; min-width: 0; }
.o_rnd_gallery small { display: block; padding: 0 8px 6px; font-size: 11.5px; }
.o_rnd_addpic { min-height: 150px; border: 1px dashed #c4c7cc; border-radius: var(--o-radius); background: transparent; color: var(--o-muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: inherit; }
.o_rnd_addpic:hover { color: var(--o-action); border-color: var(--o-action); background: #fff; }
.o_rnd_full { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; }
/* شريط المراحل لا يتجاوز عرض الشاشة الضيقة: يُمرَّر أفقياً داخل نفسه */
@media (max-width: 760px) { .o_statusbar_status { max-width: 100%; overflow-x: auto; padding-bottom: 2px; } }
.o_rnd_log.note .o_tag { background: #fff; }

/* ===== التركيبات وخدمات ما بعد البيع ===== */
.o_inst_add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.o_inst_add .o_input { width: auto; }
.o_inst_add .o_input.grow { flex: 1; min-width: 220px; }
.o_inst_add .o_select { max-width: 220px; }
.o_inst_links { margin-bottom: 14px; }
.o_inst_links h5 { font-size: 13.5px; margin-bottom: 4px; color: var(--o-heading); }
.o_inst_links .o_todo_empty { border-top: 0; padding-top: 2px; }
.o_done_row td { color: var(--o-muted); }
.o_rep_table td.c_btns { text-align: end; white-space: nowrap; }
.o_sched { max-width: none; }
.o_sched_bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.o_sched_key { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--o-muted); }
.o_sched_key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-inline-start: 8px; }
.o_sched_key i.inst, .o_sched_chip.inst { background: var(--o-brand-light); border-color: var(--o-brand); }
.o_sched_key i.srv, .o_sched_chip.srv { background: #fdf0dc; border-color: #b45309; }
.o_sched_table { border-collapse: collapse; width: 100%; min-width: 1180px; background: var(--o-view); table-layout: fixed; }
.o_sched_table th, .o_sched_table td { border: 1px solid var(--o-border); padding: 4px; vertical-align: top; }
.o_sched_table thead th { font-size: 12.5px; font-weight: 600; color: var(--o-heading); text-align: center; background: #fafbfc; }
.o_sched_table thead th:first-child, .o_sched_table tbody th { width: 150px; text-align: start; }
.o_sched_table thead th small, .o_sched_table tbody th small { display: block; font-weight: 400; color: var(--o-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_sched_table tbody th { font-size: 13.5px; font-weight: 600; color: var(--o-heading); background: #fafbfc; }
.o_sched_table td { height: 54px; }
.o_sched_table .off { background: #f3f4f6; }
.o_sched_table .today { box-shadow: inset 0 2px 0 var(--o-brand); }
.o_sched_table td.clash { box-shadow: inset 0 0 0 2px var(--o-danger); }
.o_sched_chip { display: block; border: 1px solid; border-inline-start-width: 3px; border-radius: 4px; padding: 2px 5px; margin-bottom: 3px; font-size: 11.5px; line-height: 1.35; color: var(--o-heading); text-decoration: none; overflow: hidden; }
.o_sched_chip b { display: block; font-weight: 600; overflow-wrap: anywhere; font-size: 11px; }
.o_sched_chip span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--o-text); }
.o_sched_chip.hold { border-color: var(--o-danger); background: var(--o-danger-bg); }
.o_sched_chip.wide { display: inline-block; max-width: 280px; margin-inline-end: 6px; vertical-align: top; }
.o_sched_chip:hover { box-shadow: var(--o-shadow); }
.o_srv_desc span { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--o-muted); }
.o_rep_grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.o_srv_sla { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 900px) { .o_rep_grid { grid-template-columns: 1fr; } }

/* ---------- لوحة المعلومات: ما بين الأقسام، والمكتب الفني ---------- */
.o_flow_tile .warn { cursor: pointer; }
.o_flow_tile .warn:hover span { text-decoration: underline; }
.o_flow_tile .note { color: var(--o-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.o_flow_sep { align-self: stretch; flex: none; width: 0; border-inline-start: 2px dotted var(--o-border); margin: 6px 5px; }
.o_flow_fill { flex: 1 1 194px; height: 0; min-width: 0; }
.o_dash_head + .o_dash_grid, .o_dash_head + .o_kpis { margin-bottom: 14px; }
.o_dash_grid + .o_dash_grid { margin-top: -2px; margin-bottom: 14px; }
.o_flow + .o_dash_head, .o_kpis + .o_dash_head, .o_dash_grid + .o_dash_head { margin-top: 20px; }
.o_dash_over h4 .ttl { display: inline-flex; gap: 6px; align-items: center; color: var(--o-heading); white-space: nowrap; }
.o_dash_over h4 small { text-align: end; }
.o_todo .o_queue_n { font-size: 15px; font-weight: 600; color: var(--o-heading); min-width: 28px; text-align: center; background: #f3f4f6; border-radius: 999px; padding: 0 8px; }
.o_todo.danger .o_queue_n { color: var(--o-danger); background: var(--o-danger-bg); }
.o_queue .o_todo:first-child { border-top: 0; }
.o_ov_day_ttl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--o-muted); padding: 8px 4px 3px; border-top: 1px solid var(--o-border-light); }
.o_ov_day_ttl.now { color: var(--o-brand); }
.o_ov_day_ttl .cnt { background: #f3f4f6; border-radius: 999px; padding: 0 7px; font-weight: 500; color: var(--o-muted); }
.o_ov_day_ttl + .o_todo { border-top: 0; }
.o_ov_day .o_todo .tx .code { font-weight: 500; color: var(--o-muted); }
.o_kpi_link { color: var(--o-text); text-decoration: none; display: block; }
.o_kpi_link:hover { box-shadow: var(--o-shadow); color: var(--o-text); }
.o_ov_kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.o_ov_kpis .foot { line-height: 1.5; }
.o_ov_bar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #f3f4f6; margin: 4px 0 10px; }
.o_ov_bar i { display: block; min-width: 3px; }
.o_ov_legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 22px; }
.o_ov_leg { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; border-top: 1px solid var(--o-border-light); }
.o_ov_leg.clk { cursor: pointer; }
.o_ov_leg.clk:hover { background: #f6f7f9; }
.o_ov_leg.off { color: var(--o-faint); }
.o_ov_leg i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.o_ov_leg.off i { opacity: .35; }
.o_ov_leg .nm { flex: 1; min-width: 0; }
.o_ov_leg b { font-weight: 600; color: var(--o-heading); }
.o_ov_leg.off b { color: inherit; font-weight: 400; }
.o_ov_leg .pc { color: var(--o-muted); min-width: 40px; text-align: end; font-size: 12.5px; }
.o_ov_depts { width: 100%; border-collapse: collapse; font-size: 13px; }
.o_ov_depts th { text-align: start; font-weight: 500; color: var(--o-muted); font-size: 12.5px; padding: 5px 4px; }
.o_ov_depts td { padding: 6px 4px; border-top: 1px solid var(--o-border-light); }
.o_ov_depts td i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 7px; }
.o_ov_depts tr.idle td:nth-child(2) { color: var(--o-warning); font-weight: 600; }
.o_ov_depts tr.never td:not(:first-child) { color: var(--o-faint); }
.o_dash_stale { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding: 6px 9px; background: #f8f9fa; border-radius: var(--o-radius); font-size: 12.5px; color: var(--o-muted); }
.o_dash_stale a { cursor: pointer; font-weight: 600; }
.o_dash_stale.clk { cursor: pointer; }
.o_dash_stale.clk:hover { background: #f1f3f5; }
.o_clean .o_group { margin: 10px 0 6px; }
.o_clean_checks { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.o_clean_checks label, .o_clean_row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.o_clean_sum { margin: 8px 0; padding: 9px 12px; background: var(--o-brand-light); border-radius: var(--o-radius); font-size: 14px; color: var(--o-heading); }
.o_clean_sum b { font-size: 16px; }
.o_clean_list { border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 4px 10px 6px; max-height: 300px; overflow: auto; }
.o_clean_list .ttl { font-size: 12.5px; color: var(--o-muted); padding: 5px 0; }
.o_clean_row { padding: 5px 0; border-top: 1px solid var(--o-border-light); }
.o_clean_row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o_clean_row .val { min-width: 70px; text-align: end; font-weight: 600; color: var(--o-heading); }
.o_clean_list .more { font-size: 12.5px; padding-top: 5px; border-top: 1px solid var(--o-border-light); }
.o_clean_undo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--o-muted); }
.o_clean_undo a { cursor: pointer; font-weight: 600; }
@media (max-width: 760px) { .o_flow_sep { display: none; } .o_clean_row { flex-wrap: wrap; } }

/* ---------- الجودة: الفحص النهائي قبل الشحن ---------- */
.o_qc_tag { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; }
.o_qc_tag .o_tag { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.o_qc_tag small { color: var(--o-danger); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.o_qc_checks { background: var(--o-brand-light); border-radius: var(--o-radius); padding: 8px 12px; font-size: 13px; margin-bottom: 10px; line-height: 1.7; }
.o_qc_all { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; }
.o_qc_line { border: 1px solid var(--o-border); border-inline-start: 4px solid #c4c7cc; border-radius: var(--o-radius); padding: 8px 12px; margin-bottom: 8px; background: #fff; }
.o_qc_line.res_pass { border-inline-start-color: #1f8a4c; }
.o_qc_line.res_note { border-inline-start-color: #b45309; }
.o_qc_line.res_fail { border-inline-start-color: #b42318; background: #fffafa; }
.o_qc_line .hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.o_qc_line .hd .o_thumb { margin: 0; flex: none; }
.o_qc_line .hd .nm { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.o_qc_line .hd .nm b { font-weight: 600; color: var(--o-heading); }
.o_qc_line .hd .nm small { color: var(--o-muted); font-size: 12.5px; }
.o_qc_line .hd .o_segs button { padding: 5px 12px; font-size: 13px; }
.o_qc_line .rw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.o_qc_line .rw > .o_input:not(.o_num) { flex: 1 1 260px; }
.o_qc_chips .o_chip { font-size: 12.5px; }
.o_qc_pics .pic { position: relative; width: 74px; height: 56px; border-radius: 4px; border: 1px solid var(--o-border); background: #f3f4f6 center / cover no-repeat; }
.o_qc_pics .pic button { position: absolute; top: -7px; inset-inline-end: -7px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--o-border); background: #fff; color: var(--o-danger); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.o_qc_pics .add { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--o-border); background: #fafbfc; border-radius: 4px; padding: 0 12px; height: 56px; cursor: pointer; color: var(--o-action); font-size: 13px; }
.o_qc_pics .add:hover { border-color: var(--o-action); }
.o_qc .c_qc_last a { cursor: pointer; color: var(--o-text); display: block; font-size: 12.5px; }
.o_qc .c_qc_last a:hover b { color: var(--o-action); }
.o_qc .c_qc_last small { display: block; color: var(--o-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.o_qc .c_qc_last .o_tag { margin: 0; }
.o_qc_hist { margin-top: 4px; }
.o_qc_view .o_stage_grid { margin-bottom: 10px; }
.o_qc_view .o_rnd_gallery figcaption { display: flex; align-items: center; gap: 6px; justify-content: space-between; font-size: 12.5px; }
.o_qc_view .o_rnd_gallery figcaption .o_tag { margin: 0; flex: none; }

/* ---------- معادلات الخانات الرقمية ---------- */
.o_input.o_fx { background-image: linear-gradient(225deg, var(--o-brand) 5px, transparent 0); background-repeat: no-repeat; background-size: 10px 10px; background-position: top right; }
.o_input.o_fx_edit { direction: ltr; text-align: left; }
.o_input.o_fx_bad { border-bottom-color: var(--o-danger) !important; box-shadow: 0 1px 0 var(--o-danger); background-color: var(--o-danger-bg); }
#o_fx { position: fixed; z-index: 5000; direction: ltr; display: flex; align-items: center; gap: 9px; max-width: min(620px, 94vw); background: #1f2937; color: #e5e7eb; border-radius: 6px; padding: 6px 11px; font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
#o_fx b { color: #9ca3af; font-weight: 600; font-style: italic; }
#o_fx .ex { overflow: hidden; text-overflow: ellipsis; }
#o_fx .res { color: #86efac; font-weight: 600; flex: none; }
#o_fx .bad { color: #fca5a5; flex: none; }

/* ---------- معاينة الصورة بحجم كبير ---------- */
.o_thumb.off { cursor: default; }
.o_thumb.off:hover { border-color: var(--o-border); color: var(--o-faint); }
.o_thumb:focus-visible { outline: 2px solid var(--o-action); outline-offset: 1px; }
.o_img_preview_box { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 120px; }
.o_img_preview { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--o-border-light); border-radius: var(--o-radius); }
.o_img_caption { font-weight: 500; color: var(--o-heading); text-align: center; }
.o_img_caption:empty, .o_img_preview_box .o_hint:empty { display: none; }
.o_img_preview_box .o_hint { text-align: center; max-width: 560px; }

/* ---------- ملفات المشروع واستيراد جدول الكميات ---------- */
.o_qfiles_drop { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--o-border); border-radius: 8px; padding: 14px 16px; color: var(--o-muted); cursor: pointer; background: #fff; }
.o_qfiles_drop:hover, .o_qfiles_drop.over, .o_qfiles_drop:focus-visible { border-color: var(--o-action); color: var(--o-action); outline: 0; }
.o_qfiles_drop.over { background: var(--o-brand-light); }
.o_qfiles_drop.busy { pointer-events: none; opacity: .7; }
.o_qfiles_drop b { display: block; color: var(--o-heading); font-weight: 500; }
.o_qfiles_drop small { font-size: 12.5px; }
.o_qfiles { overflow-x: auto; }
.o_qfiles_list { margin-top: 12px; min-width: 460px; }
.o_qfiles_list td { padding: 7px 6px; }
.o_qfile_name { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--o-action); max-width: 100%; }
.o_qfile_name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.o_qfile_act { text-align: end; white-space: nowrap; }
.o_qfile_act > * { margin-inline-start: 6px; vertical-align: middle; }
.o_qfiles_foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.o_qfiles .o_todo_empty { margin-top: 12px; }
.o_lines_empty_cta { margin-top: 10px; }
.o_boq_src { display: flex; flex-direction: column; gap: 16px; }
.o_boq_from label { display: block; font-weight: 500; color: var(--o-heading); margin-bottom: 6px; font-size: 13.5px; }
.o_boq_from .btn { margin: 0 0 6px 6px; max-width: 100%; }
.o_boq_from .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 44ch; }
.o_boq_paste { border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 8px; min-height: 64px; }
.o_boq { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.o_boq_bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.o_boq_bar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.o_boq_sum { font-weight: 500; color: var(--o-heading); }
.o_boq_sheets { align-self: flex-start; max-width: 100%; overflow-x: auto; }
.o_boq_grid { overflow: auto; max-height: 52vh; border: 1px solid var(--o-border); border-radius: var(--o-radius); }
.o_boq_grid table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.o_boq_grid th { position: sticky; top: 0; z-index: 1; background: #f3f4f6; padding: 5px; border-bottom: 1px solid var(--o-border); border-inline-end: 1px solid var(--o-border-light); }
.o_boq_grid th.on { background: var(--o-brand-light); }
.o_boq_grid th select { width: 100%; min-width: 112px; font-size: 12.5px; }
.o_boq_grid td { padding: 4px 7px; border-bottom: 1px solid var(--o-border-light); border-inline-end: 1px solid var(--o-border-light); white-space: pre-line; vertical-align: top; max-width: 340px; color: var(--o-faint); }
.o_boq_grid td.on { color: var(--o-text); background: #fbfdfd; }
.o_boq_grid td.num { text-align: end; }
.o_boq_grid .rn { width: 44px; min-width: 44px; text-align: center; background: #f3f4f6; color: var(--o-muted); position: sticky; inset-inline-start: 0; }
.o_boq_grid .rn svg { margin-inline-start: 3px; vertical-align: -1px; }
.o_boq_grid tr.pre td { color: var(--o-faint); background: #fafafa; font-style: italic; }
.o_boq_grid tr.head td { font-weight: 600; color: var(--o-heading); background: #eef5f5; }
.o_boq_grid tr.hid td { text-decoration: line-through; }
.o_boq_review { overflow: auto; max-height: 58vh; border: 1px solid var(--o-border-light); border-radius: var(--o-radius); }
.o_boq_review table { min-width: 760px; }
.o_boq_review thead th { position: sticky; top: 0; z-index: 1; background: var(--o-view); }
.o_boq_review .c_kind { width: 132px; }
.o_boq_review .c_no { width: 64px; color: var(--o-muted); white-space: nowrap; }
.o_boq_review .c_src { width: 96px; color: var(--o-muted); font-size: 12px; white-space: nowrap; }
.o_boq_review .c_src .o_tag { display: block; margin: 2px 0 0; width: fit-content; }
.o_boq_review tr.off td:not(.c_sel) { opacity: .4; }
.o_boq_review tr.k_section .c_name input { font-weight: 600; color: var(--o-heading); }
.o_boq_review tr.k_section td { background: #f3f4f6; }
.o_boq_review tr.k_note .c_name input, .o_boq_review tr.k_join .c_name input { font-style: italic; color: var(--o-muted); }
.o_boq_review .o_thumb { margin: 0; cursor: default; }
.o_boq .o_check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.o_boq_flag { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; font-size: 12.5px; color: #8a5a00; background: var(--o-warning-bg); border-radius: var(--o-radius); padding: 3px 7px; width: fit-content; max-width: 100%; }
.o_boq_flag svg { flex: none; margin-top: 2px; }
.o_boq_warn { color: #8a5a00; }
.o_boq_note { align-items: flex-start; }
.o_boq_wait { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; }
.o_boq_wait .o_hint { grid-column: 1 / -1; margin: 0; }
.o_boq_wait small { color: var(--o-muted); }
.o_boq_spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--o-brand-light); border-top-color: var(--o-brand); animation: o_boq_spin .9s linear infinite; }
@keyframes o_boq_spin { to { transform: rotate(360deg); } }
