/* ── Fleet Ops (LM) shared UI kit ─────────────────────────────────────────────
   Phase 2 of the Fleet Ops revamp. Used by js/lm/lm_ui.js components and by
   LM pages as they migrate off inline styles. Colors lean on the :root vars
   index.php already emits, with slate fallbacks matching the existing look. */

.lm-card{background:#fff;border-radius:12px;border:1px solid #e2e8f0;box-shadow:0 1px 3px 0 rgba(0,0,0,.05),0 1px 2px -1px rgba(0,0,0,.05);padding:20px;margin-bottom:20px}
.lm-card-title{font-size:12px;font-weight:800;color:#475569;text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid #f1f5f9;padding-bottom:8px;margin-bottom:16px;display:flex;align-items:center;gap:8px}

/* Buttons */
.lm-btn{display:inline-flex;align-items:center;gap:6px;border-radius:8px;padding:8px 14px;font-size:13px;font-weight:700;cursor:pointer;border:1px solid transparent;transition:filter .15s,background .15s;line-height:1.2;white-space:nowrap}
.lm-btn:disabled{opacity:.55;cursor:not-allowed}
.lm-btn-primary{background:var(--accent,#0f766e);color:#fff}
.lm-btn-primary:hover:not(:disabled){filter:brightness(1.08)}
.lm-btn-danger{background:#fff5f5;color:#dc2626;border-color:#fca5a5}
.lm-btn-danger:hover:not(:disabled){background:#fee2e2}
.lm-btn-ghost{background:#fff;color:#475569;border-color:#cbd5e1}
.lm-btn-ghost:hover:not(:disabled){background:#f8fafc}
.lm-btn-sm{padding:4px 10px;font-size:11px;border-radius:6px}

/* Modal scaffolding */
.lm-modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.6);display:flex;align-items:center;justify-content:center;z-index:1200;padding:16px}
.lm-modal{background:#fff;border-radius:14px;box-shadow:0 24px 64px rgba(0,0,0,.35);width:100%;max-width:640px;max-height:92vh;display:flex;flex-direction:column;overflow:hidden}
.lm-modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.lm-modal-title{margin:0;font-size:15px;font-weight:800;color:#0f172a}
.lm-modal-close{border:none;background:none;font-size:20px;line-height:1;color:#64748b;cursor:pointer;padding:4px 8px;border-radius:6px}
.lm-modal-close:hover{background:#e2e8f0;color:#0f172a}
.lm-modal-body{padding:18px;overflow-y:auto}
.lm-modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:12px 18px;border-top:1px solid #e2e8f0;background:#f8fafc}

/* Tables */
.lm-table-wrap{overflow:auto;border:1px solid #e2e8f0;border-radius:10px;background:#fff}
.lm-table{width:100%;border-collapse:collapse;font-size:12px}
.lm-table th{position:sticky;top:0;background:#f1f5f9;color:#475569;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;text-align:left;padding:9px 10px;border-bottom:1px solid #e2e8f0;white-space:nowrap;z-index:1}
.lm-table td{padding:8px 10px;border-bottom:1px solid #f1f5f9;color:#1e293b;vertical-align:middle}
.lm-table tbody tr:nth-child(even){background:#f8fafc}
.lm-table tbody tr:hover{background:#f0fdfa}

/* Badges */
.lm-badge{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:2px 9px;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap}
.lm-badge-ok{background:#dcfce7;color:#166534}
.lm-badge-warn{background:#ffedd5;color:#9a3412}
.lm-badge-danger{background:#fee2e2;color:#991b1b}
.lm-badge-muted{background:#f1f5f9;color:#64748b}

/* Forms */
.lm-form-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.lm-field-label{font-size:11px;font-weight:700;color:#64748b;display:block;margin-bottom:4px}
.lm-field-label-u{font-size:10px;font-weight:700;color:#64748b;display:block;margin-bottom:4px;text-transform:uppercase;letter-spacing:.3px}
.lm-input{border:1px solid #cbd5e1;border-radius:8px;padding:9px 12px;font-size:13px;outline:none;background:#fff;width:100%;box-sizing:border-box;color:#1e293b;box-shadow:0 1px 2px 0 rgba(0,0,0,.05);transition:border-color .15s,box-shadow .15s}
.lm-input:focus{border-color:var(--accent,#0f766e);box-shadow:0 0 0 3px rgba(15,118,110,.12)}

/* Toolbar / page furniture */
.lm-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.lm-toolbar-spacer{margin-left:auto}
.lm-empty{padding:36px 16px;text-align:center;color:#94a3b8;font-size:13px}
.lm-empty-icon{font-size:28px;margin-bottom:8px}

/* KPI cards */
.lm-kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:18px}
.lm-kpi{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:14px 16px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.lm-kpi-label{font-size:10px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px}
.lm-kpi-value{font-size:22px;font-weight:800;color:#0f172a;line-height:1.1}
.lm-kpi-sub{font-size:11px;color:#94a3b8;margin-top:4px}

/* Pager */
.lm-pager{display:flex;align-items:center;gap:8px;justify-content:flex-end;padding:10px 2px;font-size:12px;color:#64748b}
.lm-pager button{border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:4px 10px;font-size:12px;font-weight:700;color:#475569;cursor:pointer}
.lm-pager button:disabled{opacity:.4;cursor:not-allowed}
.lm-pager button:hover:not(:disabled){background:#f8fafc}

@media (max-width:640px){
  .lm-modal{max-width:100%;max-height:100vh;border-radius:0}
  .lm-form-grid{grid-template-columns:1fr}
}
