/* Unified corporate theme for Admin + Customer dashboards */

/* ===== variables ===== */
:root{
  --sidebar-bg:#0b2235;
  --accent:#0b69ff;
  --muted:#6b7280;
  --card:#fff;
  --page-bg:#f4f7fb;
  --text:#172031;
  --shadow: 0 6px 20px rgba(16,24,40,0.06);
}

/* ===== reset / base ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;background:var(--page-bg);color:var(--text);-webkit-font-smoothing:antialiased}
a{text-decoration:none;color:inherit}

/* ===== layout ===== */
.app{display:flex;min-height:100vh}
.sidebar{width:260px;background:var(--sidebar-bg);color:#dbeefe;padding:22px 18px;flex-shrink:0;display:flex;flex-direction:column;transition:width .22s}
.main{flex:1;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;gap:12px;padding:12px 20px;background:transparent;border-bottom:1px solid rgba(0,0,0,0.04)}
.content{padding:22px 28px;flex:1;}

/* ===== sidebar content ===== */
.logo{width:44px;height:44px;border-radius:8px;background:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;margin-bottom:8px}
.brand-title{font-weight:700;font-size:16px;margin-bottom:6px}
.sidebar .sub{font-size:13px;color:#b8d8f7;margin-bottom:12px}
.sidebar-nav{margin-top:14px;flex:1;display:flex;flex-direction:column;gap:6px}
.nav-item{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:8px;color:#cfe8ff;}
.nav-item:hover{background:rgba(255,255,255,0.03);color:#fff}
.nav-item.active{background:rgba(255,255,255,0.04);font-weight:700;box-shadow:inset 0 0 0 2px rgba(255,255,255,0.02)}
.sidebar-foot{padding-top:12px;border-top:1px solid rgba(255,255,255,0.03);font-size:13px;color:#b8d8f7;margin-top:12px}
.btn-ghost{display:inline-block;padding:6px 10px;border-radius:8px;background:transparent;border:1px solid rgba(255,255,255,0.06);color:#cfe8ff}

/* ===== ticket badges (sidebar multi-status) ===== */
.ticket-badges { display:inline-flex; gap:6px; align-items:center; margin-left:8px; vertical-align:middle; }
.ticket-badge {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  color:#fff;
  line-height:1;
  box-shadow:0 2px 6px rgba(2,6,23,0.08);
}
.ticket-badge .dot {
  width:8px; height:8px; border-radius:50%; display:inline-block; flex:0 0 auto;
  box-shadow:0 1px 0 rgba(0,0,0,0.06);
}

/* Colors */
.ticket-badge-new { background:#ef4444; }         /* red */
.ticket-badge-assigned { background:#0ea5e9; }    /* blue */
.ticket-badge-in_progress { background:#f59e0b; } /* orange */
.ticket-badge-completed { background:#16a34a; }   /* green */
.ticket-badge-total { background:#6b7280; }       /* gray */
.ticket-badge.small { padding:4px 6px; font-size:11px; font-weight:700; }

/* ===== cards / metrics / tables ===== */
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:16px}
.card{background:var(--card);border-radius:10px;padding:16px;box-shadow:var(--shadow)}
.metric .num{font-size:22px;color:var(--accent);font-weight:700}
.metric .label{color:var(--muted);font-size:13px}
.table{width:100%;border-collapse:collapse;margin-top:8px}
.table th,.table td{padding:10px 8px;border-bottom:1px solid #eef2f7;text-align:left}
.table th{color:var(--muted);font-weight:600}

/* ===== forms & small UI ===== */
.form-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.form-row input, .form-row select, .form-row textarea {padding:8px 10px;border-radius:8px;border:1px solid #e6eef7;background:#fff;flex:1}
.btn{display:inline-block;background:var(--accent);color:white;padding:8px 14px;border-radius:8px;border:none;cursor:pointer}
.btn.small{padding:6px 10px;font-size:14px}
.hint{color:var(--muted);font-size:13px}
.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}

/* ===== customer small components (badges, chips) ===== */
.badge-chip{display:inline-block;background:#eef6ff;color:#0b69ff;padding:6px 10px;border-radius:999px;margin-right:6px;margin-bottom:6px}
.kv{color:#6b7280;font-size:14px}

/* ===== customer sidebar collapsed (mobile) ===== */
.cs-sidebar-collapsed{width:72px}
@media (max-width:1100px){
  .grid{grid-template-columns:repeat(2,1fr)}
  .sidebar{display:none}
  .mobile-open .sidebar{display:flex;position:fixed;left:0;top:0;bottom:0;z-index:50}
}
@media (max-width:720px){
  .grid{grid-template-columns:repeat(1,1fr)}
  .topbar input[type="search"]{width:100%}
}

/* ===== active item small marker (left dot) ===== */
.nav-item.active::before{
  content:'';
  width:6px;height:6px;border-radius:2px;background:var(--accent);display:inline-block;margin-right:8px;transform:translateY(-1px)
}

/* ===== small tweaks ===== */
.topbar-right{display:flex;align-items:center;gap:12px}
.topbar .search{flex:1}
.small{font-size:13px}
.table .empty{color:var(--muted);padding:12px}

/* ======= Added: targeted popover / assign-list fixes =====
   Scope: only elements related to the engineer assign popover and create-engineer picker.
   Purpose: ensure pointer events and stacking allow clicking checkboxes/labels (fixes the issue
   where only the first "None" option was clickable). This block is intentionally scoped and
   uses moderate z-index values to avoid changing other UI. */
.assign-pop {
  position: absolute !important;
  z-index: 2000 !important;
  pointer-events: auto !important;
  background-clip: padding-box;
}

/* ensure the list inside pop and the create-form list accept pointer events */
.assign-pop .assign-list,
#engList,
#engList * {
  pointer-events: auto !important;
}

/* rows and items should be above potential internal overlays inside the pop */
.assign-row,
.eng-item {
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2001;
}

/* checkbox inputs must be clickable and above rows */
.assign-row input[type="checkbox"],
.eng-item input[type="checkbox"] {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 2002 !important;
}

/* If your page has a global overlay/backdrop with lower z-index, this keeps the popover interactive.
   This is intentionally narrow and should not affect other components. */
.assign-pop.align-right,
.assign-pop.align-top {
  z-index: 2000 !important;
}
