/* Masnaa360 shared styles — dark industrial theme, Arabic RTL */
body {
  background-color: #090d16;
  color: #e2e8f0;
  font-family: 'Cairo', sans-serif;
}
.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.glow-accent { box-shadow: 0 0 20px rgba(6, 182, 212, 0.25); }
.glow-purple { box-shadow: 0 0 20px rgba(168, 85, 247, 0.25); }

.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #0f172a; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Help icons */
.help-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  margin-right: 4px;
  border-radius: 9999px;
  font-size: 11px;
  line-height: 1;
  color: #22d3ee;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  cursor: pointer;
  vertical-align: middle;
  transition: all .15s;
}
.help-ico:hover { background: rgba(6, 182, 212, 0.3); color: #fff; transform: scale(1.15); }
.help-ico:empty::before { content: 'ⓘ'; }

/* Inputs */
.inp {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.75rem;
  color: #fff;
  outline: none;
  transition: border-color .15s;
}
.inp:focus { border-color: #06b6d4; }
.inp::placeholder { color: #64748b; }
label.lbl { display: block; font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.3rem; }

/* Buttons */
.btn { border-radius: 0.75rem; font-size: 0.75rem; font-weight: 700; padding: 0.6rem 1rem; transition: all .15s; display: inline-flex; align-items: center; gap: 0.4rem; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(to left, #0891b2, #6d28d9); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: .9; }
.btn-cyan { background: #0891b2; color: #fff; }
.btn-cyan:hover:not(:disabled) { background: #06b6d4; }
.btn-emerald { background: #059669; color: #fff; }
.btn-emerald:hover:not(:disabled) { background: #10b981; }
.btn-purple { background: #7c3aed; color: #fff; }
.btn-purple:hover:not(:disabled) { background: #8b5cf6; }
.btn-ghost { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
.btn-ghost:hover:not(:disabled) { background: #334155; color: #fff; }
.btn-danger { background: rgba(225, 29, 72, .15); color: #fda4af; border: 1px solid rgba(225, 29, 72, .4); }
.btn-danger:hover:not(:disabled) { background: rgba(225, 29, 72, .3); }

/* Cards */
.card { background: #1e293b; border: 1px solid #334155; border-radius: 1rem; }
.card-dark { background: rgba(2, 6, 23, .8); border: 1px solid #1e293b; border-radius: 1rem; }

/* Sticky tabs bar surface (light-mode override lives in theme.css) */
.tabs-sticky { background: rgba(9, 13, 22, 0.95); }

/* ============================================================
   Responsive & touch layer — tablet-first field device support
   ============================================================ */

/* Touch devices: bigger tap targets, always-visible reorder controls, no iOS zoom */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .help-ico { width: 20px; height: 20px; font-size: 13px; }
  .inp, select.inp, textarea.inp { font-size: 16px; padding-top: 0.7rem; padding-bottom: 0.7rem; }
  .touch-show { opacity: 1 !important; }
  .quick-a, .obj-chip, .pr-chip { padding: 0.5rem 0.75rem !important; font-size: 12px !important; }
}

/* Tablet (≤1024px): comfortable two-column collapse */
@media (max-width: 1024px) {
  .modal-body { max-height: 70vh; }
}

/* Small screens (≤768px): single flow, compact topbar, scrollable tab strips */
@media (max-width: 768px) {
  #tabs-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem !important;
  }
  #tabs-bar::-webkit-scrollbar { display: none; }
  #tabs-bar button { white-space: nowrap; flex-shrink: 0; }
  .topnav-link .nav-label { display: none; }        /* icons-only nav */
  .topnav-link { padding: 0.45rem 0.6rem !important; }
  table { font-size: 10.5px !important; }
}

/* Phones (≤480px): bottom-sheet modals, full-width copilot */
@media (max-width: 480px) {
  .fixed.inset-0 > .bg-slate-900 { max-width: 100% !important; border-radius: 1rem 1rem 0 0; align-self: flex-end; max-height: 92vh !important; }
  #cp-box { width: calc(100vw - 30px) !important; }
}

/* Print styles for PDF export */
@media print {
  body { background: #fff !important; color: #111 !important; }
  #topbar, #copilot-root, .no-print, .help-ico, #tabs-bar, #job-banner, .btn, select, input, textarea, details:not([open]) { display: none !important; }
  .print-area { display: block !important; }
  .card, .card-dark { background: #fff !important; border-color: #ddd !important; color: #111 !important; break-inside: avoid; }
  .card *, .card-dark * { color: #111 !important; background: transparent !important; }
  .overflow-y-auto, .overflow-x-auto { overflow: visible !important; max-height: none !important; }
  a { text-decoration: none; }
}
