
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  background:#eef2f7;
  color:#111827;
  font-family:Tahoma,Arial,sans-serif;
}

/* Login */
.login{
  min-height:100vh;
  background:linear-gradient(135deg,#0f172a,#1e293b);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.login-card{
  width:100%;
  max-width:460px;
  background:#fff;
  border-radius:26px;
  padding:36px;
  box-shadow:0 22px 60px rgba(0,0,0,.25);
}
.login-card h1{margin:0 0 10px;font-size:34px}
.login-card p{color:#64748b;line-height:1.8}

/* Form */
.field{margin-bottom:14px}
label{display:block;font-weight:700;margin-bottom:7px}
input,select,textarea{
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:12px;
  padding:12px;
  font-size:14px;
  background:#fff;
}
textarea{min-height:110px;resize:vertical}
.btn,button{
  border:0;
  border-radius:12px;
  padding:11px 15px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}
.primary{background:#2563eb;color:#fff}
.light{background:#f1f5f9;color:#334155}
.green{background:#dcfce7;color:#047857}
.red{background:#fee2e2;color:#b91c1c}
.orange{background:#ffedd5;color:#c2410c}

/* Fixed app layout */
.layout{
  min-height:100vh;
  display:flex;
  flex-direction:row-reverse;
  align-items:stretch;
  width:100%;
}
.sidebar{
  width:300px;
  min-width:300px;
  background:#0f172a;
  color:#fff;
  padding:26px 20px;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  direction:rtl;
}
.content{
  flex:1;
  min-width:0;
  padding:28px;
  background:#eef2f7;
  direction:rtl;
  display:block;
}
.sidebar h1{margin:0 0 8px;font-size:26px}
.sidebar p{color:#cbd5e1;margin-top:0}
.userbox{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  padding:16px;
  margin:22px 0;
}
.userbox b,.userbox span{display:block}
.userbox span{font-size:12px;color:#cbd5e1;margin-top:6px}
.sidebar nav a{
  display:block;
  color:#fff;
  text-decoration:none;
  padding:14px 13px;
  border-radius:12px;
  margin-bottom:8px;
  transition:.2s;
}
.sidebar nav a:hover{background:rgba(255,255,255,.09)}
.sidebar .logout{background:#991b1b;margin-top:20px;text-align:center}

.page-hero{
  background:linear-gradient(135deg,#fff,#f8fafc);
  border:1px solid #e5e7eb;
  border-radius:24px;
  padding:24px;
  margin-bottom:22px;
  box-shadow:0 14px 35px rgba(15,23,42,.08);
}
.page-hero h1{margin:0 0 8px;font-size:30px;color:#0f172a}
.page-hero p{margin:0;color:#64748b;line-height:1.8}

.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:22px;
}
.kpi,.card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:22px;
  box-shadow:0 14px 35px rgba(15,23,42,.08);
}
.kpi{
  padding:20px;
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.kpi span{color:#64748b}
.kpi b{display:block;font-size:32px;margin-top:8px;color:#0f172a}
.card{margin-bottom:22px;overflow:hidden}
.head{
  padding:18px 22px;
  border-bottom:1px solid #e5e7eb;
  background:#fff;
}
.head h2{margin:0;font-size:22px}
.body{padding:22px}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.full{grid-column:1/-1}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
table{width:100%;border-collapse:collapse}
th,td{
  padding:12px;
  border-bottom:1px solid #e5e7eb;
  text-align:right;
  vertical-align:top;
}
th{background:#f8fafc;color:#475569;font-size:13px}
.badge{
  display:inline-block;
  padding:7px 10px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
}
.pending{background:#fff7ed;color:#c2410c}
.approved{background:#ecfdf5;color:#047857}
.rejected{background:#fef2f2;color:#b91c1c}
.reviewed{background:#eef2ff;color:#4338ca}
.alert{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;border-radius:12px;padding:12px;margin:12px 0}
.muted{color:#64748b}
.reply{background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:12px;margin:10px 0}
.reply small{display:block;color:#64748b;margin-top:4px}

.quick-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin-top:16px;
}
.quick-card{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
}
.quick-card h3{margin:0 0 8px;font-size:18px}
.quick-card p{margin:0 0 14px;color:#64748b;line-height:1.7}

/* Tablet */
@media(max-width:1100px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick-grid{grid-template-columns:1fr}
}

/* Mobile only */
@media(max-width:600px){
  .layout{display:block}
  .sidebar{
    width:100%;
    min-width:0;
    height:auto;
    position:relative;
  }
  .content{padding:16px}
  .grid,.form-grid,.quick-grid{grid-template-columns:1fr}
  table{display:block;overflow:auto;white-space:nowrap}
}


/* Internal Chat */
.chat-layout{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:18px;
  align-items:start;
}
.chat-contacts .body{
  max-height:72vh;
  overflow:auto;
}
.contact-item{
  display:block;
  text-decoration:none;
  color:#111827;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:14px;
  margin-bottom:10px;
  position:relative;
}
.contact-item:hover,
.contact-item.active{
  border-color:#2563eb;
  background:#eff6ff;
}
.contact-item b{
  display:block;
  margin-bottom:6px;
}
.contact-item span{
  display:block;
  color:#64748b;
  font-size:12px;
}
.contact-item em{
  position:absolute;
  left:12px;
  top:12px;
  background:#dc2626;
  color:#fff;
  border-radius:999px;
  padding:3px 8px;
  font-style:normal;
  font-size:12px;
  font-weight:700;
}
.messages{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:16px;
  min-height:360px;
  max-height:540px;
  overflow:auto;
}
.message-row{
  display:flex;
  margin-bottom:12px;
}
.message-row.mine{
  justify-content:flex-start;
}
.message-row.theirs{
  justify-content:flex-end;
}
.message-bubble{
  max-width:72%;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:12px 14px;
}
.message-row.mine .message-bubble{
  background:#eff6ff;
  border-color:#bfdbfe;
}
.msg-meta{
  display:flex;
  gap:10px;
  justify-content:space-between;
  color:#64748b;
  font-size:12px;
  margin-bottom:8px;
}
.message-bubble p{
  margin:0 0 8px;
  line-height:1.8;
}
.chat-img{
  max-width:260px;
  max-height:220px;
  border-radius:14px;
  display:block;
  margin-top:8px;
}
.chat-audio{
  width:260px;
  margin-top:8px;
}
.chat-form{
  margin-top:16px;
}
@media(max-width:900px){
  .chat-layout{grid-template-columns:1fr}
  .message-bubble{max-width:92%}
}


/* V5 Chat polish + Tasks */
.chat-layout{display:grid;grid-template-columns:340px 1fr;gap:20px}
.chat-contacts .body{max-height:72vh;overflow:auto}
.contact-item{display:block;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;margin-bottom:12px;text-decoration:none;color:#111827;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.contact-item:hover,.contact-item.active{background:#eff6ff;border-color:#2563eb}
.contact-item b{display:block;font-size:16px;margin-bottom:6px}
.contact-item span{display:block;color:#64748b;font-size:13px;line-height:1.6}
.contact-item em{float:left;background:#dc2626;color:#fff;font-style:normal;border-radius:999px;padding:3px 9px;font-size:12px}
.messages{background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:16px;min-height:420px;max-height:560px;overflow:auto}
.message-row{display:flex;margin-bottom:12px}
.message-row.mine{justify-content:flex-start}
.message-row.theirs{justify-content:flex-end}
.message-bubble{max-width:72%;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:12px 14px;box-shadow:0 6px 18px rgba(15,23,42,.04)}
.message-row.mine .message-bubble{background:#eff6ff;border-color:#bfdbfe}
.msg-meta{display:flex;gap:10px;justify-content:space-between;color:#64748b;font-size:12px;margin-bottom:8px}
.message-bubble p{margin:0 0 8px;line-height:1.8}
.chat-img{max-width:260px;max-height:220px;border-radius:14px;display:block;margin-top:8px}
.chat-audio{width:260px;margin-top:8px}
.chat-form{margin-top:16px}
@media(max-width:900px){.chat-layout{grid-template-columns:1fr}.message-bubble{max-width:92%}}

/* =========================
   V6 Professional UI Upgrade
========================= */
:root{
  --ga-bg:#eef3f8;
  --ga-card:#ffffff;
  --ga-dark:#0f172a;
  --ga-blue:#2563eb;
  --ga-green:#16a34a;
  --ga-line:#e2e8f0;
  --ga-muted:#64748b;
  --ga-shadow:0 20px 55px rgba(15,23,42,.10);
}
body{background:var(--ga-bg)}
.sidebar{
  background:linear-gradient(180deg,#0f172a,#111827);
  box-shadow:0 0 35px rgba(15,23,42,.22);
}
.sidebar nav a{
  border:1px solid transparent;
  font-weight:700;
}
.sidebar nav a:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.08);
  transform:translateX(-3px);
}
.card,.kpi,.page-hero{
  border-radius:28px!important;
  box-shadow:var(--ga-shadow)!important;
  animation:gaFade .35s ease both;
}
@keyframes gaFade{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
.btn,button{transition:.2s ease}
.btn:hover,button:hover{transform:translateY(-1px);filter:brightness(.98)}
.kpi{position:relative;overflow:hidden}
.kpi:after{
  content:"";
  position:absolute;
  left:-28px;
  top:-28px;
  width:90px;
  height:90px;
  background:rgba(37,99,235,.08);
  border-radius:50%;
}
.head{background:linear-gradient(90deg,#fff,#f8fafc)}
input,select,textarea{transition:.2s ease}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

/* WhatsApp-like chat */
.whatsapp-shell{
  display:grid;
  grid-template-columns:360px 1fr;
  gap:0;
  background:#fff;
  border:1px solid var(--ga-line);
  border-radius:28px;
  overflow:hidden;
  box-shadow:var(--ga-shadow);
  min-height:680px;
}
.wa-sidebar{
  background:#f8fafc;
  border-left:1px solid var(--ga-line);
  display:flex;
  flex-direction:column;
}
.wa-head{padding:18px;background:#075e54;color:#fff}
.wa-head h2{margin:0;font-size:22px}
.wa-head p{margin:6px 0 0;color:#d1fae5;font-size:13px}
.wa-tabs{display:flex;gap:8px;padding:12px;background:#fff;border-bottom:1px solid var(--ga-line)}
.wa-tabs a{flex:1;text-align:center;text-decoration:none;color:#0f172a;padding:10px;border-radius:999px;background:#f1f5f9;font-weight:800;font-size:13px}
.wa-tabs a.active{background:#dcfce7;color:#166534}
.wa-list{padding:12px;overflow:auto;max-height:560px}
.wa-contact{display:flex;gap:12px;align-items:center;padding:12px;border-radius:18px;text-decoration:none;color:#0f172a;margin-bottom:8px;transition:.2s}
.wa-contact:hover,.wa-contact.active{background:#e2f7e9}
.wa-avatar{width:46px;height:46px;border-radius:50%;background:#128c7e;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;flex:none}
.wa-contact b{display:block;margin-bottom:4px}
.wa-contact span{display:block;color:#64748b;font-size:12px}
.wa-unread{margin-right:auto;background:#25d366;color:#fff;min-width:22px;height:22px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:900}
.wa-chat{background:#efeae2;display:flex;flex-direction:column;min-width:0}
.wa-chat-head{padding:16px 20px;background:#f8fafc;border-bottom:1px solid var(--ga-line);display:flex;align-items:center;gap:12px}
.wa-chat-head h2{margin:0;font-size:20px}
.wa-chat-head span{color:#64748b;font-size:13px}
.wa-messages{padding:20px;flex:1;overflow:auto;max-height:560px}
.wa-msg-row{display:flex;margin-bottom:12px}
.wa-msg-row.mine{justify-content:flex-start}
.wa-msg-row.theirs{justify-content:flex-end}
.wa-bubble{max-width:68%;padding:10px 13px;border-radius:16px;background:#fff;box-shadow:0 5px 15px rgba(15,23,42,.06)}
.wa-msg-row.mine .wa-bubble{background:#dcf8c6}
.wa-meta{display:flex;justify-content:space-between;gap:14px;color:#64748b;font-size:11px;margin-bottom:6px}
.wa-bubble p{margin:0 0 6px;line-height:1.8}
.wa-img{max-width:280px;max-height:220px;border-radius:14px;display:block}
.wa-audio{width:280px}
.wa-form{padding:14px;background:#f8fafc;border-top:1px solid var(--ga-line)}
.wa-form-row{display:grid;grid-template-columns:1fr 210px 90px;gap:10px;align-items:center}
.group-create{padding:12px;background:#fff;border-bottom:1px solid var(--ga-line)}
.group-create details{background:#f8fafc;border:1px solid var(--ga-line);border-radius:18px;padding:12px}
.group-member-list{max-height:180px;overflow:auto;display:grid;gap:8px}
.group-member-list label{background:#fff;border:1px solid var(--ga-line);border-radius:12px;padding:8px;font-weight:400}
.task-form-card{border:2px solid rgba(37,99,235,.08)}
.task-empty{background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;border-radius:18px;padding:16px}
.task-comments{background:#f8fafc;border:1px solid var(--ga-line);border-radius:16px;padding:12px;margin-top:10px}
.task-comment{background:#fff;border:1px solid var(--ga-line);border-radius:14px;padding:10px;margin-bottom:8px}
.task-comment small{display:block;color:#64748b;margin-top:4px}
@media(max-width:1000px){
  .whatsapp-shell{grid-template-columns:1fr}
  .wa-sidebar{border-left:0;border-bottom:1px solid var(--ga-line)}
  .wa-list{max-height:300px}
  .wa-form-row{grid-template-columns:1fr}
  .wa-bubble{max-width:90%}
}

/* =========================
   V7 Mobile-first + Notifications
========================= */
.nav-badge{
  display:inline-flex;
  background:#ef4444;
  color:#fff;
  min-width:22px;
  height:22px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  font-size:12px;
  margin-right:8px;
}
.notification-list{display:grid;gap:12px}
.notification-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  border:1px solid var(--ga-line);
  border-radius:18px;
  padding:14px;
  background:#fff;
}
.notification-item.unread{
  border-color:#2563eb;
  background:#eff6ff;
}
.notification-item b{display:block;margin-bottom:5px}
.notification-item p{margin:0 0 5px;color:#475569;line-height:1.7}
.notification-item small{color:#64748b}

@media(max-width:700px){
  body{background:#f1f5f9}
  .layout{display:flex;flex-direction:column}
  .sidebar{
    width:100%;
    min-width:0;
    height:auto;
    position:sticky;
    top:0;
    z-index:10;
    padding:14px;
    border-bottom-left-radius:22px;
    border-bottom-right-radius:22px;
  }
  .sidebar h1{font-size:22px;margin-bottom:4px}
  .sidebar p{font-size:12px;margin-bottom:8px}
  .userbox{margin:10px 0;padding:10px;border-radius:14px}
  .sidebar nav{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-bottom:4px;
  }
  .sidebar nav a{
    white-space:nowrap;
    flex:0 0 auto;
    background:rgba(255,255,255,.08);
    padding:10px 12px;
    font-size:13px;
  }
  .sidebar .logout{background:#991b1b!important}
  .content{padding:14px}
  .page-hero{border-radius:22px!important;padding:18px}
  .page-hero h1{font-size:24px}
  .grid{grid-template-columns:1fr 1fr!important;gap:10px}
  .kpi{min-height:95px;padding:14px;border-radius:20px!important}
  .kpi b{font-size:24px}
  .card{border-radius:22px!important}
  .head{padding:14px 16px}
  .head h2{font-size:19px}
  .body{padding:16px}
  .form-grid{grid-template-columns:1fr!important}
  table{display:block;overflow-x:auto;white-space:nowrap;border-radius:14px}
  .whatsapp-shell{min-height:calc(100vh - 230px);border-radius:22px}
  .wa-chat{min-height:560px}
  .wa-messages{max-height:420px;padding:14px}
  .wa-form-row{grid-template-columns:1fr!important}
  .wa-bubble{max-width:92%}
  .wa-sidebar{max-height:420px}
  .wa-list{max-height:260px}
  .notification-item{flex-direction:column;align-items:flex-start}
}

/* V8 Advanced Reports */
.employee-sheet{
  border:1px solid #cbd5e1;
  border-radius:18px;
  overflow:hidden;
  margin-bottom:18px;
  background:#fff;
}
.employee-name-line{
  text-align:center;
  padding:14px;
  border-bottom:1px solid #cbd5e1;
}
.employee-name-line b{display:block;font-size:18px;margin-bottom:6px}
.employee-name-line span{color:#64748b;font-size:13px}
.sheet-row{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.1fr;
}
.sheet-row>div{
  padding:14px;
  border-left:1px solid #cbd5e1;
  min-height:58px;
  text-align:center;
}
.sheet-row>div:last-child{border-left:0}
.sheet-head>div{
  background:#1f3763;
  color:#fff;
  font-weight:900;
  border-radius:0;
}
.mini-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0;
}
.mini-stats span{
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:999px;
  padding:9px 13px;
  font-weight:700;
  color:#334155;
}
.manager-review-box{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:16px;
  margin:16px 0;
}
@media(max-width:700px){
  .sheet-row{
    grid-template-columns:1fr;
  }
  .sheet-row>div{
    border-left:0;
    border-bottom:1px solid #cbd5e1;
  }
}

/* V9 Manual Supervisor Report */
.manual-report-header{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;
  gap:14px;
  margin:18px 0 14px;
}
.manual-report-header>div{
  background:#1f3763;
  color:#fff;
  border-radius:16px;
  padding:15px;
  text-align:center;
  font-weight:900;
  box-shadow:0 10px 22px rgba(31,55,99,.15);
}
.manual-employee-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:24px;
  padding:18px;
  margin:18px 0;
  box-shadow:0 14px 35px rgba(15,23,42,.06);
}
.manual-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;
  gap:14px;
}
.task-details-box{
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:20px;
  padding:16px;
  margin:14px 0;
}
.task-details-box h3{
  margin-top:0;
  text-align:center;
}
.big-add-btn{
  min-width:220px;
  font-size:17px;
  border-radius:18px;
  padding:15px 22px;
}
.manual-report-row{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;
  border:1px solid #e2e8f0;
  border-radius:16px;
  overflow:hidden;
  margin-bottom:10px;
}
.manual-report-row>div{
  padding:14px;
  border-left:1px solid #e2e8f0;
  text-align:center;
}
.manual-report-row>div:last-child{border-left:0}
.employee-task-section{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:20px;
  padding:16px;
  margin-bottom:18px;
}
.employee-task-section h3{
  margin-top:0;
  color:#1f3763;
}
@media(max-width:900px){
  .manual-report-header,.manual-grid,.manual-report-row{
    grid-template-columns:1fr;
  }
  .manual-report-row>div{
    border-left:0;
    border-bottom:1px solid #e2e8f0;
  }
}

/* =========================
   V10 Mobile PWA App Polish
========================= */
@media(max-width:760px){
  html,body{
    overscroll-behavior:none;
    -webkit-tap-highlight-color:transparent;
  }
  body{
    background:#f3f6fb;
    font-size:14px;
  }
  .layout{
    display:flex!important;
    flex-direction:column!important;
    min-height:100vh;
  }
  .sidebar{
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    position:sticky!important;
    top:0!important;
    z-index:1000!important;
    padding:12px 12px 10px!important;
    border-bottom-left-radius:26px!important;
    border-bottom-right-radius:26px!important;
    box-shadow:0 14px 35px rgba(15,23,42,.22)!important;
  }
  .sidebar h1{
    font-size:21px!important;
    margin:0 0 3px!important;
  }
  .sidebar p{
    font-size:12px!important;
    margin:0 0 8px!important;
  }
  .userbox{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin:8px 0 10px!important;
    padding:10px 12px!important;
    border-radius:18px!important;
  }
  .userbox b{font-size:14px}
  .userbox span{font-size:11px!important}
  .sidebar nav{
    display:flex!important;
    overflow-x:auto!important;
    gap:8px!important;
    padding:2px 0 6px!important;
    scroll-snap-type:x mandatory;
  }
  .sidebar nav::-webkit-scrollbar{display:none}
  .sidebar nav a{
    scroll-snap-align:start;
    flex:0 0 auto!important;
    min-width:max-content;
    margin:0!important;
    padding:10px 13px!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.09)!important;
    border:1px solid rgba(255,255,255,.08)!important;
    font-size:13px!important;
  }
  .sidebar .logout{
    background:#991b1b!important;
  }
  .content{
    padding:14px!important;
    padding-bottom:34px!important;
  }
  .page-hero{
    padding:18px!important;
    border-radius:24px!important;
    margin-bottom:14px!important;
  }
  .page-hero h1{font-size:23px!important}
  .page-hero p{font-size:13px!important}
  .card,.kpi{
    border-radius:24px!important;
  }
  .grid{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }
  .kpi{
    padding:14px!important;
    min-height:94px!important;
  }
  .kpi b{font-size:24px!important}
  .kpi span{font-size:12px!important}
  .head{
    padding:14px 16px!important;
  }
  .head h2{font-size:18px!important}
  .body{padding:15px!important}
  input,select,textarea{
    border-radius:16px!important;
    padding:13px!important;
    font-size:15px!important;
  }
  .btn,button{
    border-radius:16px!important;
    padding:12px 15px!important;
  }
  .form-grid{
    grid-template-columns:1fr!important;
  }
  table{
    display:block!important;
    overflow-x:auto!important;
    white-space:nowrap!important;
    border-radius:18px!important;
  }

  /* WhatsApp mobile polish */
  .whatsapp-shell{
    display:flex!important;
    flex-direction:column!important;
    min-height:calc(100vh - 210px)!important;
    border-radius:26px!important;
    overflow:hidden!important;
  }
  .wa-sidebar{
    max-height:none!important;
    border-left:0!important;
    border-bottom:1px solid #e2e8f0!important;
  }
  .wa-head{
    padding:14px 16px!important;
  }
  .wa-head h2{font-size:19px!important}
  .wa-tabs{
    padding:10px!important;
  }
  .wa-list{
    display:flex!important;
    overflow-x:auto!important;
    max-height:none!important;
    padding:10px!important;
    gap:8px!important;
  }
  .wa-list::-webkit-scrollbar{display:none}
  .wa-contact{
    flex:0 0 230px!important;
    margin:0!important;
    background:#fff!important;
  }
  .wa-chat{
    min-height:520px!important;
  }
  .wa-chat-head{
    padding:12px!important;
  }
  .wa-chat-head h2{font-size:17px!important}
  .wa-avatar{
    width:42px!important;
    height:42px!important;
  }
  .wa-messages{
    padding:12px!important;
    max-height:420px!important;
  }
  .wa-bubble{
    max-width:88%!important;
    border-radius:18px!important;
    padding:10px 12px!important;
  }
  .wa-img{
    max-width:230px!important;
    max-height:220px!important;
  }
  .wa-audio{
    width:230px!important;
  }
  .wa-form{
    padding:10px!important;
  }
  .wa-form-row{
    grid-template-columns:1fr!important;
    gap:8px!important;
  }

  /* Manual report mobile */
  .manual-report-header,.manual-grid,.manual-report-row{
    grid-template-columns:1fr!important;
  }
  .manual-report-header>div{
    border-radius:14px!important;
    padding:12px!important;
  }
  .manual-employee-card{
    border-radius:24px!important;
    padding:14px!important;
  }
  .big-add-btn{
    width:100%!important;
    min-width:0!important;
  }
}

/* PWA safe area */
@supports(padding:max(0px)){
  @media(max-width:760px){
    .sidebar{padding-top:max(12px, env(safe-area-inset-top))!important}
    .content{padding-bottom:max(34px, env(safe-area-inset-bottom))!important}
  }
}

/* V11 Mobile WhatsApp-like Chat UI */
.mobile-chat-app{margin:-12px}.mobile-chat-hero{min-height:50vh;background:linear-gradient(155deg,#075e54 0%,#0f172a 62%,#111827 100%);color:#fff;border-bottom-left-radius:34px;border-bottom-right-radius:34px;padding:22px 18px 18px;box-shadow:0 22px 45px rgba(15,23,42,.25);display:flex;flex-direction:column;justify-content:space-between}.hero-user{display:flex;gap:14px;align-items:center;margin-top:8px}.hero-avatar,.contact-avatar{width:54px;height:54px;border-radius:50%;background:linear-gradient(135deg,#22c55e,#2563eb);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;flex:none;box-shadow:0 10px 20px rgba(0,0,0,.18)}.hero-user h1{margin:0 0 6px;font-size:24px}.hero-user p{margin:0;color:#d1fae5;font-size:13px}.hero-actions{display:flex;gap:10px;margin:24px 0 16px}.hero-actions a{flex:1;text-align:center;color:#fff;text-decoration:none;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:12px;font-weight:800}.chat-mode-tabs{display:flex;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.14);padding:6px;border-radius:999px;gap:6px}.chat-mode-tabs a{flex:1;text-align:center;text-decoration:none;color:#d1fae5;padding:12px;border-radius:999px;font-weight:900}.chat-mode-tabs a.active{background:#fff;color:#075e54}.mobile-chat-panel{margin-top:-58px;padding:0 14px 18px;display:grid;grid-template-columns:330px 1fr;gap:14px;align-items:stretch}.mobile-chat-list{background:#fff;border:1px solid #e2e8f0;border-radius:28px;padding:12px;max-height:70vh;overflow:auto;box-shadow:0 20px 45px rgba(15,23,42,.10)}.mobile-contact{display:flex;align-items:center;gap:12px;padding:12px;border-radius:22px;color:#0f172a;text-decoration:none;margin-bottom:8px;transition:.2s ease}.mobile-contact:hover,.mobile-contact.active{background:#e7f8ee}.contact-avatar{width:48px;height:48px;background:linear-gradient(135deg,#128c7e,#25d366)}.contact-avatar.group{background:linear-gradient(135deg,#2563eb,#7c3aed)}.contact-info{flex:1;min-width:0}.contact-info b{display:block;font-size:15px;margin-bottom:4px}.contact-info span{display:block;color:#64748b;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-contact em{background:#25d366;color:#fff;min-width:22px;height:22px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:12px;font-style:normal;font-weight:900}.mobile-conversation{background:#efeae2;border:1px solid #e2e8f0;border-radius:28px;overflow:hidden;min-height:70vh;display:flex;flex-direction:column;box-shadow:0 20px 45px rgba(15,23,42,.10)}.conversation-top{background:#f8fafc;border-bottom:1px solid #e2e8f0;padding:13px 16px;display:flex;align-items:center;gap:12px}.conversation-top h2{margin:0 0 4px;font-size:18px}.conversation-top p{margin:0;color:#64748b;font-size:12px}.conversation-messages{flex:1;padding:16px;overflow:auto;background:radial-gradient(circle at top left,rgba(37,99,235,.07),transparent 28%),radial-gradient(circle at bottom right,rgba(34,197,94,.10),transparent 30%),#efeae2}.message-line{display:flex;margin-bottom:10px}.message-line.mine{justify-content:flex-start}.message-line.theirs{justify-content:flex-end}.message-bubble-mobile{max-width:72%;background:#fff;border-radius:18px;padding:10px 12px;box-shadow:0 6px 16px rgba(15,23,42,.06)}.message-line.mine .message-bubble-mobile{background:#dcf8c6;border-bottom-left-radius:5px}.message-line.theirs .message-bubble-mobile{border-bottom-right-radius:5px}.message-meta{display:flex;justify-content:space-between;gap:18px;font-size:11px;color:#64748b;margin-bottom:4px}.message-bubble-mobile p{margin:0;line-height:1.75}.mobile-chat-img{display:block;max-width:260px;max-height:230px;border-radius:14px;margin-top:8px}.mobile-chat-audio{width:260px;margin-top:8px}.chat-download{display:inline-block;margin-top:8px;color:#075e54;font-weight:900;text-decoration:none}.mobile-send-bar{display:grid;grid-template-columns:48px 1fr 74px;gap:8px;padding:10px;background:#f8fafc;border-top:1px solid #e2e8f0;align-items:end}.mobile-send-bar textarea{min-height:46px!important;max-height:110px;border-radius:22px!important;padding:12px 14px!important}.mobile-send-bar button{height:46px;border-radius:22px!important;background:#25d366;color:#fff}.attach-btn{height:46px;width:46px;border-radius:50%;background:#075e54;color:#fff;display:flex!important;align-items:center;justify-content:center;font-size:26px;font-weight:400!important;cursor:pointer;margin:0!important}.attach-btn input{display:none}.mobile-group-create{background:#f8fafc;border:1px solid #e2e8f0;border-radius:22px;padding:12px;margin-bottom:10px}.mobile-group-create summary{font-weight:900;cursor:pointer}.mobile-members{display:grid;gap:8px;max-height:200px;overflow:auto;margin:10px 0}.mobile-members label{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:8px;font-weight:500!important}.mobile-empty{color:#64748b;text-align:center;padding:18px}
@media(max-width:760px){body:has(.mobile-chat-app) .sidebar{display:none!important}body:has(.mobile-chat-app) .content{padding:0!important}.mobile-chat-app{margin:0;min-height:100vh;background:#f1f5f9}.mobile-chat-hero{min-height:50vh;border-bottom-left-radius:36px;border-bottom-right-radius:36px;padding:22px 16px 74px}.mobile-chat-panel{display:flex;flex-direction:column;margin-top:-64px;padding:0 12px 16px}.mobile-chat-list{display:flex;gap:8px;overflow-x:auto;max-height:none;border-radius:24px;padding:10px}.mobile-chat-list::-webkit-scrollbar{display:none}.mobile-contact{flex:0 0 240px;margin:0;background:#fff}.mobile-group-create{flex:0 0 260px;margin:0}.mobile-conversation{min-height:calc(100vh - 260px);border-radius:26px}.conversation-messages{max-height:calc(100vh - 395px);min-height:300px;padding:12px}.message-bubble-mobile{max-width:88%}.mobile-chat-img{max-width:220px}.mobile-chat-audio{width:220px}.mobile-send-bar{grid-template-columns:44px 1fr 68px;position:sticky;bottom:0}}
@media(min-width:761px){body:has(.mobile-chat-app) .page-hero{display:none}}


/* =========================
   V12 Mobile App UI Shell
   هدفه: تحسين الواجهة والتنقل بدون تغيير المحتوى الداخلي
========================= */
:root{
  --app-dark:#0f172a;
  --app-dark-2:#111827;
  --app-blue:#2563eb;
  --app-green:#22c55e;
  --app-bg:#f3f6fb;
  --app-card:#ffffff;
  --app-line:#e2e8f0;
  --app-muted:#64748b;
  --app-shadow:0 18px 50px rgba(15,23,42,.10);
}

/* Desktop polish */
.sidebar a.active-link{
  background:rgba(255,255,255,.13)!important;
  border-color:rgba(255,255,255,.16)!important;
}
.app-mobile-topbar,
.app-drawer-backdrop,
.app-drawer-head{
  display:none;
}

/* Make cards more app-like everywhere */
.card,.kpi,.page-hero{
  border-radius:26px!important;
}
.btn,button,input,select,textarea{
  font-family:inherit;
}

/* Mobile app shell */
@media(max-width:820px){
  html,body{
    background:var(--app-bg)!important;
    overscroll-behavior:none;
  }

  body{
    padding-top:64px!important;
  }

  .layout{
    display:block!important;
    min-height:100vh!important;
  }

  .app-mobile-topbar{
    display:flex!important;
    position:fixed;
    top:0;
    right:0;
    left:0;
    height:64px;
    z-index:3000;
    align-items:center;
    gap:12px;
    padding:10px 14px;
    background:linear-gradient(135deg,#0f172a,#111827);
    color:#fff;
    box-shadow:0 12px 30px rgba(15,23,42,.22);
  }

  .app-menu-btn{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    border-radius:16px!important;
    border:1px solid rgba(255,255,255,.12)!important;
    background:rgba(255,255,255,.09)!important;
    color:#fff!important;
    font-size:24px!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  .app-topbar-title{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    line-height:1.2;
  }

  .app-topbar-title strong{
    font-size:16px;
    letter-spacing:.2px;
  }

  .app-topbar-title span{
    color:#cbd5e1;
    font-size:11px;
  }

  .app-topbar-notif{
    width:44px;
    height:44px;
    border-radius:16px;
    background:rgba(255,255,255,.09);
    color:#fff;
    text-decoration:none;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(255,255,255,.12);
  }

  .app-drawer-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.52);
    backdrop-filter:blur(4px);
    z-index:2998;
  }

  body.drawer-open .app-drawer-backdrop{
    display:block;
  }

  .sidebar{
    display:block!important;
    position:fixed!important;
    top:0!important;
    bottom:0!important;
    right:0!important;
    height:100vh!important;
    width:84vw!important;
    max-width:340px!important;
    min-width:0!important;
    z-index:2999!important;
    padding:16px!important;
    border-radius:0!important;
    transform:translateX(110%)!important;
    transition:transform .25s ease!important;
    overflow:auto!important;
    background:linear-gradient(180deg,#0f172a,#111827)!important;
    box-shadow:-18px 0 50px rgba(15,23,42,.30)!important;
  }

  .sidebar.drawer-active{
    transform:translateX(0)!important;
  }

  .app-drawer-head{
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
    padding:8px 4px 14px;
    border-bottom:1px solid rgba(255,255,255,.12);
    color:#fff;
  }

  .app-drawer-head strong{
    font-size:20px;
  }

  .app-drawer-head button{
    width:40px!important;
    height:40px!important;
    border-radius:14px!important;
    background:rgba(255,255,255,.10)!important;
    color:#fff!important;
    font-size:26px!important;
    line-height:1!important;
    padding:0!important;
  }

  .sidebar h1{
    font-size:22px!important;
    margin:4px 0 4px!important;
  }

  .sidebar p{
    font-size:12px!important;
    margin:0 0 10px!important;
  }

  .userbox{
    border-radius:20px!important;
    padding:14px!important;
    margin:12px 0!important;
  }

  .sidebar nav{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    overflow:visible!important;
    padding:0!important;
  }

  .sidebar nav a{
    margin:0!important;
    padding:14px 14px!important;
    border-radius:18px!important;
    background:rgba(255,255,255,.07)!important;
    border:1px solid rgba(255,255,255,.08)!important;
    white-space:normal!important;
    font-size:14px!important;
  }

  .sidebar .logout{
    background:#991b1b!important;
  }

  .content{
    padding:14px!important;
    min-height:calc(100vh - 64px)!important;
    width:100%!important;
  }

  .page-hero{
    padding:18px!important;
    border-radius:26px!important;
    margin-bottom:14px!important;
  }

  .page-hero h1{
    font-size:23px!important;
    margin-bottom:8px!important;
  }

  .page-hero p{
    font-size:13px!important;
    line-height:1.7!important;
  }

  .grid{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }

  .kpi{
    min-height:96px!important;
    padding:14px!important;
    border-radius:22px!important;
  }

  .kpi span{
    font-size:12px!important;
  }

  .kpi b{
    font-size:24px!important;
  }

  .card{
    border-radius:26px!important;
    margin-bottom:14px!important;
    overflow:hidden!important;
  }

  .head{
    padding:14px 16px!important;
  }

  .head h2{
    font-size:18px!important;
  }

  .body{
    padding:15px!important;
  }

  .form-grid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  input,select,textarea{
    border-radius:16px!important;
    padding:13px!important;
    font-size:15px!important;
  }

  textarea{
    min-height:96px!important;
  }

  .btn,button{
    border-radius:16px!important;
    padding:12px 15px!important;
  }

  table{
    display:block!important;
    overflow-x:auto!important;
    white-space:nowrap!important;
    border-radius:18px!important;
  }

  th,td{
    padding:11px!important;
    font-size:13px!important;
  }

  .quick-grid{
    grid-template-columns:1fr!important;
  }

  /* Full-screen task usage: give active content more space */
  .whatsapp-shell,
  .mobile-conversation,
  .card:has(form),
  .card:has(table){
    max-width:100%!important;
  }
}

/* Chat-specific cleanup for phone: not editing backend content */
@media(max-width:820px){
  body:has(.mobile-chat-app){
    padding-top:0!important;
  }

  body:has(.mobile-chat-app) .app-mobile-topbar{
    display:none!important;
  }

  body:has(.mobile-chat-app) .content{
    padding:0!important;
  }

  body:has(.mobile-chat-app) .sidebar{
    display:block!important;
  }

  .mobile-chat-app{
    min-height:100vh!important;
    margin:0!important;
    background:#f1f5f9!important;
  }

  .mobile-chat-hero{
    min-height:50vh!important;
    border-bottom-left-radius:36px!important;
    border-bottom-right-radius:36px!important;
    padding:24px 16px 76px!important;
  }

  .mobile-chat-panel{
    margin-top:-66px!important;
    padding:0 12px 16px!important;
    display:flex!important;
    flex-direction:column!important;
  }

  .mobile-chat-list{
    display:flex!important;
    gap:8px!important;
    overflow-x:auto!important;
    max-height:none!important;
    padding:10px!important;
    border-radius:24px!important;
  }

  .mobile-chat-list::-webkit-scrollbar{
    display:none!important;
  }

  .mobile-contact{
    flex:0 0 240px!important;
    margin:0!important;
    background:#fff!important;
  }

  .mobile-conversation{
    min-height:calc(100vh - 260px)!important;
    border-radius:26px!important;
  }

  .conversation-messages{
    min-height:310px!important;
    max-height:calc(100vh - 395px)!important;
    padding:12px!important;
  }

  .message-bubble-mobile{
    max-width:88%!important;
  }

  .mobile-send-bar{
    position:sticky!important;
    bottom:0!important;
    grid-template-columns:44px 1fr 68px!important;
  }
}


/* =========================
   V13 WhatsApp Exact Mobile Chat
========================= */
.wa-app-shell{
  background:#0b1115;
  color:#e9edef;
  min-height:100vh;
  direction:rtl;
}
.wa-home-screen{
  background:#0b1115;
  min-height:100vh;
  padding:22px 18px 86px;
}
.wa-main-header{
  position:sticky;
  top:0;
  z-index:30;
  background:#0b1115;
  padding-bottom:12px;
}
.wa-main-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}
.wa-main-top h1{
  margin:0;
  color:#f8fafc;
  font-size:34px;
  font-weight:900;
  letter-spacing:-.5px;
}
.wa-main-icons{
  display:flex;
  align-items:center;
  gap:10px;
}
.wa-main-icons a{
  width:38px;
  height:38px;
  border-radius:50%;
  color:#f8fafc;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:19px;
}
.wa-avatar-upload label{
  display:block;
  position:relative;
  cursor:pointer;
}
.wa-avatar-upload input{display:none}
.wa-small-photo{
  width:38px;
  height:38px;
  border-radius:50%;
  object-fit:cover;
}
.wa-search{
  display:flex;
  align-items:center;
  gap:10px;
  background:#202c33;
  border-radius:28px;
  padding:0 16px;
  height:56px;
  margin-bottom:18px;
}
.wa-search span{
  color:#8696a0;
  font-size:25px;
}
.wa-search input{
  background:transparent!important;
  border:0!important;
  color:#e9edef!important;
  box-shadow:none!important;
  padding:0!important;
  font-size:18px!important;
}
.wa-search input::placeholder{
  color:#8696a0;
}
.wa-filter-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
}
.wa-filter-tabs::-webkit-scrollbar{display:none}
.wa-filter-tabs a{
  color:#aebac1;
  text-decoration:none;
  background:#111b21;
  border:1px solid #26343c;
  border-radius:999px;
  padding:9px 17px;
  font-size:14px;
  white-space:nowrap;
}
.wa-filter-tabs a.active{
  background:#0a4a36;
  color:#d9fdd3;
  border-color:#0a4a36;
}
.wa-chat-list-screen{
  margin-top:14px;
}
.wa-chat-row{
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  color:#e9edef;
  padding:13px 2px;
  border-bottom:1px solid rgba(134,150,160,.10);
  position:relative;
}
.wa-chat-row.active{
  background:rgba(255,255,255,.04);
  border-radius:12px;
  padding-right:8px;
}
.wa-photo{
  width:58px;
  height:58px;
  border-radius:50%;
  object-fit:cover;
  flex:none;
}
.wa-letter{
  background:#128c7e;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:22px;
  font-weight:900;
}
.wa-letter.group{
  background:#3b1241;
}
.wa-row-body{
  flex:1;
  min-width:0;
}
.wa-row-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:5px;
}
.wa-row-title b{
  color:#f8fafc;
  font-size:18px;
  font-weight:500;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.wa-row-title time{
  color:#8696a0;
  font-size:13px;
}
.wa-chat-row p{
  color:#8696a0;
  margin:0;
  font-size:15px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.wa-unread-badge{
  background:#25d366;
  color:#0b1115;
  min-width:24px;
  height:24px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-style:normal;
  font-weight:900;
  font-size:12px;
  margin-right:auto;
}
.wa-floating-action{
  position:fixed;
  left:22px;
  bottom:92px;
  width:64px;
  height:64px;
  border-radius:20px;
  background:#25d366;
  color:#0b1115;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:36px;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 10px 30px rgba(0,0,0,.28);
}
.wa-create-group{
  background:#111b21;
  border:1px solid #26343c;
  border-radius:18px;
  padding:12px;
  margin-bottom:12px;
}
.wa-create-group summary{
  color:#e9edef;
  font-weight:800;
}
.wa-create-group input{
  margin-top:10px;
}
.wa-members{
  max-height:180px;
  overflow:auto;
  display:grid;
  gap:8px;
  margin:10px 0;
}
.wa-members label{
  color:#d1d7db;
  background:#202c33;
  border-radius:12px;
  padding:8px;
}

/* Conversation */
.wa-conversation-screen{
  position:fixed;
  inset:0;
  z-index:5000;
  display:flex;
  flex-direction:column;
  background:#0b141a;
  color:#e9edef;
}
.wa-conv-header{
  height:66px;
  background:#202c33;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  flex:none;
}
.wa-back{
  width:34px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#e9edef;
  text-decoration:none;
  font-size:38px;
  line-height:1;
}
.wa-conv-header .wa-photo{
  width:43px;
  height:43px;
}
.wa-conv-title{
  flex:1;
  min-width:0;
}
.wa-conv-title h2{
  margin:0;
  font-size:17px;
  color:#f8fafc;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.wa-conv-title p{
  margin:3px 0 0;
  color:#aebac1;
  font-size:12px;
}
.wa-message-area{
  flex:1;
  overflow:auto;
  padding:14px 10px 18px;
  background:
    linear-gradient(rgba(11,20,26,.90),rgba(11,20,26,.90)),
    radial-gradient(circle at top left,rgba(37,211,102,.08),transparent 35%),
    radial-gradient(circle at bottom right,rgba(18,140,126,.10),transparent 35%);
}
.wa-message-line{
  display:flex;
  margin-bottom:8px;
}
.wa-message-line.mine{
  justify-content:flex-start;
}
.wa-message-line.theirs{
  justify-content:flex-end;
}
.wa-bubble-real{
  max-width:78%;
  padding:7px 9px 5px;
  border-radius:12px;
  background:#202c33;
  color:#e9edef;
  box-shadow:0 1px 2px rgba(0,0,0,.18);
}
.wa-message-line.mine .wa-bubble-real{
  background:#005c4b;
  border-bottom-left-radius:4px;
}
.wa-message-line.theirs .wa-bubble-real{
  border-bottom-right-radius:4px;
}
.wa-bubble-real strong{
  display:block;
  color:#25d366;
  font-size:12px;
  margin-bottom:2px;
}
.wa-bubble-real p{
  margin:0;
  font-size:15px;
  line-height:1.55;
}
.wa-bubble-real span{
  display:block;
  text-align:left;
  color:#aebac1;
  font-size:10px;
  margin-top:2px;
}
.wa-msg-img{
  max-width:240px;
  max-height:260px;
  border-radius:10px;
  display:block;
}
.wa-msg-audio{
  width:240px;
}
.wa-download{
  color:#25d366;
  font-weight:800;
}
.wa-compose{
  min-height:62px;
  background:#0b141a;
  display:grid;
  grid-template-columns:44px 1fr 46px;
  gap:8px;
  align-items:end;
  padding:8px;
  flex:none;
}
.wa-attach{
  width:44px;
  height:44px;
  border-radius:50%;
  background:#202c33;
  color:#aebac1;
  display:flex!important;
  align-items:center;
  justify-content:center;
  font-size:26px;
  margin:0!important;
}
.wa-attach input{
  display:none;
}
.wa-compose textarea{
  min-height:44px!important;
  max-height:110px;
  border-radius:22px!important;
  background:#202c33!important;
  border:0!important;
  color:#e9edef!important;
  padding:12px 14px!important;
  font-size:15px!important;
}
.wa-compose textarea::placeholder{
  color:#8696a0;
}
.wa-compose button{
  width:46px;
  height:46px;
  border-radius:50%!important;
  background:#00a884!important;
  color:#fff!important;
  padding:0!important;
  font-size:18px!important;
}
.wa-empty,.wa-empty-center{
  color:#8696a0;
  text-align:center;
  padding:18px;
}
.wa-empty-center{
  margin-top:40%;
}
@media(min-width:821px){
  .wa-app-shell{
    border-radius:26px;
    overflow:hidden;
  }
  .wa-home-screen{
    min-height:760px;
  }
}
@media(max-width:820px){
  body:has(.wa-app-shell){
    padding-top:0!important;
    background:#0b1115!important;
  }
  body:has(.wa-app-shell) .sidebar,
  body:has(.wa-app-shell) .app-mobile-topbar{
    display:none!important;
  }
  body:has(.wa-app-shell) .content{
    padding:0!important;
  }
  .wa-home-screen{
    padding:28px 18px 92px;
  }
  .wa-main-top h1{
    font-size:34px;
  }
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  background:#eef2f7;
  color:#111827;
  font-family:Tahoma,Arial,sans-serif;
}

/* Login */
.login{
  min-height:100vh;
  background:linear-gradient(135deg,#0f172a,#1e293b);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.login-card{
  width:100%;
  max-width:460px;
  background:#fff;
  border-radius:26px;
  padding:36px;
  box-shadow:0 22px 60px rgba(0,0,0,.25);
}
.login-card h1{margin:0 0 10px;font-size:34px}
.login-card p{color:#64748b;line-height:1.8}

/* Form */
.field{margin-bottom:14px}
label{display:block;font-weight:700;margin-bottom:7px}
input,select,textarea{
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:12px;
  padding:12px;
  font-size:14px;
  background:#fff;
}
textarea{min-height:110px;resize:vertical}
.btn,button{
  border:0;
  border-radius:12px;
  padding:11px 15px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}
.primary{background:#2563eb;color:#fff}
.light{background:#f1f5f9;color:#334155}
.green{background:#dcfce7;color:#047857}
.red{background:#fee2e2;color:#b91c1c}
.orange{background:#ffedd5;color:#c2410c}

/* Fixed app layout */
.layout{
  min-height:100vh;
  display:flex;
  flex-direction:row-reverse;
  align-items:stretch;
  width:100%;
}
.sidebar{
  width:300px;
  min-width:300px;
  background:#0f172a;
  color:#fff;
  padding:26px 20px;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  direction:rtl;
}
.content{
  flex:1;
  min-width:0;
  padding:28px;
  background:#eef2f7;
  direction:rtl;
  display:block;
}
.sidebar h1{margin:0 0 8px;font-size:26px}
.sidebar p{color:#cbd5e1;margin-top:0}
.userbox{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  padding:16px;
  margin:22px 0;
}
.userbox b,.userbox span{display:block}
.userbox span{font-size:12px;color:#cbd5e1;margin-top:6px}
.sidebar nav a{
  display:block;
  color:#fff;
  text-decoration:none;
  padding:14px 13px;
  border-radius:12px;
  margin-bottom:8px;
  transition:.2s;
}
.sidebar nav a:hover{background:rgba(255,255,255,.09)}
.sidebar .logout{background:#991b1b;margin-top:20px;text-align:center}

.page-hero{
  background:linear-gradient(135deg,#fff,#f8fafc);
  border:1px solid #e5e7eb;
  border-radius:24px;
  padding:24px;
  margin-bottom:22px;
  box-shadow:0 14px 35px rgba(15,23,42,.08);
}
.page-hero h1{margin:0 0 8px;font-size:30px;color:#0f172a}
.page-hero p{margin:0;color:#64748b;line-height:1.8}

.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:22px;
}
.kpi,.card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:22px;
  box-shadow:0 14px 35px rgba(15,23,42,.08);
}
.kpi{
  padding:20px;
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.kpi span{color:#64748b}
.kpi b{display:block;font-size:32px;margin-top:8px;color:#0f172a}
.card{margin-bottom:22px;overflow:hidden}
.head{
  padding:18px 22px;
  border-bottom:1px solid #e5e7eb;
  background:#fff;
}
.head h2{margin:0;font-size:22px}
.body{padding:22px}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.full{grid-column:1/-1}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
table{width:100%;border-collapse:collapse}
th,td{
  padding:12px;
  border-bottom:1px solid #e5e7eb;
  text-align:right;
  vertical-align:top;
}
th{background:#f8fafc;color:#475569;font-size:13px}
.badge{
  display:inline-block;
  padding:7px 10px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
}
.pending{background:#fff7ed;color:#c2410c}
.approved{background:#ecfdf5;color:#047857}
.rejected{background:#fef2f2;color:#b91c1c}
.reviewed{background:#eef2ff;color:#4338ca}
.alert{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;border-radius:12px;padding:12px;margin:12px 0}
.muted{color:#64748b}
.reply{background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:12px;margin:10px 0}
.reply small{display:block;color:#64748b;margin-top:4px}

.quick-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin-top:16px;
}
.quick-card{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
}
.quick-card h3{margin:0 0 8px;font-size:18px}
.quick-card p{margin:0 0 14px;color:#64748b;line-height:1.7}

/* Tablet */
@media(max-width:1100px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick-grid{grid-template-columns:1fr}
}

/* Mobile only */
@media(max-width:600px){
  .layout{display:block}
  .sidebar{
    width:100%;
    min-width:0;
    height:auto;
    position:relative;
  }
  .content{padding:16px}
  .grid,.form-grid,.quick-grid{grid-template-columns:1fr}
  table{display:block;overflow:auto;white-space:nowrap}
}


/* Internal Chat */
.chat-layout{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:18px;
  align-items:start;
}
.chat-contacts .body{
  max-height:72vh;
  overflow:auto;
}
.contact-item{
  display:block;
  text-decoration:none;
  color:#111827;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:14px;
  margin-bottom:10px;
  position:relative;
}
.contact-item:hover,
.contact-item.active{
  border-color:#2563eb;
  background:#eff6ff;
}
.contact-item b{
  display:block;
  margin-bottom:6px;
}
.contact-item span{
  display:block;
  color:#64748b;
  font-size:12px;
}
.contact-item em{
  position:absolute;
  left:12px;
  top:12px;
  background:#dc2626;
  color:#fff;
  border-radius:999px;
  padding:3px 8px;
  font-style:normal;
  font-size:12px;
  font-weight:700;
}
.messages{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:16px;
  min-height:360px;
  max-height:540px;
  overflow:auto;
}
.message-row{
  display:flex;
  margin-bottom:12px;
}
.message-row.mine{
  justify-content:flex-start;
}
.message-row.theirs{
  justify-content:flex-end;
}
.message-bubble{
  max-width:72%;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:12px 14px;
}
.message-row.mine .message-bubble{
  background:#eff6ff;
  border-color:#bfdbfe;
}
.msg-meta{
  display:flex;
  gap:10px;
  justify-content:space-between;
  color:#64748b;
  font-size:12px;
  margin-bottom:8px;
}
.message-bubble p{
  margin:0 0 8px;
  line-height:1.8;
}
.chat-img{
  max-width:260px;
  max-height:220px;
  border-radius:14px;
  display:block;
  margin-top:8px;
}
.chat-audio{
  width:260px;
  margin-top:8px;
}
.chat-form{
  margin-top:16px;
}
@media(max-width:900px){
  .chat-layout{grid-template-columns:1fr}
  .message-bubble{max-width:92%}
}


/* V5 Chat polish + Tasks */
.chat-layout{display:grid;grid-template-columns:340px 1fr;gap:20px}
.chat-contacts .body{max-height:72vh;overflow:auto}
.contact-item{display:block;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;margin-bottom:12px;text-decoration:none;color:#111827;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.contact-item:hover,.contact-item.active{background:#eff6ff;border-color:#2563eb}
.contact-item b{display:block;font-size:16px;margin-bottom:6px}
.contact-item span{display:block;color:#64748b;font-size:13px;line-height:1.6}
.contact-item em{float:left;background:#dc2626;color:#fff;font-style:normal;border-radius:999px;padding:3px 9px;font-size:12px}
.messages{background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:16px;min-height:420px;max-height:560px;overflow:auto}
.message-row{display:flex;margin-bottom:12px}
.message-row.mine{justify-content:flex-start}
.message-row.theirs{justify-content:flex-end}
.message-bubble{max-width:72%;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:12px 14px;box-shadow:0 6px 18px rgba(15,23,42,.04)}
.message-row.mine .message-bubble{background:#eff6ff;border-color:#bfdbfe}
.msg-meta{display:flex;gap:10px;justify-content:space-between;color:#64748b;font-size:12px;margin-bottom:8px}
.message-bubble p{margin:0 0 8px;line-height:1.8}
.chat-img{max-width:260px;max-height:220px;border-radius:14px;display:block;margin-top:8px}
.chat-audio{width:260px;margin-top:8px}
.chat-form{margin-top:16px}
@media(max-width:900px){.chat-layout{grid-template-columns:1fr}.message-bubble{max-width:92%}}

/* =========================
   V6 Professional UI Upgrade
========================= */
:root{
  --ga-bg:#eef3f8;
  --ga-card:#ffffff;
  --ga-dark:#0f172a;
  --ga-blue:#2563eb;
  --ga-green:#16a34a;
  --ga-line:#e2e8f0;
  --ga-muted:#64748b;
  --ga-shadow:0 20px 55px rgba(15,23,42,.10);
}
body{background:var(--ga-bg)}
.sidebar{
  background:linear-gradient(180deg,#0f172a,#111827);
  box-shadow:0 0 35px rgba(15,23,42,.22);
}
.sidebar nav a{
  border:1px solid transparent;
  font-weight:700;
}
.sidebar nav a:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.08);
  transform:translateX(-3px);
}
.card,.kpi,.page-hero{
  border-radius:28px!important;
  box-shadow:var(--ga-shadow)!important;
  animation:gaFade .35s ease both;
}
@keyframes gaFade{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
.btn,button{transition:.2s ease}
.btn:hover,button:hover{transform:translateY(-1px);filter:brightness(.98)}
.kpi{position:relative;overflow:hidden}
.kpi:after{
  content:"";
  position:absolute;
  left:-28px;
  top:-28px;
  width:90px;
  height:90px;
  background:rgba(37,99,235,.08);
  border-radius:50%;
}
.head{background:linear-gradient(90deg,#fff,#f8fafc)}
input,select,textarea{transition:.2s ease}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

/* WhatsApp-like chat */
.whatsapp-shell{
  display:grid;
  grid-template-columns:360px 1fr;
  gap:0;
  background:#fff;
  border:1px solid var(--ga-line);
  border-radius:28px;
  overflow:hidden;
  box-shadow:var(--ga-shadow);
  min-height:680px;
}
.wa-sidebar{
  background:#f8fafc;
  border-left:1px solid var(--ga-line);
  display:flex;
  flex-direction:column;
}
.wa-head{padding:18px;background:#075e54;color:#fff}
.wa-head h2{margin:0;font-size:22px}
.wa-head p{margin:6px 0 0;color:#d1fae5;font-size:13px}
.wa-tabs{display:flex;gap:8px;padding:12px;background:#fff;border-bottom:1px solid var(--ga-line)}
.wa-tabs a{flex:1;text-align:center;text-decoration:none;color:#0f172a;padding:10px;border-radius:999px;background:#f1f5f9;font-weight:800;font-size:13px}
.wa-tabs a.active{background:#dcfce7;color:#166534}
.wa-list{padding:12px;overflow:auto;max-height:560px}
.wa-contact{display:flex;gap:12px;align-items:center;padding:12px;border-radius:18px;text-decoration:none;color:#0f172a;margin-bottom:8px;transition:.2s}
.wa-contact:hover,.wa-contact.active{background:#e2f7e9}
.wa-avatar{width:46px;height:46px;border-radius:50%;background:#128c7e;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;flex:none}
.wa-contact b{display:block;margin-bottom:4px}
.wa-contact span{display:block;color:#64748b;font-size:12px}
.wa-unread{margin-right:auto;background:#25d366;color:#fff;min-width:22px;height:22px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:900}
.wa-chat{background:#efeae2;display:flex;flex-direction:column;min-width:0}
.wa-chat-head{padding:16px 20px;background:#f8fafc;border-bottom:1px solid var(--ga-line);display:flex;align-items:center;gap:12px}
.wa-chat-head h2{margin:0;font-size:20px}
.wa-chat-head span{color:#64748b;font-size:13px}
.wa-messages{padding:20px;flex:1;overflow:auto;max-height:560px}
.wa-msg-row{display:flex;margin-bottom:12px}
.wa-msg-row.mine{justify-content:flex-start}
.wa-msg-row.theirs{justify-content:flex-end}
.wa-bubble{max-width:68%;padding:10px 13px;border-radius:16px;background:#fff;box-shadow:0 5px 15px rgba(15,23,42,.06)}
.wa-msg-row.mine .wa-bubble{background:#dcf8c6}
.wa-meta{display:flex;justify-content:space-between;gap:14px;color:#64748b;font-size:11px;margin-bottom:6px}
.wa-bubble p{margin:0 0 6px;line-height:1.8}
.wa-img{max-width:280px;max-height:220px;border-radius:14px;display:block}
.wa-audio{width:280px}
.wa-form{padding:14px;background:#f8fafc;border-top:1px solid var(--ga-line)}
.wa-form-row{display:grid;grid-template-columns:1fr 210px 90px;gap:10px;align-items:center}
.group-create{padding:12px;background:#fff;border-bottom:1px solid var(--ga-line)}
.group-create details{background:#f8fafc;border:1px solid var(--ga-line);border-radius:18px;padding:12px}
.group-member-list{max-height:180px;overflow:auto;display:grid;gap:8px}
.group-member-list label{background:#fff;border:1px solid var(--ga-line);border-radius:12px;padding:8px;font-weight:400}
.task-form-card{border:2px solid rgba(37,99,235,.08)}
.task-empty{background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;border-radius:18px;padding:16px}
.task-comments{background:#f8fafc;border:1px solid var(--ga-line);border-radius:16px;padding:12px;margin-top:10px}
.task-comment{background:#fff;border:1px solid var(--ga-line);border-radius:14px;padding:10px;margin-bottom:8px}
.task-comment small{display:block;color:#64748b;margin-top:4px}
@media(max-width:1000px){
  .whatsapp-shell{grid-template-columns:1fr}
  .wa-sidebar{border-left:0;border-bottom:1px solid var(--ga-line)}
  .wa-list{max-height:300px}
  .wa-form-row{grid-template-columns:1fr}
  .wa-bubble{max-width:90%}
}

/* =========================
   V7 Mobile-first + Notifications
========================= */
.nav-badge{
  display:inline-flex;
  background:#ef4444;
  color:#fff;
  min-width:22px;
  height:22px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  font-size:12px;
  margin-right:8px;
}
.notification-list{display:grid;gap:12px}
.notification-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  border:1px solid var(--ga-line);
  border-radius:18px;
  padding:14px;
  background:#fff;
}
.notification-item.unread{
  border-color:#2563eb;
  background:#eff6ff;
}
.notification-item b{display:block;margin-bottom:5px}
.notification-item p{margin:0 0 5px;color:#475569;line-height:1.7}
.notification-item small{color:#64748b}

@media(max-width:700px){
  body{background:#f1f5f9}
  .layout{display:flex;flex-direction:column}
  .sidebar{
    width:100%;
    min-width:0;
    height:auto;
    position:sticky;
    top:0;
    z-index:10;
    padding:14px;
    border-bottom-left-radius:22px;
    border-bottom-right-radius:22px;
  }
  .sidebar h1{font-size:22px;margin-bottom:4px}
  .sidebar p{font-size:12px;margin-bottom:8px}
  .userbox{margin:10px 0;padding:10px;border-radius:14px}
  .sidebar nav{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-bottom:4px;
  }
  .sidebar nav a{
    white-space:nowrap;
    flex:0 0 auto;
    background:rgba(255,255,255,.08);
    padding:10px 12px;
    font-size:13px;
  }
  .sidebar .logout{background:#991b1b!important}
  .content{padding:14px}
  .page-hero{border-radius:22px!important;padding:18px}
  .page-hero h1{font-size:24px}
  .grid{grid-template-columns:1fr 1fr!important;gap:10px}
  .kpi{min-height:95px;padding:14px;border-radius:20px!important}
  .kpi b{font-size:24px}
  .card{border-radius:22px!important}
  .head{padding:14px 16px}
  .head h2{font-size:19px}
  .body{padding:16px}
  .form-grid{grid-template-columns:1fr!important}
  table{display:block;overflow-x:auto;white-space:nowrap;border-radius:14px}
  .whatsapp-shell{min-height:calc(100vh - 230px);border-radius:22px}
  .wa-chat{min-height:560px}
  .wa-messages{max-height:420px;padding:14px}
  .wa-form-row{grid-template-columns:1fr!important}
  .wa-bubble{max-width:92%}
  .wa-sidebar{max-height:420px}
  .wa-list{max-height:260px}
  .notification-item{flex-direction:column;align-items:flex-start}
}

/* V8 Advanced Reports */
.employee-sheet{
  border:1px solid #cbd5e1;
  border-radius:18px;
  overflow:hidden;
  margin-bottom:18px;
  background:#fff;
}
.employee-name-line{
  text-align:center;
  padding:14px;
  border-bottom:1px solid #cbd5e1;
}
.employee-name-line b{display:block;font-size:18px;margin-bottom:6px}
.employee-name-line span{color:#64748b;font-size:13px}
.sheet-row{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.1fr;
}
.sheet-row>div{
  padding:14px;
  border-left:1px solid #cbd5e1;
  min-height:58px;
  text-align:center;
}
.sheet-row>div:last-child{border-left:0}
.sheet-head>div{
  background:#1f3763;
  color:#fff;
  font-weight:900;
  border-radius:0;
}
.mini-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0;
}
.mini-stats span{
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:999px;
  padding:9px 13px;
  font-weight:700;
  color:#334155;
}
.manager-review-box{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:16px;
  margin:16px 0;
}
@media(max-width:700px){
  .sheet-row{
    grid-template-columns:1fr;
  }
  .sheet-row>div{
    border-left:0;
    border-bottom:1px solid #cbd5e1;
  }
}

/* V9 Manual Supervisor Report */
.manual-report-header{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;
  gap:14px;
  margin:18px 0 14px;
}
.manual-report-header>div{
  background:#1f3763;
  color:#fff;
  border-radius:16px;
  padding:15px;
  text-align:center;
  font-weight:900;
  box-shadow:0 10px 22px rgba(31,55,99,.15);
}
.manual-employee-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:24px;
  padding:18px;
  margin:18px 0;
  box-shadow:0 14px 35px rgba(15,23,42,.06);
}
.manual-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;
  gap:14px;
}
.task-details-box{
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:20px;
  padding:16px;
  margin:14px 0;
}
.task-details-box h3{
  margin-top:0;
  text-align:center;
}
.big-add-btn{
  min-width:220px;
  font-size:17px;
  border-radius:18px;
  padding:15px 22px;
}
.manual-report-row{
  display:grid;
  grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;
  border:1px solid #e2e8f0;
  border-radius:16px;
  overflow:hidden;
  margin-bottom:10px;
}
.manual-report-row>div{
  padding:14px;
  border-left:1px solid #e2e8f0;
  text-align:center;
}
.manual-report-row>div:last-child{border-left:0}
.employee-task-section{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:20px;
  padding:16px;
  margin-bottom:18px;
}
.employee-task-section h3{
  margin-top:0;
  color:#1f3763;
}
@media(max-width:900px){
  .manual-report-header,.manual-grid,.manual-report-row{
    grid-template-columns:1fr;
  }
  .manual-report-row>div{
    border-left:0;
    border-bottom:1px solid #e2e8f0;
  }
}

/* =========================
   V10 Mobile PWA App Polish
========================= */
@media(max-width:760px){
  html,body{
    overscroll-behavior:none;
    -webkit-tap-highlight-color:transparent;
  }
  body{
    background:#f3f6fb;
    font-size:14px;
  }
  .layout{
    display:flex!important;
    flex-direction:column!important;
    min-height:100vh;
  }
  .sidebar{
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    position:sticky!important;
    top:0!important;
    z-index:1000!important;
    padding:12px 12px 10px!important;
    border-bottom-left-radius:26px!important;
    border-bottom-right-radius:26px!important;
    box-shadow:0 14px 35px rgba(15,23,42,.22)!important;
  }
  .sidebar h1{
    font-size:21px!important;
    margin:0 0 3px!important;
  }
  .sidebar p{
    font-size:12px!important;
    margin:0 0 8px!important;
  }
  .userbox{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin:8px 0 10px!important;
    padding:10px 12px!important;
    border-radius:18px!important;
  }
  .userbox b{font-size:14px}
  .userbox span{font-size:11px!important}
  .sidebar nav{
    display:flex!important;
    overflow-x:auto!important;
    gap:8px!important;
    padding:2px 0 6px!important;
    scroll-snap-type:x mandatory;
  }
  .sidebar nav::-webkit-scrollbar{display:none}
  .sidebar nav a{
    scroll-snap-align:start;
    flex:0 0 auto!important;
    min-width:max-content;
    margin:0!important;
    padding:10px 13px!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.09)!important;
    border:1px solid rgba(255,255,255,.08)!important;
    font-size:13px!important;
  }
  .sidebar .logout{
    background:#991b1b!important;
  }
  .content{
    padding:14px!important;
    padding-bottom:34px!important;
  }
  .page-hero{
    padding:18px!important;
    border-radius:24px!important;
    margin-bottom:14px!important;
  }
  .page-hero h1{font-size:23px!important}
  .page-hero p{font-size:13px!important}
  .card,.kpi{
    border-radius:24px!important;
  }
  .grid{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }
  .kpi{
    padding:14px!important;
    min-height:94px!important;
  }
  .kpi b{font-size:24px!important}
  .kpi span{font-size:12px!important}
  .head{
    padding:14px 16px!important;
  }
  .head h2{font-size:18px!important}
  .body{padding:15px!important}
  input,select,textarea{
    border-radius:16px!important;
    padding:13px!important;
    font-size:15px!important;
  }
  .btn,button{
    border-radius:16px!important;
    padding:12px 15px!important;
  }
  .form-grid{
    grid-template-columns:1fr!important;
  }
  table{
    display:block!important;
    overflow-x:auto!important;
    white-space:nowrap!important;
    border-radius:18px!important;
  }

  /* WhatsApp mobile polish */
  .whatsapp-shell{
    display:flex!important;
    flex-direction:column!important;
    min-height:calc(100vh - 210px)!important;
    border-radius:26px!important;
    overflow:hidden!important;
  }
  .wa-sidebar{
    max-height:none!important;
    border-left:0!important;
    border-bottom:1px solid #e2e8f0!important;
  }
  .wa-head{
    padding:14px 16px!important;
  }
  .wa-head h2{font-size:19px!important}
  .wa-tabs{
    padding:10px!important;
  }
  .wa-list{
    display:flex!important;
    overflow-x:auto!important;
    max-height:none!important;
    padding:10px!important;
    gap:8px!important;
  }
  .wa-list::-webkit-scrollbar{display:none}
  .wa-contact{
    flex:0 0 230px!important;
    margin:0!important;
    background:#fff!important;
  }
  .wa-chat{
    min-height:520px!important;
  }
  .wa-chat-head{
    padding:12px!important;
  }
  .wa-chat-head h2{font-size:17px!important}
  .wa-avatar{
    width:42px!important;
    height:42px!important;
  }
  .wa-messages{
    padding:12px!important;
    max-height:420px!important;
  }
  .wa-bubble{
    max-width:88%!important;
    border-radius:18px!important;
    padding:10px 12px!important;
  }
  .wa-img{
    max-width:230px!important;
    max-height:220px!important;
  }
  .wa-audio{
    width:230px!important;
  }
  .wa-form{
    padding:10px!important;
  }
  .wa-form-row{
    grid-template-columns:1fr!important;
    gap:8px!important;
  }

  /* Manual report mobile */
  .manual-report-header,.manual-grid,.manual-report-row{
    grid-template-columns:1fr!important;
  }
  .manual-report-header>div{
    border-radius:14px!important;
    padding:12px!important;
  }
  .manual-employee-card{
    border-radius:24px!important;
    padding:14px!important;
  }
  .big-add-btn{
    width:100%!important;
    min-width:0!important;
  }
}

/* PWA safe area */
@supports(padding:max(0px)){
  @media(max-width:760px){
    .sidebar{padding-top:max(12px, env(safe-area-inset-top))!important}
    .content{padding-bottom:max(34px, env(safe-area-inset-bottom))!important}
  }
}

/* V11 Mobile WhatsApp-like Chat UI */
.mobile-chat-app{margin:-12px}.mobile-chat-hero{min-height:50vh;background:linear-gradient(155deg,#075e54 0%,#0f172a 62%,#111827 100%);color:#fff;border-bottom-left-radius:34px;border-bottom-right-radius:34px;padding:22px 18px 18px;box-shadow:0 22px 45px rgba(15,23,42,.25);display:flex;flex-direction:column;justify-content:space-between}.hero-user{display:flex;gap:14px;align-items:center;margin-top:8px}.hero-avatar,.contact-avatar{width:54px;height:54px;border-radius:50%;background:linear-gradient(135deg,#22c55e,#2563eb);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;flex:none;box-shadow:0 10px 20px rgba(0,0,0,.18)}.hero-user h1{margin:0 0 6px;font-size:24px}.hero-user p{margin:0;color:#d1fae5;font-size:13px}.hero-actions{display:flex;gap:10px;margin:24px 0 16px}.hero-actions a{flex:1;text-align:center;color:#fff;text-decoration:none;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:12px;font-weight:800}.chat-mode-tabs{display:flex;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.14);padding:6px;border-radius:999px;gap:6px}.chat-mode-tabs a{flex:1;text-align:center;text-decoration:none;color:#d1fae5;padding:12px;border-radius:999px;font-weight:900}.chat-mode-tabs a.active{background:#fff;color:#075e54}.mobile-chat-panel{margin-top:-58px;padding:0 14px 18px;display:grid;grid-template-columns:330px 1fr;gap:14px;align-items:stretch}.mobile-chat-list{background:#fff;border:1px solid #e2e8f0;border-radius:28px;padding:12px;max-height:70vh;overflow:auto;box-shadow:0 20px 45px rgba(15,23,42,.10)}.mobile-contact{display:flex;align-items:center;gap:12px;padding:12px;border-radius:22px;color:#0f172a;text-decoration:none;margin-bottom:8px;transition:.2s ease}.mobile-contact:hover,.mobile-contact.active{background:#e7f8ee}.contact-avatar{width:48px;height:48px;background:linear-gradient(135deg,#128c7e,#25d366)}.contact-avatar.group{background:linear-gradient(135deg,#2563eb,#7c3aed)}.contact-info{flex:1;min-width:0}.contact-info b{display:block;font-size:15px;margin-bottom:4px}.contact-info span{display:block;color:#64748b;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-contact em{background:#25d366;color:#fff;min-width:22px;height:22px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:12px;font-style:normal;font-weight:900}.mobile-conversation{background:#efeae2;border:1px solid #e2e8f0;border-radius:28px;overflow:hidden;min-height:70vh;display:flex;flex-direction:column;box-shadow:0 20px 45px rgba(15,23,42,.10)}.conversation-top{background:#f8fafc;border-bottom:1px solid #e2e8f0;padding:13px 16px;display:flex;align-items:center;gap:12px}.conversation-top h2{margin:0 0 4px;font-size:18px}.conversation-top p{margin:0;color:#64748b;font-size:12px}.conversation-messages{flex:1;padding:16px;overflow:auto;background:radial-gradient(circle at top left,rgba(37,99,235,.07),transparent 28%),radial-gradient(circle at bottom right,rgba(34,197,94,.10),transparent 30%),#efeae2}.message-line{display:flex;margin-bottom:10px}.message-line.mine{justify-content:flex-start}.message-line.theirs{justify-content:flex-end}.message-bubble-mobile{max-width:72%;background:#fff;border-radius:18px;padding:10px 12px;box-shadow:0 6px 16px rgba(15,23,42,.06)}.message-line.mine .message-bubble-mobile{background:#dcf8c6;border-bottom-left-radius:5px}.message-line.theirs .message-bubble-mobile{border-bottom-right-radius:5px}.message-meta{display:flex;justify-content:space-between;gap:18px;font-size:11px;color:#64748b;margin-bottom:4px}.message-bubble-mobile p{margin:0;line-height:1.75}.mobile-chat-img{display:block;max-width:260px;max-height:230px;border-radius:14px;margin-top:8px}.mobile-chat-audio{width:260px;margin-top:8px}.chat-download{display:inline-block;margin-top:8px;color:#075e54;font-weight:900;text-decoration:none}.mobile-send-bar{display:grid;grid-template-columns:48px 1fr 74px;gap:8px;padding:10px;background:#f8fafc;border-top:1px solid #e2e8f0;align-items:end}.mobile-send-bar textarea{min-height:46px!important;max-height:110px;border-radius:22px!important;padding:12px 14px!important}.mobile-send-bar button{height:46px;border-radius:22px!important;background:#25d366;color:#fff}.attach-btn{height:46px;width:46px;border-radius:50%;background:#075e54;color:#fff;display:flex!important;align-items:center;justify-content:center;font-size:26px;font-weight:400!important;cursor:pointer;margin:0!important}.attach-btn input{display:none}.mobile-group-create{background:#f8fafc;border:1px solid #e2e8f0;border-radius:22px;padding:12px;margin-bottom:10px}.mobile-group-create summary{font-weight:900;cursor:pointer}.mobile-members{display:grid;gap:8px;max-height:200px;overflow:auto;margin:10px 0}.mobile-members label{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:8px;font-weight:500!important}.mobile-empty{color:#64748b;text-align:center;padding:18px}
@media(max-width:760px){body:has(.mobile-chat-app) .sidebar{display:none!important}body:has(.mobile-chat-app) .content{padding:0!important}.mobile-chat-app{margin:0;min-height:100vh;background:#f1f5f9}.mobile-chat-hero{min-height:50vh;border-bottom-left-radius:36px;border-bottom-right-radius:36px;padding:22px 16px 74px}.mobile-chat-panel{display:flex;flex-direction:column;margin-top:-64px;padding:0 12px 16px}.mobile-chat-list{display:flex;gap:8px;overflow-x:auto;max-height:none;border-radius:24px;padding:10px}.mobile-chat-list::-webkit-scrollbar{display:none}.mobile-contact{flex:0 0 240px;margin:0;background:#fff}.mobile-group-create{flex:0 0 260px;margin:0}.mobile-conversation{min-height:calc(100vh - 260px);border-radius:26px}.conversation-messages{max-height:calc(100vh - 395px);min-height:300px;padding:12px}.message-bubble-mobile{max-width:88%}.mobile-chat-img{max-width:220px}.mobile-chat-audio{width:220px}.mobile-send-bar{grid-template-columns:44px 1fr 68px;position:sticky;bottom:0}}
@media(min-width:761px){body:has(.mobile-chat-app) .page-hero{display:none}}


/* =========================
   V12 Mobile App UI Shell
   هدفه: تحسين الواجهة والتنقل بدون تغيير المحتوى الداخلي
========================= */
:root{
  --app-dark:#0f172a;
  --app-dark-2:#111827;
  --app-blue:#2563eb;
  --app-green:#22c55e;
  --app-bg:#f3f6fb;
  --app-card:#ffffff;
  --app-line:#e2e8f0;
  --app-muted:#64748b;
  --app-shadow:0 18px 50px rgba(15,23,42,.10);
}

/* Desktop polish */
.sidebar a.active-link{
  background:rgba(255,255,255,.13)!important;
  border-color:rgba(255,255,255,.16)!important;
}
.app-mobile-topbar,
.app-drawer-backdrop,
.app-drawer-head{
  display:none;
}

/* Make cards more app-like everywhere */
.card,.kpi,.page-hero{
  border-radius:26px!important;
}
.btn,button,input,select,textarea{
  font-family:inherit;
}

/* Mobile app shell */
@media(max-width:820px){
  html,body{
    background:var(--app-bg)!important;
    overscroll-behavior:none;
  }

  body{
    padding-top:64px!important;
  }

  .layout{
    display:block!important;
    min-height:100vh!important;
  }

  .app-mobile-topbar{
    display:flex!important;
    position:fixed;
    top:0;
    right:0;
    left:0;
    height:64px;
    z-index:3000;
    align-items:center;
    gap:12px;
    padding:10px 14px;
    background:linear-gradient(135deg,#0f172a,#111827);
    color:#fff;
    box-shadow:0 12px 30px rgba(15,23,42,.22);
  }

  .app-menu-btn{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    border-radius:16px!important;
    border:1px solid rgba(255,255,255,.12)!important;
    background:rgba(255,255,255,.09)!important;
    color:#fff!important;
    font-size:24px!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  .app-topbar-title{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    line-height:1.2;
  }

  .app-topbar-title strong{
    font-size:16px;
    letter-spacing:.2px;
  }

  .app-topbar-title span{
    color:#cbd5e1;
    font-size:11px;
  }

  .app-topbar-notif{
    width:44px;
    height:44px;
    border-radius:16px;
    background:rgba(255,255,255,.09);
    color:#fff;
    text-decoration:none;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(255,255,255,.12);
  }

  .app-drawer-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.52);
    backdrop-filter:blur(4px);
    z-index:2998;
  }

  body.drawer-open .app-drawer-backdrop{
    display:block;
  }

  .sidebar{
    display:block!important;
    position:fixed!important;
    top:0!important;
    bottom:0!important;
    right:0!important;
    height:100vh!important;
    width:84vw!important;
    max-width:340px!important;
    min-width:0!important;
    z-index:2999!important;
    padding:16px!important;
    border-radius:0!important;
    transform:translateX(110%)!important;
    transition:transform .25s ease!important;
    overflow:auto!important;
    background:linear-gradient(180deg,#0f172a,#111827)!important;
    box-shadow:-18px 0 50px rgba(15,23,42,.30)!important;
  }

  .sidebar.drawer-active{
    transform:translateX(0)!important;
  }

  .app-drawer-head{
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
    padding:8px 4px 14px;
    border-bottom:1px solid rgba(255,255,255,.12);
    color:#fff;
  }

  .app-drawer-head strong{
    font-size:20px;
  }

  .app-drawer-head button{
    width:40px!important;
    height:40px!important;
    border-radius:14px!important;
    background:rgba(255,255,255,.10)!important;
    color:#fff!important;
    font-size:26px!important;
    line-height:1!important;
    padding:0!important;
  }

  .sidebar h1{
    font-size:22px!important;
    margin:4px 0 4px!important;
  }

  .sidebar p{
    font-size:12px!important;
    margin:0 0 10px!important;
  }

  .userbox{
    border-radius:20px!important;
    padding:14px!important;
    margin:12px 0!important;
  }

  .sidebar nav{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    overflow:visible!important;
    padding:0!important;
  }

  .sidebar nav a{
    margin:0!important;
    padding:14px 14px!important;
    border-radius:18px!important;
    background:rgba(255,255,255,.07)!important;
    border:1px solid rgba(255,255,255,.08)!important;
    white-space:normal!important;
    font-size:14px!important;
  }

  .sidebar .logout{
    background:#991b1b!important;
  }

  .content{
    padding:14px!important;
    min-height:calc(100vh - 64px)!important;
    width:100%!important;
  }

  .page-hero{
    padding:18px!important;
    border-radius:26px!important;
    margin-bottom:14px!important;
  }

  .page-hero h1{
    font-size:23px!important;
    margin-bottom:8px!important;
  }

  .page-hero p{
    font-size:13px!important;
    line-height:1.7!important;
  }

  .grid{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }

  .kpi{
    min-height:96px!important;
    padding:14px!important;
    border-radius:22px!important;
  }

  .kpi span{
    font-size:12px!important;
  }

  .kpi b{
    font-size:24px!important;
  }

  .card{
    border-radius:26px!important;
    margin-bottom:14px!important;
    overflow:hidden!important;
  }

  .head{
    padding:14px 16px!important;
  }

  .head h2{
    font-size:18px!important;
  }

  .body{
    padding:15px!important;
  }

  .form-grid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  input,select,textarea{
    border-radius:16px!important;
    padding:13px!important;
    font-size:15px!important;
  }

  textarea{
    min-height:96px!important;
  }

  .btn,button{
    border-radius:16px!important;
    padding:12px 15px!important;
  }

  table{
    display:block!important;
    overflow-x:auto!important;
    white-space:nowrap!important;
    border-radius:18px!important;
  }

  th,td{
    padding:11px!important;
    font-size:13px!important;
  }

  .quick-grid{
    grid-template-columns:1fr!important;
  }

  /* Full-screen task usage: give active content more space */
  .whatsapp-shell,
  .mobile-conversation,
  .card:has(form),
  .card:has(table){
    max-width:100%!important;
  }
}

/* Chat-specific cleanup for phone: not editing backend content */
@media(max-width:820px){
  body:has(.mobile-chat-app){
    padding-top:0!important;
  }

  body:has(.mobile-chat-app) .app-mobile-topbar{
    display:none!important;
  }

  body:has(.mobile-chat-app) .content{
    padding:0!important;
  }

  body:has(.mobile-chat-app) .sidebar{
    display:block!important;
  }

  .mobile-chat-app{
    min-height:100vh!important;
    margin:0!important;
    background:#f1f5f9!important;
  }

  .mobile-chat-hero{
    min-height:50vh!important;
    border-bottom-left-radius:36px!important;
    border-bottom-right-radius:36px!important;
    padding:24px 16px 76px!important;
  }

  .mobile-chat-panel{
    margin-top:-66px!important;
    padding:0 12px 16px!important;
    display:flex!important;
    flex-direction:column!important;
  }

  .mobile-chat-list{
    display:flex!important;
    gap:8px!important;
    overflow-x:auto!important;
    max-height:none!important;
    padding:10px!important;
    border-radius:24px!important;
  }

  .mobile-chat-list::-webkit-scrollbar{
    display:none!important;
  }

  .mobile-contact{
    flex:0 0 240px!important;
    margin:0!important;
    background:#fff!important;
  }

  .mobile-conversation{
    min-height:calc(100vh - 260px)!important;
    border-radius:26px!important;
  }

  .conversation-messages{
    min-height:310px!important;
    max-height:calc(100vh - 395px)!important;
    padding:12px!important;
  }

  .message-bubble-mobile{
    max-width:88%!important;
  }

  .mobile-send-bar{
    position:sticky!important;
    bottom:0!important;
    grid-template-columns:44px 1fr 68px!important;
  }
}


/* =========================
   V13 WhatsApp Exact Mobile Chat
========================= */
.wa-app-shell{
  background:#0b1115;
  color:#e9edef;
  min-height:100vh;
  direction:rtl;
}
.wa-home-screen{
  background:#0b1115;
  min-height:100vh;
  padding:22px 18px 86px;
}
.wa-main-header{
  position:sticky;
  top:0;
  z-index:30;
  background:#0b1115;
  padding-bottom:12px;
}
.wa-main-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}
.wa-main-top h1{
  margin:0;
  color:#f8fafc;
  font-size:34px;
  font-weight:900;
  letter-spacing:-.5px;
}
.wa-main-icons{
  display:flex;
  align-items:center;
  gap:10px;
}
.wa-main-icons a{
  width:38px;
  height:38px;
  border-radius:50%;
  color:#f8fafc;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:19px;
}
.wa-avatar-upload label{
  display:block;
  position:relative;
  cursor:pointer;
}
.wa-avatar-upload input{display:none}
.wa-small-photo{
  width:38px;
  height:38px;
  border-radius:50%;
  object-fit:cover;
}
.wa-search{
  display:flex;
  align-items:center;
  gap:10px;
  background:#202c33;
  border-radius:28px;
  padding:0 16px;
  height:56px;
  margin-bottom:18px;
}
.wa-search span{
  color:#8696a0;
  font-size:25px;
}
.wa-search input{
  background:transparent!important;
  border:0!important;
  color:#e9edef!important;
  box-shadow:none!important;
  padding:0!important;
  font-size:18px!important;
}
.wa-search input::placeholder{
  color:#8696a0;
}
.wa-filter-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
}
.wa-filter-tabs::-webkit-scrollbar{display:none}
.wa-filter-tabs a{
  color:#aebac1;
  text-decoration:none;
  background:#111b21;
  border:1px solid #26343c;
  border-radius:999px;
  padding:9px 17px;
  font-size:14px;
  white-space:nowrap;
}
.wa-filter-tabs a.active{
  background:#0a4a36;
  color:#d9fdd3;
  border-color:#0a4a36;
}
.wa-chat-list-screen{
  margin-top:14px;
}
.wa-chat-row{
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  color:#e9edef;
  padding:13px 2px;
  border-bottom:1px solid rgba(134,150,160,.10);
  position:relative;
}
.wa-chat-row.active{
  background:rgba(255,255,255,.04);
  border-radius:12px;
  padding-right:8px;
}
.wa-photo{
  width:58px;
  height:58px;
  border-radius:50%;
  object-fit:cover;
  flex:none;
}
.wa-letter{
  background:#128c7e;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:22px;
  font-weight:900;
}
.wa-letter.group{
  background:#3b1241;
}
.wa-row-body{
  flex:1;
  min-width:0;
}
.wa-row-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:5px;
}
.wa-row-title b{
  color:#f8fafc;
  font-size:18px;
  font-weight:500;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.wa-row-title time{
  color:#8696a0;
  font-size:13px;
}
.wa-chat-row p{
  color:#8696a0;
  margin:0;
  font-size:15px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.wa-unread-badge{
  background:#25d366;
  color:#0b1115;
  min-width:24px;
  height:24px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-style:normal;
  font-weight:900;
  font-size:12px;
  margin-right:auto;
}
.wa-floating-action{
  position:fixed;
  left:22px;
  bottom:92px;
  width:64px;
  height:64px;
  border-radius:20px;
  background:#25d366;
  color:#0b1115;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:36px;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 10px 30px rgba(0,0,0,.28);
}
.wa-create-group{
  background:#111b21;
  border:1px solid #26343c;
  border-radius:18px;
  padding:12px;
  margin-bottom:12px;
}
.wa-create-group summary{
  color:#e9edef;
  font-weight:800;
}
.wa-create-group input{
  margin-top:10px;
}
.wa-members{
  max-height:180px;
  overflow:auto;
  display:grid;
  gap:8px;
  margin:10px 0;
}
.wa-members label{
  color:#d1d7db;
  background:#202c33;
  border-radius:12px;
  padding:8px;
}

/* Conversation */
.wa-conversation-screen{
  position:fixed;
  inset:0;
  z-index:5000;
  display:flex;
  flex-direction:column;
  background:#0b141a;
  color:#e9edef;
}
.wa-conv-header{
  height:66px;
  background:#202c33;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  flex:none;
}
.wa-back{
  width:34px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#e9edef;
  text-decoration:none;
  font-size:38px;
  line-height:1;
}
.wa-conv-header .wa-photo{
  width:43px;
  height:43px;
}
.wa-conv-title{
  flex:1;
  min-width:0;
}
.wa-conv-title h2{
  margin:0;
  font-size:17px;
  color:#f8fafc;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.wa-conv-title p{
  margin:3px 0 0;
  color:#aebac1;
  font-size:12px;
}
.wa-message-area{
  flex:1;
  overflow:auto;
  padding:14px 10px 18px;
  background:
    linear-gradient(rgba(11,20,26,.90),rgba(11,20,26,.90)),
    radial-gradient(circle at top left,rgba(37,211,102,.08),transparent 35%),
    radial-gradient(circle at bottom right,rgba(18,140,126,.10),transparent 35%);
}
.wa-message-line{
  display:flex;
  margin-bottom:8px;
}
.wa-message-line.mine{
  justify-content:flex-start;
}
.wa-message-line.theirs{
  justify-content:flex-end;
}
.wa-bubble-real{
  max-width:78%;
  padding:7px 9px 5px;
  border-radius:12px;
  background:#202c33;
  color:#e9edef;
  box-shadow:0 1px 2px rgba(0,0,0,.18);
}
.wa-message-line.mine .wa-bubble-real{
  background:#005c4b;
  border-bottom-left-radius:4px;
}
.wa-message-line.theirs .wa-bubble-real{
  border-bottom-right-radius:4px;
}
.wa-bubble-real strong{
  display:block;
  color:#25d366;
  font-size:12px;
  margin-bottom:2px;
}
.wa-bubble-real p{
  margin:0;
  font-size:15px;
  line-height:1.55;
}
.wa-bubble-real span{
  display:block;
  text-align:left;
  color:#aebac1;
  font-size:10px;
  margin-top:2px;
}
.wa-msg-img{
  max-width:240px;
  max-height:260px;
  border-radius:10px;
  display:block;
}
.wa-msg-audio{
  width:240px;
}
.wa-download{
  color:#25d366;
  font-weight:800;
}
.wa-compose{
  min-height:62px;
  background:#0b141a;
  display:grid;
  grid-template-columns:44px 1fr 46px;
  gap:8px;
  align-items:end;
  padding:8px;
  flex:none;
}
.wa-attach{
  width:44px;
  height:44px;
  border-radius:50%;
  background:#202c33;
  color:#aebac1;
  display:flex!important;
  align-items:center;
  justify-content:center;
  font-size:26px;
  margin:0!important;
}
.wa-attach input{
  display:none;
}
.wa-compose textarea{
  min-height:44px!important;
  max-height:110px;
  border-radius:22px!important;
  background:#202c33!important;
  border:0!important;
  color:#e9edef!important;
  padding:12px 14px!important;
  font-size:15px!important;
}
.wa-compose textarea::placeholder{
  color:#8696a0;
}
.wa-compose button{
  width:46px;
  height:46px;
  border-radius:50%!important;
  background:#00a884!important;
  color:#fff!important;
  padding:0!important;
  font-size:18px!important;
}
.wa-empty,.wa-empty-center{
  color:#8696a0;
  text-align:center;
  padding:18px;
}
.wa-empty-center{
  margin-top:40%;
}
@media(min-width:821px){
  .wa-app-shell{
    border-radius:26px;
    overflow:hidden;
  }
  .wa-home-screen{
    min-height:760px;
  }
}
@media(max-width:820px){
  body:has(.wa-app-shell){
    padding-top:0!important;
    background:#0b1115!important;
  }
  body:has(.wa-app-shell) .sidebar,
  body:has(.wa-app-shell) .app-mobile-topbar{
    display:none!important;
  }
  body:has(.wa-app-shell) .content{
    padding:0!important;
  }
  .wa-home-screen{
    padding:28px 18px 92px;
  }
  .wa-main-top h1{
    font-size:34px;
  }
}


/* =========================
   V14 Chat Phone Design - matching requested mockup
========================= */
@media(max-width:820px){
  body:has(.wa-app-shell){
    background:#050708!important;
  }

  .wa-app-shell{
    background:#050708!important;
    min-height:100vh!important;
  }

  .wa-home-screen{
    padding:0 14px 24px!important;
    background:#050708!important;
    min-height:100vh!important;
  }

  /* الهيدر الجديد: ياخد حوالي نص الشاشة */
  .wa-main-header{
    position:relative!important;
    top:auto!important;
    min-height:50vh!important;
    padding:64px 22px 24px!important;
    margin:0 -14px 18px!important;
    background:
      radial-gradient(circle at 22% 8%, rgba(34,197,94,.28), transparent 34%),
      radial-gradient(circle at 84% 18%, rgba(37,99,235,.22), transparent 34%),
      linear-gradient(145deg,#064e45 0%,#0f172a 62%,#111827 100%)!important;
    border-bottom-left-radius:38px!important;
    border-bottom-right-radius:38px!important;
    box-shadow:0 24px 55px rgba(0,0,0,.35)!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
  }

  /* نخفي جزء البحث القديم الكبير ونخلي البحث صغير اختياري تحت */
  .wa-main-top,
  .wa-main-icons{
    display:none!important;
  }

  .wa-profile-hero{
    display:flex!important;
    flex-direction:row-reverse!important;
    align-items:center!important;
    justify-content:center!important;
    gap:26px!important;
    margin-bottom:42px!important;
  }

  .wa-hero-avatar-form{
    margin:0!important;
  }

  .wa-hero-photo{
    width:118px!important;
    height:118px!important;
    border-radius:50%!important;
    object-fit:cover!important;
    background:linear-gradient(135deg,#22c55e,#2563eb)!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    color:#fff!important;
    font-size:40px!important;
    font-weight:900!important;
    box-shadow:0 18px 40px rgba(0,0,0,.28)!important;
  }

  .wa-hero-text{
    text-align:center!important;
  }

  .wa-hero-text h1{
    margin:0 0 12px!important;
    color:#fff!important;
    font-size:42px!important;
    line-height:1.08!important;
    font-weight:900!important;
    letter-spacing:-1px!important;
  }

  .wa-hero-text p{
    margin:0!important;
    color:#d9fdd3!important;
    font-size:22px!important;
    line-height:1.4!important;
  }

  .wa-hero-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:24px!important;
    margin-bottom:34px!important;
  }

  .wa-hero-actions a{
    min-height:72px!important;
    border-radius:28px!important;
    color:#fff!important;
    text-decoration:none!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:22px!important;
    font-weight:900!important;
    background:rgba(255,255,255,.10)!important;
    border:1px solid rgba(255,255,255,.18)!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.04)!important;
    backdrop-filter:blur(10px)!important;
  }

  .wa-filter-tabs{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:0!important;
    background:rgba(255,255,255,.10)!important;
    border:1px solid rgba(255,255,255,.18)!important;
    border-radius:34px!important;
    padding:8px!important;
    margin-bottom:16px!important;
    overflow:visible!important;
  }

  .wa-filter-tabs a{
    height:66px!important;
    border-radius:28px!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border:0!important;
    background:transparent!important;
    color:#d9fdd3!important;
    font-size:22px!important;
    font-weight:900!important;
  }

  .wa-filter-tabs a.active{
    background:#fff!important;
    color:#075e54!important;
    box-shadow:0 10px 25px rgba(0,0,0,.15)!important;
  }

  .wa-monitor-link{
    display:block!important;
    color:#d9fdd3!important;
    text-align:center!important;
    text-decoration:none!important;
    font-weight:900!important;
    margin:-4px 0 12px!important;
    font-size:14px!important;
  }

  .wa-search-compact{
    height:44px!important;
    margin:0!important;
    background:rgba(255,255,255,.10)!important;
    border:1px solid rgba(255,255,255,.14)!important;
    border-radius:999px!important;
  }

  .wa-search-compact input{
    font-size:15px!important;
  }

  /* قائمة الشات كالموكاب الأسود: دوائر يمين وشرائط محادثة */
  .wa-chat-list-screen{
    background:#050708!important;
    border-radius:24px!important;
    padding:2px 0 86px!important;
    margin-top:0!important;
  }

  .wa-chat-row{
    min-height:92px!important;
    flex-direction:row-reverse!important;
    gap:14px!important;
    padding:14px 8px!important;
    border-bottom:0!important;
    margin-bottom:16px!important;
    background:transparent!important;
  }

  .wa-chat-row.active{
    background:transparent!important;
  }

  .wa-photo{
    width:74px!important;
    height:74px!important;
    order:0!important;
    box-shadow:0 8px 20px rgba(0,0,0,.22)!important;
  }

  .wa-letter{
    font-size:28px!important;
  }

  .wa-row-body{
    background:#fff!important;
    border-radius:999px!important;
    min-height:54px!important;
    padding:9px 20px!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    box-shadow:0 8px 20px rgba(255,255,255,.04)!important;
  }

  .wa-row-title{
    margin:0!important;
  }

  .wa-row-title b{
    color:#0f172a!important;
    font-size:16px!important;
    font-weight:900!important;
  }

  .wa-row-title time{
    color:#64748b!important;
    font-size:11px!important;
  }

  .wa-chat-row p{
    color:#64748b!important;
    font-size:12px!important;
    margin-top:2px!important;
  }

  .wa-unread-badge{
    position:absolute!important;
    right:70px!important;
    top:8px!important;
    background:#25d366!important;
    color:#052e1d!important;
  }

  .wa-floating-action{
    left:22px!important;
    bottom:28px!important;
    background:#25d366!important;
    color:#04130b!important;
    border-radius:22px!important;
  }

  .wa-create-group{
    background:#050708!important;
    border:0!important;
    padding:0!important;
  }

  .wa-create-group summary{
    background:#fff!important;
    color:#0f172a!important;
    border-radius:999px!important;
    min-height:54px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-weight:900!important;
    margin-bottom:16px!important;
  }

  .wa-members label{
    background:#fff!important;
    color:#0f172a!important;
  }

  /* شاشة المحادثة تبقى واتساب داكنة */
  .wa-conversation-screen{
    background:#0b141a!important;
  }

  .wa-conv-header{
    background:#202c33!important;
  }

  .wa-empty{
    color:#fff!important;
  }
}

/* للأجهزة الصغيرة جدًا */
@media(max-width:430px){
  .wa-main-header{
    padding-top:48px!important;
  }

  .wa-profile-hero{
    gap:18px!important;
    margin-bottom:34px!important;
  }

  .wa-hero-photo{
    width:96px!important;
    height:96px!important;
    font-size:34px!important;
  }

  .wa-hero-text h1{
    font-size:34px!important;
  }

  .wa-hero-text p{
    font-size:18px!important;
  }

  .wa-hero-actions{
    gap:14px!important;
  }

  .wa-hero-actions a{
    min-height:62px!important;
    font-size:18px!important;
  }

  .wa-filter-tabs a{
    height:58px!important;
    font-size:18px!important;
  }

  .wa-photo{
    width:66px!important;
    height:66px!important;
  }

  .wa-row-body{
    min-height:50px!important;
  }
}


/* =========================
   V15 Desktop Professional Chat Fix
   Desktop = WhatsApp Web style
   Mobile = keep V14 phone design
========================= */

/* Desktop only */
@media (min-width: 821px){

  body:has(.wa-app-shell){
    background:#e9edef !important;
  }

  body:has(.wa-app-shell) .content{
    padding:18px !important;
  }

  body:has(.wa-app-shell) .page-hero{
    display:none !important;
  }

  .wa-app-shell{
    background:#e9edef !important;
    color:#111b21 !important;
    min-height:calc(100vh - 36px) !important;
    border-radius:28px !important;
    overflow:hidden !important;
    box-shadow:0 24px 70px rgba(15,23,42,.14) !important;
    display:grid !important;
    grid-template-columns:390px 1fr !important;
    max-width:1500px !important;
    margin:0 auto !important;
    border:1px solid #d1d7db !important;
  }

  .wa-home-screen{
    background:#fff !important;
    min-height:calc(100vh - 36px) !important;
    padding:0 !important;
    border-left:1px solid #d1d7db !important;
    display:flex !important;
    flex-direction:column !important;
  }

  .wa-home-screen.has-chat-open{
    display:flex !important;
  }

  .wa-main-header{
    position:relative !important;
    top:auto !important;
    z-index:10 !important;
    min-height:auto !important;
    padding:0 !important;
    margin:0 !important;
    background:#fff !important;
    border-radius:0 !important;
    box-shadow:none !important;
    display:block !important;
  }

  .wa-profile-hero{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:12px !important;
    margin:0 !important;
    padding:16px !important;
    background:#f0f2f5 !important;
    border-bottom:1px solid #d1d7db !important;
  }

  .wa-hero-avatar-form{
    order:1 !important;
    margin:0 !important;
  }

  .wa-hero-photo{
    width:48px !important;
    height:48px !important;
    border-radius:50% !important;
    object-fit:cover !important;
    background:linear-gradient(135deg,#22c55e,#2563eb) !important;
    color:#fff !important;
    font-size:18px !important;
    font-weight:900 !important;
    box-shadow:none !important;
  }

  .wa-hero-text{
    order:2 !important;
    flex:1 !important;
    min-width:0 !important;
    text-align:right !important;
  }

  .wa-hero-text h1{
    margin:0 0 4px !important;
    color:#111b21 !important;
    font-size:18px !important;
    line-height:1.25 !important;
    font-weight:900 !important;
    letter-spacing:0 !important;
    overflow:hidden !important;
    white-space:nowrap !important;
    text-overflow:ellipsis !important;
  }

  .wa-hero-text p{
    margin:0 !important;
    color:#667781 !important;
    font-size:12px !important;
    line-height:1.4 !important;
  }

  .wa-hero-actions{
    display:flex !important;
    gap:8px !important;
    padding:12px 16px !important;
    margin:0 !important;
    background:#fff !important;
    border-bottom:1px solid #edf0f2 !important;
  }

  .wa-hero-actions a{
    min-height:38px !important;
    border-radius:999px !important;
    color:#075e54 !important;
    text-decoration:none !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:13px !important;
    font-weight:900 !important;
    background:#e7f8ee !important;
    border:1px solid #d1fae5 !important;
    box-shadow:none !important;
    padding:0 14px !important;
    flex:1 !important;
  }

  .wa-filter-tabs{
    display:flex !important;
    gap:8px !important;
    overflow-x:auto !important;
    padding:12px 16px !important;
    background:#fff !important;
    border:0 !important;
    border-bottom:1px solid #edf0f2 !important;
    border-radius:0 !important;
    margin:0 !important;
  }

  .wa-filter-tabs a{
    height:34px !important;
    border-radius:999px !important;
    padding:0 16px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border:1px solid #d1d7db !important;
    background:#f0f2f5 !important;
    color:#54656f !important;
    font-size:13px !important;
    font-weight:800 !important;
    text-decoration:none !important;
    flex:none !important;
  }

  .wa-filter-tabs a.active{
    background:#d9fdd3 !important;
    color:#008069 !important;
    border-color:#d9fdd3 !important;
    box-shadow:none !important;
  }

  .wa-monitor-link{
    display:block !important;
    margin:0 !important;
    padding:10px 16px !important;
    color:#008069 !important;
    background:#fff !important;
    text-align:right !important;
    text-decoration:none !important;
    font-weight:900 !important;
    font-size:13px !important;
    border-bottom:1px solid #edf0f2 !important;
  }

  .wa-search-compact,
  .wa-search{
    display:flex !important;
    height:44px !important;
    margin:12px 16px !important;
    background:#f0f2f5 !important;
    border:0 !important;
    border-radius:10px !important;
    padding:0 14px !important;
  }

  .wa-search span{
    color:#667781 !important;
    font-size:20px !important;
  }

  .wa-search input{
    color:#111b21 !important;
    font-size:14px !important;
  }

  .wa-search input::placeholder{
    color:#667781 !important;
  }

  .wa-chat-list-screen{
    background:#fff !important;
    padding:0 !important;
    margin:0 !important;
    overflow:auto !important;
    flex:1 !important;
    border-radius:0 !important;
  }

  .wa-chat-row{
    min-height:74px !important;
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    gap:12px !important;
    padding:10px 16px !important;
    border-bottom:1px solid #edf0f2 !important;
    margin:0 !important;
    background:#fff !important;
    color:#111b21 !important;
    position:relative !important;
  }

  .wa-chat-row:hover,
  .wa-chat-row.active{
    background:#f5f6f6 !important;
    border-radius:0 !important;
  }

  .wa-photo{
    width:52px !important;
    height:52px !important;
    border-radius:50% !important;
    object-fit:cover !important;
    box-shadow:none !important;
    order:0 !important;
    flex:none !important;
  }

  .wa-letter{
    font-size:20px !important;
  }

  .wa-row-body{
    background:transparent !important;
    border-radius:0 !important;
    min-height:auto !important;
    padding:0 !important;
    display:block !important;
    box-shadow:none !important;
    flex:1 !important;
    min-width:0 !important;
  }

  .wa-row-title{
    margin:0 0 5px !important;
    display:flex !important;
    justify-content:space-between !important;
    align-items:center !important;
    gap:10px !important;
  }

  .wa-row-title b{
    color:#111b21 !important;
    font-size:16px !important;
    font-weight:700 !important;
  }

  .wa-row-title time{
    color:#667781 !important;
    font-size:12px !important;
  }

  .wa-chat-row p{
    color:#667781 !important;
    font-size:13px !important;
    margin:0 !important;
  }

  .wa-unread-badge{
    position:static !important;
    background:#25d366 !important;
    color:#111b21 !important;
    min-width:20px !important;
    height:20px !important;
    font-size:11px !important;
    margin-right:6px !important;
  }

  .wa-floating-action{
    display:none !important;
  }

  .wa-create-group{
    background:#fff !important;
    border:0 !important;
    border-bottom:1px solid #edf0f2 !important;
    border-radius:0 !important;
    padding:12px 16px !important;
    margin:0 !important;
  }

  .wa-create-group summary{
    background:#e7f8ee !important;
    color:#008069 !important;
    border-radius:999px !important;
    min-height:38px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-weight:900 !important;
    margin-bottom:10px !important;
  }

  .wa-members label{
    background:#f0f2f5 !important;
    color:#111b21 !important;
  }

  /* Conversation is not fixed on desktop */
  .wa-conversation-screen{
    position:relative !important;
    inset:auto !important;
    z-index:1 !important;
    display:flex !important;
    flex-direction:column !important;
    min-height:calc(100vh - 36px) !important;
    background:#efeae2 !important;
    color:#111b21 !important;
  }

  .wa-conv-header{
    height:70px !important;
    background:#f0f2f5 !important;
    border-bottom:1px solid #d1d7db !important;
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    padding:10px 18px !important;
  }

  .wa-back{
    display:none !important;
  }

  .wa-conv-header .wa-photo{
    width:48px !important;
    height:48px !important;
  }

  .wa-conv-title h2{
    color:#111b21 !important;
    font-size:17px !important;
    margin:0 0 4px !important;
  }

  .wa-conv-title p{
    color:#667781 !important;
    font-size:12px !important;
  }

  .wa-message-area{
    flex:1 !important;
    overflow:auto !important;
    padding:24px 44px !important;
    background:
      linear-gradient(rgba(239,234,226,.92),rgba(239,234,226,.92)),
      radial-gradient(circle at top left,rgba(37,211,102,.12),transparent 32%),
      radial-gradient(circle at bottom right,rgba(18,140,126,.10),transparent 35%) !important;
  }

  .wa-message-line{
    display:flex !important;
    margin-bottom:8px !important;
  }

  .wa-message-line.mine{
    justify-content:flex-start !important;
  }

  .wa-message-line.theirs{
    justify-content:flex-end !important;
  }

  .wa-bubble-real{
    max-width:62% !important;
    padding:8px 10px 5px !important;
    border-radius:12px !important;
    background:#fff !important;
    color:#111b21 !important;
    box-shadow:0 1px 2px rgba(15,23,42,.08) !important;
  }

  .wa-message-line.mine .wa-bubble-real{
    background:#d9fdd3 !important;
    border-bottom-left-radius:4px !important;
  }

  .wa-message-line.theirs .wa-bubble-real{
    background:#fff !important;
    border-bottom-right-radius:4px !important;
  }

  .wa-bubble-real p{
    color:#111b21 !important;
    font-size:14px !important;
  }

  .wa-bubble-real span{
    color:#667781 !important;
  }

  .wa-compose{
    min-height:68px !important;
    background:#f0f2f5 !important;
    border-top:1px solid #d1d7db !important;
    display:grid !important;
    grid-template-columns:46px 1fr 46px !important;
    gap:10px !important;
    padding:10px 16px !important;
  }

  .wa-attach{
    width:46px !important;
    height:46px !important;
    border-radius:50% !important;
    background:#fff !important;
    color:#54656f !important;
  }

  .wa-compose textarea{
    min-height:46px !important;
    max-height:110px !important;
    border-radius:999px !important;
    background:#fff !important;
    border:0 !important;
    color:#111b21 !important;
    padding:13px 16px !important;
  }

  .wa-compose textarea::placeholder{
    color:#667781 !important;
  }

  .wa-compose button{
    width:46px !important;
    height:46px !important;
    border-radius:50% !important;
    background:#00a884 !important;
    color:#fff !important;
  }

  .wa-empty-center{
    color:#667781 !important;
    margin-top:25% !important;
  }

  .wa-msg-img{
    max-width:300px !important;
    max-height:320px !important;
  }

  .wa-msg-audio{
    width:300px !important;
  }
}

/* Fallback: if no conversation selected on desktop, show a pleasant empty area */
@media (min-width:821px){
  .wa-app-shell:not(:has(.wa-conversation-screen))::after{
    content:"اختر محادثة لبدء التواصل";
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:calc(100vh - 36px);
    background:#efeae2;
    color:#667781;
    font-weight:900;
    font-size:20px;
  }
}


/* =========================
   V17 Professional Chat System
   Full rewrite UI for desktop + mobile
========================= */
.prochat-shell{
  height:calc(100vh - 36px);
  display:grid;
  grid-template-columns:390px 1fr;
  background:#eef2f5;
  border-radius:28px;
  overflow:hidden;
  box-shadow:0 24px 70px rgba(15,23,42,.14);
  border:1px solid #d1d7db;
}
.prochat-sidebar{
  background:#fff;
  border-left:1px solid #d1d7db;
  display:flex;
  flex-direction:column;
  min-width:0;
}
.prochat-me{
  background:linear-gradient(135deg,#075e54,#0f172a);
  color:#fff;
  padding:18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.prochat-brand h1{margin:0;font-size:24px}
.prochat-brand p{margin:6px 0 0;color:#d1fae5;font-size:12px}
.prochat-my-avatar{
  width:46px;height:46px;border-radius:50%;object-fit:cover;
}
.prochat-avatar-upload input{display:none}
.prochat-shortcuts{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
  padding:12px;
  background:#f8fafc;
}
.prochat-shortcuts a{
  background:#e7f8ee;
  color:#075e54;
  text-decoration:none;
  border-radius:999px;
  padding:10px 8px;
  text-align:center;
  font-weight:900;
  font-size:12px;
}
.prochat-tabs{
  display:flex;
  gap:8px;
  padding:12px;
  border-bottom:1px solid #edf0f2;
}
.prochat-tabs a{
  flex:1;text-align:center;text-decoration:none;color:#54656f;background:#f0f2f5;
  border-radius:999px;padding:10px;font-weight:900;
}
.prochat-tabs a.active{background:#d9fdd3;color:#008069}
.prochat-search{padding:0 12px 12px}
.prochat-search input{
  width:100%;background:#f0f2f5!important;border:0!important;border-radius:14px!important;padding:12px!important;
}
.prochat-list{overflow:auto;flex:1}
.prochat-create{padding:12px;background:#f8fafc;border-bottom:1px solid #edf0f2}
.prochat-create summary{cursor:pointer;color:#008069;font-weight:900}
.prochat-members{display:grid;gap:8px;max-height:180px;overflow:auto;margin:10px 0}
.prochat-members label{
  background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:8px;color:#111b21;
}
.prochat-row{
  display:grid;
  grid-template-columns:54px 1fr auto;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid #edf0f2;
  text-decoration:none;
  color:#111b21;
}
.prochat-row:hover,.prochat-row.active{background:#f5f6f6}
.prochat-avatar{
  width:52px;height:52px;border-radius:50%;object-fit:cover;
  background:linear-gradient(135deg,#128c7e,#25d366);
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:900;font-size:20px;
}
.prochat-avatar.group{background:linear-gradient(135deg,#2563eb,#7c3aed)}
.prochat-letter{background:linear-gradient(135deg,#128c7e,#25d366)}
.prochat-row-main{min-width:0}
.prochat-row-main b{display:block;color:#111b21;font-size:15px;margin-bottom:4px}
.prochat-row-main span{
  display:block;color:#667781;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px;
}
.prochat-row-meta{
  display:grid;gap:5px;justify-items:end;
}
.prochat-row-meta time{color:#667781;font-size:11px}
.prochat-row-meta em{
  background:#25d366;color:#052e1d;min-width:20px;height:20px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;font-style:normal;font-size:11px;font-weight:900;
}
.prochat-window{
  display:flex;flex-direction:column;background:#efeae2;min-width:0;
}
.prochat-window-head{
  height:72px;background:#f0f2f5;border-bottom:1px solid #d1d7db;
  display:flex;align-items:center;gap:12px;padding:12px 18px;
}
.prochat-back{display:none}
.prochat-window-title{flex:1;min-width:0}
.prochat-window-title h2{margin:0;color:#111b21;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prochat-window-title p{margin:4px 0 0;color:#667781;font-size:12px}
.prochat-more{
  width:40px!important;height:40px!important;border-radius:50%!important;background:#fff!important;color:#54656f!important;
  padding:0!important;font-size:24px!important;
}
.prochat-messages{
  flex:1;overflow:auto;padding:24px 44px;
  background:
    linear-gradient(rgba(239,234,226,.92),rgba(239,234,226,.92)),
    radial-gradient(circle at top left,rgba(37,211,102,.12),transparent 32%),
    radial-gradient(circle at bottom right,rgba(18,140,126,.10),transparent 35%);
}
.prochat-line{display:flex;margin-bottom:9px}
.prochat-line.mine{justify-content:flex-start}
.prochat-line.theirs{justify-content:flex-end}
.prochat-bubble{
  position:relative;max-width:62%;padding:8px 10px 5px;border-radius:12px;background:#fff;color:#111b21;
  box-shadow:0 1px 2px rgba(15,23,42,.08);
}
.prochat-line.mine .prochat-bubble{background:#d9fdd3;border-bottom-left-radius:4px}
.prochat-line.theirs .prochat-bubble{background:#fff;border-bottom-right-radius:4px}
.prochat-bubble p{margin:0;font-size:14px;line-height:1.65}
.prochat-time{display:block;text-align:left;color:#667781;font-size:10px;margin-top:3px}
.prochat-sender{display:block;color:#008069;font-size:12px;margin-bottom:3px}
.prochat-bubble-actions{
  display:none;position:absolute;top:-34px;right:0;background:#111b21;color:#fff;border-radius:12px;padding:4px;gap:4px;z-index:5;
  box-shadow:0 10px 25px rgba(0,0,0,.22);
}
.prochat-bubble:hover .prochat-bubble-actions{display:flex}
.prochat-bubble-actions button{
  background:transparent!important;color:#fff!important;border:0!important;padding:5px 8px!important;border-radius:8px!important;font-size:11px!important;
}
.prochat-bubble-actions form{margin:0}
.prochat-bubble-actions button:hover{background:rgba(255,255,255,.12)!important}
.prochat-reply-preview{
  border-right:4px solid #00a884;background:rgba(255,255,255,.55);
  border-radius:8px;padding:7px;margin-bottom:6px;display:grid;gap:2px;
}
.prochat-reply-preview b{font-size:11px;color:#008069}
.prochat-reply-preview span{text-align:right;font-size:12px;color:#54656f;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.prochat-forwarded{display:block;color:#667781;font-size:11px;margin-bottom:4px}
.prochat-deleted{color:#667781!important;font-style:italic}
.ga-chat-img{max-width:300px;max-height:320px;border-radius:10px;display:block}
.ga-chat-audio{width:300px}
.ga-chat-file{color:#008069;font-weight:900}
.prochat-compose{
  min-height:70px;background:#f0f2f5;border-top:1px solid #d1d7db;
  display:grid;grid-template-columns:46px 1fr 74px;gap:10px;padding:10px 16px;align-items:end;
}
.prochat-reply-bar{
  grid-column:1/-1;background:#fff;border-right:4px solid #00a884;border-radius:12px;padding:8px 10px;
  align-items:center;gap:8px;color:#111b21;
}
.prochat-reply-bar div{display:grid;gap:2px;flex:1}
.prochat-reply-bar b{color:#008069;font-size:12px}
.prochat-reply-bar span{color:#54656f;font-size:12px}
.prochat-reply-bar button{width:28px!important;height:28px!important;border-radius:50%!important;padding:0!important}
.prochat-attach{
  width:46px;height:46px;border-radius:50%;background:#fff;color:#54656f;display:flex!important;
  align-items:center;justify-content:center;font-size:24px;margin:0!important;
}
.prochat-attach input{display:none}
.prochat-compose textarea{
  min-height:46px!important;max-height:120px;border-radius:999px!important;background:#fff!important;
  border:0!important;color:#111b21!important;padding:13px 16px!important;
}
.prochat-send{
  height:46px;border-radius:999px!important;background:#00a884!important;color:#fff!important;padding:0!important;
}
.prochat-empty{
  display:flex;align-items:center;justify-content:center;height:100%;color:#667781;font-size:16px;font-weight:900;text-align:center;
}
.prochat-empty.big{font-size:20px}
.forward-modal{
  display:none;position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:8000;align-items:center;justify-content:center;padding:16px;
}
.forward-modal.show{display:flex}
.forward-box{
  background:#fff;border-radius:22px;max-width:420px;width:100%;padding:18px;box-shadow:0 30px 80px rgba(0,0,0,.25);
}
.forward-box h3{margin:0 0 12px;color:#111b21}
.forward-list{display:grid;gap:8px;max-height:300px;overflow:auto}
.forward-list label{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:10px;color:#111b21}
.forward-actions{display:flex;gap:10px;margin-top:14px}
.forward-actions button{flex:1}

@media(max-width:820px){
  body:has(.prochat-shell){padding-top:0!important;background:#0b1115!important}
  body:has(.prochat-shell) .sidebar,
  body:has(.prochat-shell) .app-mobile-topbar{display:none!important}
  body:has(.prochat-shell) .content{padding:0!important}
  .prochat-shell{height:100vh;display:block;border-radius:0;border:0;box-shadow:none;background:#0b1115}
  .prochat-sidebar{height:100vh;background:#0b1115;color:#e9edef;border:0}
  .prochat-me{padding:28px 18px 18px;background:#0b1115}
  .prochat-brand h1{font-size:34px}
  .prochat-shortcuts{background:#0b1115;grid-template-columns:1fr 1fr;padding:10px 18px}
  .prochat-shortcuts a{background:#202c33;color:#e9edef;border-radius:22px;padding:14px}
  .prochat-shortcuts a:nth-child(3){display:none}
  .prochat-tabs{background:#0b1115;border:0;padding:12px 18px}
  .prochat-tabs a{background:#111b21;color:#aebac1}
  .prochat-tabs a.active{background:#0a4a36;color:#d9fdd3}
  .prochat-search{padding:0 18px 12px}
  .prochat-search input{background:#202c33!important;color:#e9edef!important;border-radius:22px!important}
  .prochat-list{padding:0 18px 90px}
  .prochat-row{
    grid-template-columns:58px 1fr auto;background:#0b1115;color:#e9edef;border-bottom:1px solid rgba(134,150,160,.10);padding:13px 0;
  }
  .prochat-row-main b{color:#e9edef;font-size:18px}
  .prochat-row-main span,.prochat-row-meta time{color:#8696a0}
  .prochat-avatar{width:58px;height:58px}
  .prochat-window{position:fixed;inset:0;z-index:7000;background:#0b141a}
  .prochat-window-head{height:66px;background:#202c33;border:0;padding:8px 10px}
  .prochat-back{display:flex;width:34px;height:46px;align-items:center;justify-content:center;color:#e9edef;text-decoration:none;font-size:38px}
  .prochat-window-title h2{color:#e9edef}
  .prochat-window-title p{color:#aebac1}
  .prochat-more{background:transparent!important;color:#aebac1!important}
  .prochat-messages{padding:14px 10px;background:#0b141a}
  .prochat-bubble{max-width:84%;background:#202c33;color:#e9edef}
  .prochat-line.mine .prochat-bubble{background:#005c4b}
  .prochat-bubble p{color:#e9edef}
  .prochat-time{color:#aebac1}
  .prochat-bubble-actions{position:static;display:flex;margin-bottom:5px;background:transparent;padding:0;box-shadow:none}
  .prochat-bubble-actions button{color:#aebac1!important;background:rgba(255,255,255,.06)!important}
  .prochat-compose{grid-template-columns:44px 1fr 54px;background:#0b141a;border:0;padding:8px}
  .prochat-attach,.prochat-compose textarea{background:#202c33!important;color:#e9edef!important}
  .prochat-send{border-radius:50%!important;width:46px;font-size:0!important}
  .prochat-send::after{content:'➤';font-size:18px}
  .ga-chat-img{max-width:240px}
  .ga-chat-audio{width:240px}
}


/* =========================
   V18 Mobile Chat Fix
   يحافظ على Desktop V17 ويصلح الموبايل فقط
========================= */
@media(max-width:820px){

  html, body{
    width:100%;
    max-width:100%;
    overflow-x:hidden!important;
    background:#0b1115!important;
  }

  body:has(.prochat-shell){
    padding-top:0!important;
    margin:0!important;
    background:#0b1115!important;
  }

  body:has(.prochat-shell) .sidebar,
  body:has(.prochat-shell) .app-mobile-topbar,
  body:has(.prochat-shell) .page-hero{
    display:none!important;
  }

  body:has(.prochat-shell) .content{
    padding:0!important;
    margin:0!important;
    width:100%!important;
    min-height:100vh!important;
    background:#0b1115!important;
  }

  .prochat-shell{
    display:block!important;
    width:100%!important;
    height:100vh!important;
    min-height:100vh!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    overflow:hidden!important;
    background:#0b1115!important;
  }

  /* شاشة قائمة الشات */
  .prochat-sidebar{
    width:100%!important;
    height:100vh!important;
    min-height:100vh!important;
    display:flex!important;
    flex-direction:column!important;
    background:#0b1115!important;
    color:#e9edef!important;
    border:0!important;
    overflow:hidden!important;
  }

  .prochat-me{
    flex:none!important;
    padding:24px 18px 16px!important;
    background:#0b1115!important;
    color:#fff!important;
    display:flex!important;
    align-items:center!important;
    gap:12px!important;
    border:0!important;
  }

  .prochat-brand{
    flex:1!important;
    min-width:0!important;
  }

  .prochat-brand h1{
    margin:0!important;
    font-size:31px!important;
    line-height:1.15!important;
    font-weight:900!important;
    color:#f8fafc!important;
    letter-spacing:-.6px!important;
  }

  .prochat-brand p{
    margin:6px 0 0!important;
    color:#8696a0!important;
    font-size:13px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .prochat-my-avatar{
    width:48px!important;
    height:48px!important;
    border-radius:50%!important;
    object-fit:cover!important;
    box-shadow:0 8px 22px rgba(0,0,0,.28)!important;
  }

  .prochat-shortcuts{
    flex:none!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
    padding:8px 18px 12px!important;
    background:#0b1115!important;
  }

  .prochat-shortcuts a{
    min-height:46px!important;
    border-radius:24px!important;
    background:#202c33!important;
    color:#e9edef!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-decoration:none!important;
    font-size:14px!important;
    font-weight:900!important;
    border:1px solid rgba(255,255,255,.04)!important;
  }

  .prochat-shortcuts a:nth-child(3){
    display:none!important;
  }

  .prochat-tabs{
    flex:none!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    padding:6px 18px 12px!important;
    background:#0b1115!important;
    border:0!important;
  }

  .prochat-tabs a{
    height:42px!important;
    border-radius:999px!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    background:#111b21!important;
    color:#aebac1!important;
    font-size:14px!important;
    font-weight:900!important;
    text-decoration:none!important;
  }

  .prochat-tabs a.active{
    background:#0a4a36!important;
    color:#d9fdd3!important;
  }

  .prochat-search{
    flex:none!important;
    padding:0 18px 12px!important;
    background:#0b1115!important;
  }

  .prochat-search input{
    width:100%!important;
    height:48px!important;
    border:0!important;
    border-radius:24px!important;
    background:#202c33!important;
    color:#e9edef!important;
    padding:0 16px!important;
    font-size:15px!important;
    box-shadow:none!important;
  }

  .prochat-search input::placeholder{
    color:#8696a0!important;
  }

  .prochat-list{
    flex:1!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding:0 18px 90px!important;
    background:#0b1115!important;
  }

  .prochat-row{
    display:grid!important;
    grid-template-columns:58px 1fr auto!important;
    gap:12px!important;
    align-items:center!important;
    padding:12px 0!important;
    border-bottom:1px solid rgba(134,150,160,.12)!important;
    background:transparent!important;
    color:#e9edef!important;
    min-height:78px!important;
    text-decoration:none!important;
  }

  .prochat-row:hover,
  .prochat-row.active{
    background:transparent!important;
  }

  .prochat-avatar{
    width:58px!important;
    height:58px!important;
    border-radius:50%!important;
    object-fit:cover!important;
    font-size:21px!important;
    flex:none!important;
  }

  .prochat-row-main{
    min-width:0!important;
    overflow:hidden!important;
  }

  .prochat-row-main b{
    display:block!important;
    color:#e9edef!important;
    font-size:18px!important;
    font-weight:600!important;
    margin:0 0 5px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .prochat-row-main span{
    display:block!important;
    color:#8696a0!important;
    font-size:14px!important;
    max-width:100%!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .prochat-row-meta{
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-end!important;
    gap:6px!important;
    min-width:42px!important;
  }

  .prochat-row-meta time{
    color:#8696a0!important;
    font-size:12px!important;
  }

  .prochat-row-meta em{
    width:auto!important;
    min-width:22px!important;
    height:22px!important;
    border-radius:999px!important;
    background:#25d366!important;
    color:#052e1d!important;
    font-size:11px!important;
  }

  .prochat-create{
    background:#111b21!important;
    border:1px solid rgba(255,255,255,.06)!important;
    border-radius:18px!important;
    padding:12px!important;
    margin-bottom:10px!important;
  }

  .prochat-create summary{
    color:#d9fdd3!important;
    font-weight:900!important;
  }

  .prochat-create input{
    margin-top:10px!important;
    background:#202c33!important;
    color:#fff!important;
    border:0!important;
  }

  .prochat-members label{
    background:#202c33!important;
    color:#e9edef!important;
    border:0!important;
  }

  /* شاشة المحادثة على الهاتف */
  .prochat-window{
    position:fixed!important;
    inset:0!important;
    width:100%!important;
    height:100vh!important;
    z-index:7000!important;
    display:flex!important;
    flex-direction:column!important;
    background:#0b141a!important;
    transform:none!important;
    border:0!important;
  }

  .prochat-window-head{
    flex:none!important;
    height:64px!important;
    padding:8px 10px!important;
    background:#202c33!important;
    border:0!important;
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    color:#e9edef!important;
  }

  .prochat-back{
    display:flex!important;
    width:34px!important;
    height:46px!important;
    align-items:center!important;
    justify-content:center!important;
    color:#e9edef!important;
    text-decoration:none!important;
    font-size:38px!important;
    line-height:1!important;
    flex:none!important;
  }

  .prochat-window-head .prochat-avatar{
    width:42px!important;
    height:42px!important;
    font-size:17px!important;
  }

  .prochat-window-title{
    flex:1!important;
    min-width:0!important;
  }

  .prochat-window-title h2{
    margin:0 0 3px!important;
    color:#e9edef!important;
    font-size:16px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .prochat-window-title p{
    margin:0!important;
    color:#aebac1!important;
    font-size:11px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .prochat-more{
    width:34px!important;
    height:34px!important;
    background:transparent!important;
    color:#aebac1!important;
    font-size:24px!important;
    flex:none!important;
  }

  .prochat-messages{
    flex:1!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding:12px 10px 14px!important;
    background:
      linear-gradient(rgba(11,20,26,.96),rgba(11,20,26,.96)),
      radial-gradient(circle at top left,rgba(37,211,102,.08),transparent 35%),
      radial-gradient(circle at bottom right,rgba(18,140,126,.10),transparent 35%)!important;
  }

  .prochat-line{
    display:flex!important;
    margin-bottom:8px!important;
    width:100%!important;
  }

  .prochat-line.mine{
    justify-content:flex-start!important;
  }

  .prochat-line.theirs{
    justify-content:flex-end!important;
  }

  .prochat-bubble{
    max-width:84%!important;
    min-width:0!important;
    background:#202c33!important;
    color:#e9edef!important;
    border-radius:13px!important;
    padding:7px 9px 5px!important;
    box-shadow:0 1px 2px rgba(0,0,0,.22)!important;
    overflow-wrap:anywhere!important;
  }

  .prochat-line.mine .prochat-bubble{
    background:#005c4b!important;
    border-bottom-left-radius:4px!important;
  }

  .prochat-line.theirs .prochat-bubble{
    background:#202c33!important;
    border-bottom-right-radius:4px!important;
  }

  .prochat-bubble p{
    color:#e9edef!important;
    font-size:14px!important;
    line-height:1.6!important;
    margin:0!important;
  }

  .prochat-time{
    color:#aebac1!important;
    font-size:10px!important;
    margin-top:3px!important;
  }

  .prochat-sender{
    color:#25d366!important;
    font-size:12px!important;
  }

  .prochat-reply-preview{
    background:rgba(0,0,0,.18)!important;
    border-right:4px solid #25d366!important;
    border-radius:8px!important;
    padding:6px!important;
    margin-bottom:6px!important;
  }

  .prochat-reply-preview b{
    color:#25d366!important;
  }

  .prochat-reply-preview span{
    color:#aebac1!important;
    max-width:220px!important;
  }

  .prochat-bubble-actions{
    position:static!important;
    display:flex!important;
    gap:4px!important;
    margin-bottom:5px!important;
    background:transparent!important;
    padding:0!important;
    box-shadow:none!important;
  }

  .prochat-bubble-actions button{
    background:rgba(255,255,255,.08)!important;
    color:#aebac1!important;
    padding:4px 7px!important;
    font-size:10px!important;
    border-radius:999px!important;
  }

  .prochat-bubble-actions form{
    margin:0!important;
  }

  .ga-chat-img{
    max-width:230px!important;
    max-height:260px!important;
    border-radius:10px!important;
  }

  .ga-chat-audio{
    width:230px!important;
  }

  .prochat-compose{
    flex:none!important;
    min-height:62px!important;
    background:#0b141a!important;
    border:0!important;
    display:grid!important;
    grid-template-columns:42px 1fr 46px!important;
    gap:7px!important;
    padding:8px!important;
    align-items:end!important;
  }

  .prochat-reply-bar{
    grid-column:1/-1!important;
    background:#202c33!important;
    border-right:4px solid #25d366!important;
    color:#e9edef!important;
    border-radius:12px!important;
    padding:7px 9px!important;
  }

  .prochat-reply-bar b{
    color:#25d366!important;
  }

  .prochat-reply-bar span{
    color:#aebac1!important;
  }

  .prochat-attach{
    width:42px!important;
    height:42px!important;
    background:#202c33!important;
    color:#aebac1!important;
    border-radius:50%!important;
    font-size:22px!important;
  }

  .prochat-compose textarea{
    min-height:42px!important;
    max-height:100px!important;
    border-radius:22px!important;
    background:#202c33!important;
    border:0!important;
    color:#e9edef!important;
    padding:11px 13px!important;
    font-size:14px!important;
  }

  .prochat-compose textarea::placeholder{
    color:#8696a0!important;
  }

  .prochat-send{
    width:46px!important;
    height:46px!important;
    border-radius:50%!important;
    background:#00a884!important;
    color:#fff!important;
    padding:0!important;
    font-size:0!important;
  }

  .prochat-send::after{
    content:'➤';
    font-size:18px!important;
  }

  .prochat-empty{
    color:#8696a0!important;
    font-size:15px!important;
    text-align:center!important;
  }

  .forward-modal{
    z-index:9000!important;
    padding:14px!important;
  }

  .forward-box{
    max-height:82vh!important;
    overflow:auto!important;
    border-radius:20px!important;
  }

  .forward-list{
    max-height:50vh!important;
  }
}

@media(max-width:390px){
  .prochat-brand h1{
    font-size:28px!important;
  }
  .prochat-row{
    grid-template-columns:52px 1fr auto!important;
  }
  .prochat-avatar{
    width:52px!important;
    height:52px!important;
  }
  .prochat-row-main b{
    font-size:16px!important;
  }
  .prochat-row-main span{
    font-size:13px!important;
  }
  .prochat-bubble{
    max-width:88%!important;
  }
}


/* =========================
   V19 WhatsApp Mobile Start Screen + Back Fix
========================= */
@media(max-width:820px){

  /* أول صفحة الشات = قائمة المحادثات فقط */
  .prochat-shell:not(:has(.prochat-window)) .prochat-sidebar{
    display:flex!important;
  }

  .prochat-shell:not(:has(.prochat-window)) .prochat-list{
    padding-bottom:110px!important;
  }

  /* تحسين شكل الصفحة الأولى لتكون أقرب لواتساب */
  .prochat-shell:not(:has(.prochat-window)) .prochat-me{
    padding-top:34px!important;
    padding-bottom:18px!important;
  }

  .prochat-shell:not(:has(.prochat-window)) .prochat-brand h1{
    font-size:33px!important;
  }

  .prochat-shell:not(:has(.prochat-window)) .prochat-shortcuts{
    display:none!important;
  }

  .prochat-shell:not(:has(.prochat-window)) .prochat-tabs{
    padding-top:8px!important;
  }

  .prochat-shell:not(:has(.prochat-window)) .prochat-row{
    min-height:82px!important;
  }

  /* عند فتح محادثة: اخفي القائمة وخلي المحادثة Full Screen */
  .prochat-shell:has(.prochat-window) .prochat-sidebar{
    display:none!important;
  }

  .prochat-window{
    right:0!important;
    left:0!important;
    top:0!important;
    bottom:0!important;
  }

  /* زر الرجوع */
  .prochat-back{
    display:flex!important;
    transform:none!important;
    font-size:42px!important;
    color:#e9edef!important;
    padding:0!important;
    margin:0!important;
    cursor:pointer!important;
    z-index:10!important;
  }

  /* إخفاء أزرار الرسالة افتراضيًا على الهاتف */
  .prochat-bubble .prochat-bubble-actions{
    display:none!important;
  }

  .prochat-bubble.show-actions .prochat-bubble-actions{
    display:flex!important;
    position:static!important;
    margin-bottom:6px!important;
    background:transparent!important;
    box-shadow:none!important;
    padding:0!important;
    gap:5px!important;
  }

  .prochat-bubble.show-actions .prochat-bubble-actions button{
    background:rgba(255,255,255,.10)!important;
    color:#d1d7db!important;
    border-radius:999px!important;
    padding:5px 9px!important;
    font-size:11px!important;
  }

  /* شكل الرسائل أنضف */
  .prochat-bubble{
    padding-top:8px!important;
  }

  .prochat-deleted{
    font-size:14px!important;
    color:#cbd5e1!important;
  }

  /* صندوق الكتابة */
  .prochat-compose{
    position:relative!important;
    bottom:auto!important;
  }

  /* لو مفيش محادثة مفتوحة، ممنوع ظهور مساحة محادثة فاضية */
  .prochat-empty.big{
    display:none!important;
  }
}

/* Desktop: لا تخفي القائمة عند فتح محادثة */
@media(min-width:821px){
  .prochat-shell:has(.prochat-window) .prochat-sidebar{
    display:flex!important;
  }
}


/* =========================
   V20 Mobile Chat NO Fullscreen + Back Fix
   المطلوب: الشات ليس Full Screen، والرجوع يظهر جهات التواصل
========================= */
@media(max-width:820px){

  body:has(.prochat-shell){
    padding-top:0!important;
    margin:0!important;
    background:#0b1115!important;
    overflow-x:hidden!important;
  }

  body:has(.prochat-shell) .content{
    padding:0!important;
    margin:0!important;
    width:100%!important;
    min-height:100vh!important;
    background:#0b1115!important;
  }

  body:has(.prochat-shell) .sidebar,
  body:has(.prochat-shell) .app-mobile-topbar,
  body:has(.prochat-shell) .page-hero{
    display:none!important;
  }

  /* الغاء Full Screen نهائيًا */
  .prochat-shell{
    display:block!important;
    position:relative!important;
    width:100%!important;
    min-height:100vh!important;
    height:auto!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    background:#0b1115!important;
  }

  .prochat-window{
    position:relative!important;
    inset:auto!important;
    right:auto!important;
    left:auto!important;
    top:auto!important;
    bottom:auto!important;
    z-index:1!important;
    width:100%!important;
    height:auto!important;
    min-height:100vh!important;
    max-height:none!important;
    border:0!important;
    transform:none!important;
    background:#0b141a!important;
  }

  /* عند فتح قائمة الشات: اعرض جهات التواصل فقط واخفِ شاشة المحادثة الفاضية */
  .prochat-shell.chat-list-open .prochat-sidebar{
    display:flex!important;
    width:100%!important;
    min-height:100vh!important;
    height:100vh!important;
  }

  .prochat-shell.chat-list-open .prochat-window{
    display:none!important;
  }

  /* عند فتح محادثة: اخفي القائمة واعرض المحادثة عادي بدون fixed */
  .prochat-shell.chat-open .prochat-sidebar{
    display:none!important;
  }

  .prochat-shell.chat-open .prochat-window{
    display:flex!important;
    flex-direction:column!important;
  }

  /* حماية إضافية لو CSS القديم استخدم :has */
  .prochat-shell:not(.chat-open) .prochat-sidebar{
    display:flex!important;
  }

  .prochat-shell:not(.chat-open) .prochat-window{
    display:none!important;
  }

  /* قائمة التواصل */
  .prochat-sidebar{
    background:#0b1115!important;
    color:#e9edef!important;
    border:0!important;
    overflow:hidden!important;
  }

  .prochat-me{
    background:#0b1115!important;
    color:#fff!important;
    border:0!important;
    padding:30px 18px 16px!important;
  }

  .prochat-brand h1{
    color:#f8fafc!important;
    font-size:32px!important;
    margin:0!important;
  }

  .prochat-brand p{
    color:#8696a0!important;
  }

  .prochat-shortcuts{
    display:none!important;
  }

  .prochat-tabs{
    background:#0b1115!important;
    border:0!important;
    padding:8px 18px 12px!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }

  .prochat-tabs a{
    background:#111b21!important;
    color:#aebac1!important;
    border-radius:999px!important;
    height:42px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  .prochat-tabs a.active{
    background:#0a4a36!important;
    color:#d9fdd3!important;
  }

  .prochat-search{
    background:#0b1115!important;
    padding:0 18px 12px!important;
  }

  .prochat-search input{
    background:#202c33!important;
    color:#e9edef!important;
    border-radius:22px!important;
    height:48px!important;
    border:0!important;
  }

  .prochat-list{
    flex:1!important;
    overflow-y:auto!important;
    padding:0 18px 100px!important;
    background:#0b1115!important;
  }

  .prochat-row{
    background:transparent!important;
    color:#e9edef!important;
    border-bottom:1px solid rgba(134,150,160,.12)!important;
    min-height:78px!important;
    padding:12px 0!important;
  }

  .prochat-row-main b{
    color:#e9edef!important;
  }

  .prochat-row-main span,
  .prochat-row-meta time{
    color:#8696a0!important;
  }

  /* رأس المحادثة */
  .prochat-window-head{
    position:sticky!important;
    top:0!important;
    z-index:20!important;
    height:64px!important;
    background:#202c33!important;
    border:0!important;
    color:#e9edef!important;
  }

  .prochat-back{
    display:flex!important;
    width:38px!important;
    height:46px!important;
    align-items:center!important;
    justify-content:center!important;
    color:#e9edef!important;
    text-decoration:none!important;
    font-size:42px!important;
    line-height:1!important;
    flex:none!important;
    pointer-events:auto!important;
    cursor:pointer!important;
  }

  .prochat-window-title h2{
    color:#e9edef!important;
  }

  .prochat-window-title p{
    color:#aebac1!important;
  }

  .prochat-more{
    background:transparent!important;
    color:#aebac1!important;
  }

  /* جسم الرسائل */
  .prochat-messages{
    flex:1!important;
    min-height:calc(100vh - 134px)!important;
    max-height:none!important;
    overflow-y:auto!important;
    background:#0b141a!important;
    padding:12px 10px 18px!important;
  }

  /* الشات ليس fixed، لكن صندوق الإرسال ثابت أسفل شاشة المحادثة */
  .prochat-compose{
    position:sticky!important;
    bottom:0!important;
    z-index:25!important;
    background:#0b141a!important;
    border:0!important;
  }

  /* أزرار الرسالة تظهر عند الضغط فقط */
  .prochat-bubble .prochat-bubble-actions{
    display:none!important;
  }

  .prochat-bubble.show-actions .prochat-bubble-actions{
    display:flex!important;
    position:static!important;
    margin-bottom:6px!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  .prochat-bubble.show-actions .prochat-bubble-actions button{
    background:rgba(255,255,255,.10)!important;
    color:#d1d7db!important;
    border-radius:999px!important;
  }
}

/* Desktop يبقى كما هو */
@media(min-width:821px){
  .prochat-shell.chat-open .prochat-sidebar,
  .prochat-shell.chat-list-open .prochat-sidebar{
    display:flex!important;
  }
  .prochat-shell.chat-list-open .prochat-window{
    display:flex!important;
  }
}

/* =========================================================
   V23 PROFESSIONAL UI REFRESH - FULL PORTAL UPDATE
   تحديث شامل بدون حذف وظائف الموقع القديمة
========================================================= */
:root{
  --ga-bg:#f3f6fb;
  --ga-surface:#ffffff;
  --ga-ink:#0f172a;
  --ga-muted:#64748b;
  --ga-primary:#173b7a;
  --ga-primary-2:#2563eb;
  --ga-accent:#08b68b;
  --ga-border:#dbe4ef;
  --ga-shadow:0 18px 45px rgba(15,23,42,.10);
  --ga-radius:24px;
}
html,body{height:auto!important;min-height:100%;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
body{background:radial-gradient(circle at 20% 0%,rgba(37,99,235,.10),transparent 34%),linear-gradient(180deg,#f7faff,#edf3fb)!important;color:var(--ga-ink);font-family:Tahoma,Arial,sans-serif}
.layout{background:transparent!important;align-items:stretch!important}
.sidebar{
  width:292px!important;min-width:292px!important;background:linear-gradient(180deg,#0b1427,#0f172a 55%,#08111f)!important;
  border-left:1px solid rgba(255,255,255,.08)!important;box-shadow:18px 0 45px rgba(15,23,42,.22)!important;
  padding:28px 18px!important;scrollbar-width:thin;z-index:80!important;
}
.sidebar h1{font-size:28px!important;letter-spacing:.2px}.sidebar p{color:#bdc8d9!important}.userbox{background:linear-gradient(135deg,rgba(255,255,255,.12),rgba(255,255,255,.04))!important;border:1px solid rgba(255,255,255,.16)!important;border-radius:20px!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
.sidebar nav a{position:relative;display:flex!important;align-items:center;justify-content:space-between;border-radius:16px!important;margin-bottom:8px!important;padding:13px 15px!important;font-weight:800!important;color:#f8fafc!important;transition:all .18s ease!important}.sidebar nav a:hover,.sidebar nav a.active-link{background:rgba(255,255,255,.12)!important;transform:translateX(-3px)}.sidebar nav a.active-link:before{content:"";width:4px;height:28px;background:linear-gradient(180deg,#22d3ee,#22c55e);position:absolute;right:-8px;border-radius:999px}.sidebar .logout{background:linear-gradient(135deg,#991b1b,#dc2626)!important;color:#fff!important;box-shadow:0 12px 25px rgba(220,38,38,.18)}
.content{background:transparent!important;padding:28px!important;overflow:visible!important;min-height:100vh!important}.page-hero{border:1px solid rgba(219,228,239,.85)!important;background:rgba(255,255,255,.82)!important;backdrop-filter:blur(10px);border-radius:30px!important;box-shadow:var(--ga-shadow)!important;padding:28px 30px!important}.page-hero h1{font-size:32px!important;font-weight:900!important}.page-hero p{font-size:15px!important;color:var(--ga-muted)!important}.pro-hero{background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(238,246,255,.86))!important}
.grid{gap:18px!important}.kpi,.card{border:1px solid rgba(219,228,239,.9)!important;border-radius:26px!important;background:rgba(255,255,255,.92)!important;box-shadow:var(--ga-shadow)!important}.kpi{position:relative;overflow:hidden}.kpi:after{content:"";position:absolute;inset:auto -28px -38px auto;width:110px;height:110px;border-radius:50%;background:rgba(37,99,235,.10)}.kpi span{font-weight:800;color:#64748b!important}.kpi b{font-size:36px!important}.head{background:linear-gradient(180deg,#fff,#f8fbff)!important}.body{background:#fff}.quick-card{border-radius:22px!important;background:linear-gradient(135deg,#fff,#f8fbff)!important;box-shadow:0 10px 28px rgba(15,23,42,.06)!important}
input,select,textarea{border:1px solid #cbd8e7!important;border-radius:16px!important;padding:13px 14px!important;outline:none!important;transition:.15s!important;touch-action:auto!important;background:#fff!important}input:focus,select:focus,textarea:focus{border-color:#2563eb!important;box-shadow:0 0 0 4px rgba(37,99,235,.11)!important}label{font-weight:900!important;color:#0f172a!important}.btn,button,.primary{border-radius:16px!important;background:linear-gradient(135deg,#1d4ed8,#2563eb)!important;color:#fff!important;box-shadow:0 12px 25px rgba(37,99,235,.18)!important}.light{background:#f1f5f9!important;color:#334155!important}.green{background:#dcfce7!important;color:#047857!important}.red{background:#fee2e2!important;color:#b91c1c!important}.orange{background:#ffedd5!important;color:#c2410c!important}
table{border-radius:20px!important;overflow:hidden!important}th{background:#f1f5f9!important;color:#334155!important;font-weight:900!important}td,th{border-bottom:1px solid #e7eef7!important}.table-wrap{overflow-x:auto!important}.tabs-pro{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px}.tabs-pro a{text-decoration:none;background:#fff;color:#0f172a;border:1px solid #dbe4ef;border-radius:999px;padding:12px 18px;font-weight:900;box-shadow:0 8px 20px rgba(15,23,42,.05)}.tabs-pro a.active{background:linear-gradient(135deg,#0f172a,#1e3a8a);color:#fff}.viewer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px}.viewer-grid label{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:12px}.progress{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden;min-width:90px;margin-bottom:6px}.progress span{display:block;height:100%;background:linear-gradient(90deg,#22c55e,#14b8a6)}
.app-mobile-topbar{display:none}.app-drawer-head{display:none}
@media(max-width:820px){
  html,body{height:auto!important;min-height:100%!important;overflow-y:auto!important;position:relative!important;touch-action:auto!important;background:#f3f6fb!important}
  body.drawer-open{overflow-y:auto!important;position:relative!important;height:auto!important}
  .app-mobile-topbar{position:sticky!important;top:0;z-index:120;display:flex!important;align-items:center;gap:12px;background:linear-gradient(135deg,#0b1427,#172554)!important;color:#fff;height:auto;min-height:68px;padding:12px 14px;box-shadow:0 12px 30px rgba(15,23,42,.22)}
  .app-menu-btn{background:rgba(255,255,255,.10)!important;color:#fff!important;box-shadow:none!important;min-width:46px;height:46px}.app-topbar-title strong{display:block}.app-topbar-title span{display:block;color:#cbd5e1;font-size:12px}.app-topbar-notif{margin-right:auto;color:#fff;text-decoration:none;background:rgba(255,255,255,.10);border-radius:14px;padding:10px 12px}
  .layout{display:block!important;min-height:auto!important;height:auto!important;overflow:visible!important}.content{padding:16px!important;display:block!important;min-height:calc(100vh - 70px)!important;height:auto!important;overflow:visible!important;padding-bottom:140px!important}.sidebar{position:fixed!important;top:0!important;right:-310px!important;width:300px!important;min-width:300px!important;height:100vh!important;z-index:300!important;transition:right .25s ease!important;padding-top:20px!important}.sidebar.drawer-active{right:0!important}.app-drawer-head{display:flex!important;align-items:center;justify-content:space-between;margin-bottom:12px;color:#fff}.app-drawer-head button{background:rgba(255,255,255,.12)!important;color:#fff!important;box-shadow:none!important;border-radius:12px!important}.app-drawer-backdrop{display:none!important;position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:250}.drawer-open .app-drawer-backdrop{display:block!important}.grid,.form-grid,.quick-grid{grid-template-columns:1fr!important}.page-hero{padding:20px!important;border-radius:24px!important}.page-hero h1{font-size:25px!important}.card,.kpi{border-radius:22px!important}.body{padding:16px!important}table{display:table!important;white-space:normal!important}.table-wrap,table{overflow-x:auto!important}.tabs-pro{overflow-x:auto;flex-wrap:nowrap;padding-bottom:7px}.tabs-pro a{white-space:nowrap}.prochat-window,.wa-conversation-screen{position:relative!important;inset:auto!important;height:auto!important;min-height:calc(100vh - 90px)!important;z-index:1!important}.prochat-shell,.wa-app-shell{height:auto!important;min-height:calc(100vh - 90px)!important;overflow:visible!important}.prochat-messages,.wa-message-area{overflow:auto!important;max-height:none!important}input,textarea,select,button,label{pointer-events:auto!important;touch-action:auto!important;user-select:text!important;-webkit-user-select:text!important}
}

/* =========================================================
   V24 PROFESSIONAL UI REDESIGN
   ألوان جديدة + تجربة موبايل أفضل + شكل إداري احترافي
========================================================= */
:root{
  --ga-bg:#f4f7fb;
  --ga-surface:#ffffff;
  --ga-surface-2:#f8fafc;
  --ga-border:#e2e8f0;
  --ga-text:#0f172a;
  --ga-muted:#64748b;
  --ga-primary:#2563eb;
  --ga-primary-2:#1d4ed8;
  --ga-dark:#0f172a;
  --ga-green:#16a34a;
  --ga-orange:#f59e0b;
  --ga-red:#dc2626;
  --ga-radius:22px;
  --ga-shadow:0 18px 45px rgba(15,23,42,.08);
  --ga-shadow-soft:0 10px 28px rgba(15,23,42,.06);
}

html,body{
  background:radial-gradient(circle at top left,rgba(37,99,235,.10),transparent 32%),linear-gradient(135deg,#f8fafc 0%,#eef4ff 100%)!important;
  color:var(--ga-text)!important;
  min-height:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  scroll-behavior:smooth;
}
body{font-family:Tahoma,Arial,sans-serif!important;}

.layout{background:transparent!important;min-height:100vh!important;}
.content{
  background:transparent!important;
  padding:26px!important;
  overflow:visible!important;
  min-height:100vh!important;
}

.sidebar{
  background:linear-gradient(180deg,#07111f 0%,#0f172a 50%,#111827 100%)!important;
  color:#fff!important;
  border-left:1px solid rgba(255,255,255,.08)!important;
  box-shadow:18px 0 55px rgba(15,23,42,.20)!important;
}
.sidebar h1{font-size:28px!important;letter-spacing:.3px!important;margin-bottom:4px!important;color:#fff!important;}
.sidebar p{color:#93a4bd!important;font-weight:600!important;}
.userbox{
  background:linear-gradient(135deg,rgba(37,99,235,.22),rgba(22,163,74,.15))!important;
  border:1px solid rgba(255,255,255,.10)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06)!important;
  border-radius:20px!important;
}
.userbox b{color:#fff!important;}
.userbox span{color:#cbd5e1!important;}
.sidebar nav a{
  color:#dbeafe!important;
  border-radius:16px!important;
  margin:5px 0!important;
  padding:13px 14px!important;
  font-weight:800!important;
  transition:.18s ease!important;
}
.sidebar nav a:hover,
.sidebar nav a.active{
  background:linear-gradient(135deg,var(--ga-primary),#0ea5e9)!important;
  color:#fff!important;
  transform:translateX(-2px);
}
.sidebar nav a.logout{background:rgba(220,38,38,.12)!important;color:#fecaca!important;}

.app-mobile-topbar{
  background:rgba(255,255,255,.88)!important;
  border-bottom:1px solid var(--ga-border)!important;
  box-shadow:0 8px 25px rgba(15,23,42,.08)!important;
  backdrop-filter:blur(14px)!important;
}
.app-menu-btn,.app-topbar-notif{
  background:var(--ga-dark)!important;color:#fff!important;border-radius:14px!important;
  box-shadow:0 10px 24px rgba(15,23,42,.18)!important;
}
.app-topbar-title strong{color:var(--ga-text)!important;font-size:18px!important;}
.app-topbar-title span{color:var(--ga-muted)!important;font-weight:700!important;}

.page-hero,.pro-hero{
  background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 70%,#0ea5e9 100%)!important;
  color:#fff!important;
  border-radius:28px!important;
  padding:34px!important;
  box-shadow:var(--ga-shadow)!important;
  position:relative;overflow:hidden;margin-bottom:22px!important;
}
.page-hero:after,.pro-hero:after{
  content:"";position:absolute;inset:auto -60px -90px auto;width:260px;height:260px;
  background:rgba(255,255,255,.10);border-radius:50%;
}
.page-hero h1,.pro-hero h1{font-size:34px!important;color:#fff!important;margin:0 0 8px!important;font-weight:900!important;}
.page-hero p,.pro-hero p{color:#dbeafe!important;margin:0!important;font-size:15px!important;font-weight:700!important;}

.card{
  background:rgba(255,255,255,.92)!important;border:1px solid rgba(226,232,240,.9)!important;
  border-radius:var(--ga-radius)!important;box-shadow:var(--ga-shadow-soft)!important;
  overflow:hidden!important;margin-bottom:18px!important;
}
.card .head{
  background:linear-gradient(180deg,#fff,#f8fafc)!important;border-bottom:1px solid var(--ga-border)!important;
  padding:18px 22px!important;
}
.card .head h2,.card h2{font-size:20px!important;font-weight:900!important;color:var(--ga-text)!important;margin:0!important;}
.card .body{padding:22px!important;background:transparent!important;}

.kpis,.stats-grid,.dashboard-grid{gap:18px!important;}
.kpi,.stat-card,.dashboard-card{
  background:linear-gradient(135deg,#ffffff,#f8fbff)!important;border:1px solid rgba(226,232,240,.9)!important;
  border-radius:24px!important;box-shadow:var(--ga-shadow-soft)!important;
  padding:22px!important;color:var(--ga-text)!important;position:relative;overflow:hidden;
}
.kpi:before,.stat-card:before,.dashboard-card:before{
  content:"";position:absolute;top:0;right:0;width:7px;height:100%;background:linear-gradient(180deg,var(--ga-primary),#0ea5e9);
}
.kpi b,.stat-card b,.dashboard-card b{font-size:28px!important;color:var(--ga-text)!important;}
.kpi span,.stat-card span,.dashboard-card span{color:var(--ga-muted)!important;font-weight:800!important;}

.form-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important;}
.field.full{grid-column:1/-1!important;}
.field label{display:block!important;margin-bottom:8px!important;color:#334155!important;font-weight:900!important;font-size:13px!important;}
input,select,textarea{
  width:100%!important;background:#fff!important;border:1px solid var(--ga-border)!important;border-radius:16px!important;
  padding:13px 14px!important;outline:none!important;color:var(--ga-text)!important;transition:.18s ease!important;
}
textarea{min-height:120px!important;resize:vertical!important;}
input:focus,select:focus,textarea:focus{border-color:var(--ga-primary)!important;box-shadow:0 0 0 4px rgba(37,99,235,.12)!important;}
button,.primary,.btn.primary,a.primary{
  background:linear-gradient(135deg,var(--ga-primary),#0ea5e9)!important;color:#fff!important;border:0!important;
  border-radius:16px!important;padding:12px 18px!important;font-weight:900!important;box-shadow:0 12px 24px rgba(37,99,235,.20)!important;
}
button:hover,.primary:hover{filter:brightness(.98);transform:translateY(-1px);}

.tabs-pro,.hr-tabs{
  display:flex!important;gap:10px!important;flex-wrap:wrap!important;margin:0 0 18px!important;
  background:#fff!important;border:1px solid var(--ga-border)!important;border-radius:22px!important;padding:10px!important;box-shadow:var(--ga-shadow-soft)!important;
}
.tabs-pro a,.hr-tabs a{
  text-decoration:none!important;color:var(--ga-muted)!important;background:#f8fafc!important;border:1px solid transparent!important;
  padding:12px 16px!important;border-radius:16px!important;font-weight:900!important;
}
.tabs-pro a.active,.hr-tabs a.active{
  background:linear-gradient(135deg,var(--ga-primary),#0ea5e9)!important;color:#fff!important;box-shadow:0 10px 25px rgba(37,99,235,.20)!important;
}

.table-wrap{overflow-x:auto!important;}
table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;min-width:780px;}
th{background:#f8fafc!important;color:#334155!important;font-weight:900!important;padding:14px!important;border-bottom:1px solid var(--ga-border)!important;white-space:nowrap;}
td{background:#fff!important;padding:14px!important;border-bottom:1px solid #f1f5f9!important;color:#334155!important;vertical-align:middle!important;}
tr:hover td{background:#f8fbff!important;}
.badge{border-radius:999px!important;padding:7px 12px!important;font-weight:900!important;}

.chat-shell,.prochat-shell{border-radius:26px!important;box-shadow:var(--ga-shadow)!important;border:1px solid var(--ga-border)!important;overflow:hidden!important;}
.prochat-window-head{background:linear-gradient(135deg,#0f172a,#1d4ed8)!important;color:#fff!important;}
.prochat-messages{background:#edf3fb!important;}
.prochat-compose{background:#fff!important;border-top:1px solid var(--ga-border)!important;}

@media(max-width:820px){
  html,body{height:auto!important;min-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;position:relative!important;-webkit-overflow-scrolling:touch!important;}
  .layout{display:block!important;min-height:100vh!important;overflow:visible!important;}
  .content{padding:82px 14px 120px!important;min-height:100vh!important;overflow:visible!important;}
  .app-mobile-topbar{display:flex!important;position:fixed!important;top:0!important;right:0!important;left:0!important;z-index:3000!important;height:66px!important;}
  .sidebar{position:fixed!important;top:0!important;right:-86%!important;width:86%!important;height:100vh!important;z-index:3100!important;transition:.25s ease!important;overflow-y:auto!important;}
  body.drawer-open .sidebar,.sidebar.open,.sidebar.show{right:0!important;}
  .app-drawer-backdrop{display:none!important;}
  body.drawer-open .app-drawer-backdrop{display:block!important;position:fixed!important;inset:0!important;background:rgba(15,23,42,.55)!important;z-index:3050!important;}
  .page-hero,.pro-hero{padding:24px!important;border-radius:24px!important;}
  .page-hero h1,.pro-hero h1{font-size:25px!important;}
  .form-grid{grid-template-columns:1fr!important;gap:12px!important;}
  .tabs-pro,.hr-tabs{flex-wrap:nowrap!important;overflow-x:auto!important;padding:8px!important;}
  .tabs-pro a,.hr-tabs a{white-space:nowrap!important;}
  .card .body{padding:16px!important;}
  table{min-width:720px!important;}
  .prochat-shell{height:auto!important;min-height:calc(100vh - 90px)!important;}
  .prochat-window,.prochat-sidebar{height:auto!important;min-height:calc(100vh - 90px)!important;}
  .prochat-messages{min-height:55vh!important;max-height:none!important;overflow-y:auto!important;}
}

/* =========================================================
   V25 FINAL MOBILE SCROLL FIX
   المشكلة: الصفحة لا تتحرك إلا بعد فتح القائمة الجانبية.
   السبب غالبًا كان body/layout/content أو overlay ماسك اللمس على الموبايل.
   هذا البلوك يجب أن يكون في آخر style.css حتى يغلب أي قواعد قبله.
========================================================= */
@media (max-width:820px){
  html,
  body{
    width:100%!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    position:relative!important;
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:auto!important;
  }

  body{
    padding-top:64px!important;
    min-height:100dvh!important;
  }

  body:not(.drawer-open){
    overflow-y:auto!important;
    overflow-x:hidden!important;
    position:relative!important;
    height:auto!important;
    max-height:none!important;
  }

  .layout{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    position:relative!important;
    touch-action:pan-y!important;
  }

  .content{
    display:block!important;
    width:100%!important;
    min-height:calc(100dvh - 64px)!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    position:relative!important;
    touch-action:pan-y!important;
    padding-bottom:max(140px, env(safe-area-inset-bottom))!important;
  }

  .page-hero,
  .grid,
  .quick-grid,
  .card,
  .head,
  .body,
  .form-grid,
  form,
  fieldset,
  .field,
  main,
  section{
    height:auto!important;
    min-height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    position:relative!important;
  }

  input,
  textarea,
  select,
  button,
  label,
  a{
    pointer-events:auto!important;
    touch-action:auto!important;
  }

  input,
  textarea{
    user-select:text!important;
    -webkit-user-select:text!important;
  }

  textarea{
    min-height:110px!important;
  }

  table{
    display:block!important;
    overflow-x:auto!important;
    overflow-y:visible!important;
    max-height:none!important;
    white-space:nowrap!important;
  }

  /* أي طبقة مخفية كانت ماسكة اللمس وهي سبب شائع لعدم التمرير */
  body:not(.drawer-open) .app-drawer-backdrop,
  body:not(.drawer-open) .overlay,
  body:not(.drawer-open) .backdrop,
  body:not(.drawer-open) .modal-backdrop,
  body:not(.drawer-open) .sidebar-backdrop{
    display:none!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  body.drawer-open .app-drawer-backdrop{
    display:block!important;
    pointer-events:auto!important;
  }
}
