﻿:root{--bg:#f3f6fb;--card:#fff;--ink:#172033;--muted:#667085;--line:#dde5ef;--primary:#2563eb;--danger:#dc2626;--ok:#16a34a;--warn:#f59e0b}*{box-sizing:border-box}body{margin:0;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,select,textarea{font-family:inherit;font-size:15px}button{border:0;border-radius:12px;padding:10px 14px;cursor:pointer}.primary{background:var(--primary);color:white}.secondary{background:#e8eef8;color:#17315f}.danger{background:var(--danger);color:#fff}.ok{background:var(--ok);color:#fff}.warn{background:var(--warn);color:#fff}.hidden{display:none!important}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card,.panel,.card{background:var(--card);border:1px solid var(--line);border-radius:22px;box-shadow:0 14px 40px rgba(15,23,42,.08)}.login-card{width:min(440px,100%);padding:28px}.brand{display:flex;gap:12px;align-items:center;margin-bottom:20px}.brand h1{margin:0}.brand p{margin:3px 0;color:var(--muted)}.logo{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#2563eb,#0f172a);color:#fff;display:grid;place-items:center;font-weight:800;font-size:24px}.login-card label,.panel label{display:block;margin-top:13px;color:#344054}.login-card input,.panel input,.panel select,.panel textarea,.filters input,.filters select{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px;background:white;margin-top:6px}.app{display:grid;grid-template-columns:260px 1fr;min-height:100vh}.side{background:#0f172a;color:white;padding:18px;display:flex;flex-direction:column;gap:10px;position:sticky;top:0;height:100vh}.side button{background:rgba(255,255,255,.08);color:#fff;text-align:right}.side button:hover{background:rgba(255,255,255,.16)}.mini .logo{width:38px;height:38px;border-radius:12px}.main{padding:22px}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.top h2{margin:0}.top p{margin:5px 0;color:var(--muted)}.panel{padding:20px;margin-bottom:18px}.grid{display:grid;grid-template-columns:repeat(3,minmax(160px,1fr));gap:12px}.row{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}.filters{display:grid;grid-template-columns:1fr 220px;gap:10px;margin-bottom:14px}.cards{display:grid;gap:12px}.card{padding:16px;border-right:8px solid var(--primary)}.card.late{border-right-color:var(--danger);background:#fff7f7}.card.done{border-right-color:var(--ok)}.card .meta{display:flex;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:13px}.badge{background:#eef2ff;color:#1e3a8a;padding:4px 8px;border-radius:999px}.badge.red{background:#fee2e2;color:#991b1b}.badge.green{background:#dcfce7;color:#166534}.badge.orange{background:#ffedd5;color:#9a3412}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.checks{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:8px;margin:8px 0}.checks label{background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:8px}.table-wrap{overflow:auto;margin-top:15px}table{width:100%;border-collapse:collapse;background:white}th,td{border:1px solid var(--line);padding:9px;text-align:right;white-space:nowrap}th{background:#f8fafc}dialog{border:0;border-radius:18px;max-width:720px;width:calc(100% - 30px);padding:20px}#toast{position:fixed;left:20px;bottom:20px;z-index:99}.toast{background:#111827;color:#fff;border-radius:12px;padding:12px 14px;margin-top:8px;box-shadow:0 10px 30px rgba(0,0,0,.2)}@media(max-width:900px){.app{grid-template-columns:1fr}.side{height:auto;position:relative;flex-direction:row;overflow:auto}.main{padding:14px}.grid,.checks,.filters{grid-template-columns:1fr}.top{align-items:flex-start;gap:10px}.card{padding:13px}}@media print{.side,.top button,.actions,.filters button{display:none}.app{display:block}.main{padding:0}.panel,.card{box-shadow:none;border:1px solid #ccc}}

/* ============================================================
   NEXORA_TASKFLOW_EMPLOYEES_LANGUAGES_CSS_V1
   تنسيق شاشة الموظفين واللغات
   ============================================================ */

.tf-employees-floating-btn{
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(15, 118, 110, .25);
  cursor: pointer;
}

.tf-employees-panel{
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tf-employees-panel.hidden{
  display: none !important;
}

.tf-employees-card{
  width: min(1100px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  direction: rtl;
}

.tf-employees-head{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.tf-employees-head h2{
  margin: 0 0 6px;
}

.tf-employees-head p{
  margin: 0;
  color: #64748b;
}

.tf-employee-form{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr 1fr auto;
  gap: 10px;
  margin: 16px 0;
}

.tf-employee-form input,
.tf-employee-form select{
  min-height: 42px;
  border: 1px solid #d7dee9;
  border-radius: 12px;
  padding: 8px 12px;
}

.tf-employees-tools{
  margin: 12px 0;
}

.tf-employees-table{
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.tf-employees-table th,
.tf-employees-table td{
  border: 1px solid #e2e8f0;
  padding: 10px;
  text-align: right;
}

.tf-employees-table th{
  background: #f8fafc;
  font-weight: 800;
}

@media (max-width: 900px){
  .tf-employee-form{
    grid-template-columns: 1fr;
  }

  .tf-employees-card{
    width: 98vw;
    padding: 16px;
  }
}




/* ============================================================
   NEXORA_TASKFLOW_TRANSLATE_BY_EMPLOYEE_LANGUAGE_CSS_V1
   أزرار الترجمة حسب لغة الموظف
   ============================================================ */

.tf-translate-actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.tf-translate-actions small{
  color: #64748b;
  font-weight: 700;
}



/* ============================================================
   NEXORA_TASKFLOW_READ_TASK_HOME_BUTTON_CSS_V1
   زر قراءة المهمة في الشاشة الرئيسية
   ============================================================ */

.tf-read-task-home-wrap{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px;
}

.tf-read-task-home-btn{
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.tf-stop-task-home-btn{
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #f97316;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(249, 115, 22, .16);
}

.tf-read-task-home-btn:hover,
.tf-stop-task-home-btn:hover{
  filter: brightness(.96);
}


/* ============================================================
   NEXORA_TASKFLOW_FIX_READ_EDIT_REPLY_CSS_V1
   تنسيق تعديل المهمة والرد الصوتي
   ============================================================ */

.tf-task-details-extra-actions{
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fafc;
}

.tf-task-extra-title{
  font-weight: 900;
  margin-bottom: 10px;
  color: #0f172a;
}

.tf-task-extra-buttons{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tf-reply-status{
  margin: 10px 0;
  color: #475569;
  font-weight: 700;
}

#employeeVoiceReplyPlayer{
  width: 100%;
  margin: 8px 0;
}

.tf-task-edit-box{
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed #cbd5e1;
}

.tf-task-edit-box label{
  display: block;
  margin: 8px 0 4px;
  font-weight: 800;
}

.tf-task-edit-box input,
.tf-task-edit-box textarea{
  width: 100%;
  border: 1px solid #d7dee9;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}


/* ============================================================
   NEXORA_TASKFLOW_FORCE_EMPLOYEE_ADD_FORM_V2_CSS
   فورم إضافة الموظف داخل شاشة الموظفين
   ============================================================ */

.tf-employee-add-v2{
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.tf-employee-add-v2-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tf-employee-add-v2-top strong{
  display: block;
  font-size: 16px;
  color: #0f172a;
}

.tf-employee-add-v2-top span{
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.tf-employee-add-v2-body{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

.tf-employee-add-v2-grid{
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1.3fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.tf-employee-add-v2-grid label{
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.tf-employee-add-v2-grid input,
.tf-employee-add-v2-grid select{
  width: 100%;
  min-height: 42px;
  border: 1px solid #d7dee9;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
}

.tf-employee-add-v2-actions{
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.tf-employee-add-v2-actions button{
  min-height: 42px;
  white-space: nowrap;
}

@media (max-width: 1000px){
  .tf-employee-add-v2-grid{
    grid-template-columns: 1fr 1fr;
  }

  .tf-employee-add-v2-top{
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 650px){
  .tf-employee-add-v2-grid{
    grid-template-columns: 1fr;
  }
}













/* ============================================================
   NEXORA_TASKFLOW_FINAL_STABLE_EMPLOYEE_ASSIGNEE_CSS_V1
   إلغاء زر الموظفين العائم + Dropdown نهائي ثابت
   ============================================================ */

#employeesFloatingButton,
.tf-employees-floating-btn{
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#tfAssigneeDropdownBox,
#tfSafeAssigneeBox,
#tfFinalAssigneeBox,
#tfCleanAssigneeMultiSelectBox,
#tfAssigneeMultiBox,
#nxAssigneeDropdownBox,
.tf-pro-assignee-picker,
.tf-assignee-multiselect-box{
  display: none !important;
}

#nxFinalAssigneeBox{
  display: block !important;
}

.nx-final-hidden-real-assignee{
  display: none !important;
}

.nx-final-assignee-box{
  position: relative;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.nx-final-assignee-title{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.nx-final-assignee-title strong{
  color: #0f172a;
  font-size: 15px;
}

.nx-final-assignee-title span{
  color: #64748b;
  font-size: 12px;
}

.nx-final-assignee-dropdown{
  position: relative;
}

#nxFinalAssigneeButton{
  width: 100%;
  min-height: 46px;
  border: 1px solid #d7dee9;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 800;
  text-align: right;
  padding: 10px 14px;
  cursor: pointer;
}

.nx-final-assignee-menu{
  position: absolute;
  z-index: 9999;
  top: calc(100% + 6px);
  right: 0;
  width: 100%;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid #d7dee9;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
  padding: 10px;
}

.nx-final-assignee-menu.hidden{
  display: none !important;
}

#nxFinalAssigneeSearch{
  width: 100%;
  min-height: 40px;
  border: 1px solid #d7dee9;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.nx-final-assignee-item{
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 4px;
}

.nx-final-assignee-item:hover{
  background: #f1f5f9;
}

.nx-final-assignee-item input[type="checkbox"]{
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  position: static !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.nx-final-assignee-footer{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  margin-top: 8px;
}

.nx-final-assignee-summary{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.nx-final-assignee-summary span{
  background: #dcfce7;
  color: #166534;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.nx-final-assignee-summary em{
  color: #94a3b8;
  font-style: normal;
}


/* ============================================================
   NEXORA_TASKFLOW_ASSIGNEE_SEND_BRIDGE_CSS_V1
   إخفاء عناصر ربط الإرسال المخفية
   ============================================================ */

.nx-assignee-send-bridge{
  display: none !important;
}


/* ============================================================
   NEXORA_TASKFLOW_MOBILE_BUTTONS_FIX_V1
   تنظيم أزرار الجوال ومنع التداخل والخروج من الكروت
   ============================================================ */

/* [1] قاعدة عامة لكل مجموعات الأزرار */
.actions,
.task-actions,
.tf-task-extra-buttons,
.tf-assignee-dropdown-footer,
.nx-final-assignee-footer,
.nx-assignee-footer,
.card .actions,
.modal .actions,
.dialog .actions,
.popup .actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* [2] منع أي زر من الخروج عن عرض الشاشة */
button,
.ok,
.warn,
.danger,
.secondary,
.tf-read-task-home-btn,
.tf-stop-task-home-btn{
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

/* [3] شكل أزرار المهام داخل الكروت */
.task-card button,
.card button,
.task-actions button,
.actions button{
  min-height: 40px;
  border-radius: 12px;
}

/* [4] تحسين أزرار القراءة والإيقاف */
.tf-read-task-home-wrap{
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.tf-read-task-home-btn,
.tf-stop-task-home-btn{
  flex: 1 1 150px;
  min-height: 40px;
}

/* [5] تحسين قائمة اختيار الموظفين على الجوال */
#nxFinalAssigneeBox,
#nxAssigneeDropdownBox,
#tfAssigneeDropdownBox{
  width: 100%;
  box-sizing: border-box;
}

#nxFinalAssigneeButton,
#nxAssigneeButton,
#tfAssigneeDropdownButton{
  width: 100%;
  min-height: 46px;
}

.nx-final-assignee-menu,
.nx-assignee-menu,
.tf-assignee-dropdown-menu{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.nx-final-assignee-item,
.nx-assignee-item,
.tf-assignee-dropdown-item{
  align-items: flex-start;
}

.nx-final-assignee-item span,
.nx-assignee-item span,
.tf-assignee-dropdown-item span{
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* [6] موبايل */
@media (max-width: 768px){

  .actions,
  .task-actions,
  .tf-task-extra-buttons,
  .card .actions,
  .modal .actions,
  .dialog .actions,
  .popup .actions{
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .actions button,
  .task-actions button,
  .tf-task-extra-buttons button,
  .card .actions button,
  .modal .actions button,
  .dialog .actions button,
  .popup .actions button{
    width: 100% !important;
    min-height: 42px;
    padding: 9px 10px;
    font-size: 13px;
    text-align: center;
  }

  /* الأزرار الطويلة تأخذ الصف كامل */
  .tf-read-task-home-btn,
  .tf-stop-task-home-btn,
  button[onclick*="read"],
  button[onclick*="Read"],
  button[onclick*="openTask"],
  button[onclick*="completeTask"],
  button[onclick*="requestDelay"],
  button[onclick*="rejectTask"]{
    width: 100% !important;
  }

  .tf-read-task-home-wrap{
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* تفاصيل المهمة والمودال */
  .modal,
  .dialog,
  .popup{
    max-width: calc(100vw - 18px) !important;
    width: calc(100vw - 18px) !important;
    box-sizing: border-box;
  }

  .modal button,
  .dialog button,
  .popup button{
    font-size: 13px;
  }

  /* قائمة الموظفين المنسدلة */
  .nx-final-assignee-footer,
  .nx-assignee-footer,
  .tf-assignee-dropdown-footer{
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nx-final-assignee-footer button,
  .nx-assignee-footer button,
  .tf-assignee-dropdown-footer button{
    width: 100% !important;
  }
}

/* [7] شاشات صغيرة جدًا */
@media (max-width: 430px){

  .actions,
  .task-actions,
  .tf-task-extra-buttons,
  .card .actions,
  .modal .actions,
  .dialog .actions,
  .popup .actions{
    grid-template-columns: 1fr !important;
  }

  .tf-read-task-home-wrap{
    grid-template-columns: 1fr !important;
  }

  button,
  .ok,
  .warn,
  .danger,
  .secondary{
    width: 100%;
  }

  .nx-final-assignee-footer,
  .nx-assignee-footer,
  .tf-assignee-dropdown-footer{
    grid-template-columns: 1fr !important;
  }
}
