*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f1f5f9; color: #1e293b; }

/* Stats cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border: 2px solid transparent;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.11); }
.card.active-filter { border-color: #1e293b; box-shadow: 0 0 0 3px rgba(30,41,59,.1), 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.card .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 6px; }
.card .value { font-size: 32px; font-weight: 700; }
.card.total        .value { color: #1e293b; }
.card.active       .value { color: #16a34a; }
.card.expired      .value { color: #dc2626; }
.card.full         .value { color: #2563eb; }
.card.full-expired .value { color: #7c3aed; }
.card.pending      .value { color: #d97706; }
.card.active-filter.active       { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12), 0 4px 14px rgba(0,0,0,.1); }
.card.active-filter.expired      { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12), 0 4px 14px rgba(0,0,0,.1); }
.card.active-filter.full         { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 4px 14px rgba(0,0,0,.1); }
.card.active-filter.full-expired { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.12), 0 4px 14px rgba(0,0,0,.1); }
.card.active-filter.pending      { border-color: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.12), 0 4px 14px rgba(0,0,0,.1); }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button {
  padding: 7px 16px; border-radius: 6px; border: 1px solid #cbd5e1;
  background: #fff; font-size: 13px; cursor: pointer; color: #475569; font-weight: 500;
  transition: all .15s;
}
.filters button:hover { background: #f1f5f9; }
.filters button.active { background: #1e293b; color: #fff; border-color: #1e293b; }

/* Search */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar input {
  padding: 7px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 13px; width: 260px; outline: none;
}
.toolbar input:focus { border-color: #2563eb; }
.toolbar .count { font-size: 13px; color: #64748b; margin-left: auto; }

/* Table */
.table-wrap { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
thead th {
  background: #f8fafc; text-align: left; padding: 11px 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #64748b; border-bottom: 1px solid #e2e8f0;
  white-space: nowrap; cursor: pointer; user-select: none;
}
thead th:hover { background: #f1f5f9; }
tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
td { padding: 10px 14px; vertical-align: middle; white-space: nowrap; }

/* Status badges */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.badge.trial-active  { background: #dcfce7; color: #15803d; }
.badge.trial-expired { background: #fee2e2; color: #b91c1c; }
.badge.full          { background: #dbeafe; color: #1d4ed8; }
.badge.full-expired  { background: #ede9fe; color: #6d28d9; }
.badge.pending       { background: #fef3c7; color: #b45309; }

.empty   { text-align: center; padding: 48px; color: #94a3b8; font-size: 14px; }
.loading { text-align: center; padding: 48px; color: #94a3b8; }
.loading .spinner-border { width: 1.8rem; height: 1.8rem; }

/* ── Row hover pointer ────────────────────────────────────────────────────── */
tbody tr { cursor: pointer; }

/* ── License detail modal ─────────────────────────────────────────────────── */
#licDetailModal .modal-content {
  border: none; border-radius: .85rem;
  box-shadow: 0 12px 48px rgba(0,0,0,.22);
}
#licDetailModal .modal-header {
  border-radius: .85rem .85rem 0 0;
  color: #fff; padding: 1rem 1.4rem;
  transition: background .2s;
}
#licDetailModal .btn-close { filter: invert(1) brightness(2); }
#licDetailModal .modal-footer {
  border-top: 1px solid #f1f5f9; padding: .7rem 1.4rem;
}
#licDetailModal .border-end { border-color: #f1f5f9 !important; }
.ld-section-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b; margin-bottom: .65rem;
}
.ld-field { margin-bottom: .9rem; }
.ld-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #94a3b8; margin-bottom: 2px;
}
.ld-value {
  font-size: 13.5px; color: #1e293b; font-weight: 500; word-break: break-all;
}
.ld-value.mono {
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px;
}
.ld-empty { color: #cbd5e1; font-style: italic; }

/* ── Pagination bar ─────────────────────────────────────────────────────── */
._pg-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid #e2e8f0;
  background: #fff; font-size: 12.5px; color: #64748b;
  border-radius: 0 0 10px 10px; flex-wrap: wrap; gap: 6px;
}
._pg-btns { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
._pg-btn {
  min-width: 30px; height: 28px; padding: 0 7px; line-height: 1;
  border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; color: #475569; font-size: 12.5px;
  cursor: pointer; transition: background .1s, border-color .1s;
}
._pg-btn:hover:not(:disabled):not(._pg-cur) { background: #f8fafc; border-color: #cbd5e1; }
._pg-btn._pg-cur { background: #1e293b; border-color: #1e293b; color: #fff; font-weight: 600; }
._pg-btn:disabled { opacity: .38; cursor: not-allowed; }
._pg-ellipsis { padding: 0 3px; color: #cbd5e1; }

/* ── Redesigned detail modal sections ───────────────────────────────────── */
.ldm-panel { background: #fff; }
.ldm-right { border-left: 1px solid #e2e8f0 !important; }
.ldm-top-border { border-top: 1px solid #e2e8f0 !important; }

.ldm-sec-hdr {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  padding: 6px 10px; border-radius: 7px; margin-bottom: 14px;
}
.ldm-sec-hdr.identity    { background: #e0f2fe; color: #0369a1; }
.ldm-sec-hdr.license-s   { background: #f5f3ff; color: #7c3aed; }
.ldm-sec-hdr.application { background: #ecfdf5; color: #065f46; }
.ldm-sec-hdr.machine     { background: #fff7ed; color: #c2410c; }

.ldm-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid #f1f5f9;
}
.ldm-row:last-child { border-bottom: none; }
.ldm-lbl {
  font-size: 10.5px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .04em;
  min-width: 108px; flex-shrink: 0; line-height: 1.55;
}
.ldm-val {
  font-size: 13.5px; color: #1e293b; font-weight: 500;
  flex: 1; word-break: break-all; line-height: 1.4;
}
.ldm-val.mono { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; color: #334155; }
.ldm-val.empty { color: #cbd5e1; font-style: italic; font-weight: 400; }
.ldm-copy-btn {
  flex-shrink: 0; background: none; border: none; padding: 2px 5px;
  cursor: pointer; color: #cbd5e1; font-size: 12px; transition: color .15s, background .15s;
  border-radius: 4px; line-height: 1;
}
.ldm-copy-btn:hover { color: #64748b; background: #f1f5f9; }
