/* Language Platform — isolated Staffboard module. The visual language follows
   the existing macOS/iPad-style shell while keeping every selector namespaced. */
.lp-root {
  --lp-blue: #248fc4;
  --lp-blue-soft: rgba(37, 167, 222, .12);
  --lp-lime: #a9ca1d;
  color: var(--text);
}

.lp-commandbar,
.lp-toolbar,
.lp-filterbar,
.lp-panel-head,
.lp-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lp-commandbar {
  margin-bottom: 20px;
}

.lp-commandbar h2,
.lp-section-heading h3,
.lp-panel h3,
.lp-drawer h3,
.lp-action-card h3 {
  margin: 0;
  font-family: var(--font-head);
  color: var(--text);
}

.lp-commandbar h2 { font-size: clamp(24px, 2.5vw, 34px); letter-spacing: -.035em; }
.lp-commandbar p,
.lp-panel-head p,
.lp-section-heading p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }

.lp-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lp-command-actions { display: flex; align-items: center; gap: 10px; }
.lp-icon-button { min-width: 38px; padding-inline: 10px; font-size: 20px; line-height: 1; }

.lp-connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}
.lp-connection i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(117,116,111,.11); }
.lp-connection.is-online i { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.lp-connection.is-offline i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.lp-connection.is-checking i { animation: lpPulse 1.2s ease-in-out infinite; }

.lp-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 20px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
}

.lp-segmented,
.lp-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lp-segmented { padding: 3px; border-radius: 10px; background: var(--panel-2); }
.lp-segmented button,
.lp-view-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: 650 12px var(--font-body);
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.lp-segmented button img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.lp-segmented button.is-active { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.lp-view-tabs button.is-active { background: var(--text); color: var(--panel); }
.lp-segmented button:hover:not(.is-active),
.lp-view-tabs button:hover:not(.is-active) { background: var(--panel-3); color: var(--text); }

.lp-alert {
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid var(--info-border);
  border-radius: 12px;
  background: var(--info-soft);
  color: var(--text);
  font-size: 13px;
}
.lp-alert-error { border-color: color-mix(in srgb, var(--danger) 34%, transparent); background: var(--danger-soft); }

.lp-skeleton-grid,
.lp-kpi-grid,
.lp-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.lp-skeleton-grid span { height: 126px; border-radius: 18px; background: linear-gradient(105deg,var(--panel-2) 32%,var(--panel-3) 45%,var(--panel-2) 58%); background-size: 220% 100%; animation: lpShimmer 1.35s linear infinite; }

.lp-kpi-card,
.lp-product-card,
.lp-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.lp-kpi-card { min-height: 126px; padding: 18px; }
.lp-kpi-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 18px; border-radius: 10px; background: var(--lp-blue-soft); color: var(--lp-blue); font-size: 16px; }
.lp-kpi-value { font: 750 28px/1 var(--font-head); letter-spacing: -.04em; }
.lp-kpi-label { margin-top: 7px; color: var(--text-2); font-size: 12px; }

.lp-section-heading { margin: 28px 2px 12px; }
.lp-section-heading h3 { font-size: 17px; }
.lp-muted { color: var(--muted); font-size: 11px; }

.lp-product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: 16px; }
.lp-product-card { position: relative; overflow: hidden; padding: 20px; }
.lp-product-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--lp-product-color); }
.lp-product-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lp-product-title { display: flex; align-items: center; gap: 10px; }
.lp-product-title img { width: 28px; height: 28px; border-radius: 50%; }
.lp-product-title strong { font: 700 16px var(--font-head); }
.lp-product-version { padding: 4px 8px; border-radius: 999px; background: var(--panel-2); color: var(--text-2); font-size: 10px; font-weight: 650; }
.lp-product-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lp-product-metric strong { display: block; font: 700 19px var(--font-head); }
.lp-product-metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.25; }

.lp-panel { margin-top: 16px; overflow: hidden; }
.lp-panel-head { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.lp-panel-head h3 { font-size: 16px; }
.lp-panel-head .ghost { flex: 0 0 auto; }
.lp-table-panel { margin-top: 12px; }

.lp-filterbar { justify-content: flex-start; flex-wrap: wrap; margin: 0 0 12px; }
.lp-filterbar-compact { justify-content: flex-end; }
.lp-filterbar select,
.lp-action-card select,
.lp-action-card input,
.lp-action-card textarea {
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font: 13px var(--font-body);
}
.lp-filterbar select { min-height: 38px; padding: 0 34px 0 11px; }
.lp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 300px);
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
}
.lp-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 13px var(--font-body); }

.lp-table-wrap { overflow-x: auto; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lp-table th { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.lp-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.lp-table tbody tr:last-child td { border-bottom: 0; }
.lp-table tbody tr { transition: background .14s; }
.lp-table tbody tr[data-lp-account-id] { cursor: pointer; }
.lp-table tbody tr:hover { background: var(--panel-2); }
.lp-person { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.lp-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; background: var(--lp-blue-soft); color: var(--lp-blue); font: 750 12px var(--font-head); }
.lp-person strong { display: block; color: var(--text); font-size: 12px; }
.lp-person span { display: block; max-width: 250px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.lp-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.lp-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font-size: 10px; font-weight: 700; white-space: nowrap; }
.lp-badge.is-active { background: var(--success-soft); color: var(--success); }
.lp-badge.is-suspended,
.lp-badge.is-revoked { background: var(--danger-soft); color: var(--danger-strong); }
.lp-badge.is-germanize { background: rgba(37,167,222,.13); color: var(--lp-blue); }
.lp-badge.is-englify { background: rgba(169,202,29,.17); color: color-mix(in srgb, var(--lp-lime) 72%, var(--text)); }
.lp-row-arrow { color: var(--muted); font-size: 18px; }
.lp-progress { min-width: 100px; }
.lp-progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--panel-3); }
.lp-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.lp-progress small { display: block; margin-top: 5px; color: var(--muted); }

.lp-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 55px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.lp-pagination button:disabled { opacity: .4; cursor: default; }
.lp-empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.lp-empty > span { display: block; font-size: 26px; }
.lp-empty h4 { margin: 10px 0 4px; color: var(--text); font: 700 15px var(--font-head); }
.lp-empty p { margin: 0; font-size: 12px; }

.lp-audit-list { display: grid; padding: 4px 20px 12px; }
.lp-audit-item { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.lp-audit-item:last-child { border-bottom: 0; }
.lp-audit-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--panel-2); color: var(--text-2); font-size: 13px; }
.lp-audit-copy strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 12px; }
.lp-audit-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.lp-audit-time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.lp-drawer { position: fixed; z-index: 80; inset: 0; }
.lp-drawer-scrim { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(20,20,18,.34); backdrop-filter: blur(3px); cursor: default; }
.lp-drawer-panel { position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column; width: min(540px, 92vw); border-left: 1px solid var(--border); background: var(--bg); box-shadow: -20px 0 50px rgba(0,0,0,.14); animation: lpSlideIn .2s ease-out; }
.lp-drawer-panel > header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel); }
.lp-drawer-panel > header h3 { font-size: 20px; }
.lp-drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.lp-drawer-close { min-width: 36px; padding-inline: 9px; }
.lp-detail-hero { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.lp-detail-hero .lp-avatar { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; font-size: 15px; }
.lp-detail-hero h4 { margin: 0; font: 700 17px var(--font-head); }
.lp-detail-hero p { margin: 4px 0 8px; color: var(--muted); font-size: 11px; }
.lp-detail-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.lp-detail-stat { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.lp-detail-stat strong { display: block; font: 700 18px var(--font-head); }
.lp-detail-stat span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.lp-detail-section { margin-top: 18px; }
.lp-detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.lp-detail-section h5 { margin: 0; font: 700 13px var(--font-head); }
.lp-detail-list { overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.lp-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border-bottom: 1px solid var(--border); font-size: 11px; }
.lp-detail-row:last-child { border-bottom: 0; }
.lp-detail-row strong { display: block; color: var(--text); }
.lp-detail-row small { display: block; margin-top: 3px; color: var(--muted); }
.lp-capacity-row { align-items: flex-end; }
.lp-capacity-copy { flex: 1 1 auto; min-width: 0; }
.lp-capacity-meter { display: block; width: min(100%, 240px); height: 5px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: var(--panel-3); }
.lp-capacity-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lp-blue), var(--lp-lime)); }
.lp-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.lp-detail-actions button { min-height: 39px; }
.lp-danger-action { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)) !important; color: var(--danger-strong) !important; }
.lp-empty-inline { padding: 12px; color: var(--muted); font-size: 11px; text-align: center; }

.lp-action-card { width: min(480px, calc(100vw - 28px)); }
.lp-action-card .modal-body { display: grid; gap: 10px; }
.lp-action-card .modal-body > p { margin: 0 0 4px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.lp-action-card label { display: flex; justify-content: space-between; gap: 8px; color: var(--text); font-size: 12px; font-weight: 650; }
.lp-action-card textarea,
.lp-action-card input,
.lp-action-card select { width: 100%; padding: 10px 11px; resize: vertical; }
.lp-action-extra { display: grid; gap: 10px; }
.lp-action-extra label { display: grid; justify-content: initial; }
.lp-capacity-help { color: var(--muted); font-size: 10px; line-height: 1.45; }
.lp-required { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }

@keyframes lpShimmer { to { background-position-x: -220%; } }
@keyframes lpPulse { 50% { transform: scale(.72); opacity: .45; } }
@keyframes lpSlideIn { from { transform: translateX(35px); opacity: .65; } }

@media (max-width: 980px) {
  .lp-kpi-grid,.lp-skeleton-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lp-toolbar { align-items: stretch; flex-direction: column; }
  .lp-segmented,.lp-view-tabs { width: 100%; overflow-x: auto; }
  .lp-segmented button,.lp-view-tabs button { flex: 1 0 auto; }
}

@media (max-width: 900px) {
  .lp-filterbar { align-items: stretch; flex-direction: column; }
  .lp-filterbar select,.lp-search { width: 100%; }
}

@media (max-width: 720px) {
  .lp-commandbar { align-items: flex-start; }
  .lp-connection span { display: none; }
  .lp-connection { width: 36px; justify-content: center; padding: 0; }
  .lp-product-grid { grid-template-columns: 1fr; }
  .lp-table th:nth-child(3),.lp-table td:nth-child(3),
  .lp-table th:nth-child(5),.lp-table td:nth-child(5) { display: none; }
  .lp-drawer-panel { width: 100%; }
}

@media (max-width: 480px) {
  .lp-kpi-grid,.lp-skeleton-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lp-kpi-card { min-height: 110px; padding: 14px; }
  .lp-kpi-icon { margin-bottom: 13px; }
  .lp-product-metrics { grid-template-columns: 1fr 1fr; }
  .lp-detail-actions { grid-template-columns: 1fr; }
  .lp-audit-item { grid-template-columns: 30px minmax(0,1fr); }
  .lp-audit-time { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-skeleton-grid span,.lp-connection.is-checking i,.lp-drawer-panel { animation: none; }
}
