/* ══════════════════════════════════════════════════════════════════ */
/* ORBITCYB — INTUNE DASHBOARD CSS                                   */
/* ══════════════════════════════════════════════════════════════════ */

/* ── Layout ───────────────────────────────────────────────────────── */
#view-intune .infra-view { padding: 24px; }
@media (max-width: 768px) { #view-intune .infra-view { padding: 12px; } }

/* ── Summary KPIs (top row) ─────────────────────────────────────── */
.itdb-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.itdb-sum-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--rL);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.itdb-sum-val  { font-size: 28px; font-weight: 800; font-family: var(--fm); color: var(--txt); line-height: 1; }
.itdb-sum-lbl  { font-size: 10px; color: var(--txtM); text-transform: uppercase; letter-spacing: .6px; }

/* ── Section title ────────────────────────────────────────────────── */
.itdb-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--txtM);
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.itdb-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Department cards grid ──────────────────────────────────────── */
.itdb-dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.itdb-dept-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--rL);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s, transform .12s;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.itdb-dept-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--dc, var(--border));
  border-radius: var(--rL) var(--rL) 0 0;
}
.itdb-dept-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
  transform: translateY(-1px);
}
.itdb-dept-card.active {
  border-color: var(--dc, var(--orbit));
  box-shadow: 0 0 0 2px var(--dc, var(--orbit)), 0 4px 16px rgba(0,0,0,.35);
}

.itdb-card-head  { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.itdb-card-icon  { font-size: 22px; line-height: 1; }
.itdb-card-edit  {
  background: none; border: none; color: var(--txtD); cursor: pointer;
  font-size: 11px; padding: 2px 5px; border-radius: 3px; opacity: 0;
  transition: opacity .15s;
}
.itdb-dept-card:hover .itdb-card-edit { opacity: 1; }
.itdb-card-edit:hover { color: var(--txtM); background: var(--slate); }

.itdb-card-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--txt);
  word-break: break-word;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.itdb-card-name-input {
  background: var(--slate);
  border: 1px solid var(--dc, var(--orbit));
  color: var(--txt);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 4px 6px;
  border-radius: 4px;
  width: 100%;
  font-family: var(--fs);
}

.itdb-card-count { font-size: 26px; font-weight: 800; font-family: var(--fm); color: var(--dc, var(--txt)); line-height: 1; margin-top: 6px; }
.itdb-card-pct   { font-size: 11px; color: var(--txtM); margin-top: 2px; }

.itdb-card-bar   { height: 4px; background: var(--border); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.itdb-card-fill  { height: 100%; border-radius: 2px; background: var(--dc, var(--orbit)); transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ── Filter info bar ────────────────────────────────────────────── */
.itdb-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--txtM);
}
.itdb-filter-bar strong { color: var(--txt); }
.itdb-filter-clear {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--txtM);
  padding: 3px 9px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 11px;
  transition: color .15s, border-color .15s;
}
.itdb-filter-clear:hover { color: var(--nova); border-color: var(--nova); }

/* ── Table toolbar ────────────────────────────────────────────────── */
.itdb-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.itdb-search {
  flex: 1;
  min-width: 180px;
  background: var(--slate);
  border: 1px solid var(--border);
  color: var(--txt);
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: 13px;
  font-family: var(--fs);
}
.itdb-search::placeholder { color: var(--txtD); }

/* ── Devices table ────────────────────────────────────────────────── */
.itdb-table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--rL);
  overflow: hidden;
  overflow-x: auto;
}
.itdb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.itdb-table th {
  background: var(--slate);
  color: var(--txtM);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}
.itdb-table td {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--txt);
  vertical-align: middle;
}
.itdb-table tr:hover td { background: var(--hover); }

.itdb-dept-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}

.itdb-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  flex-shrink: 0;
}
.itdb-status-dot.activo   { background: #22c55e; }
.itdb-status-dot.inactivo { background: #525252; }
.itdb-status-dot.revision { background: #f59e0b; }
.itdb-status-dot.baja     { background: #ef4444; }

.itdb-count-badge {
  font-size: 10px;
  color: var(--txtM);
  padding: 2px 8px;
  background: var(--slate);
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ── Empty / loading ────────────────────────────────────────────── */
.itdb-empty { text-align: center; padding: 40px; color: var(--txtD); }
.itdb-empty i { font-size: 32px; display: block; margin-bottom: 10px; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .itdb-dept-grid { grid-template-columns: repeat(2, 1fr); }
  .itdb-summary   { grid-template-columns: repeat(2, 1fr); }
  .itdb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .itdb-toolbar { flex-direction: column; align-items: stretch; }
  .itdb-search  { min-width: unset; }
}
@media (max-width: 380px) {
  .itdb-dept-grid { grid-template-columns: 1fr; }
}
